/* www.piano.cl — hoja de estilos común */

:root {
    /* Modo claro con los rosas del envoltorio de referencia (ver notas-tecnicas.md) */
    --papel: #fcf5f4;        /* crema con un toque rosa */
    --papel-hondo: #f9e5e7;  /* tarjetas y fondos de fotos */
    --tinta: #1f1b17;
    --tenue: #6a6056;
    --linea: #eccbd0;
    --acento: #7d2f2c;
    --acento-suave: #fce1e4; /* rosa del envoltorio */
    --banda: #fce1e4;        /* cabecera y pie */
    --marco: #fce1e4;        /* interior del marco del retrato */
    --seleccion: #ffd2db;    /* rosa del corazón */

    --letra-titulo: "Marcellus", "Optima", "Candara", serif;
    --letra-texto: "EB Garamond", "Garamond", "Georgia", serif;

    --ancho-texto: 38rem;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --papel: #17140f;
        --papel-hondo: #211d17;
        --tinta: #ece5da;
        --tenue: #a99f92;
        --linea: #3a332a;
        --acento: #fecada;       /* rubor de las mejillas */
        --acento-suave: #372d2b;
        --seleccion: #5c4b4c;
        --banda: var(--papel);
        --marco: var(--papel);
    }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
    color-scheme: dark;
    --papel: #17140f;
    --papel-hondo: #211d17;
    --tinta: #ece5da;
    --tenue: #a99f92;
    --linea: #3a332a;
    --acento: #fecada;
    --acento-suave: #372d2b;
    --seleccion: #5c4b4c;
    --banda: var(--papel);
    --marco: var(--papel);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
::selection { background: var(--seleccion); color: var(--tinta); }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--papel);
    color: var(--tinta);
    font-family: var(--letra-texto);
    font-size: 1.1875rem;
    line-height: 1.6;
    font-variant-numeric: oldstyle-nums;
}

main { flex: 1; width: 100%; }

a { color: var(--acento); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--acento);
    outline-offset: 3px;
    border-radius: 2px;
}

h1, h2, h3 {
    font-family: var(--letra-titulo);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.saltar {
    position: absolute;
    left: -999px;
    top: 0.5rem;
    background: var(--papel);
    padding: 0.5rem 1rem;
}
.saltar:focus { left: 1rem; z-index: 10; }

/* Adorno: dos filetes y una estrella, recuerdo del adorno original */
.adorno {
    display: block;
    width: 7.5rem;
    height: 1rem;
    margin: 1.5rem auto;
    background: var(--acento);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 16'%3E%3Cpath d='M4 8Q26 6.4 48 8Q26 9.6 4 8ZM116 8Q94 6.4 72 8Q94 9.6 116 8Z'/%3E%3Ccircle cx='51.5' cy='8' r='1.3'/%3E%3Ccircle cx='68.5' cy='8' r='1.3'/%3E%3Cpath d='M60 2.6v10.8M55.3 5.3l9.4 5.4M55.3 10.7l9.4-5.4' stroke='black' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 16'%3E%3Cpath d='M4 8Q26 6.4 48 8Q26 9.6 4 8ZM116 8Q94 6.4 72 8Q94 9.6 116 8Z'/%3E%3Ccircle cx='51.5' cy='8' r='1.3'/%3E%3Ccircle cx='68.5' cy='8' r='1.3'/%3E%3Cpath d='M60 2.6v10.8M55.3 5.3l9.4 5.4M55.3 10.7l9.4-5.4' stroke='black' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Cabecera de las páginas interiores ---------- */

.cabecera {
    background: var(--banda);
    border-bottom: 1px solid var(--linea);
    padding: 1.1rem 1rem;
}
.cabecera-dentro {
    max-width: 60rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "marca menu tema";
    align-items: center;
    gap: 0.5rem 1.5rem;
}
.cabecera .marca { grid-area: marca; }
.cabecera .menu { grid-area: menu; }
.cabecera .cambiar-tema { grid-area: tema; }
@media (max-width: 44rem) {
    .cabecera-dentro {
        grid-template-columns: 1fr auto;
        grid-template-areas: "marca tema" "menu menu";
    }
}

/* Interruptor claro/oscuro: luna en modo claro, sol en modo oscuro */
.cambiar-tema {
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--linea);
    border-radius: 50%;
    background: transparent;
    color: var(--tenue);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.cambiar-tema[hidden] { display: none; }
.cambiar-tema:hover { color: var(--acento); border-color: var(--acento); }
.cambiar-tema svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cambiar-tema .icono-sol { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .cambiar-tema .icono-luna { display: none; }
    :root:not([data-theme="light"]) .cambiar-tema .icono-sol { display: block; }
}
:root[data-theme="dark"] .cambiar-tema .icono-luna { display: none; }
:root[data-theme="dark"] .cambiar-tema .icono-sol { display: block; }

.tema-portada {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.marca {
    font-family: var(--letra-titulo);
    font-size: 1.3rem;
    color: var(--tinta);
    text-decoration: none;
}
.marca:hover { color: var(--acento); }

.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}
.menu a {
    font-family: var(--letra-titulo);
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: var(--tenue);
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
}
.menu a:hover { color: var(--tinta); }
.menu a[aria-current="page"] { color: var(--acento); border-bottom-color: currentColor; }
@media (max-width: 30rem) {
    .menu ul { gap: 0.25rem 0.85rem; }
    .menu a { font-size: 0.95rem; letter-spacing: 0.02em; }
}

/* ---------- Portada ---------- */

.portada {
    max-width: 60rem;
    margin: 0 auto;
    padding: clamp(2.5rem, 8vh, 6rem) 1rem 3rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

/* Retrato en arco: recuerda el óvalo del sitio anterior sin cortar el teclado */
.retrato {
    margin: 0;
    width: 320px;
    aspect-ratio: 2 / 3;
    border-radius: 50% 50% 4px 4px / 33.333% 33.333% 4px 4px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--linea), 0 0 0 9px var(--marco), 0 0 0 10px var(--acento);
}
.retrato img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portada h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    margin: 0;
}
.oficio {
    font-style: italic;
    font-size: 1.5rem;
    color: var(--tenue);
    margin: 0.4rem 0 0;
}
.portada .adorno { margin: 1.75rem 0; }
.presentacion { max-width: 32rem; margin: 0 0 2rem; }

.menu-portada {
    list-style: none;
    margin: 0 0 2.25rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.menu-portada a {
    display: inline-block;
    font-family: var(--letra-titulo);
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--tinta);
    border: 1px solid var(--linea);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.menu-portada a:hover { border-color: var(--acento); color: var(--acento); background: var(--acento-suave); }
.menu-portada .principal a { background: var(--acento); border-color: var(--acento); color: var(--papel); }
.menu-portada .principal a:hover { background: transparent; color: var(--acento); }

.escuchar { margin: 0; color: var(--tenue); font-size: 1.05rem; }
.escuchar a { margin-left: 0.4rem; }

@media (max-width: 44rem) {
    .portada { grid-template-columns: 1fr; text-align: center; justify-items: center; padding-top: 4.5rem; }
    .retrato { width: min(260px, 70vw); }
    .portada .adorno { margin: 1.5rem auto; }
    .presentacion { margin-left: auto; margin-right: auto; }
    .menu-portada { justify-content: center; }
}

/* ---------- Páginas interiores ---------- */

.pagina {
    max-width: calc(var(--ancho-texto) + 2rem);
    margin: 0 auto;
    padding: 3rem 1rem 4rem;
}
.pagina > h1 {
    font-size: clamp(2rem, 5vw, 2.6rem);
    text-align: center;
    margin: 0;
}
.pagina > .adorno { margin-bottom: 2.5rem; }
.entrada {
    text-align: center;
    font-style: italic;
    color: var(--tenue);
    margin: -1rem 0 2.5rem;
}

.pagina h2 {
    font-size: 1.45rem;
    margin: 3rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--linea);
}
.pagina p { margin: 0 0 1rem; }

/* Lista con año al margen */
.cronologia {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cronologia li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 1rem;
    padding: 0.5rem 0;
}
.cronologia .fecha {
    font-family: var(--letra-titulo);
    font-size: 0.95rem;
    color: var(--acento);
    font-variant-numeric: lining-nums;
    padding-top: 0.2rem;
}
@media (max-width: 30rem) {
    .cronologia li { grid-template-columns: 1fr; gap: 0; }
}

.datos {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1.5rem;
    margin: 0;
}
.datos dt { color: var(--tenue); }
.datos dd { margin: 0; }
@media (max-width: 30rem) {
    .datos { grid-template-columns: 1fr; gap: 0; }
    .datos dd { margin-bottom: 0.6rem; }
}

/* ---------- Contacto ---------- */

.tarjeta {
    text-align: center;
    background: var(--papel-hondo);
    border: 1px solid var(--linea);
    border-radius: 6px;
    padding: 2.25rem 1.5rem;
}
.tarjeta .nombre { font-family: var(--letra-titulo); font-size: 1.4rem; margin: 0 0 0.25rem; }
.tarjeta .lugar { font-style: italic; color: var(--tenue); margin: 0 0 1.75rem; }
.tarjeta .datos { display: inline-grid; text-align: left; font-size: 1.15rem; }
.tarjeta .datos a { font-variant-numeric: lining-nums; }
.nota-contacto { margin: -0.75rem 0 1.25rem !important; text-wrap: balance; }
.acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}
.accion {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--letra-titulo);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    color: var(--tinta);
    background: var(--papel);
    border: 1px solid var(--linea);
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    transition: border-color 0.15s, color 0.15s;
}
.accion:hover { border-color: var(--acento); color: var(--acento); background: var(--acento-suave); }
.accion svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: var(--acento);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.accion-whatsapp svg { stroke: #1da851; }
.accion-whatsapp:hover { border-color: #1da851; color: var(--tinta); }

/* ---------- Grabaciones ---------- */

.obra-grupo h3 {
    font-size: 1.15rem;
    letter-spacing: 0.03em;
    color: var(--tenue);
    margin: 2rem 0 0.5rem;
}

/* Videos: miniatura que se convierte en reproductor */
.videos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1.75rem 1.25rem;
}
.video-enlace, .video-marco {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: var(--papel-hondo);
    border: 0;
    margin-bottom: 0.6rem;
}
.video-enlace img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s, filter 0.3s;
}
.video-enlace:hover img { transform: scale(1.03); filter: brightness(0.85); }
.video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3.25rem;
    height: 3.25rem;
    margin: -1.625rem 0 0 -1.625rem;
    border-radius: 50%;
    background: var(--acento);
    box-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}
.video-play::after {
    content: "";
    position: absolute;
    left: 54%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 0.6rem 0 0.6rem 1rem;
    border-color: transparent transparent transparent var(--papel);
}
.video-obra { line-height: 1.35; }
.video-con { font-size: 0.95rem; color: var(--tenue); line-height: 1.35; margin-top: 0.15rem; }
.pistas {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pista {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 1rem;
    padding: 0.7rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: 6px;
}
.con-reproductor .pista { grid-template-columns: 2.75rem 1fr auto; }
.pista { position: relative; }
/* El separador queda alineado con el texto aunque la fila sobresalga */
.pista + .pista::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0.75rem;
    right: 0.75rem;
    border-top: 1px solid var(--linea);
}
.pista.activa { background: var(--acento-suave); }
.pista.activa::before, .pista.activa + .pista::before { display: none; }

.pista-boton {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--acento);
    background: transparent;
    color: var(--acento);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}
.pista-boton:hover, .activa .pista-boton { background: var(--acento); color: var(--papel); }
.pista-boton svg { width: 1rem; height: 1rem; fill: currentColor; }
.pista-boton .icono-pausa { display: none; }
.sonando .pista-boton .icono-play { display: none; }
.sonando .pista-boton .icono-pausa { display: block; }

.pista-titulo { font-size: 1.15rem; }
.pista-detalle { font-size: 0.95rem; color: var(--tenue); font-variant-numeric: tabular-nums lining-nums; }
.pista-descarga { font-size: 0.95rem; white-space: nowrap; }

/* Forma de onda: el lienzo dibuja, el control deslizante invisible encima
   se encarga del clic, el arrastre, el teclado y los lectores de pantalla. */
.con-reproductor .pista-boton { grid-row: 1 / span 2; align-self: center; }
.con-reproductor .pista-detalle { display: none; }
.con-reproductor .pista { padding-top: 0.9rem; padding-bottom: 0.9rem; }

.onda {
    grid-column: 2 / -1;
    position: relative;
    height: 3.5rem;
    margin-top: 0.4rem;
    border-radius: 2px;
}
.onda canvas { display: block; width: 100%; height: 100%; }
.onda input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}
/* Pulgar de 1 px: así el clic cae exactamente donde apunta el puntero */
.onda input::-webkit-slider-thumb { -webkit-appearance: none; width: 1px; height: 3.5rem; }
.onda input::-moz-range-thumb { width: 1px; height: 3.5rem; border: 0; }
.onda:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 4px; }

.onda-tiempo, .onda-total {
    position: absolute;
    bottom: 0;
    padding: 0 0.3rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--tenue);
    background: var(--papel);
    font-variant-numeric: tabular-nums lining-nums;
    pointer-events: none;
}
.onda-tiempo { left: 0; color: var(--acento); visibility: hidden; }
.onda-total { right: 0; }
.activa .onda-tiempo { visibility: visible; }
.activa .onda-tiempo, .activa .onda-total { background: var(--acento-suave); }

@media (max-width: 30rem) {
    .pista-descarga { font-size: 0; text-decoration: none; }
    .pista-descarga::after { content: "mp3"; font-size: 0.95rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
}

.nota { margin-top: 2.5rem; color: var(--tenue); font-size: 1rem; text-align: center; }

/* ---------- Fotos ---------- */

.pagina-ancha { max-width: 62rem; }
.pagina-ancha > .entrada { margin-bottom: 1rem; }
.concierto h2 { margin-bottom: 0.25rem; }
.concierto-datos { color: var(--tenue); font-style: italic; margin: 0 0 1.25rem !important; }

.galeria {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
    gap: 0.75rem;
}
.galeria a { display: block; border-radius: 4px; overflow: hidden; background: var(--papel-hondo); }
.galeria img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.35s, filter 0.35s;
}
.galeria a:hover img { transform: scale(1.03); filter: brightness(0.9); }

.visor {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(12 10 8 / 0.94);
    color: #ece5da;
}
.visor::backdrop { background: rgb(12 10 8 / 0.94); }
.visor figure {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 3.5rem 4rem 2rem;
}
.visor img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: 2px; }
.visor figcaption { font-style: italic; color: #b9afa2; text-align: center; }
.visor button {
    position: absolute;
    background: transparent;
    border: 0;
    color: #ece5da;
    font: 2.4rem/1 var(--letra-texto);
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    border-radius: 50%;
}
.visor button:hover { background: rgb(255 255 255 / 0.1); }
.visor-cerrar { top: 0.75rem; right: 0.75rem; }
.visor-anterior { left: 0.5rem; top: 50%; margin-top: -1.5rem; }
.visor-siguiente { right: 0.5rem; top: 50%; margin-top: -1.5rem; }
@media (max-width: 40rem) {
    .visor figure { padding: 3.5rem 0.5rem 4.5rem; }
    .visor-anterior, .visor-siguiente { top: auto; bottom: 0.75rem; margin: 0; }
    .visor-anterior { left: 25%; }
    .visor-siguiente { right: 25%; }
}

/* ---------- Pie ---------- */

.pie {
    background: var(--banda);
    border-top: 1px solid var(--linea);
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--tenue);
}
.pie p { margin: 0; }
.pie a { color: inherit; }

/* ---------- Página de error ---------- */

.error {
    max-width: 30rem;
    margin: 0 auto;
    padding: 18vh 1rem 4rem;
    text-align: center;
}
.error h1 { font-size: 2rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
