/* EGAS — Institute Editorial (mockup)
   Self-hosted fonts, no CDN. */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin.woff2") format("woff2");
}

/* ---------- tokens ---------- */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --hairline: #e4e4e2;
  --accent: #16548f;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container: 1200px;
  --radius: 3px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.eyebrow-accent { color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  height: 26px;
  width: auto;
  filter: invert(1); /* white wordmark -> dark */
}
.brand-name {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  border-left: 1px solid var(--hairline);
  padding-left: 14px;
}

/* desktop nav */
.nav-desktop ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}
.nav-item { position: relative; }
.nav-link {
  display: block;
  padding: 22px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.nav-link:hover { color: var(--accent); }
.nav-item.is-active > .nav-link { color: var(--accent); }

.submenu-wrap {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 6px;
}
.nav-item.has-sub:hover .submenu-wrap,
.nav-item.has-sub:focus-within .submenu-wrap { display: block; }

.submenu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 28, 28, 0.08);
}
.submenu li + li { margin-top: 2px; }
.submenu a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.submenu a:hover {
  color: var(--accent);
  background: var(--bg);
}

/* mobile nav */
.nav-mobile { display: none; }
.nav-mobile-toggle {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px;
  cursor: pointer;
  border-radius: var(--radius);
}
.nav-mobile-toggle::-webkit-details-marker { display: none; }
.nav-mobile-toggle::marker { display: none; content: ""; }
.nav-mobile-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-mobile[open] .nav-mobile-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-mobile[open] .nav-mobile-toggle span:nth-child(2) { opacity: 0; }
.nav-mobile[open] .nav-mobile-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 16px 32px rgba(28, 28, 28, 0.1);
  padding: 8px 24px 20px;
}
.nav-mobile-panel a {
  display: block;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.nav-mobile-panel a.sub {
  padding-left: 20px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.nav-mobile-panel a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  padding: 88px 0 64px;
  text-align: center;
}
.hero .eyebrow { margin-bottom: 20px; }
.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  max-width: 760px;
  margin: 0 auto;
}
.standfirst {
  margin: 20px auto 0;
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- feature card ---------- */
.feature { padding: 0 0 88px; }
.feature-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 44px;
}
.feature-text h2 {
  font-size: 28px;
  margin: 14px 0 16px;
}
.feature-text p {
  margin: 0 0 14px;
  font-size: 15.5px;
  line-height: 1.7;
}
.feature-text p:last-child { margin-bottom: 0; }
.feature-text mark {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}
.feature-image {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

/* ---------- section head + cards ---------- */
.recent { padding: 0 0 96px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-head h2 { font-size: 26px; }
.section-link {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.section-link .arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}
.section-link:hover .arrow { transform: translateX(3px); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.conf-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* cards without a photo (photo-less conferences) */
.card-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #f1f0ee;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.card-noimg span {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a3a09b;
}


.conf-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
/* board portraits: original treatment — 150px wide, left-aligned,
   natural aspect ratio, uncropped (as on eps-egas.org/egas-board.html) */
.card-grid--team img {
  width: 150px;
  height: auto;
  aspect-ratio: auto;
  object-fit: fill;
  border: none;
  border-radius: 0;
}

.conf-card h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 14px;
}
.conf-card:hover h3 { color: var(--accent); }
.conf-meta {
  font-size: 14px;
  color: var(--muted);
  margin: 2px 0 0;
}

/* ---------- pages (list / single) ---------- */
.page { padding: 56px 0 96px; }
.page h1 { font-size: clamp(28px, 4vw, 36px); }

.page-intro {
  margin: 20px 0 40px;
  max-width: 72ch;
  font-size: 16px;
  line-height: 1.7;
}
.page-intro p { margin: 0 0 1em; }
.page-intro p:last-child { margin-bottom: 0; }

.page-image {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 28px 0 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.prose {
  max-width: 720px;
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.7;
}
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 24px; margin-top: 1.6em; }
.prose h3 { font-size: 20px; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0; }
.prose table { border-collapse: collapse; margin: 0; }
.prose td, .prose th { padding: 0; text-align: left; }
.prose address { font-style: normal; }
.prose mark { background: transparent; color: var(--accent); font-weight: 600; }
.prose a { color: var(--accent); }
.prose a[href^="http"]::after {
  content: " \2197";
  font-size: 0.8em;
  text-decoration: none;
}
.prose strong { font-weight: 600; }

/* narrow portrait images (board member pages) */
.page-image--portrait { max-width: 320px; }

/* 404 */
.page-404 .notfound-links {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  max-width: 420px;
}
.page-404 .notfound-links a {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
}
.page-404 .notfound-links a:hover { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  padding: 56px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-logo {
  height: 24px;
  filter: invert(1);
}
.footer-brand p {
  margin: 16px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 30ch;
}
.footer-eps { display: inline-block; margin-top: 16px; }
.footer-eps img {
  width: 34px;
  height: 34px;
  filter: invert(1);
  opacity: 0.85;
}

.footer-col h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  line-height: 2.2;
}
.footer-col a:hover { color: var(--accent); text-decoration: underline; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--muted);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .brand-name { display: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-desktop { display: none; }
  /* panel positions against the sticky header (its nearest positioned ancestor) */
  .nav-mobile { display: block; }

  .hero { padding: 64px 0 48px; }
  .feature { padding-bottom: 64px; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-image { order: -1; min-height: 0; max-height: 340px; }
  .feature-text { padding: 28px 24px 32px; }

  .recent { padding-bottom: 64px; }
  .section-head { flex-direction: column; gap: 4px; }
  .page { padding: 40px 0 72px; }
}

@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 32px; }
  .standfirst { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; }
}
