/* ============================================================
   CSLT — "The Mareogram" design system
   Token reference: see /home/marta plan "Diseño visual" section.
   ============================================================ */

:root {
  --paper: #f2ebdd;
  --paper-raised: #ece2cd;
  --ink: #1c2b33;
  --ink-soft: #4a5a62;
  --deepsea: #0b3d4c;
  --deepsea-dark: #072a35;
  --trace-red: #b5432d;
  --tide-teal: #2e7a79;
  --grid: #c9bfa8;
  --grid-strong: #a99c7c;

  --font-display: "Newsreader", "Iowan Old Style", "Georgia", serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --measure: 40rem;
  --container: 74rem;
  --radius: 2px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--tide-teal); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--trace-red); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 var(--space-2);
}
h1 { font-size: clamp(2.25rem, 3vw + 1.5rem, 3.75rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 1.4vw + 1.2rem, 2.35rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 var(--space-2); }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: var(--measure); }
small, .mono, .eyebrow, time, .tag {
  font-family: var(--font-mono);
}
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tide-teal);
  margin-bottom: var(--space-1);
}
.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: 2px solid var(--trace-red);
  outline-offset: 2px;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}
.section {
  padding-block: var(--space-5);
  border-top: 1px solid var(--grid);
}
.section:first-of-type { border-top: none; }
.section--tight { padding-block: var(--space-4); }

/* ---------- Trace divider (signature element, static contexts) ---------- */
.trace-divider {
  width: 100%;
  height: 28px;
  margin-block: var(--space-3);
  color: var(--grid-strong);
}
.trace-divider svg { width: 100%; height: 100%; display: block; }
.trace-divider path { fill: none; stroke: currentColor; stroke-width: 1.4; }
.trace-divider.hero-trace {
  height: 108px;
  color: var(--deepsea);
  opacity: 0.9;
  margin-block: var(--space-4) 0;
}
.trace-divider.hero-trace path { stroke-width: 2; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--deepsea);
  color: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--deepsea-dark);
}
.site-header__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.site-brand {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-mono);
}
.site-brand:hover { color: var(--paper); }
.site-brand__mark {
  font-weight: 500;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}
.site-brand__full {
  font-size: 0.78rem;
  color: #bcd2d6;
  letter-spacing: 0.02em;
  display: none;
}
@media (min-width: 46rem) {
  .site-brand__full { display: inline; }
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: 1px solid rgba(242,235,221,0.35);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
}
.nav-toggle__bar {
  display: block;
  width: 1.1rem;
  height: 1.5px;
  background: var(--paper);
  margin-inline: auto;
}
@media (min-width: 52rem) {
  .nav-toggle { display: none; }
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.primary-nav a {
  display: block;
  color: #d8e6e6;
  text-decoration: none;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(242,235,221,0.12);
}
.primary-nav a:hover { color: var(--paper); }
.primary-nav a[aria-current="page"] {
  color: var(--paper);
  box-shadow: inset 0 -2px 0 var(--trace-red);
}
.primary-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--deepsea);
  padding: 0 var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--deepsea-dark);
}
.primary-nav.is-open { display: block; }

@media (min-width: 52rem) {
  .primary-nav {
    display: block;
    position: static;
    background: none;
    padding: 0;
    border-bottom: none;
  }
  .primary-nav ul { flex-direction: row; gap: var(--space-4); }
  .primary-nav a { padding: 0.3em 0; border-bottom: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--deepsea);
  color: #a9c2c4;
  margin-top: var(--space-6);
}
.site-footer__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-4) var(--space-3);
}
.site-footer .trace-divider { color: rgba(242,235,221,0.25); margin-block: 0 var(--space-3); }
.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin: 0 0 0.4em;
}
.site-footer a { color: #cfe3e4; }
.site-footer a:hover { color: var(--paper); }

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-5) var(--space-4);
  border-top: none;
}
.hero__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
@media (min-width: 56rem) {
  .hero__grid {
    flex-direction: row;
    align-items: flex-end;
    gap: var(--space-5);
  }
  .hero__text { flex: 1 1 54%; }
  .hero__figure { flex: 1 1 40%; max-width: 21rem; }
}
.hero__text .eyebrow { margin-top: 0; }
.hero__text h1 { margin-bottom: var(--space-2); }
.hero__figure {
  border: 1px solid var(--grid-strong);
  padding: 6px;
  background: var(--paper-raised);
}
.hero__figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.hero__caption {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  padding: 0.5em 0.2em 0.1em;
  letter-spacing: 0.02em;
}
.hero .trace-divider { margin-top: var(--space-4); }

/* ---------- Buttons / links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--paper);
  background: var(--trace-red);
  padding: 0.7em 1.1em;
  border: 1px solid var(--trace-red);
  border-radius: var(--radius);
}
.btn:hover { background: #9a3823; border-color: #9a3823; color: var(--paper); }
.btn--ghost {
  background: none;
  color: var(--ink);
  border-color: var(--grid-strong);
}
.btn--ghost:hover { background: var(--paper-raised); color: var(--ink); }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: var(--space-3);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

.card {
  border: 1px solid var(--grid);
  background: var(--paper-raised);
  padding: var(--space-3);
}
.card h3 { margin-bottom: 0.3em; }
.card .eyebrow { margin-bottom: 0.6em; }

.news-item, .activity-item {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-top: 1px solid var(--grid);
}
.news-item:first-child, .activity-item:first-child { border-top: none; padding-top: 0; }
.news-item time, .activity-item time {
  font-size: 0.78rem;
  color: var(--tide-teal);
  padding-top: 0.2em;
}
.news-item h3, .activity-item h3 { font-size: 1.1rem; margin-bottom: 0.3em; }
.news-item p, .activity-item p { color: var(--ink-soft); margin-bottom: 0.4em; }
@media (max-width: 32rem) {
  .news-item, .activity-item { grid-template-columns: 1fr; gap: 0.3em; }
}
.activities-more {
  display: inline-block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tide-teal);
  text-decoration: none;
  border-bottom: 1px solid var(--tide-teal);
  padding-bottom: 0.1em;
}
.activities-more:hover { color: var(--trace-red); border-color: var(--trace-red); }

/* ---------- Leadership ("Who We Are") ---------- */
.leader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.leader {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  border-left: 2px solid var(--trace-red);
  padding-left: var(--space-2);
}
.leader.leader--past { border-left-color: var(--grid-strong); }
.leader .eyebrow { display: block; }
.leader strong { display: block; font-size: 1.05rem; }
.leader__affiliation { display: block; color: var(--ink-soft); font-size: 0.9rem; }
.leader__photo {
  width: 6.5rem;
  height: 6.5rem;
  border: 1px solid var(--grid-strong);
  background: var(--paper-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.leader__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.leader__photo span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

/* ---------- Core group cards ---------- */
.group-card { border: 1px solid var(--grid); background: var(--paper-raised); }
.group-card__head {
  padding: var(--space-3);
  border-bottom: 1px solid var(--grid);
}
.group-card__body { padding: var(--space-3); }
.group-card__chair { font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Resources ---------- */
.resource-group + .resource-group { margin-top: var(--space-4); }
.resource-group h2 { margin-bottom: var(--space-2); }
.resource-group__placeholder { font-style: italic; color: var(--ink-soft); font-family: var(--font-display); }
.resource-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.resource-card:hover { border-color: var(--trace-red); color: var(--ink); }
.resource-card h3 { font-size: 1.1rem; margin: 0 0 0.3em; }
.resource-card p { color: var(--ink-soft); margin: 0; font-size: 0.92rem; }
.resource-card__url {
  display: block;
  margin-top: 0.7em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--tide-teal);
  word-break: break-all;
}

/* ---------- Page header (non-home pages) ---------- */
.page-header { padding-block: var(--space-4) var(--space-2); }
.page-header .eyebrow { margin-bottom: var(--space-1); }

/* ---------- Contact ---------- */
.contact-block { max-width: var(--measure); font-size: 1.3rem; }
