/* ============================================================
   IDECS — hoja de estilos
   Paleta institucional: navy #0A2342 · amarillo #FAD02C
   Tipografía: Aptos, con Inter como respaldo para la web.
   ============================================================ */

:root {
  --navy: #0A2342;
  --navy-deep: #071A32;
  --sun: #FAD02C;
  --paper: #FFFFFF;
  --mist: #F2F5F9;
  --ink: #16263D;
  --muted: #55677F;
  --body-grey: #4C5E75;
  --line: #D8DFE8;

  --sans: "Aptos", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sans-display: "Aptos Display", "Aptos", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max: 1120px;
  --step: clamp(3.5rem, 7vw, 6.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1rem; }
h1, h2, h3 { font-family: var(--sans-display); font-weight: 600; letter-spacing: -.018em; margin: 0; color: var(--navy); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.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; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 2px; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 200; background: var(--sun); color: var(--navy); padding: .6rem 1rem; font-weight: 500; }
.skip-link:focus { top: .5rem; }

/* ---------- cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; gap: 1.5rem; padding-block: .85rem; }
.brand { display: flex; align-items: center; margin-right: auto; }
.brand img { width: 158px; height: auto; display: block; }
.site-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: .95rem; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--sun); }

.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a { text-decoration: none; font-size: .78rem; font-weight: 500; letter-spacing: .06em; color: var(--muted); padding: .35rem .7rem; }
.lang-switch a.is-active { background: var(--navy); color: #fff; }
.lang-switch a:hover:not(.is-active) { background: var(--mist); color: var(--navy); }

.menu-toggle { display: none; border: 1px solid var(--line); background: none; border-radius: 6px; padding: .5rem .6rem; cursor: pointer; }
.menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 20px; height: 2px; background: var(--navy); content: ""; }
.menu-bars { position: relative; }
.menu-bars::before { position: absolute; top: -6px; }
.menu-bars::after { position: absolute; top: 6px; }

/* ---------- portada ---------- */
.hero { background: var(--navy-deep); color: #fff; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.62fr); gap: 2rem; align-items: center; padding-block: clamp(3.5rem,8vw,7rem); }
.hero-name { color: var(--sun); font-size: 1rem; font-weight: 500; margin: 0 0 1.15rem; }
.hero h1 { color: #fff; font-size: clamp(2rem,4.2vw,3.15rem); line-height: 1.14; letter-spacing: -.025em; max-width: 20ch; margin-bottom: 1.6rem; }
.hero-lead { max-width: 52ch; color: #DCE5F0; font-size: 1.08rem; line-height: 1.68; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-mark { min-height: 200px; }
.sunburst { display: block; width: min(108%,440px); margin-left: auto; transform: translateX(14%); opacity: .95; }

.btn { display: inline-block; text-decoration: none; font-weight: 500; font-size: .98rem; padding: .72rem 1.4rem; border-radius: 2px; border: 1.5px solid transparent; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.btn-sun { background: var(--sun); color: var(--navy); border-color: var(--sun); }
.btn-sun:hover { background: #ffdf5c; border-color: #ffdf5c; }
.btn-ghost { border-color: rgba(255,255,255,.45); color: #fff; }
.btn-ghost:hover { border-color: var(--sun); color: var(--sun); }

/* ---------- secciones ---------- */
.band { padding: var(--step) 0; }
.band--mist { background: var(--mist); border-block: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: minmax(0,.4fr) minmax(0,1fr); gap: clamp(2rem,5vw,4.5rem); }
.col-head h2 { font-size: clamp(1.7rem,2.8vw,2.3rem); line-height: 1.15; }
.col-head h2::after { content: ""; display: block; width: 52px; height: 4px; background: var(--sun); margin-top: 1rem; }
.col-note { color: var(--muted); font-size: 1rem; margin-top: 1.1rem; max-width: 32ch; }
.prose { max-width: 62ch; }
.prose p { margin-bottom: 1.15rem; }

.lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 3rem; }
.lines li { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.lines li:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.lines h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.lines p { color: var(--body-grey); font-size: 1rem; margin: 0; line-height: 1.65; }

.facts { margin: 0; display: grid; }
.facts > div { display: grid; grid-template-columns: minmax(0,.42fr) minmax(0,1fr); gap: 1.5rem; padding: 1.35rem 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { font-weight: 600; color: var(--navy); }
.facts dd { margin: 0; color: var(--body-grey); font-size: 1rem; line-height: 1.65; }

.contact { background: var(--navy); color: #fff; padding: var(--step) 0; }
.contact h2 { color: #fff; font-size: clamp(1.8rem,3.2vw,2.5rem); margin-bottom: 1.1rem; }
.contact-alt { margin-top: 1.6rem; color: #AFC0D4; font-size: .95rem; }
.contact-alt a { color: var(--sun); text-underline-offset: 3px; }

/* ---------- páginas internas ---------- */
.page-head { background: var(--mist); border-bottom: 1px solid var(--line); padding: clamp(2.5rem,5vw,4rem) 0; }
.page-head h1 { font-size: clamp(1.9rem,3.4vw,2.6rem); }
.page-intro { color: var(--muted); max-width: 56ch; margin: .9rem 0 0; }
.page-body { padding: var(--step) 0; }
.page-aside { margin-bottom: 2rem; }
.empty-state { color: var(--muted); }
.text-link { color: var(--navy); text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 500; }
.text-link--back { display: inline-block; margin-bottom: 1.5rem; font-size: .95rem; }

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 4.5rem minmax(0,1fr); gap: 1.5rem; padding: 1.35rem 0; border-top: 1px solid var(--line); }
.pub:first-child { border-top: 0; padding-top: 0; }
.pub-year { font-weight: 600; color: var(--navy); margin: 0; font-variant-numeric: tabular-nums; }
.pub-cite { margin: 0 0 .35rem; font-size: 1rem; line-height: 1.6; }
.pub-cite em { color: var(--muted); }
.pub-meta { margin: 0; font-size: .85rem; color: var(--muted); }

.story-list { list-style: none; margin: 0; padding: 0; }
.story { display: grid; grid-template-columns: minmax(0,.32fr) minmax(0,1fr); gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--line); align-items: start; }
.story:first-child { border-top: 0; padding-top: 0; }
.story { grid-template-columns: minmax(0,.24fr) minmax(0,1fr); ... }
.story-thumb { width: 100%; border-radius: 4px; aspect-ratio: 4 / 3; object-fit: cover; }
.story h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.story h2 a { text-decoration: none; }
.story h2 a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; }
.story p { color: var(--body-grey); font-size: 1rem; }
.story-date { color: var(--muted); font-size: .88rem; margin: 0 0 .4rem; }

.post { max-width: 72ch; padding-block: var(--step); }
.post h1 { font-size: clamp(1.9rem,3.4vw,2.6rem); margin-bottom: 1.5rem; }
.post-hero { width: 100%; margin-bottom: 2rem; border-radius: 4px; }
.post .prose h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.post .prose h3 { font-size: 1.2rem; margin: 2rem 0 .8rem; }

/* ---------- pie ---------- */
.site-footer { background: var(--navy-deep); color: #C6D2E1; padding: 2.6rem 0; font-size: .9rem; }
.footer-grid { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.footer-grid img { width: 150px; }
.site-footer p { margin: 0 0 .35rem; }
.site-footer .muted { color: #8FA2B9; }

/* ---------- adaptable ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; min-height: 0; }
  .sunburst { width: min(56%,240px); margin-inline: 0; transform: none; }
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .lines { grid-template-columns: 1fr; gap: 0; }
  .lines li:nth-child(2) { border-top: 1px solid var(--line); padding-top: 1.5rem; }
  .facts > div { grid-template-columns: 1fr; gap: .35rem; }
  .story { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 780px) {
  .menu-toggle { display: block; order: 3; }
  .site-nav { order: 4; width: 100%; display: none; flex-direction: column; gap: .9rem; padding: 1rem 0 .5rem; border-top: 1px solid var(--line); margin-top: .85rem; }
  .site-header.is-open .site-nav { display: flex; }
  .header-bar { flex-wrap: wrap; gap: .8rem; }
  .brand img { width: 130px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .pub { grid-template-columns: 1fr; gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
