/* =============================================================
   Trayectoria — Archetype: Magazine Multi-Page (adaptado a página única)
   Revista impresa: cubierta + artículo de portada + grid de artículos +
   departamentos, todo en una sola página con topología de revista.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f2e7;
  --bg-2: #efe6d3;
  --paper: #fffdf8;
  --ink: #211c15;
  --mute: #5b5346;
  --faint: #5f574c; /* 26/9/2026: antes #8a8171 (3,45:1) → 6,37:1, AA */
  --accent-2-text: #7d581c; /* mostaza para TEXTO sobre fondo claro (5,15–6,29:1); --accent-2 solo sobre oscuro */
  --accent: #a9291f;    /* rojo revista */
  --accent-2: #b8862e;  /* mostaza — departamentos, acentos secundarios */
  --line: #211c15;
  --line-soft: rgba(33, 28, 21, 0.16);

  --display: "Bodoni Moda", "Playfair Display", Georgia, serif;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1080px;
  --gutter: 1.4rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-press: cubic-bezier(0.23, 1, 0.32, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (max-width: 900px) { html { scroll-padding-top: .5rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a, button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.08; color: var(--ink); overflow-wrap: anywhere; hyphens: auto; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; font-family: var(--sans); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.kicker {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.8rem;
}
section { padding-block: clamp(2.8rem, 6vw, 5rem); border-bottom: 1px solid var(--line-soft); }
.section-title { font-size: clamp(2rem, 3.6vw, 2.5rem); margin-bottom: 1rem; max-width: 24ch; }
.section-lede { font-family: var(--serif); color: var(--mute); max-width: 68ch; margin-bottom: 2.2rem; overflow-wrap: anywhere; }

/* Bodoni Moda con tamaño óptico automático (opsz hasta 96) deja los trazos finos en un hilo a partir de
   ~40 px: el guion de «Wiśniewska-Kowalczyk» y el «—» desaparecían y el 4 de «12.400» se leía como 1.
   Titulares, títulos de sección y citas: opsz 16 (conserva el contraste de revista, el hilo ya se ve);
   cifras y números pequeños: opsz por defecto (trazo más grueso). */
h1, h2, h3, .pull-quote p { font-variation-settings: "opsz" 16; }
.stat-num, .tl-period, .department-count, .article-index { font-optical-sizing: none; }

/* Reveal al hacer scroll: tarjetas y rejillas, nunca el cuerpo del artículo. Sin JS no se oculta nada. */
html:not(.no-js) [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
html:not(.no-js) [data-reveal].is-revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html:not(.no-js) [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* Parallax suave en la imagen (no en el marco), desactivado con reduced-motion */
@media (prefers-reduced-motion: reduce) { [data-parallax] img { transform: none !important; } }

/* =============================================================
   4. Nav — subrayado animado
   ============================================================= */
.nav { position: sticky; top: 0; z-index: 500; background: rgba(247, 242, 231, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: .8rem; padding: 0.25rem var(--gutter); font-family: var(--sans); }
.nav-brand { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
.nav-links { display: flex; align-items: center; gap: .3rem; margin-left: .6rem; }
.nav-link { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; padding-inline: .8rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute); }
.nav-link span { position: relative; }
.nav-link span::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .2s var(--ease-out);
}
.nav-link:focus-visible span::after { transform: scaleX(1); }
.nav-link:focus-visible { color: var(--ink); }
@media (hover: hover) { .nav-link:hover span::after { transform: scaleX(1); } .nav-link:hover { color: var(--ink); } }
.nav-link--cta { margin-left: auto; color: #fff; background: var(--accent); padding: 0.4rem 1rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; transition: background-color .2s ease, transform .16s var(--ease-press); }
.nav-link--cta:focus-visible { color: #fff; }
@media (hover: hover) { .nav-link--cta:hover { background: #7f1e16; color: #fff; } }
.nav-link--cta:active, .btn:active { transform: scale(.97); }
.lang { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding-inline: .6rem; font-family: var(--sans); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.lang:focus-visible { color: var(--ink); }
@media (hover: hover) { .lang:hover { color: var(--ink); } }
.lang:active { color: var(--ink); }
@media (min-width: 901px) { .nav-link--extra { display: none; } }

/* Hasta 900 px: fila 1 = marca + contacto + idioma; fila 2 = tira horizontal con todas las secciones.
   La cabecera deja de ser fija (dos filas fijas ocupaban demasiada pantalla). */
@media (max-width: 900px) {
  .nav { position: static; backdrop-filter: none; background: var(--bg); }
  .nav-inner { flex-wrap: wrap; gap: 0 .2rem; padding-block: .25rem 0; }
  .nav-brand { order: 1; flex: 1 1 auto; }
  .nav-link--cta { order: 2; margin-left: 0; }
  .lang { order: 3; }
  .nav-links { order: 4; flex: 1 0 100%; margin: 0 calc(var(--gutter) * -1); padding-inline: calc(var(--gutter) - .8rem); gap: 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line-soft); }
  .nav-links::-webkit-scrollbar { display: none; }
}

/* =============================================================
   5. Buttons
   ============================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; max-width: 100%; padding: 0.8rem 1.6rem; font-family: var(--sans); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; overflow-wrap: anywhere; transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-press); }
.btn-primary { background: var(--accent); color: #fff; }
@media (hover: hover) { .btn-primary:hover { background: #7f1e16; } }
.btn-large { padding: 1rem 2rem; font-size: 0.92rem; }
.btn-ghost { border: 1px solid var(--ink); color: var(--ink); }
@media (hover: hover) { .btn-ghost:hover { background: var(--ink); color: var(--bg); } }
.btn.email { text-transform: none; letter-spacing: 0; font-size: 1rem; }

.link-underline { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--sans); font-weight: 700; font-size: 0.9rem; color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; text-decoration-color: rgba(169, 41, 31, .45); transition: text-decoration-color .2s ease, transform .16s var(--ease-press); }
.link-underline:active { transform: scale(.97); }
@media (hover: hover) { .link-underline:hover { text-decoration-color: currentColor; } }

/* =============================================================
   6. Masthead + cover story
   ============================================================= */
.cover { border-bottom: none; padding-top: 0; }
.masthead { text-align: center; padding: 2.6rem var(--gutter) 1.6rem; border-bottom: 1px solid var(--line); }
.masthead-eyebrow { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2-text); margin-bottom: 0.5rem; }
.masthead-brand { font-size: clamp(2.4rem, 5.6vw, 3.6rem); letter-spacing: -0.01em; max-width: 22ch; margin-inline: auto; text-wrap: balance; }
.masthead-roles { display: flex; flex-wrap: wrap; justify-content: center; max-width: 58rem; margin: 0.6rem auto 0; font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.02em; color: var(--mute); }
.masthead-roles li { min-width: 0; padding: .1rem .55rem; overflow-wrap: anywhere; }
.masthead-roles--lista li::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: .6rem; background: var(--accent-2); transform: rotate(45deg); vertical-align: middle; position: relative; top: -1px; }

.cover-story { display: flex; flex-direction: column; padding-block: clamp(2rem, 6vw, 4rem); max-width: 760px; }
.cover-title { font-size: clamp(2rem, 5vw, 3.2rem); font-style: italic; margin-bottom: 1rem; }
.cover-title.long { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.byline { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.03em; color: var(--faint); margin-bottom: 1.4rem; overflow-wrap: anywhere; }
.byline strong { color: var(--ink); font-weight: 600; }

/* Orden de lectura: titular, firma, botones, foto, texto. Así el botón principal se ve en la primera pantalla. */
.cover-cta { order: 1; display: flex; flex-wrap: wrap; gap: 0.7rem 0.9rem; margin-bottom: 2rem; }
.cover-figure { order: 2; position: relative; aspect-ratio: 16/9; max-height: min(60svh, 460px); margin-bottom: 1.8rem; overflow: hidden; }
.cover-body { order: 3; }
/* la imagen sobresale 20 px por arriba y por abajo del marco: el parallax la mueve sin dejar huecos */
.cover-figure img, .timeline-figure img { position: absolute; left: 0; top: -20px; width: 100%; height: calc(100% + 40px); object-fit: cover; filter: sepia(0.12) saturate(1.05); }

.cover-body { text-align: justify; hyphens: auto; overflow-wrap: break-word; }
.cover-body p { margin-bottom: 1.2rem; text-wrap: pretty; }
.cover-body p.has-dropcap::first-letter {
  font-family: var(--display); font-weight: 800; font-size: 4.4rem; line-height: 0.78;
  float: left; padding: 0.05em 0.1em 0 0; color: var(--accent);
}
.cover-personal { font-style: italic; color: var(--faint); text-align: left; }

.pull-quote { margin-block: 1.8rem; padding-left: 1.6rem; border-left: 3px solid var(--accent); position: relative; text-align: left; }
.pull-quote p { font-family: var(--display); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.6rem); position: relative; padding-left: 1.4rem; overflow-wrap: anywhere; }
.pull-quote p::before { content: "“"; position: absolute; left: -0.4rem; top: -0.4rem; font-size: 2.6rem; color: var(--accent-2-text); font-family: var(--display); }

@media (max-width: 700px) {
  .masthead { padding-top: 1.6rem; }
  .cover-body { text-align: left; hyphens: none; }
  .cover-cta { margin-bottom: 1.6rem; }
  .cover-cta .btn { flex: 1 1 auto; }
}

/* =============================================================
   7. Stats band — columnas calculadas en la plantilla (--c), bordes por clase
   ============================================================= */
.stats-band { background: var(--bg-2); }
.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.stat { container-type: inline-size; min-width: 0; padding: 1.4rem 1.6rem; }
.stat + .stat { border-top: 1px solid var(--line-soft); }
.stat-num { font-family: var(--display); font-weight: 700; font-size: min(2.9rem, calc(100cqi / (var(--n, 4) * .62))); color: var(--accent); line-height: 1.05; margin-bottom: 0.4rem; overflow-wrap: anywhere; }
.stat-label { font-family: var(--sans); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.stat-note { font-family: var(--sans); color: var(--faint); font-size: 0.82rem; overflow-wrap: anywhere; }

@media (min-width: 761px) {
  .stats-grid { grid-template-columns: repeat(var(--c, 3), minmax(0, 1fr)); }
  .stat + .stat { border-top: 0; }
  .stat.r { border-right: 1px solid var(--line-soft); }
  .stat.r2 { border-top: 1px solid var(--line-soft); }
}

/* =============================================================
   8. Trayectoria
   ============================================================= */
.timeline-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.4rem; margin-top: 1.8rem; align-items: start; }
.timeline-layout--solo { grid-template-columns: minmax(0, 1fr); }
.timeline { display: flex; flex-direction: column; min-width: 0; }
.tl-item { padding-block: 1.5rem; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr); gap: 1.6rem; }
.tl-item:first-child { border-top: none; }
.tl-period { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--accent-2-text); overflow-wrap: anywhere; }
.tl-item--current .tl-period { color: var(--accent); }
.tl-body { min-width: 0; }
.tl-body p { color: var(--mute); margin-top: 0.5rem; overflow-wrap: anywhere; }
.tl-tags { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tl-tags li { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--mute); border: 1px solid var(--line-soft); padding: 0.25rem 0.6rem; overflow-wrap: anywhere; }

.timeline-figure { position: relative; overflow: hidden; align-self: start; aspect-ratio: 3/4; max-height: min(75svh, 520px); }
.timeline-figure img { filter: sepia(0.12) saturate(1.05); }
@media (min-width: 861px) { .timeline-figure { position: sticky; top: 5.5rem; } }

@media (max-width: 860px) {
  .timeline-layout { grid-template-columns: minmax(0, 1fr); }
  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .timeline-figure { max-width: 420px; }
}

/* =============================================================
   9. Rejillas de tarjetas sin bordes compartidos (ponencias, artículos, contacto):
      1 columna en móvil; --ct (≤ 2) en tablet; --c (≤ 3, 2 si hay 4) en escritorio.
   ============================================================= */
.departments-grid, .articles-grid, .contact-cards { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 761px) {
  .departments-grid, .articles-grid, .contact-cards { grid-template-columns: repeat(var(--ct, 2), minmax(0, 1fr)); }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .departments-grid > :last-child:nth-child(odd), .articles-grid > :last-child:nth-child(odd), .contact-cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1001px) {
  .departments-grid, .articles-grid, .contact-cards { grid-template-columns: repeat(var(--c, 3), minmax(0, 1fr)); }
}

/* Departamentos — ponencias */
.department-section { background: var(--bg-2); }
.departments-grid { gap: 1.6rem; margin-top: 1.8rem; }
.department-card { min-width: 0; background: var(--paper); padding: 1.6rem; border-top: 3px solid var(--accent-2); }
.department-head { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 0.9rem; }
.department-head h3 { font-size: 1.1rem; flex: 1; min-width: 0; }
.department-count { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--accent-2-text); }
.department-examples li { font-family: var(--serif); font-size: 0.94rem; color: var(--mute); padding-block: 0.4rem; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.department-examples li:first-child { border-top: none; }

/* Formación */
.education-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 0 2.4rem; margin-top: 1.8rem; }
.education-column { min-width: 0; }
.education-heading { font-family: var(--sans); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-2-text); margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line-soft); }
.education-list li { display: grid; grid-template-columns: minmax(0, 100px) minmax(0, 1fr); gap: 1rem; padding-block: 0.7rem; border-top: 1px solid var(--line-soft); }
.education-list li:first-child { border-top: none; }
.edu-period { font-family: var(--sans); color: var(--faint); font-size: 0.8rem; font-weight: 700; overflow-wrap: anywhere; }
.edu-body { color: var(--mute); font-size: 0.94rem; overflow-wrap: anywhere; }
.edu-body strong { color: var(--ink); font-family: var(--serif); }

/* Artículos — grid «en portada» */
.articles-grid { gap: 1.8rem; margin-top: 1.8rem; margin-bottom: 1.8rem; }
.article-preview { min-width: 0; border-top: 1px solid var(--line); padding-top: 1rem; }
.article-index { font-family: var(--display); font-size: 0.9rem; color: var(--accent-2-text); font-weight: 700; }
.article-preview h3 { font-size: 1.2rem; margin: 0.5rem 0 0.5rem; }
.article-preview p { color: var(--mute); font-size: 0.97rem; overflow-wrap: anywhere; }
.articles-links { display: flex; flex-wrap: wrap; gap: 0 1.6rem; margin-top: 1rem; }

/* =============================================================
   10. Prensa
   ============================================================= */
.press-section .pull-quote--press { max-width: 74ch; }
.press-source { font-family: var(--sans); color: var(--faint); font-size: 0.85rem; margin-top: 0.6rem; overflow-wrap: anywhere; }

/* =============================================================
   11. Colaboraciones — créditos (un marcador por elemento: sin separador colgante)
   ============================================================= */
.collab-section { text-align: center; }
.collab-credits { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem .3rem; max-width: 62rem; margin-inline: auto; font-family: var(--sans); font-size: 0.95rem; color: var(--mute); font-style: italic; line-height: 1.6; }
.collab-credits li { min-width: 0; padding: .35rem .5rem; overflow-wrap: anywhere; }
.collab-credits li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: .7rem; background: var(--accent-2); transform: rotate(45deg); vertical-align: middle; position: relative; top: -1px; }

/* =============================================================
   12. Suscríbete / contacto
   ============================================================= */
.contact-banner { background: var(--ink); color: var(--bg); padding: clamp(2.2rem, 5vw, 3.6rem); }
.contact-banner .kicker { color: var(--accent-2); }
.contact-banner .section-title { color: var(--bg); }
.contact-cards { gap: 1.2rem; margin-block: 1.8rem; }
.contact-card { display: block; min-width: 0; padding: 1.4rem; border: 1px solid rgba(247, 242, 231, 0.22); transition: border-color .2s ease, transform .16s var(--ease-press); }
.contact-card:active { transform: scale(.98); }
@media (hover: hover) { .contact-card:hover { border-color: var(--accent-2); } }
.contact-card h3 { color: var(--bg); font-size: 1.1rem; margin-bottom: 0.4rem; }
.contact-card p { color: rgba(247, 242, 231, 0.78); font-size: 0.94rem; margin-bottom: 0.7rem; font-family: var(--serif); overflow-wrap: anywhere; }
.contact-card-cta { display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent-2); }
.contact-direct { display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; }
.contact-direct .btn-ghost { border-color: var(--bg); color: var(--bg); }
@media (hover: hover) { .contact-direct .btn-ghost:hover { background: var(--bg); color: var(--ink); } }
.contact-direct .btn-primary { min-width: 0; }

/* =============================================================
   13. Footer
   ============================================================= */
.footer { padding-block: 1.8rem; border-bottom: none; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.2rem 1.2rem; font-family: var(--sans); color: var(--faint); font-size: 0.82rem; }
.footer-inner p, .footer-note { overflow-wrap: anywhere; min-width: 0; }
.footer-top { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 700; }
.trayectoria-credit { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; opacity: .92; transition: opacity .2s; }
@media (hover: hover) { .trayectoria-credit:hover { opacity: 1; } }
.trayectoria-credit img { display: block; border-radius: 2px; }

/* Robustez: un email o una palabra muy larga no debe desbordar la página en móvil. */
a[href^="mailto:"], .email { overflow-wrap: anywhere; }
