/* AMedRA Design System & Layout */
:root {
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .25s;
  --green: #10682F;
  --green-hover: #0d5426;
  --deep: #0B3F1D;
  --red: #9E1B18;
  --red-light: #fbebe9;
  --ink: #2D312E;
  --ink-muted: #575D58;
  --mist: #F4F7F3;
  --card-bg: #FFFFFF;
  --line: #DFE5DE;
  --shadow-sm: 0 2px 8px rgba(11, 63, 29, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 63, 29, 0.08);
  --shadow-lg: 0 16px 36px rgba(11, 63, 29, 0.12);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --head: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
.page-view.icon-1-bg {
  position: relative;
  isolation: isolate;
}
.page-view.icon-1-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("assets/img/home/icon-1.svg") center 42% / min(92vw, 1080px) auto no-repeat;
  opacity: 0.12;
}

h1, h2, h3, h4 {
  font-family: var(--head);
  color: var(--green);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Top notification banner */
.top-notice {
  background: var(--deep);
  color: #D9EADB;
  font-size: 0.875rem;
  padding: 6px 0;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.top-notice a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 600;
  margin-left: 6px;
}

/* Header & Nav */
header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
header .wrap {
  max-width: 1440px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand-link { display: flex; align-items: center; }
.brand-link img { height: 44px; width: auto; display: block; }

header nav { margin-left: auto; display: flex; align-items: center; gap: 0; }
nav { display: flex; align-items: center; gap: 4px; }
nav a {
  font-weight: 500;
  font-size: 0.975rem;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
nav a:hover { color: var(--green); background: var(--mist); }
header nav a.on { color: var(--green); font-weight: 700; background: none; }

.nav-cta {
  background: var(--green);
  color: #fff !important;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--deep) !important; }
header nav .nav-cta.on { background: var(--deep); color: #ffffff !important; font-weight: 700; }

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.2rem;
}

/* Keep the header spacious at large widths while preventing the expanded nav
   from competing with the logo at laptop widths. */
@media (min-width: 1024px) and (max-width: 1180px) {
  header .wrap { gap: 14px; padding-left: 18px; padding-right: 18px; }
  .brand-link img { height: 40px; }
  nav a { font-size: .9rem; padding-left: 8px; padding-right: 8px; }
  .nav-cta { margin-left: 4px; padding-left: 12px; padding-right: 12px; }
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-view.is-active { animation: page-enter .24s ease both; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--green);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform .15s var(--ease);
  cursor: pointer;
}
.btn.p { background: var(--green); color: #fff; }
.btn.p:hover { background: var(--deep); border-color: var(--deep); transform: translateY(-1px); }
.btn.s { background: transparent; color: var(--green); }
.btn.s:hover { background: var(--mist); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.red:hover { background: #7f1412; border-color: #7f1412; }

/* Stripes decoration */
.stripes {
  height: 24px;
  background: repeating-linear-gradient(to bottom, var(--red) 0 3px, transparent 3px 8px);
  opacity: 0.85;
}

/* Hero Section */
.hero {
  padding: 72px 0 64px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--mist) 100%);
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #E8EFE8;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  border: 1px solid #D1DFD2;
}
.hero-badge span {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
}
.hero-badge--home {
  padding: 0;
  color: var(--red);
  background: transparent;
  border: 0;
  border-radius: 0;
}
.hero p.lead {
  margin: 24px 0 32px;
  font-size: 1.18rem;
  color: var(--ink-muted);
  max-width: 58ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-art {
  position: relative;
  text-align: center;
}
.hero-art img {
  width: 100%;
  max-width: 420px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 24px rgba(16, 104, 47, 0.12));
}

/* Partners Logo Ticker */
.partners-section {
  padding: 52px 0 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.partners-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
}
.ticker {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}
.ticker:focus-visible { outline-offset: -3px; }
#page-home .partner-ticker:hover .partner-logos,
#page-home .partner-ticker:focus-within .partner-logos,
#page-events .photo-ticker:hover .partner-logos,
#page-events .photo-ticker:focus-within .partner-logos { animation-play-state: paused; }
#page-events .photo-ticker .partner-logos { animation-duration: 66s; }
.partner-logos {
  display: flex;
  width: max-content;
  animation: partner-scroll 42s linear infinite;
  will-change: transform;
}
.partner-logo-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
  padding: 4px 10px;
}
.partner-logo-item {
  flex: 0 0 150px;
  width: 150px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid #EBEFEA;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.partner-logo-item img {
  max-height: 46px;
  max-width: 120px;
  object-fit: contain;
  filter: grayscale(80%) opacity(0.85);
  transition: filter 0.2s ease;
}
.partner-logo-item:hover img {
  filter: grayscale(0%) opacity(1);
}
.partner-logo-item:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
}
@keyframes partner-scroll {
  to { transform: translateX(-50%); }
}

/* Common Section */
section { padding: 80px 0; }
.section-head { margin-bottom: 44px; }
.section-head.center { text-align: center; max-width: 64ch; margin-left: auto; margin-right: auto; }
.intro { max-width: 68ch; margin-top: 14px; font-size: 1.125rem; color: var(--ink-muted); }
.dark { background: var(--deep); color: #E4EEE6; }
.dark h2, .dark h3 { color: #fff; }
.mist { background: var(--mist); }

/* Grid & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}
.item {
  background: #ffffff;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--red);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.item p { margin-top: 10px; color: var(--ink-muted); }
.mission-card {
  border-left: 0;
  border-top: 3px solid var(--red);
  padding: 24px;
}
.green-icon {
  display: block;
  width: 50px;
  height: 50px;
  margin-bottom: 16px;
  flex: 0 0 50px;
  background-color: var(--green);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.green-icon--healthcare { -webkit-mask-image: url("assets/img/home/healthcare.png"); mask-image: url("assets/img/home/healthcare.png"); }
.green-icon--ministry { -webkit-mask-image: url("assets/img/home/ministry-of-health.png"); mask-image: url("assets/img/home/ministry-of-health.png"); }
.green-icon--training { -webkit-mask-image: url("assets/img/home/research-training.png"); mask-image: url("assets/img/home/research-training.png"); }
.green-icon--health-research { -webkit-mask-image: url("assets/img/home/health-research.png"); mask-image: url("assets/img/home/health-research.png"); }
.green-icon--cardiology { -webkit-mask-image: url("assets/img/home/cardiology.png"); mask-image: url("assets/img/home/cardiology.png"); }
.green-icon--public-health { -webkit-mask-image: url("assets/img/home/public-health.png"); mask-image: url("assets/img/home/public-health.png"); }
.green-icon--research-team { -webkit-mask-image: url("assets/img/home/research-team.png"); mask-image: url("assets/img/home/research-team.png"); }
.green-icon--cardio-workout { -webkit-mask-image: url("assets/img/research/icons/cardio-workout.png"); mask-image: url("assets/img/research/icons/cardio-workout.png"); }
.green-icon--oncology { -webkit-mask-image: url("assets/img/research/icons/oncology.png"); mask-image: url("assets/img/research/icons/oncology.png"); }
.action-cta { margin-top: 36px; text-align: center; }
.footprint-section { background: var(--mist); overflow: hidden; }
.footprint-copy { max-width: 760px; margin: 0 auto; text-align: center; }
.footprint-copy .intro { margin: 14px auto 24px; }
.footprint-map {
  display: block;
  width: 100%;
  max-height: min(58vw, 640px);
  object-fit: contain;
  margin: 36px auto 0;
  mix-blend-mode: multiply;
}
.quote-section { padding-top: 76px; padding-bottom: 76px; }
.research-quote {
  max-width: 850px;
  margin: 0 auto;
  text-align: center;
}
.research-quote p {
  color: var(--deep);
  font-family: var(--head);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
}
.research-quote cite {
  display: block;
  margin-top: 24px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 600;
}
.pillars-title { margin-top: 64px; }
.pillars-grid { margin-top: 24px; }
.research-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 36px;
}
.research-topic-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-left: 0;
  padding: 24px;
}
.research-topic-card h3 { color: var(--green); }
.dark .item {
  background: #104C25;
  border-color: #6CD28A;
  color: #DEEBDF;
}
.dark .item p { color: #C2D9C5; }

/* Photo Gallery & Showcase */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 36px;
}
.photo-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}
.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.photo-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}
.photo-caption {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.photo-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  margin-bottom: 6px;
}
.photo-title {
  font-size: 1.15rem;
  font-family: var(--head);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.photo-desc {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Feature Showcase Strip */
.feature-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 40px;
  box-shadow: var(--shadow-md);
  margin-top: 48px;
}
.feature-box img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: block;
}

/* Page Header banner for subpages */
.page-head {
  background: var(--mist);
  padding: 60px 0;
  border-bottom: 1px solid var(--line);
}
.page-head .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.page-head p.intro { margin-top: 12px; }

#page-research .research-priority-box { padding: 48px; }
#page-research .research-priority-badge { border: 0; }

/* Leadership Cards */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
.team-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green);
}
.team-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #E8ECE6;
  overflow: hidden;
}
.team-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.team-card:hover .team-photo-wrap img { transform: scale(1.03); }
#page-leadership .executive-team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#page-leadership .committee-heading {
  margin-top: 116px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}
.team-linkedin {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(11, 63, 29, 0.62);
  opacity: 0;
  transition: opacity 0.2s ease;
  text-decoration: none;
}
.team-linkedin svg { width: 54px; height: 54px; }
.team-photo-wrap:hover .team-linkedin,
.team-linkedin:focus-visible { opacity: 1; }
.team-linkedin:focus-visible { outline: 3px solid #ffffff; outline-offset: -6px; }
.team-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.team-role {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  background: var(--red-light);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  align-self: flex-start;
}
.team-name {
  font-size: 1.25rem;
  font-family: var(--head);
  font-weight: 700;
  color: var(--green);
  line-height: 1.25;
}
.team-bio {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-top: 10px;
  flex-grow: 1;
}
.linkedin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0A66C2;
}
.linkedin-badge:hover { text-decoration: underline; }

/* Contact Section & Form */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 48px;
  margin-top: 36px;
  min-width: 0;
}
.contact-grid > * { min-width: 0; }
.contact-info-card {
  background: var(--mist);
  border-radius: var(--radius-md);
  padding: 36px;
  border: 1px solid var(--line);
}
.contact-method {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 24px;
}
.contact-icon {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.contact-method h4 { color: var(--ink); font-size: 1.05rem; }
.contact-method p { color: var(--ink-muted); font-size: 0.95rem; margin-top: 2px; }

.contact-form {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 36px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.925rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,104,47,0.15); }
textarea.form-control { min-height: 120px; resize: vertical; }

.form-alert {
  padding: 14px 18px;
  background: #EBF8EE;
  color: #10682F;
  border-radius: var(--radius-sm);
  border: 1px solid #C4E8CB;
  margin-top: 16px;
  display: none;
  font-weight: 500;
}
.newsletter-alert { margin-top: 10px; color: #BDD2C1; font-size: 0.85rem; }

#page-events .feature-box { padding: 28px; gap: 28px; }
#page-events .events-news-heading { margin-top: 108px; margin-bottom: 28px; }
#page-events .research-news-grid { gap: 18px; align-items: start; }
#page-events .research-news-grid .item { min-height: 0; padding: 20px 22px; }
#page-events .research-news-grid .news-link-row { margin-top: 8px; }
#page-events .research-news-grid .news-portrait { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; }
#page-events .research-news-grid .news-portrait img { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); }
#page-events .news-more-row { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 26px; }
#page-events .research-news-grid .news-portrait figcaption { font-size: 0.85rem; font-weight: 600; color: var(--green); line-height: 1.35; }
.pictures-section { padding: 72px 0; }
.photo-ticker { margin: 0; }
.photo-group { gap: 16px; }
.photo-group img {
  display: block;
  flex: 0 0 300px;
  width: 300px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Text link used by catalog cards */
.archive-link { color: var(--green); font-weight: 600; }
.archive-link:hover { text-decoration: underline; }

/* Footer */
footer {
  background: var(--deep);
  color: #C9DACD;
  padding: 60px 0 32px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { max-width: 380px; }
.footer-brand img { height: 44px; width: auto; margin-bottom: 16px; }
.footer-brand p { font-size: 0.95rem; line-height: 1.6; color: #BDD2C1; }
.footer-links h4 { color: #ffffff; font-size: 1.1rem; margin-bottom: 16px; }
.footer-links nav { display: flex; flex-direction: column; gap: 10px; }
.footer-links nav a { color: #C9DACD; padding: 0; }
.footer-links nav a:hover { color: #ffffff; background: none; }
.footer-links nav a.on { color: #ffffff; font-weight: 700; background: none; }
.footer-social { display: flex; gap: 14px; margin-top: 20px; }
.footer-social a {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: background 0.2s;
}
.footer-social a:hover { background: var(--green); }
.footer-bottom {
  padding-top: 28px;
  font-size: 0.875rem;
  color: #8FA693;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 260px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-box { grid-template-columns: 1fr; padding: 24px; }
  #page-leadership .executive-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-research .research-priority-box { padding: 32px; }
}

/* The header collapses to the menu button below 1024px: the nav links do not fit beside the logo before that. */
@media (max-width: 1023px) {
  .menu-toggle { display: block; margin-left: auto; }
  header nav {
    margin-left: 0;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  header nav.active { display: flex; }
  header nav a { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
  .nav-cta { margin-left: 0; margin-top: 10px; text-align: center; }
  header .wrap { gap: 16px; }
  .brand-link { flex: 0 1 auto; min-width: 0; }
  .brand-link img { width: 100%; max-width: 301px; height: auto; }
}

@media (max-width: 768px) {
  section { padding: 56px 0; }
  .partner-logo-item { flex-basis: 132px; width: 132px; }
  .partner-logo-group { gap: 14px; }
    .quote-section { padding-top: 56px; padding-bottom: 56px; }
  .footprint-map { max-height: none; margin-top: 24px; }
  #page-leadership .executive-team-grid { grid-template-columns: minmax(0, 1fr); }
  #page-leadership .committee-heading { margin-top: 76px; padding-top: 28px; }
  #page-research .research-priority-box { padding: 24px; }
  .photo-group img { flex-basis: 230px; width: 230px; height: 160px; }
}

/* Phones narrower than 380px: a 320px minimum column no longer fits between the page gutters. */
@media (max-width: 380px) {
  .grid, .photo-gallery { grid-template-columns: minmax(0, 1fr); }
  .footer-brand img { width: 100%; max-width: 301px; height: auto; }
}

@media (hover: none) {
  .team-linkedin {
    inset: auto 10px 10px auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--green);
    opacity: 1;
  }
  .team-linkedin svg { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .ticker {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .partner-logos { animation: none !important; transform: none; }
  .partner-logo-group[aria-hidden="true"] { display: none; }
}

/* Nine nav links: tighten spacing between the mobile menu breakpoint and wide desktop so the bar stays on one line */
@media (min-width: 1024px) and (max-width: 1279px) {
  header nav a { padding: 8px 7px; font-size: 0.9rem; white-space: nowrap; }
  header .brand-link img { max-width: 210px; height: auto; }
}


/* ===== Interaction layer: motion, navigation feedback, scroll helpers ===== */

/* Skip link: first thing keyboard users reach */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 300; padding: 10px 16px; background: var(--deep); color: #fff; font-weight: 700; border-radius: var(--radius-sm); transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; }

/* Anchored sections clear the sticky header */
main [id] { scroll-margin-top: 96px; }

/* Header: compact with a shadow once the page scrolls */
header .wrap { transition: padding var(--dur) var(--ease); }
.brand-link img { transition: height var(--dur) var(--ease); }
header.is-scrolled { box-shadow: 0 6px 20px rgba(11, 63, 29, .08); }
header.is-scrolled .wrap { padding-top: 6px; padding-bottom: 6px; }
@media (min-width: 1024px) { header.is-scrolled .brand-link img { height: 36px; } }
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--red); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

/* Desktop nav: an underline that grows from the centre instead of a grey pill */
@media (min-width: 1024px) {
  header nav a:not(.nav-cta) { position: relative; background: none; }
  header nav a:not(.nav-cta)::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 2px; height: 2px; border-radius: 2px; background: var(--green); transition: left var(--dur) var(--ease), right var(--dur) var(--ease); }
  header nav a:not(.nav-cta):hover { background: none; }
  header nav a:not(.nav-cta):hover::after { left: 11px; right: 11px; }
  header nav a.on:not(.nav-cta)::after { left: 11px; right: 11px; background: var(--red); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  header nav a:not(.nav-cta):hover::after, header nav a.on:not(.nav-cta)::after { left: 7px; right: 7px; }
}

/* Mobile menu slides down and fades; page behind does not scroll while it is open */
@media (max-width: 1023px) {
  header nav { display: flex; visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur); }
  header nav.active { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
  body.menu-open { overflow: hidden; }
}

/* Buttons: a small press */
.btn:active, .nav-cta:active { transform: scale(.98); }

/* Text links: underline slides in, arrow nudges */
.archive-link, .issue-link { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size var(--dur) var(--ease), color var(--dur) var(--ease); }
.archive-link:hover, .issue-link:hover { text-decoration: none; background-size: 100% 1.5px; }
.link-arrow { display: inline-block; margin-left: 4px; transition: transform var(--dur) var(--ease); }
a:hover > .link-arrow { transform: translateX(4px); }
.issue-back:hover > .link-arrow { transform: translateX(-4px); }

/* Photo cards zoom like the event cards */
.photo-card img { transition: transform .6s var(--ease); }
.photo-card:hover img { transform: scale(1.03); }

/* Lazy images fade in when they arrive */
img[data-fade] { opacity: 0; transition: opacity .5s var(--ease); }
img[data-fade].is-loaded { opacity: 1; }

/* Reveal on scroll (only when JS adds .js-reveal) */
.js-reveal .reveal { opacity: 0; transform: translateY(10px); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; transition: opacity .35s var(--ease), transform .35s var(--ease); transition-delay: calc(var(--i, 0) * 35ms); }

/* Page change: cross-fade with a slight rise (browsers with View Transitions) */
::view-transition-old(root) { animation: vt-out .18s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@supports (view-transition-name: none) { .page-view.is-active { animation: none; } }

/* Back to top */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--green); color: #fff; box-shadow: var(--shadow-md); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur) var(--ease), visibility 0s linear var(--dur); }
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.to-top:hover { background: var(--deep); }
.to-top:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  img[data-fade] { opacity: 1; }
  html { scroll-behavior: auto; }
}
