/* ==========================================================================
   TRC - Türkiye Research Center
   Public site stylesheet. Bootstrap is deliberately not used here; the
   admin keeps its own bundle under /assets/dash.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand -----------------------------------------------------------------
     Two identity colours. Teal carries structure (dark bands, rules,
     highlights); red carries action (buttons, chips, active state).
     --teal is too light for text on white at 2.4:1, so --teal-text is the
     readable variant and --teal-ink the dark band background.             */
  --teal:         #00ADBB;
  --teal-text:    #046873;
  --teal-ink:     #053F47;
  --teal-soft:    #E2F6F8;

  --red:          #D8002E;
  --red-dark:     #A80024;
  --red-soft:     #FDE7EC;

  /* Neutrals */
  --ink:          #082226;
  --ink-2:        #3B4A4D;
  --muted:        #6C7A7D;
  --line:         #E1E7E8;
  --line-soft:    #EEF3F4;
  --paper:        #F7FAFA;
  --surface:      #FFFFFF;

  /* Type - Poppins throughout, heavier weights for display */
  --font-display: "Poppins", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --font:         "Poppins", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;

  /* Fluid scale */
  --step--1: clamp(0.80rem, 0.78rem + 0.10vw, 0.86rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2:  clamp(1.40rem, 1.25rem + 0.75vw, 1.85rem);
  --step-3:  clamp(1.75rem, 1.45rem + 1.50vw, 2.60rem);
  --step-4:  clamp(2.10rem, 1.60rem + 2.50vw, 3.60rem);

  /* Layout */
  --wide:    1240px;
  --narrow:  760px;
  --gutter:  clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --radius:  10px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, .06), 0 2px 8px rgba(20, 20, 20, .04);
  --shadow-md: 0 4px 12px rgba(20, 20, 20, .08), 0 12px 32px rgba(20, 20, 20, .07);

  --ease: cubic-bezier(.2, .7, .3, 1);
  --header-h: 76px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::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: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--teal-text); text-decoration: none; }
a:hover { color: var(--red); }

img { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--red);
  color: #fff;
  padding: .75rem 1.25rem;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: var(--narrow); }

.section { padding-block: clamp(2.5rem, 1.5rem + 3.5vw, 4.5rem); }
.section--tight { padding-block: clamp(1.75rem, 1rem + 2.5vw, 3rem); }
.section--paper { background: var(--paper); }
.section--surface { background: var(--surface); }
.section--dark { background: var(--ink); color: #fff; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: .9rem;
  border-bottom: 2px solid var(--teal);
}
.section-head h2 { margin: 0; font-size: var(--step-2); }
.section-head .more {
  font-family: var(--font);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.section-head .more::after { content: " →"; }

.grid { display: grid; gap: clamp(1.25rem, .8rem + 1.4vw, 2rem); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */
.utility {
  background: var(--teal-ink);
  color: rgba(255, 255, 255, .85);
  font-size: .78rem;
  letter-spacing: .02em;
}
.utility .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 38px;
}
.utility a { color: rgba(255, 255, 255, .85); }
.utility a:hover { color: #fff; }
.utility__affil { display: flex; align-items: center; gap: .6rem; }
.utility__links { display: flex; align-items: center; gap: 1.25rem; }

.langswitch { display: flex; align-items: center; gap: .35rem; font-weight: 600; }
.langswitch a { padding: .15rem .35rem; border-radius: 3px; }
.langswitch a[aria-current="true"] { color: var(--teal); }
.langswitch span { opacity: .4; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s var(--ease);
}
.masthead.is-stuck { box-shadow: var(--shadow-sm); }

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: clamp(1rem, .3rem + 2.5vw, 3rem);
  min-height: var(--header-h);
}

/* Brand ------------------------------------------------------------------ */
.brand { display: flex; align-items: center; gap: .8rem; flex-shrink: 0; }
.brand__mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal) 0%, var(--red) 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.brand__sub {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

/* Primary nav ------------------------------------------------------------ */
.nav { margin-inline-start: auto; }
.nav__list { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav__item { position: relative; }

.nav__link {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 500;
  white-space: nowrap;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav__link:hover { background: var(--teal-soft); color: var(--teal-text); }
.nav__link[aria-current="page"] { color: var(--red); font-weight: 600; }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: .8rem; right: .8rem; bottom: -2px;
  height: 2px;
  background: var(--red);
}

.nav__caret {
  width: 9px; height: 9px;
  transition: transform .2s var(--ease);
  opacity: .55;
}
.nav__item.is-open .nav__caret { transform: rotate(180deg); }

/* Dropdown --------------------------------------------------------------- */
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 232px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .4rem;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.nav__item.is-open > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown a {
  display: block;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: .9rem;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.dropdown a:hover { background: var(--teal-soft); color: var(--teal-text); }
.dropdown li + li { margin-top: 1px; }
.dropdown__sep { height: 1px; background: var(--line-soft); margin: .35rem .5rem; }

/* Header actions --------------------------------------------------------- */
.masthead__actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.icon-btn:hover { background: var(--teal-soft); border-color: var(--teal-soft); color: var(--teal-text); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-toggle { display: none; }

/* Search panel ----------------------------------------------------------- */
.searchpanel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 1rem;
}
.searchpanel.is-open { display: block; }
.searchpanel form { display: flex; gap: .6rem; }
.searchpanel input[type="search"] {
  flex: 1;
  padding: .8rem 1rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.searchpanel input[type="search"]:focus { border-color: var(--teal); background: var(--surface); }

/* Mobile drawer ---------------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 20, 20, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
.drawer.is-open { opacity: 1; visibility: visible; }

.drawer__panel {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(88vw, 380px);
  background: var(--surface);
  padding: 1.25rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s var(--ease);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.drawer nav ul { list-style: none; margin: 0; padding: 0; }
.drawer nav > ul > li { border-bottom: 1px solid var(--line-soft); }
.drawer nav a, .drawer nav button {
  display: block;
  width: 100%;
  text-align: start;
  padding: .85rem .25rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.drawer nav ul ul { padding-inline-start: 1rem; padding-bottom: .5rem; }
.drawer nav ul ul a { padding: .5rem .25rem; font-size: .9rem; color: var(--muted); font-weight: 400; }

/* --------------------------------------------------------------------------
   5. Chips, buttons, meta
   -------------------------------------------------------------------------- */
.chip {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 3px;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  line-height: 1.5;
}
.chip--ghost { background: var(--red-soft); color: var(--red-dark); }
.chip--teal { background: var(--teal-soft); color: var(--teal-text); }
.chip--ink { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(6px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  transition: background .18s var(--ease), transform .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { background: var(--red-dark); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--teal-soft); color: var(--ink); }
.btn--block { width: 100%; }

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.meta__dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero { background: var(--ink); color: #fff; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 0;
  min-height: clamp(380px, 46vw, 560px);
}

.hero__main { position: relative; display: grid; }
.hero__slide {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease), visibility .5s;
}
.hero__slide.is-active { opacity: 1; visibility: visible; }

.hero__slide img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 8s linear;
}
.hero__slide.is-active img { transform: scale(1.09); }

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(12, 12, 12, .92) 0%,
      rgba(12, 12, 12, .72) 34%,
      rgba(12, 12, 12, .18) 68%,
      rgba(12, 12, 12, .05) 100%);
}

.hero__body {
  position: relative;
  padding: clamp(1.5rem, 1rem + 3vw, 3rem);
  max-width: 46rem;
}
.hero__body h2 {
  color: #fff;
  font-size: var(--step-3);
  margin: .7rem 0 .6rem;
}
.hero__body h2 a { color: inherit; }
.hero__body h2 a:hover { color: var(--teal); }
.hero__body p { color: rgba(255, 255, 255, .78); max-width: 44ch; }
.hero__body .meta { color: rgba(255, 255, 255, .6); }

/* Rail of the remaining featured items */
.hero__rail {
  display: flex;
  flex-direction: column;
  background: #101010;
  border-inline-start: 1px solid rgba(255, 255, 255, .08);
}
.hero__railitem {
  flex: 1;
  display: flex;
  gap: .9rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: none;
  border-inline: 0;
  border-top: 0;
  text-align: start;
  color: rgba(255, 255, 255, .72);
  font: inherit;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.hero__railitem:last-child { border-bottom: 0; }
.hero__railitem:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.hero__railitem.is-active { background: var(--red); color: #fff; }
.hero__railitem img {
  width: 62px; height: 46px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.hero__railitem span {
  font-size: .85rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Page hero for inner pages ---------------------------------------------- */
.pagehero {
  background: var(--ink);
  color: #fff;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  position: relative;
  overflow: hidden;
}
.pagehero::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: -8%;
  width: 42%;
  background: radial-gradient(circle at 60% 50%, rgba(0, 173, 187, .5), transparent 68%);
  pointer-events: none;
}
.pagehero h1 { color: #fff; margin-bottom: .4rem; position: relative; }
.pagehero p {
  color: rgba(255, 255, 255, .74);
  max-width: 62ch;
  font-size: var(--step-1);
  position: relative;
}
.pagehero .chip { margin-bottom: 1rem; }

/* Breadcrumb ------------------------------------------------------------- */
.crumbs {
  font-size: var(--step--1);
  color: var(--muted);
  padding-block: .9rem;
  border-bottom: 1px solid var(--line);
}
.crumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.crumbs li::after { content: "/"; margin-inline-start: .4rem; opacity: .5; }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--line-soft);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.card:hover .card__media img { transform: scale(1.045); }
.card__media .chip { position: absolute; top: .75rem; inset-inline-start: .75rem; }

.card__body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; flex: 1; gap: .6rem; }
.card__title {
  font-size: var(--step-1);
  margin: 0;
  line-height: 1.3;
}
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--red); }
.card__excerpt {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__foot { margin-top: auto; padding-top: .3rem; }

/* Horizontal card, used in the news column */
.card--row { flex-direction: row; align-items: stretch; }
.card--row .card__media { width: 38%; aspect-ratio: auto; flex-shrink: 0; }
.card--row .card__body { padding: .95rem 1.1rem; }
.card--row .card__title { font-size: 1.02rem; }

/* Plain list item, no image */
.linkrow {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.linkrow:last-child { border-bottom: 0; }
.linkrow__date {
  flex-shrink: 0;
  width: 6.5rem;
  font-size: var(--step--1);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.linkrow h3 { font-size: 1.05rem; margin: 0 0 .2rem; }
.linkrow h3 a { color: var(--ink); }
.linkrow h3 a:hover { color: var(--red); }

/* Event card ------------------------------------------------------------- */
.eventcard {
  display: flex;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.eventcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }

.eventcard__date {
  flex-shrink: 0;
  width: 68px;
  text-align: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  align-self: flex-start;
}
.eventcard__date .m {
  display: block;
  background: var(--teal);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .25rem 0;
}
.eventcard__date .d {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.eventcard__date .y { display: block; font-size: .66rem; color: var(--muted); padding-bottom: .3rem; }

.eventcard__body { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.eventcard__body h3 { font-size: 1.05rem; margin: 0; }
.eventcard__body h3 a { color: var(--ink); }
.eventcard__body h3 a:hover { color: var(--red); }
.eventcard__body p {
  color: var(--muted);
  font-size: .9rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eventcard.is-past { opacity: .78; }
.eventcard.is-past .eventcard__date .m { background: var(--muted); }

/* Theme tile ------------------------------------------------------------- */
.theme {
  display: block;
  position: relative;
  padding: 1.35rem 1.3rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.theme::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--red));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.theme:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.theme:hover::before { transform: scaleX(1); }
.theme h3 { font-size: 1.1rem; margin: 0 0 .35rem; color: var(--ink); }
.theme p {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 .8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.theme__count {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-text);
}

/* --------------------------------------------------------------------------
   8. Journal band
   -------------------------------------------------------------------------- */
.journal {
  background: linear-gradient(135deg, var(--teal-ink) 0%, var(--teal-text) 45%, var(--teal) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.75rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.journal::after {
  content: "";
  position: absolute;
  inset-block-start: -40%;
  inset-inline-end: -6%;
  width: 300px; height: 300px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  pointer-events: none;
}
.journal h2 { color: #fff; margin: 0 0 .4rem; font-size: var(--step-2); }
.journal p { color: rgba(255, 255, 255, .85); margin: 0; max-width: 52ch; }

/* --------------------------------------------------------------------------
   9. Filters, pagination, search results
   -------------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}
.filters a {
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.filters a:hover { border-color: var(--red); color: var(--red); }
.filters a[aria-current="true"] { background: var(--red); border-color: var(--red); color: #fff; }

.resultcount { font-size: var(--step--1); color: var(--muted); margin-bottom: 1.5rem; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.pager a, .pager span {
  min-width: 40px;
  height: 40px;
  padding-inline: .6rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--ink-2);
  background: var(--surface);
}
.pager a:hover { border-color: var(--red); color: var(--red); }
.pager .is-current { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.pager .is-disabled { opacity: .4; }
.pager .gap { border: 0; background: none; }

.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   10. Article detail
   -------------------------------------------------------------------------- */

/* Reading progress, pinned under the sticky header. */
.readbar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  height: 3px;
  background: transparent;
}
.readbar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--red));
  transition: width .12s linear;
}

.post__head { padding-block: clamp(2rem, 1.4rem + 3vw, 3.5rem) 1.75rem; }
.post__head .chip { display: inline-block; margin-bottom: 1.1rem; }
.post__head h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -.025em;
  margin-bottom: .8rem;
}

.post__lead {
  font-size: clamp(1.05rem, 1rem + .4vw, 1.28rem);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 1.75rem;
}

/* Byline ----------------------------------------------------------------- */
.byline {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.byline__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line-soft);
  flex-shrink: 0;
}
.byline__text { display: flex; flex-direction: column; line-height: 1.4; }
.byline__name { font-weight: 600; font-size: .95rem; color: var(--ink); }
.byline__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  font-size: var(--step--1);
  color: var(--muted);
}

/* Cover ------------------------------------------------------------------ */
.post__cover { margin: 0 0 clamp(1.75rem, 1rem + 2.5vw, 3rem); }
.post__cover img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Body + share rail ------------------------------------------------------ */
.post__grid {
  /* Centre the text column so it lines up with the header above, and let the
     share rail sit in the left margin rather than pushing the text across. */
  display: grid;
  grid-template-columns: 1fr minmax(0, var(--narrow)) 1fr;
  column-gap: clamp(1rem, .5rem + 1.5vw, 2rem);
  align-items: start;
}

.post__rail {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.post__rail-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}

.sharebtn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease);
}
.sharebtn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-text);
  transform: translateY(-2px);
}
.sharebtn svg { width: 17px; height: 17px; }
.sharebtn.is-copied { background: var(--teal); border-color: var(--teal); color: #fff; }

.post__body {
  min-width: 0;
  padding-bottom: 1rem;
  /* .wrap--narrow on the header includes the gutter inside its 760px, so the
     body column needs the same inset for the two to line up. */
  padding-inline: var(--gutter);
}
.post__external { margin-top: 2rem; }

/* Author card ------------------------------------------------------------ */
.authorcard {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
}
.authorcard img {
  width: 66px; height: 66px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line-soft);
  flex-shrink: 0;
}
.authorcard__label {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.authorcard h3 { font-size: 1.05rem; margin: .15rem 0 .1rem; }
.authorcard__title { color: var(--teal-text); font-size: .88rem; font-weight: 500; margin-bottom: .5rem; }
.authorcard p { font-size: .92rem; color: var(--muted); line-height: 1.6; margin: 0; }

.post__foot {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* Prose refinements for long-form reading -------------------------------- */
.prose > p:first-of-type { font-size: 1.09rem; }
.prose h2 {
  font-size: var(--step-2);
  letter-spacing: -.02em;
  padding-top: .3em;
}
.prose h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: .55rem;
  background: linear-gradient(90deg, var(--teal), var(--red));
  border-radius: 2px;
}

@media (max-width: 1100px) {
  .post__grid { grid-template-columns: 56px minmax(0, 1fr); }
  .post__rail { justify-self: start; }
}

@media (max-width: 760px) {
  .post__grid { grid-template-columns: 1fr; }
  .post__body { padding-inline: 0; }
  .post__rail {
    position: static;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: .45rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
  }
  .post__rail-label { margin: 0 .35rem 0 0; }
  .post__cover img { aspect-ratio: 16 / 9; }
}

/* --------------------------------------------------------------------------
   10b. Legacy article classes (kept for pages not yet migrated)
   -------------------------------------------------------------------------- */
.article__head { padding-block: clamp(2rem, 1.2rem + 3vw, 3.25rem) 1.5rem; }
.article__head h1 { font-size: var(--step-3); margin-bottom: .75rem; }
.article__lead { font-size: var(--step-1); color: var(--ink-2); max-width: 68ch; }

.article__cover {
  margin-block: 1.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 8;
  background: var(--line-soft);
}
.article__cover img { width: 100%; height: 100%; object-fit: cover; }

.prose { font-size: 1.06rem; line-height: 1.75; color: var(--ink-2); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: var(--step-2); color: var(--ink); margin-top: 2em; }
.prose h3 { font-size: var(--step-1); color: var(--ink); margin-top: 1.75em; }
.prose a { text-decoration: underline; text-underline-offset: .18em; }
.prose ul, .prose ol { padding-inline-start: 1.35em; }
.prose li + li { margin-top: .4em; }
.prose blockquote {
  margin-inline: 0;
  padding: .3em 0 .3em 1.3em;
  border-inline-start: 3px solid var(--teal);
  font-family: var(--font-display);
  font-size: 1.15em;
  color: var(--ink);
}
.prose img { border-radius: var(--radius); margin-block: 1.5em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .75rem; text-align: start; }
.prose th { background: var(--paper); font-weight: 600; }

.article__foot {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.share { display: flex; gap: .4rem; }

/* --------------------------------------------------------------------------
   11. Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--ink-2);
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: .7rem .85rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  outline: none;
}
.field textarea { min-height: 160px; resize: vertical; }

.notice {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid;
  margin-bottom: 1.5rem;
  font-size: .93rem;
}
.notice--ok { background: #EEF7F0; border-color: #2F7D45; color: #1F5730; }
.notice--bad { background: var(--red-soft); border-color: var(--red); color: var(--red-dark); }

/* Honeypot - kept out of the layout and out of the a11y tree */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.footer { background: var(--ink); color: rgba(255, 255, 255, .72); margin-top: 3rem; }
.footer a { color: rgba(255, 255, 255, .72); }
.footer a:hover { color: #fff; }

.footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}
.footer h3 {
  color: #fff;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li + li { margin-top: .55rem; }
.footer p { font-size: .93rem; line-height: 1.7; }

.footer__brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.footer__brand .brand__name { color: #fff; }
.footer__brand .brand__sub { color: rgba(255, 255, 255, .5); }

.socials { display: flex; gap: .5rem; margin-top: 1.25rem; }
.socials a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-sm);
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.socials a:hover { background: var(--teal); border-color: var(--teal); }
.socials svg { width: 17px; height: 17px; }

.contactlist li { display: flex; gap: .65rem; align-items: flex-start; font-size: .93rem; }
.contactlist svg { width: 16px; height: 16px; margin-top: .28rem; flex-shrink: 0; opacity: .6; }

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-block: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .84rem;
  color: rgba(255, 255, 255, .5);
}
.footer__bottom ul { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer__bottom li + li { margin-top: 0; }

/* --------------------------------------------------------------------------
   13. Error pages
   -------------------------------------------------------------------------- */
.errorpage { text-align: center; padding-block: clamp(4rem, 3rem + 6vw, 8rem); }
.errorpage__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 3rem + 12vw, 10rem);
  line-height: 1;
  color: var(--teal-soft);
  margin-bottom: -.35em;
}
.errorpage p { color: var(--muted); max-width: 46ch; margin-inline: auto; margin-bottom: 1.75rem; }

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__rail { flex-direction: row; border-inline-start: 0; border-top: 1px solid rgba(255,255,255,.08); }
  .hero__railitem { border-bottom: 0; border-inline-end: 1px solid rgba(255, 255, 255, .08); }
  .hero__railitem img { display: none; }
  .footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav, .masthead__actions .icon-btn--search { display: none; }
  .nav-toggle { display: grid; }
  .journal { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .utility__affil { display: none; }
  .utility .wrap { justify-content: flex-end; }
  .hero__rail { display: none; }
  .hero__body { padding-block: 1.5rem 2rem; }
  .card--row { flex-direction: column; }
  .card--row .card__media { width: 100%; aspect-ratio: 16 / 9; }
  .footer__top { grid-template-columns: 1fr; }
  .linkrow { flex-direction: column; gap: .25rem; }
  .linkrow__date { width: auto; }
  .section-head { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

@media print {
  .utility, .masthead, .footer, .pager, .filters, .share { display: none !important; }
  body { background: #fff; }
  .prose { font-size: 11pt; }
}

/* --------------------------------------------------------------------------
   10c. Event detail
   -------------------------------------------------------------------------- */
.post__chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.1rem; }

.chip--live {
  background: var(--teal);
  color: #04353B;
}

/* Everything needed to decide whether to attend, in one block. */
.factbox {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1rem, .6rem + 1.5vw, 2rem);
  align-items: center;
  padding: 1.35rem 1.5rem;
  margin-bottom: clamp(1.75rem, 1rem + 2.5vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.factbox__cal {
  width: 76px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.factbox__cal .m {
  display: block;
  background: var(--teal);
  color: #04353B;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .28rem 0;
}
.factbox__cal .d {
  display: block;
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}
.factbox__cal .y { display: block; font-size: .68rem; color: var(--muted); padding-bottom: .35rem; }

.factbox__list {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 2rem;
  margin: 0;
}
.factbox__list dt {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .18rem;
}
.factbox__list dd { margin: 0; font-size: .95rem; font-weight: 500; color: var(--ink); }

.factbox__cta { flex-shrink: 0; }

/* Repeat of the registration CTA at the end of the description. */
.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal-ink) 0%, var(--teal-text) 60%, var(--teal) 100%);
  color: #fff;
}
.callout h3 { margin: 0 0 .2rem; color: #fff; font-size: 1.1rem; }
.callout p { margin: 0; color: rgba(255, 255, 255, .82); font-size: .92rem; }
.callout .btn { background: #fff; color: var(--ink); }
.callout .btn:hover { background: var(--teal-soft); color: var(--ink); }

@media (max-width: 760px) {
  .factbox { grid-template-columns: 1fr; text-align: left; }
  .factbox__cal { width: 68px; }
  .factbox__cta .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   10d. About page
   -------------------------------------------------------------------------- */
.abouthero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--teal-ink) 0%, var(--teal-text) 55%, var(--teal) 100%);
  color: #fff;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
}
.abouthero::after {
  content: "";
  position: absolute;
  inset-inline-end: -12%;
  inset-block-start: -40%;
  width: 560px; height: 560px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 46%, rgba(255,255,255,.08) 46.5%, transparent 47.5%),
    radial-gradient(circle, transparent 62%, rgba(255,255,255,.08) 62.5%, transparent 63.5%);
  pointer-events: none;
}

.abouthero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(1.75rem, 1rem + 3vw, 4rem);
  align-items: center;
}

.abouthero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
  margin: 1rem 0 .6rem;
}
.abouthero p { color: rgba(255,255,255,.8); font-size: var(--step-1); max-width: 46ch; }

.abouthero__partners {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}

/* Figures come from the database, so they cannot drift from reality. */
.abouthero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  overflow: hidden;
}
.abouthero__stats > div {
  background: rgba(4, 38, 44, .34);
  padding: 1.25rem 1.35rem;
  backdrop-filter: blur(4px);
}
.abouthero__stats strong {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}
.abouthero__stats span {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.66);
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  align-items: start;
}
.about__body .prose { font-size: 1.06rem; }

.about__side { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: 1rem; }

.sidecard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}
.sidecard h3 {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .8rem;
}
.sidecard p { font-size: .93rem; color: var(--ink-2); line-height: 1.6; margin-bottom: .8rem; }

.sidecard--accent {
  background: linear-gradient(135deg, var(--teal-ink) 0%, var(--teal-text) 65%, var(--teal) 100%);
  border-color: transparent;
  color: #fff;
}
.sidecard--accent h3 { color: rgba(255,255,255,.72); }
.sidecard--accent p { color: rgba(255,255,255,.85); }

@media (max-width: 900px) {
  .abouthero__grid { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .about__side { position: static; }
}

@media (max-width: 520px) {
  .abouthero__stats { grid-template-columns: 1fr 1fr; }
  .abouthero__stats strong { font-size: 1.6rem; }
}
