/* ==========================================================
   Partituras Sinaloenses — hoja de estilos del sitio
   Paleta tomada de un estuche de instrumento: terciopelo azul,
   herrajes de latón y papel de partitura.
   ========================================================== */

:root {
    --tinta: #1a1d24;
    --texto: #3a4150;
    --tenue: #646c7d;
    --linea: #dfe3ea;
    --fondo: #f3f5f8;
    --papel: #ffffff;
    --estuche: #1b2840;
    --estuche-hondo: #121c2f;
    --laton: #c9a24c;
    --laton-claro: #e2c47f;
    --laton-texto: #7d5f17;   /* latón oscuro legible sobre blanco */
    --enlace: #24406e;
    --serif: 'Spectral', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --ancho: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--texto);
    background: var(--fondo);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1; }
h1, h2, h3, h4 { color: var(--tinta); margin: 0; }
p { margin: 0; }
a { color: var(--enlace); }
img, svg, canvas { max-width: 100%; }
:focus-visible { outline: 3px solid var(--laton); outline-offset: 3px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.envoltura { max-width: var(--ancho); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .envoltura { padding: 0 1.5rem; } }
.saltar {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    background: var(--tinta); color: #fff; padding: .6rem 1rem; border-radius: 6px;
}
.saltar:focus { top: 1rem; }

/* ---------- Encabezado ---------- */
.cabecera {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--linea);
    backdrop-filter: saturate(1.4) blur(8px);
}
.cabecera__fila {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; min-height: 4.25rem;
}
.marca {
    display: inline-flex; align-items: center; gap: .65rem;
    color: var(--tinta); text-decoration: none;
    font-family: var(--serif); font-weight: 600; font-size: 1.28rem; line-height: 1.1;
}
.marca svg { flex-shrink: 0; color: var(--estuche); }
.menu-boton {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem .9rem; font: 600 .95rem var(--sans);
    color: var(--tinta); background: var(--papel);
    border: 1px solid var(--linea); border-radius: 999px; cursor: pointer;
}
.menu { display: none; }
.menu.abierto {
    display: flex; flex-direction: column; gap: .15rem;
    position: absolute; left: 0; right: 0; top: 100%;
    padding: .75rem 1rem 1.25rem; background: var(--papel);
    border-bottom: 1px solid var(--linea);
    box-shadow: 0 16px 30px rgba(18, 28, 47, .12);
}
.menu a {
    padding: .7rem .8rem; border-radius: 8px;
    color: var(--tinta); text-decoration: none; font-weight: 600; font-size: 1rem;
}
.menu a:hover { background: var(--fondo); }
.menu a[aria-current="page"] { color: var(--laton-texto); }
.menu a.menu__principal {
    background: var(--estuche); color: #fff; text-align: center; margin-top: .4rem;
}
.menu a.menu__principal:hover { background: #24345a; }
.menu a.menu__principal[aria-current="page"] { color: var(--laton-claro); }
@media (min-width: 900px) {
    .menu-boton { display: none; }
    .menu, .menu.abierto {
        display: flex; flex-direction: row; align-items: center; gap: .25rem;
        position: static; padding: 0; background: none; border: 0; box-shadow: none;
    }
    .menu a { font-size: .95rem; padding: .5rem .8rem; }
    .menu a.menu__principal { margin: 0 0 0 .5rem; padding: .55rem 1.15rem; border-radius: 999px; }
}

/* ---------- Botones y enlaces ---------- */
.boton {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .8rem 1.4rem; border-radius: 999px;
    font: 700 1rem var(--sans); text-decoration: none; cursor: pointer; border: 0;
}
.boton--laton { background: var(--laton); color: var(--tinta); }
.boton--laton:hover { background: var(--laton-claro); }
.boton--tinta { background: var(--estuche); color: #fff; }
.boton--tinta:hover { background: #24345a; }
.boton--linea { background: transparent; color: var(--tinta); border: 1.5px solid var(--tinta); }
.boton--linea:hover { background: var(--tinta); color: #fff; }

/* ---------- Portada ---------- */
.portada {
    color: #e8ebf2;
    background:
        radial-gradient(110% 80% at 50% 0%, #26365a 0%, rgba(38, 54, 90, 0) 65%),
        linear-gradient(180deg, var(--estuche) 0%, var(--estuche-hondo) 100%);
    border-bottom: 3px solid var(--laton);
    padding: 3.5rem 0 3.75rem;
}
.portada h1 {
    font-family: var(--serif); font-weight: 600; color: #fff;
    font-size: clamp(2.2rem, 6vw, 3.9rem); line-height: 1.04; letter-spacing: -.015em;
    max-width: 16ch;
}
.portada__texto { margin-top: 1.1rem; max-width: 38rem; color: #c3cbdc; font-size: 1.1rem; }
.buscador {
    position: relative; margin-top: 2rem; max-width: 42rem;
    display: flex; gap: .5rem; padding: .4rem; background: var(--papel); border-radius: 999px;
    box-shadow: 0 10px 30px rgba(3, 8, 18, .4);
}
.buscador svg { position: absolute; left: 1.15rem; top: 50%; transform: translateY(-50%); color: #7a8296; pointer-events: none; }
.buscador input {
    flex: 1; min-width: 0; padding: .85rem .5rem .85rem 2.6rem;
    font: 400 1.05rem var(--sans); color: var(--tinta);
    background: transparent; border: 0; outline: none;
}
.buscador:focus-within { outline: 3px solid var(--laton); outline-offset: 3px; }
.buscador button { flex-shrink: 0; }
.portada__atajos { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .98rem; }
.portada__atajos a { color: var(--laton-claro); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(226, 196, 127, .4); }
.portada__atajos a:hover { border-bottom-color: var(--laton-claro); }
@media (max-width: 520px) {
    .portada { padding: 2.5rem 0 2.75rem; }
    .buscador { flex-direction: column; border-radius: 1.25rem; padding: .5rem; }
    .buscador input { padding-left: 2.6rem; }
    .buscador svg { top: 1.85rem; }
    .buscador button { width: 100%; }
}

/* ---------- Secciones ---------- */
.seccion { padding: 3.5rem 0; }
.seccion--blanca { background: var(--papel); border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.seccion__cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 1.75rem; }
.seccion__titulo { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.15; }
.seccion__nota { color: var(--tenue); max-width: 34rem; }
.enlace-fuerte { font-weight: 700; color: var(--enlace); text-decoration: none; border-bottom: 2px solid var(--laton); }
.enlace-fuerte:hover { color: var(--tinta); }

/* Lista editorial de guías: filas con línea divisoria, no tarjetas */
.guias { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linea); }
.guias li { border-bottom: 1px solid var(--linea); }
.guia {
    display: grid; grid-template-columns: 1fr; gap: .3rem;
    padding: 1.35rem 0; text-decoration: none; color: inherit;
}
.guia__tema { font-size: .88rem; font-weight: 600; color: var(--laton-texto); }
.guia__titulo { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; line-height: 1.25; color: var(--tinta); }
.guia__resumen { color: var(--texto); max-width: 46rem; }
.guia:hover .guia__titulo { color: var(--enlace); text-decoration: underline; text-decoration-color: var(--laton); text-underline-offset: 4px; }
@media (min-width: 900px) {
    .guia { grid-template-columns: 11rem 1fr; column-gap: 2rem; }
    .guia__tema { padding-top: .35rem; }
    .guia__titulo, .guia__resumen { grid-column: 2; }
    .guia__tema { grid-row: 1 / span 2; }
}

/* Bloque de herramienta destacada */
.herramienta {
    display: grid; gap: 1.5rem; align-items: center;
    padding: 2rem; background: var(--papel); border: 1px solid var(--linea); border-left: 4px solid var(--laton);
    border-radius: 6px;
}
.herramienta h2 { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; line-height: 1.2; }
.herramienta p { margin-top: .6rem; max-width: 40rem; }
@media (min-width: 800px) { .herramienta { grid-template-columns: 1fr auto; padding: 2.25rem 2.5rem; } }

/* Filtros de categorías */
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.filtros a {
    padding: .45rem 1rem; border-radius: 999px; font-size: .92rem; font-weight: 600;
    color: var(--tinta); background: var(--papel); border: 1px solid var(--linea); text-decoration: none;
}
.filtros a[aria-current="page"] { background: var(--estuche); border-color: var(--estuche); color: #fff; }

/* ---------- Páginas interiores ---------- */
.encabezado-pagina { padding-top: 2.75rem; padding-bottom: 1.5rem; }
.migas { font-size: .9rem; color: var(--tenue); margin-bottom: 1rem; }
.migas a { color: var(--tenue); }
.migas span { margin: 0 .35rem; }
.encabezado-pagina h1 {
    font-family: var(--serif); font-weight: 600;
    font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.1; letter-spacing: -.01em; max-width: 22ch;
}
.encabezado-pagina .entrada { margin-top: 1rem; font-size: 1.15rem; color: var(--texto); max-width: 42rem; }
.firma { margin-top: 1.1rem; font-size: .92rem; color: var(--tenue); }
.firma a { color: var(--tinta); font-weight: 600; }

/* Texto largo */
.texto {
    max-width: 44rem; background: var(--papel); border: 1px solid var(--linea); border-radius: 6px;
    padding: 1.75rem 1.25rem 2.25rem; margin-bottom: 3.5rem;
}
@media (min-width: 640px) { .texto { padding: 2.5rem 3rem 3rem; } }
.texto > :first-child { margin-top: 0; }
.texto h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; line-height: 1.25; margin-top: 2.4rem; }
.texto h3 { font-size: 1.12rem; font-weight: 700; margin-top: 1.8rem; }
.texto p { margin-top: 1rem; line-height: 1.78; }
.texto ul, .texto ol { margin: 1rem 0 0; padding-left: 1.35rem; line-height: 1.75; }
.texto li { margin-top: .4rem; }
.texto a { font-weight: 600; text-decoration-color: var(--laton); text-underline-offset: 3px; }
.texto strong { color: var(--tinta); }
.texto .table-wrap { overflow-x: auto; margin-top: 1.25rem; -webkit-overflow-scrolling: touch; }
.texto table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 30rem; }
.texto table.compacta { min-width: 0; }
.texto th, .texto td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--linea); vertical-align: top; }
.texto th { color: var(--tinta); background: var(--fondo); font-weight: 700; }
.texto .nota {
    margin-top: 1.5rem; padding: 1rem 1.25rem; background: #fbf6ea;
    border-left: 3px solid var(--laton); border-radius: 4px; color: #4d3d14;
}
.texto .nota a { color: #4d3d14; }
.texto pre, .texto .cuenta {
    margin-top: 1rem; padding: .9rem 1rem; background: var(--fondo); border-radius: 6px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; overflow-x: auto;
}
.texto hr { border: 0; border-top: 1px solid var(--linea); margin: 2.25rem 0 0; }
.texto .pie-nota { margin-top: 1.25rem; font-size: .92rem; color: var(--tenue); }

.relacionados { max-width: 44rem; margin-bottom: 3.5rem; }
.relacionados h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; margin-bottom: .75rem; }

/* Tarjetas de contacto y bloques simples */
.bloques { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .bloques { grid-template-columns: 1fr 1fr; } }
.bloque { padding: 1.25rem 1.35rem; border: 1px solid var(--linea); border-radius: 6px; background: var(--fondo); }
.bloque h3 { margin-top: 0; font-size: 1.05rem; }
.bloque p { margin-top: .4rem; }
.bloque .boton { margin-top: 1rem; }

/* Formularios del transpositor */
.campos { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.25rem; }
.campo { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; color: var(--tinta); font-size: .95rem; }
.campo { flex: 1 1 13rem; }
.campo select {
    width: 100%;
    min-width: 0; max-width: 100%; padding: .75rem 2.2rem .75rem .9rem;
    font: 400 1rem var(--sans); color: var(--tinta); background: var(--papel);
    border: 1.5px solid #c9cfda; border-radius: 8px;
}
.resultado-nota { margin-top: 1.25rem; padding: 1.1rem 1.25rem; background: var(--fondo); border-radius: 8px; font-size: 1.05rem; }
.resultado-nota strong.grande { font-family: var(--serif); font-size: 1.6rem; color: var(--laton-texto); }

/* ---------- Pie de página ---------- */
.pie { background: var(--estuche-hondo); color: #b7c0d3; padding: 3rem 0 2rem; margin-top: auto; font-size: .95rem; }
.pie__columnas { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .pie__columnas { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.pie__marca { grid-column: 1 / -1; }
@media (min-width: 900px) { .pie__marca { grid-column: auto; } }
.pie .marca { color: #fff; }
.pie .marca svg { color: var(--laton-claro); }
.pie__marca p { margin-top: .75rem; max-width: 22rem; }
.pie h2 { font: 700 .95rem var(--sans); color: #fff; margin-bottom: .6rem; }
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li { margin-top: .35rem; }
.pie a { color: #d6dcea; text-decoration: none; }
.pie a:hover { color: var(--laton-claro); text-decoration: underline; }
.pie__final { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .88rem; color: #8f9ab0; }

/* ---------- Página 404 ---------- */
.vacio { text-align: center; padding: 5rem 1rem; }
.vacio h1 { font-family: var(--serif); font-weight: 600; font-size: 2.4rem; }
.vacio p { margin-top: .75rem; }
.vacio .acciones { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* Espacio para anuncios (solo en páginas editoriales) */
.anuncio { margin: 2rem 0; min-height: 1px; }

@media (max-width: 420px) {
    .marca { font-size: 1.02rem; gap: .5rem; }
    .marca svg { width: 26px; height: 26px; }
    .marca span { white-space: nowrap; }
    .menu-boton { padding: .5rem .75rem; }
}
