/* ============================================================================
   C.F.D.L. — base.css
   Shared chrome for the top-level site pages (index, manifiesto, proyectos,
   eventos, galeria). No build step: this file is linked directly.
   NOTE: url() resolves relative to THIS file (docs/assets/css/), so font and
   asset paths are ../fonts/… etc.

   Dirección: sobria. Papel, tinta, mucho aire, una retícula recta. El color
   lo pone el logotipo —el cuadrado ámbar— y casi nada más. Minion en cursiva
   para los títulos, Futura para todo lo demás.
   ========================================================================== */

/* ── Fonts ─────────────────────────────────────────────────────────────── */
/* woff2 recortado a latín (ES, CA, FR, PT, AST, EN): Minion pasa de 218 KB
   a 75 KB. El .otf queda de reserva y lo siguen usando las piezas output/. */
@font-face {
    font-family: 'FuturaStd';
    src: url('../fonts/FuturaStd-Book.woff2') format('woff2'),
         url('../fonts/FuturaStd-Book.otf') format('opentype');
    font-display: swap;
}
@font-face {
    font-family: 'MinionPro';
    src: url('../fonts/MinionPro-Regular.woff2') format('woff2'),
         url('../fonts/MinionPro-Regular.otf') format('opentype');
    font-display: swap;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { max-width: 100%; height: auto; display: block; }

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
    /* LA PALETA DEL LOGOTIPO (studio/brand) — y nada más. Sin pasteles:
       blanco, negro, ámbar y zafiro, a plena tinta. La crema sólo como
       letra sobre fondo oscuro. */
    --blanco: #ffffff;
    --negro:  #171513;
    --ambar:  #ffb923;
    --zafiro: #332f8a;
    --crema:  #fff4d6;

    --bg:      var(--blanco);
    --surface: var(--blanco);
    --text:    var(--negro);
    --muted:   var(--zafiro);   /* lo secundario va en zafiro, no en gris (9,9:1) */
    --border:  var(--negro);
    --rule:    var(--negro);

    --accent:    var(--ambar);  /* relleno: bandas, subrayado, marca          */
    --accent-fg: var(--zafiro); /* letra de acento sobre blanco               */

    --band-bg:    var(--zafiro);
    --band-fg:    var(--crema);
    --band-muted: var(--ambar);
    --band-rule:  rgba(255, 244, 214, 0.35);

    /* Escala editorial. Ninguna letra baja de --fs-label. */
    --fs-label:   12px;
    --fs-small:   15px;
    --fs-body:    18px;
    --fs-h3:      clamp(22px, 2vw, 30px);
    --fs-h2:      clamp(34px, 4vw, 56px);
    --fs-display: clamp(60px, 10vw, 168px);
    --track:      0.14em;

    --gutter: clamp(20px, 4vw, 56px);
    --max:    1440px;

    --radius: 0;
    --ease:   0.2s;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Esquemas de una sola tinta: crema sobre zafiro (<body class="theme-dark">,
   el manifiesto) o crema sobre negro (<body class="theme-tinta">, eventos). Sin ámbar: el azul y el naranja, juntos y a plena
   tinta, se pelean. La jerarquía la dan el tamaño y la intensidad de la
   crema, no un segundo color. */
body.theme-dark,
body.theme-tinta {
    --bg:      var(--zafiro);
    --surface: var(--zafiro);
    --text:    var(--crema);
    --muted:   rgba(255, 244, 214, 0.66);
    --border:  rgba(255, 244, 214, 0.28);
    --rule:    rgba(255, 244, 214, 0.28);
    --accent:    var(--crema);
    --accent-fg: var(--crema);
}
:is(.theme-dark, .theme-tinta) ::selection { background: var(--crema); color: var(--bg); }
:is(.theme-dark, .theme-tinta) .nav-links a:hover,
:is(.theme-dark, .theme-tinta) .nav-links a[aria-current="page"] { border-bottom-color: var(--crema); }
:is(.theme-dark, .theme-tinta) footer,
:is(.theme-dark, .theme-tinta) footer p,
:is(.theme-dark, .theme-tinta) footer a,
:is(.theme-dark, .theme-tinta) .footer-brand { color: var(--crema); }
:is(.theme-dark, .theme-tinta) footer a:hover { border-bottom-color: var(--crema); }
:is(.theme-dark, .theme-tinta) :focus-visible { outline-color: var(--crema); }
/* El menú móvil, del color de la página. */
:is(.theme-dark, .theme-tinta) .menu,
:is(.theme-dark, .theme-tinta) .menu::backdrop { background: var(--bg); color: var(--crema); }
:is(.theme-dark, .theme-tinta) .menu .nav-brand,
:is(.theme-dark, .theme-tinta) .menu-links a,
:is(.theme-dark, .theme-tinta) .menu-foot,
:is(.theme-dark, .theme-tinta) .menu-foot a,
:is(.theme-dark, .theme-tinta) .menu-close { color: var(--crema); }
:is(.theme-dark, .theme-tinta) .menu-head,
:is(.theme-dark, .theme-tinta) .menu-links li { border-color: rgba(255, 244, 214, 0.28); }
:is(.theme-dark, .theme-tinta) .menu-close { border-bottom-color: var(--crema); }
:is(.theme-dark, .theme-tinta) .menu-links a[aria-current="page"] { color: rgba(255, 244, 214, 0.66); }
body.theme-tinta { --bg: var(--negro); --surface: var(--negro); }

/* ── Body ──────────────────────────────────────────────────────────────── */
body {
    font-family: 'FuturaStd', sans-serif;
    font-size: var(--fs-body);
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    /* Sólo tenemos Minion redonda: nada de cursivas fingidas. */
    font-synthesis: none;
}

::selection { background: var(--ambar); color: var(--negro); }

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.label {
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Nav ───────────────────────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    /* El mismo borde que todo lo demás: en pantallas de más de 1440 px la
       barra no se va al canto, se alinea con la columna del contenido. */
    padding: 0 max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    view-transition-name: site-nav;
}

/* La marca: el lockup «línea» de studio/brand (espiral + siglas), en
   contornos y en currentColor — tinta sobre papel, crema sobre zafiro. */
.nav-brand {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}
.nav-brand .logo-linea { display: block; height: 40px; width: auto; }

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 34px;
}

.nav-links a {
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: color var(--ease), border-color var(--ease);
}
.nav-links a { padding: 4px 0 3px; }   /* un solo grosor de línea en todo el sitio: 1 px */
.nav-links a:hover { border-bottom-color: var(--ambar); }
.nav-links a.active,
.nav-links a[aria-current="page"] { border-bottom-color: var(--ambar); }

/* Botón «Menú» — lo crea site.js; sin JS no existe y la barra envuelve. */
.nav-toggle {
    display: none;
    font: inherit;
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--text);
    background: none;
    border: 0;
    border-bottom: 1px solid var(--text);
    padding: 4px 0;
    cursor: pointer;
}

/* ── Menú a pantalla completa (móvil) ──────────────────────────────────── */
.menu {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0 var(--gutter) 32px;
    border: none;
    background: var(--ambar);
    color: var(--negro);
    overflow-y: auto;
}
.menu[open] { display: flex; flex-direction: column; }
.menu::backdrop { background: var(--ambar); }
.menu .nav-brand { color: var(--negro); }

.menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    border-bottom: 1px solid var(--negro);
}
.menu-close {
    font: inherit;
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--negro);
    background: none;
    border: 0;
    border-bottom: 1px solid var(--negro);
    padding: 4px 0;
    cursor: pointer;
}

.menu-links {
    list-style: none;
    padding: 40px 0 32px;
}
.menu-links li { border-bottom: 1px solid var(--negro); }
.menu-links a {
    display: block;
    padding: 14px 0 10px;
    font-family: 'MinionPro', serif;
    font-size: clamp(40px, 12vw, 64px);
    line-height: 1.05;
    color: var(--negro);
    text-decoration: none;
}
.menu-links a[aria-current="page"] { color: var(--zafiro); }

.menu-foot {
    margin-top: auto;
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--negro);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.menu-foot a { color: var(--negro); text-decoration: none; }

@keyframes cfdl-fade { from { opacity: 0; } to { opacity: 1; } }
.menu[open] { animation: cfdl-fade 0.25s ease both; }

/* ── Cabecera de sección ───────────────────────────────────────────────── */
/* Sin banda: el título sobre el papel, y un filete debajo. */
header {
    position: relative;
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(64px, 10vw, 136px) var(--gutter) clamp(40px, 5vw, 64px);
}
header::after {
    content: '';
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 0;
    height: 1px;
    background: var(--border);
}

.kicker {
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 18px;
}

.section-title {
    font-family: 'MinionPro', serif;
    font-weight: normal;
    font-size: var(--fs-display);
    line-height: 0.92;
    letter-spacing: -0.025em;
    color: var(--text);
    view-transition-name: page-title;
}

.section-subtitle {
    font-family: 'MinionPro', serif;
    font-size: clamp(20px, 1.8vw, 26px);
    line-height: 1.45;
    color: var(--text);
    margin-top: 28px;
    max-width: 40ch;
}

/* ── Pie: ámbar sobre negro, de lado a lado ───────────────────────────── */
footer {
    margin-top: clamp(80px, 10vw, 160px);
    padding: clamp(40px, 5vw, 64px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px 40px;
    background: var(--negro);
    color: var(--ambar);
}
footer p {
    font-size: var(--fs-label);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--ambar);
}
footer a {
    color: var(--ambar);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--ease);
}
footer a:hover { border-bottom-color: var(--ambar); }
.footer-brand {
    display: flex;
    align-items: flex-end;
    gap: 32px;
    color: var(--ambar);
}
/* El lockup «nombre»: espiral + COLECTIVO FUERA DE LUGAR. */
.footer-brand .logo-nombre { display: block; height: 72px; width: auto; }

/* ── Accessibility ─────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--negro);
    outline-offset: 3px;
}
footer :focus-visible { outline-color: var(--ambar); }
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Entrada de página ─────────────────────────────────────────────────── */
@keyframes cfdl-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.reveal { animation: cfdl-rise 0.9s var(--ease-out) both; }
.reveal-2 { animation-delay: 0.06s; }
.reveal-3 { animation-delay: 0.12s; }

/* ── Transiciones entre páginas (sólo un fundido) ──────────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.3s; }

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal, .reveal-2, .reveal-3 { animation: none; }
    @view-transition { navigation: none; }
}

/* ── Responsive (shared chrome) ────────────────────────────────────────── */
@media (max-width: 760px) {
    .js .nav-links { display: none; }
    .js .nav-toggle { display: inline-block; }
    .site-nav { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; min-height: 68px; }
    .nav-brand .logo-linea { height: 34px; }
    .nav-links { gap: 4px 18px; }
    .menu-head { min-height: 68px; }
    footer { flex-direction: column; align-items: flex-start; }
}
