/*
Theme Name: M2SF
Theme URI:
Description: WordPress theme for the Multiscale Self-Force Collaboration
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Author: M2SF
Text Domain: m2sf
*/

/* ============================================================
   Custom Properties
   ============================================================ */

:root {
  /* Brand colours */
  --clr-gold:    #f5c945;
  --clr-orange:  #e7591c;
  --clr-black:   #000000;
  --clr-white:   #ffffff;
  --clr-text:    #111111;
  --clr-muted:   #555555;

  /* Type scale  (modular, ratio ≈ 1.25, root 16 px) */
  --fs-xs:   0.64rem;   /* 10.24 px */
  --fs-sm:   0.8rem;    /* 12.80 px */
  --fs-base: 1rem;      /* 16.00 px */
  --fs-lead: 1.25rem;   /* 20.00 px */
  --fs-h5:   1.563rem;  /* 25.00 px */
  --fs-h4:   1.953rem;  /* 31.25 px */
  --fs-h3:   2.441rem;  /* 39.06 px */
  --fs-h2:   3.052rem;  /* 48.83 px */
  --fs-h1:   3.815rem;  /* 61.04 px */

  /* Layout */
  --nav-height:    120px;
  --content-width: 930px;
  --text-width:    740px;
  --site-max:      1440px;
  --side-pad:      clamp(1.5rem, 4vw, 3rem);

  /* Misc */
  --font:       'Rubik', sans-serif;
  --lh-body:    1.3;
  --transition: 220ms ease;
}


/* ============================================================
   Reset & Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--clr-text);
  background: var(--clr-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--clr-orange);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--clr-orange); text-decoration: underline; }

ul { list-style: none; }

button { font-family: var(--font); }

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.1;
  color: var(--clr-text);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-lead); }

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


/* ============================================================
   Layout Utilities
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 0;
}
.container--wide   { max-width: var(--site-max);     }
.container--narrow { max-width: var(--text-width);   }
.container--flush  { padding-inline: 0;              }

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


/* ============================================================
   Site Header / Navigation
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--clr-white);
  border-bottom: 1px solid transparent;
  height: var(--nav-height);
}

/* Front page: black navbar */
.home .site-header {
  background: var(--clr-black);
  border-bottom: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--site-max);
  margin-inline: auto;
  padding-inline: var(--side-pad);
}

/* Image logo */
.site-logo {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}

.site-logo img {
  height: 80px;
  width: auto;
  display: block;
}



/* Primary navigation */
.site-nav { display: flex; align-items: center; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

/* Default (white navbar): dark links */
.primary-nav a {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-text);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
  transition: color var(--transition);
}

.primary-nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--clr-orange);
  transition: width var(--transition);
}

/* Hover: show underline only */
.primary-nav a:hover { text-decoration: none; }
.primary-nav a:hover::after { width: 100%; }

/* Active page: orange text + underline */
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .current-menu-ancestor > a {
  color: var(--clr-orange);
  text-decoration: none;
}

.primary-nav .current-menu-item > a:not(:hover)::after,
.primary-nav .current_page_item > a:not(:hover)::after,
.primary-nav .current-menu-ancestor > a:not(:hover)::after {
  width: 0;
}

/* Front page (black navbar): white links, but keep active orange */
.home .primary-nav a { color: var(--clr-white); }

.home .primary-nav .current-menu-item > a,
.home .primary-nav .current_page_item > a,
.home .primary-nav .current-menu-ancestor > a { color: var(--clr-orange); }

/* ── Dropdown submenus (desktop) ── */
.primary-nav li { position: relative; }

.primary-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: -1rem;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  background: var(--clr-white);
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 100;
}

/* Show dropdown on hover or keyboard focus */
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.primary-nav .sub-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: var(--fs-sm);
  color: var(--clr-text);
  white-space: nowrap;
}

/* Sub-menu links never get the underline accent */
.primary-nav .sub-menu a::after { display: none; }

.primary-nav .sub-menu a:hover { color: var(--clr-orange); }

.primary-nav .sub-menu .current-menu-item > a,
.primary-nav .sub-menu .current_page_item > a {
  color: var(--clr-orange);
}

/* On the front page (black navbar), submenus still use the light style */
.home .primary-nav .sub-menu a { color: var(--clr-text); }
.home .primary-nav .sub-menu a:hover { color: var(--clr-orange); }

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-text);
  z-index: 300;
  position: relative;
}

/* Front page: white hamburger */
.home .nav-toggle { color: var(--clr-white); }
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] { color: var(--clr-white); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   Hero — Landing Page
   ============================================================ */

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-height));
  background: var(--clr-black);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 1;
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--site-max);
  margin-inline: auto;
  padding: 2rem var(--side-pad) 3rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
}

.hero__title {
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--clr-white);
  line-height: 1.1;
  text-transform: uppercase;
  max-width: 55%;
}

.hero__title span { display: block; }

.hero__subtitle {
  margin-top: 2rem;
  font-size: var(--fs-lead);
  color: rgba(255, 255, 255, 0.8);
  max-width: 40ch;
  line-height: var(--lh-body);
}


/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 6px;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
}
.btn:hover { text-decoration: none; }

/* Semi-transparent orange — for use on dark/image backgrounds */
.btn--primary {
  background: rgba(231, 89, 28, 0.8);
  border-color: var(--clr-orange);
  color: var(--clr-white);
}
.btn--primary:hover {
  background: var(--clr-orange);
  border-color: var(--clr-orange);
  color: var(--clr-white);
}

/* Semi-transparent white — for use on dark/image backgrounds */
.btn--ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--clr-white);
}
.btn--ghost:hover {
  background: var(--clr-white);
  border-color: var(--clr-white);
  color: var(--clr-black);
}

/* Transparent with dark border — for use on light backgrounds */
.btn--outline {
  background: transparent;
  border-color: var(--clr-text);
  color: var(--clr-text);
}
.btn--outline:hover {
  background: var(--clr-text);
  color: var(--clr-white);
}


/* ============================================================
   Home Page — Hero CTAs
   ============================================================ */

.hero__ctas {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.hero__ctas .btn {
  text-align: center;
}


/* ============================================================
   Home Page — In Numbers
   ============================================================ */

.home-stats {
  background: var(--clr-black);
  padding: 3.5rem 0;
}

.home-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.home-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.home-stats__number {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--clr-gold);
  line-height: 1;
}

.home-stats__label {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ============================================================
   Home Page — Research Highlights
   ============================================================ */

.home-research {
  padding: 4rem 0;
}

.home-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0;
}

.home-section-title {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--clr-text);
}

.home-section-more {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--clr-orange);
  text-decoration: none;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.home-section-more:hover { color: var(--clr-orange); text-decoration: underline; }

/* Remove the bottom padding that the research archive page uses */
.home-project-grid {
  padding-bottom: 0;
}
.project-grid.home-project-grid {
  grid-template-columns: repeat(2, 1fr);
}


/* ============================================================
   Home Page — Featured Achievement
   ============================================================ */

.home-achievement {
  background: #f5f5f5;
  padding: 4rem 0;
}

.home-achievement__inner {
  border-left: 4px solid var(--clr-gold);
  padding-left: 2rem;
  max-width: var(--text-width);
}

.home-achievement__label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--clr-orange);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.home-achievement__title {
  display: block;
  font-size: var(--fs-h5);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.25;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color var(--transition);
}
a.home-achievement__title:hover {
  color: var(--clr-orange);
  text-decoration: none;
}

.home-achievement__citation {
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  margin-bottom: 1.5rem;
  line-height: var(--lh-body);
}


/* ============================================================
   Page Header (interior pages)
   ============================================================ */

.page-header {
  padding: 0.75rem 0 0;
  margin-bottom: 1rem;
}

.page-header__title {
  font-size: var(--fs-h3);
  color: var(--clr-text);
}

.page-header__lead {
  font-size: var(--fs-lead);
  font-weight: 400;
  color: var(--clr-text);
  margin-top: 1.25rem;
  margin-bottom: 0;
  max-width: 100%;
  line-height: var(--lh-body);
}

.page-header__meta {
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-size: var(--fs-sm);
  color: var(--clr-muted);
}


/* ============================================================
   Entry Content (WP editor output)
   ============================================================ */

.entry-content {
  max-width: var(--text-width);
  margin-inline: auto;
  line-height: var(--lh-body);
}

.entry-content > * + * { margin-top: 1.25em; }

.entry-content h2 { margin-top: 2.5rem; font-size: var(--fs-h3); }
.entry-content h3 { margin-top: 2rem;   font-size: var(--fs-h4); }
.entry-content h4 { margin-top: 1.5rem; font-size: var(--fs-h5); }

.entry-content h5 {
  font-size: var(--fs-h5);
  font-weight: 700;
  margin-top: 2rem;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

.entry-content li { margin-bottom: 0.4em; }

.entry-content blockquote {
  border-left: 4px solid var(--clr-gold);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-size: var(--fs-lead);
  font-style: italic;
  color: var(--clr-muted);
}

.entry-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

/* Captions — block editor (figcaption) and classic editor (.wp-caption-text) */
.entry-content figcaption,
.entry-content .wp-caption-text {
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  line-height: var(--lh-body);
  margin-top: 0.35rem;
}

.entry-content figure {
  margin: 1.5rem calc((var(--text-width) - var(--content-width)) / 2);
  max-width: var(--content-width);
}

.entry-content figure img {
  width: 100%;
  margin: 0;
}

.entry-content .wp-caption {
  max-width: 100%;
}

.entry-content .wp-caption img {
  margin: 0;
  display: block;
}


/* ============================================================
   About Page — Illustration Banner
   ============================================================ */

.about-illustration {
  width: 100%;
  max-width: var(--site-max);
  margin: 4rem auto 0;
  overflow: hidden;
}

.about-illustration img {
  width: 100%;
  height: auto;
  display: block;
}


/* ============================================================
   News Archive / Card Grid
   ============================================================ */

.archive-section {
  padding: 0 0 3rem;
}

/* Bottom breathing room on pages where content runs directly to the footer */
.page-content-end {
  padding-bottom: 5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 3rem;
  margin-top: 2rem;
}

/* ── News list ── */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
}

.news-card + .news-card {
  border-top: 1px solid #e0e0e0;
  padding-top: 2.5rem;
  margin-top: 1.25rem;
}

.news-card {
  display: grid;
  grid-template-columns: 455px 455px;
  gap: 20px;
  align-items: start;
}

.news-card__image {
  width: 100%;
}

.news-card__image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.news-card__title {
  font-size: var(--fs-h5);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--transition);
}
.news-card__title:hover { color: var(--clr-orange); text-decoration: none; }

.news-card__excerpt {
  font-size: var(--fs-base);
  color: var(--clr-text);
  line-height: var(--lh-body);
}

.news-card__meta {
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  margin-top: 0.25rem;
}

/* Legacy .card styles (kept for any other uses) */
.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card__title {
  font-size: var(--fs-h5);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--transition);
}
.card__title:hover { color: var(--clr-orange); text-decoration: none; }

.card__excerpt {
  font-size: var(--fs-base);
  color: var(--clr-text);
  line-height: var(--lh-body);
  flex: 1;
}

.card__meta {
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  margin-top: 0.25rem;
}

.card__link {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--clr-orange);
  text-decoration: none;
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
}
.card__link:hover { text-decoration: underline; }


/* ============================================================
   Single Post
   ============================================================ */



/* ============================================================
   Members Page
   ============================================================ */

.members-section {
  margin-top: 1.5rem;
  margin-bottom: 4rem;
}

.members-section__title {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 0;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--clr-gold);
  display: inline-block;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem 1rem;
  margin-top: 2rem;
}

.member-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.member-card__photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  background: #ddd;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 2.25rem;
  font-weight: 700;
}

.member-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-card__name {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-text);
}

.member-card__career {
  font-size: var(--fs-xs);
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--clr-muted);
  line-height: 1.4;
}

.member-card__affiliation {
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  line-height: 1.4;
}

.member-card__research {
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  font-style: italic;
  line-height: 1.4;
}

/* ── Member profile links ── */
.member-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.member-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--clr-muted);
  background: #efefef;
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.member-card__link svg {
  width: 14px;
  height: 14px;
  display: block;
}
.member-card__link:hover {
  background: var(--clr-orange);
  color: var(--clr-white);
  text-decoration: none;
}

/* ── Partner Institutions ── */
.partner-institutions {
  background: #f5f5f5;
  padding: 3rem 0;
  margin-top: 2rem;
}

.partner-institutions__title {
  font-size: var(--fs-h4);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.partner-institutions__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.partner-institutions__list li {
  font-size: var(--fs-base);
  color: var(--clr-text);
  padding: 0.4rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: var(--clr-white);
}


/* ============================================================
   Research Page — Index (3-column card grid)
   ============================================================ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  padding-bottom: 5rem;
}

/* Research page — tiered sections (Themes + Projects) */
.research-tier {
  padding-bottom: 0;
}
.research-tier + .research-tier {
  margin-top: 3rem;
}
.research-tier:last-child {
  padding-bottom: 5rem;
}
.research-tier__title {
  font-size: var(--fs-h5);
  font-weight: 700;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.5rem;
  margin-bottom: 0;
}
.research-tier .project-grid {
  padding-bottom: 0;
}
.research-tier__grid {
  grid-template-columns: repeat(2, 1fr);
}

.project-card {
  background: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--clr-white);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  border-color: var(--clr-orange);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  text-decoration: none;
}

.project-card__title {
  font-size: var(--fs-h5);
  font-weight: 700;
  color: var(--clr-white);
  line-height: 1.2;
  margin: 0;
  transition: color var(--transition);
}

.project-card:hover .project-card__title {
  color: var(--clr-orange);
}

.project-card__tagline {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
  margin: 0;
  flex: 1;
}

.project-card__credits {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-card__meta {
  font-size: var(--fs-xs);
  color: var(--clr-gold);
  margin: 0;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.project-card__contributors {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.4;
}


/* ============================================================
   Research Page — Project Detail
   ============================================================ */

.page-breadcrumb {
  padding-top: 0.75rem;
  font-size: var(--fs-sm);
  margin-bottom: -0.5rem;
}

.page-breadcrumb a {
  color: var(--clr-orange);
  text-decoration: none;
  font-weight: 700;
}

.page-breadcrumb a:hover {
  text-decoration: underline;
}

.project-hero {
  margin: 2rem 0 2.5rem;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
}

.project-hero img {
  width: 100%;
  height: auto;
  display: block;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
}

.project-prose {
  max-width: 100%;
  margin-inline: 0;
}

.project-sidebar {
  font-size: var(--fs-sm);
}

.project-sidebar__block {
  border-top: 2px solid var(--clr-gold);
  padding-top: 0.75rem;
  margin-bottom: 1.75rem;
}

.project-sidebar__label {
  font-size: var(--fs-xs);
  color: var(--clr-muted);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.project-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-sidebar__list li {
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.project-sidebar__list a {
  color: var(--clr-text);
  text-decoration: none;
}

.project-sidebar__list a:hover {
  color: var(--clr-orange);
}


/* ============================================================
   Publications Page
   ============================================================ */

.publication-section {
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.publication-section__title {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 0;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--clr-gold);
  display: inline-block;
}

.publication-section--featured .publication {
  border-left: 3px solid var(--clr-gold);
  padding-left: 1rem;
}

.publication-year {
  margin-top: 2rem;
}

.publication-year__label {
  font-size: var(--fs-h5);
  font-weight: 700;
  color: var(--clr-muted);
  margin: 1.5rem 0 1rem;
}

.publication-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.publication {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.publication__title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-text);
  text-decoration: none;
  line-height: 1.35;
  transition: color var(--transition);
}

.publication__title:hover {
  color: var(--clr-orange);
}

.publication__citation {
  font-size: var(--fs-sm);
  color: var(--clr-text);
  margin: 0;
  line-height: 1.5;
}

.publication__links {
  font-size: var(--fs-sm);
  margin: 0.2rem 0 0;
  display: flex;
  gap: 1rem;
}

.publication__links a {
  color: var(--clr-orange);
  text-decoration: none;
  font-weight: 700;
}

.publication__links a:hover {
  text-decoration: underline;
}


/* ============================================================
   Resources Page
   ============================================================ */

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
}

.resource-card + .resource-card {
  border-top: 1px solid #e0e0e0;
  padding-top: 2.5rem;
  margin-top: 1.25rem;
}

.resource-card {
  display: grid;
  grid-template-columns: 455px 455px;
  gap: 20px;
  align-items: start;
}

.resource-card--no-image {
  grid-template-columns: 1fr;
}

.resource-card__image {
  width: 100%;
}

.resource-card__image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.resource-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.resource-card__title {
  font-size: var(--fs-h5);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--transition);
}
.resource-card__title:hover { color: var(--clr-orange); text-decoration: none; }

.resource-card__excerpt {
  font-size: var(--fs-base);
  color: var(--clr-text);
  line-height: var(--lh-body);
}

.resource-card__link {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--clr-orange);
  text-decoration: none;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}
.resource-card__link:hover { text-decoration: underline; }


/* ============================================================
   Contact Page
   ============================================================ */

.contact-section {
  padding: 0 0 5rem;
}

.contact-intro {
  max-width: var(--text-width);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  margin-bottom: 2.5rem;
}

.contact-form {
  max-width: 620px;
}

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-form__group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form__group--full {
  grid-column: 1 / -1;
}

.contact-form__label {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-text);
}

.contact-form__label .required {
  color: var(--clr-orange);
  margin-left: 0.15em;
}

.contact-form__input,
.contact-form__textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--clr-black);
  background: var(--clr-white);
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--clr-text);
  border-radius: 0;
  appearance: none;
  transition: border-color var(--transition);
}

.contact-form__input:focus,
.contact-form__textarea:focus {
  outline: none;
  border-color: var(--clr-orange);
}

.contact-form__textarea {
  min-height: 180px;
  resize: vertical;
}

.contact-form__submit {
  margin-top: 1.5rem;
}

/* Form feedback */
.form-notice {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: var(--fs-sm);
  border-left: 4px solid;
}
.form-notice--success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #22c55e;
}
.form-notice--error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: var(--clr-orange);
}


/* ============================================================
   Site Footer
   ============================================================ */

.site-footer {
  background: var(--clr-orange);
  color: var(--clr-white);
  padding: 2rem 0;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  max-width: var(--site-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Left column: wordmark stacked above contact details */
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}

.footer-logo {
  display: block;
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--clr-white);
  text-decoration: none;
}
.footer-logo:hover { color: var(--clr-black); text-decoration: none; }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-style: normal;
}

.footer-contact a {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.footer-contact a:hover { color: var(--clr-black); }

.footer-contact span {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.75);
}

/* Right column: description text */
.footer-info {
  max-width: 45ch;
  flex-shrink: 0;
}

.footer-info__description {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
}



/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 3rem 0 4rem;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-text);
  text-decoration: none;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.page-numbers:hover,
.page-numbers.current {
  border-color: var(--clr-black);
  background: var(--clr-black);
  color: var(--clr-white);
  text-decoration: none;
}

.page-numbers.prev,
.page-numbers.next {
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
}


/* ============================================================
   404 Page
   ============================================================ */

.error-page {
  padding: 7rem 0;
  text-align: center;
}

.error-page__code {
  display: block;
  font-size: clamp(6rem, 18vw, 14rem);
  font-weight: 700;
  color: var(--clr-gold);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page__title {
  font-size: var(--fs-h4);
  margin-bottom: 1.5rem;
}

.error-page__body {
  font-size: var(--fs-lead);
  color: var(--clr-muted);
  margin-bottom: 2.5rem;
}


/* ============================================================
   Sticky Header — Scrolled State
   ============================================================ */

.site-header {
  transition: height var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  border-bottom-color: #e5e5e5;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}


/* ============================================================
   WordPress Block Editor Compatibility
   ============================================================ */

.wp-block-image { margin: 1.5rem 0; }
.wp-block-image.alignwide  {
  max-width: var(--content-width);
  margin-inline: calc((var(--text-width) - var(--content-width)) / 2);
}
.wp-block-image.alignfull  { max-width: 100vw; margin-inline: calc(50% - 50vw); }

.wp-block-quote {
  border-left: 4px solid var(--clr-gold);
  padding: 1rem 1.5rem;
  font-style: italic;
  color: var(--clr-muted);
}

.aligncenter { margin-inline: auto; text-align: center; }
.alignleft   { float: left;  margin: 0 1.5rem 1rem 0; }
.alignright  { float: right; margin: 0 0 1rem 1.5rem; }


/* ============================================================
   Responsive — Tablet  (≤ 900 px)
   ============================================================ */

@media (max-width: 900px) {

  :root { --nav-height: 80px; }

  .container { padding-inline: var(--side-pad); }

  /* Reset figure breakout — let images fill the text column naturally */
  .entry-content figure { margin-inline: 0; max-width: 100%; }

  /* Hero */
  .hero__title { max-width: 65%; }

  /* Members grid */
  .members-grid { grid-template-columns: repeat(3, 1fr); }

  /* Project detail — collapse sidebar below content */
  .project-body { grid-template-columns: 1fr; gap: 2rem; }

  /* Footer */
  .site-footer__inner { gap: 3rem; }
  .footer-logo { font-size: var(--fs-h4); }

  /* Home — stats: 2×2 on tablet */
  .home-stats__grid { grid-template-columns: repeat(2, 1fr); }

  /* Home — section header: stack on narrow viewports */
  .home-section-header { flex-wrap: wrap; gap: 0.5rem; }

}


/* ============================================================
   Responsive — Mobile  (≤ 768 px)
   ============================================================ */

@media (max-width: 768px) {

  :root { --nav-height: 70px; }

  /* Logo */
  .site-logo img { height: 52px; }

  /* Navigation: slide-in overlay */
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--clr-black);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 150;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }

  .site-nav.is-open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .primary-nav {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .primary-nav > li {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Always white links inside the mobile overlay */
  .primary-nav a,
  .home .primary-nav a,
  .primary-nav .sub-menu a,
  .home .primary-nav .sub-menu a {
    font-size: var(--fs-h4);
    font-weight: 700;
    color: var(--clr-white);
  }

  /* Mobile submenus → inline, indented, always visible */
  .primary-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 1rem 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .primary-nav .sub-menu a {
    font-size: var(--fs-h5);
    font-weight: 400;
    padding: 0;
  }

  /* Hero */
  .hero__title {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, var(--fs-h1));
  }
  .hero__subtitle { display: none; }
  .hero__content { flex-direction: column; align-items: flex-start; gap: 1.5rem; }

  /* Card grid → single column */
  .card-grid { grid-template-columns: 1fr; gap: 2rem; }

  /* Resource and news cards → stack vertically */
  .resource-card,
  .news-card { grid-template-columns: 1fr; }

  /* Members */
  .members-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }

  /* Project grid → 2 columns */
  .project-grid { grid-template-columns: repeat(2, 1fr); }

  /* Contact form */
  .contact-form__row { grid-template-columns: 1fr; gap: 1rem; }

  /* Footer */
  .site-footer__inner { flex-direction: column; gap: 2rem; }
  .footer-info { max-width: none; }

  /* Typography scale */
  h1 { font-size: clamp(2rem, 8vw, var(--fs-h1)); }
  h2 { font-size: clamp(1.75rem, 6vw, var(--fs-h2)); }
  h3 { font-size: clamp(1.5rem, 5vw, var(--fs-h3)); }
  .page-header__title  { font-size: clamp(1.5rem, 5vw, var(--fs-h3)); }

}


/* ============================================================
   Responsive — Small Mobile  (≤ 480 px)
   ============================================================ */

@media (max-width: 480px) {

  .members-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .member-card__photo { width: 100%; aspect-ratio: 3 / 4; }

  /* Project grid → single column */
  .project-grid { grid-template-columns: 1fr; }

}
