/* ============================================================
   ESS Jekyll Theme
   English Students' Society, University of Lethbridge
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f7;
  --bg-soft: #f7f7f7;

  --primary: #000000;
  --primary-soft: #222222;

  --accent: #b9915d;
  --accent-dark: #8b6a3f;
  --accent-pale: #efe3d1;

  /* Logo (bird) palette — used as subtle accents for brand cohesion */
  --logo-green: #2f8020;
  --logo-gold: #f0c030;
  --logo-purple: #704080;
  --logo-teal: #1aa3ad;
  --logo-red: #d0341a;

  --text: #111111;
  --muted: #555555;
  --border: #000000;
  --white: #ffffff;

  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', Arial, sans-serif;
  --font-ui: 'Montserrat', Arial, sans-serif;

  --nav-h: 88px;
  --wide: 1180px;
  --prose-w: 760px;

  --body-size: 1rem;
  --small-size: 0.85rem;
  --label-size: 0.78rem;

  --h1-size: clamp(3.8rem, 7vw, 6.5rem);
  --h2-size: clamp(2.8rem, 5vw, 4.5rem);
  --h3-size: clamp(1.8rem, 3vw, 2.35rem);
  --h4-size: 1.35rem;

  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.13);
}

/* ============================================================
   RESET
   ============================================================ */

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.75;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

ul,
ol {
  list-style: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  color: var(--primary);
  font-weight: 600;
  line-height: 1.05;
}

h1 {
  font-size: var(--h1-size);
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: var(--h2-size);
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}

h3 {
  font-size: var(--h3-size);
  letter-spacing: -0.025em;
  margin-bottom: 0.65rem;
}

h4 {
  font-size: var(--h4-size);
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

p,
li {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.75;
}

/* Body/prose text justification */
p,
.prose li,
.split__text li,
.opp-item li,
.constitution-block li,
.contact-info li {
  text-align: justify;
}

p {
  margin-bottom: 1rem;
}

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

.eyebrow {
  display: block;
  margin-bottom: 0.65rem;
  font-family: var(--font-ui);
  font-size: var(--small-size);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
}

/* ============================================================
   GENERAL LAYOUT
   ============================================================ */

.wrap {
  width: min(var(--wide), calc(100% - 3rem));
  margin: 0 auto;
}

.section {
  padding: 6rem 0;
  background: var(--bg);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.section--alt {
  background: var(--bg-alt);
}

.section--dark {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.78);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--white);
}

.section--dark p {
  color: rgba(255, 255, 255, 0.72);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.75rem;
}

.section-head p {
  max-width: 620px;
  margin: 0.75rem auto 0;
  color: var(--muted);
}

.section-head--left {
  text-align: left;
  margin-left: 0;
}

.section-head--left p {
  margin-left: 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
}

.nav__inner {
  width: min(var(--wide), calc(100% - 3rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--primary);
}

.nav__logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.nav__site-name {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--primary);
  max-width: 230px;
}

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

.nav__links a {
  font-family: var(--font-ui);
  font-size: var(--small-size);
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.03em;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}

.nav__links a:hover,
.nav__links a.active {
  border-bottom-color: var(--primary);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  min-height: 550px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(10%) brightness(0.72);
  opacity: 0.9;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(0, 0, 0, 0.38),
    rgba(0, 0, 0, 0.48)
  );
}

.hero__body {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 7rem 0;
  text-align: center;
}

.hero__body h1 {
  color: var(--white);
  font-size: var(--h1-size);
  margin: 0 auto 2rem;
  max-width: 1200px;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.35);
}

.hero__body p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 680px;
  margin: 0 auto 2.25rem;
  font-size: var(--body-size);
  font-weight: 400;
}

.hero--short {
  min-height: 340px;
}

.hero--short .hero__body {
  padding: 4.5rem 0;
}

/* ============================================================
   PAGE-SPECIFIC SPACING
   ============================================================ */

.about-welcome {
  padding-top: 7rem;
}

.about-welcome h1 {
  margin-bottom: 1.5rem;
}

.constitution-section {
  background: var(--bg);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-block;
  min-width: 155px;
  padding: 0.95rem 2rem;
  border: 2px solid var(--primary);
  border-radius: 28px;
  background: var(--white);
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: var(--small-size);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn--primary,
.btn--outline,
.btn--outline-light,
.btn--ghost {
  background: var(--white);
  color: var(--primary);
  border-color: var(--primary);
}

.btn:hover,
.btn--primary:hover,
.btn--outline:hover,
.btn--outline-light:hover,
.btn--ghost:hover {
  background: var(--logo-green);
  color: var(--white);
  border-color: var(--logo-green);
}

/* Per-button hover colors drawn from the logo palette.
   Listed after the default so the modifier wins (equal specificity). */
.btn--green:hover  { background: var(--logo-green);  color: var(--white);   border-color: var(--logo-green); }
.btn--purple:hover { background: var(--logo-purple); color: var(--white);   border-color: var(--logo-purple); }
.btn--teal:hover   { background: var(--logo-teal);   color: var(--white);   border-color: var(--logo-teal); }
.btn--red:hover    { background: var(--logo-red);    color: var(--white);   border-color: var(--logo-red); }
.btn--gold:hover   { background: var(--logo-gold);   color: var(--white);   border-color: var(--logo-gold); }

/* ============================================================
   IMAGE + TEXT SPLIT SECTIONS
   ============================================================ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 520px;
  align-items: center;
}

.split--image-right .split__text {
  order: 1;
}

.split--image-right .split__media {
  order: 2;
}

.split--image-left .split__media {
  order: 1;
}

.split--image-left .split__text {
  order: 2;
}

.split--flip .split__media {
  order: 1;
}

.split--flip .split__text {
  order: 2;
}

.split__text {
  max-width: none;
  padding: 5rem 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
}

.split__text p {
  max-width: 540px;
  color: var(--text);
  font-size: var(--body-size);
  line-height: 1.75;
}

.split__text .btn {
  margin-top: 1.4rem;
  align-self: flex-start;
}

.split__media {
  position: relative;
  min-height: 520px;
  overflow: hidden;
}

.split__media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.split__media--top img {
  object-position: center top;
}

.split__media--bottom img {
  object-position: center bottom;
}

.split__media--left img {
  object-position: left center;
}

.split__media--right img {
  object-position: right center;
}

.split__media--contain img {
  object-fit: cover;
  background: var(--primary);
}

/* ============================================================
   NEWS / CARDS
   ============================================================ */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.25rem;
}

.card {
  background: var(--white);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-left: 3px solid var(--logo-green);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Each card carries a different logo color on its left edge */
.card:nth-child(5n+1) { border-left-color: var(--logo-green); }
.card:nth-child(5n+2) { border-left-color: var(--logo-gold); }
.card:nth-child(5n+3) { border-left-color: var(--logo-purple); }
.card:nth-child(5n+4) { border-left-color: var(--logo-teal); }
.card:nth-child(5n+5) { border-left-color: var(--logo-red); }

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card__thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-alt);
}

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

.card__body {
  padding: 1.2rem 1.2rem 1.35rem;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-ui);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__tag {
  color: var(--logo-teal);
}

.card__title {
  font-family: var(--font-head);
  font-size: var(--h3-size);
  color: var(--primary);
  margin-bottom: 0.65rem;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.card__excerpt {
  color: var(--muted);
  font-size: var(--body-size);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.card__link {
  font-family: var(--font-ui);
  font-size: var(--label-size);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding-bottom: 2px;
  align-self: flex-start;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.card__link:hover {
  color: var(--logo-green);
  border-bottom-color: var(--logo-green);
}

/* Home output cards: pin the link to the bottom, like the outputs page */
.cards .card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cards .card__link {
  margin-top: auto;
}

.view-all-row {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* ============================================================
   OPPORTUNITIES HUB PAGE
   ============================================================ */

.opportunities-header {
  text-align: center;
}

.opportunities-header h1 {
  margin-bottom: 1rem;
}

.opportunities-header p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: var(--body-size);
  line-height: 1.75;
  text-align: center;
}

.opportunities-section {
  padding-top: 5rem;
}

.opportunity-category {
  margin-bottom: 5rem;
}

.opportunity-category:last-child {
  margin-bottom: 0;
}

.opportunity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  align-items: stretch;
}

.opportunity-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.opportunity-card-link:hover {
  color: inherit;
}

.opportunity-card-link:hover .opportunity-card {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.opportunity-card {
  height: 100%;
  min-height: 260px;
  background: var(--white);
  border: 1px solid var(--primary);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.opportunity-card h3 {
  font-size: var(--h3-size);
  margin-bottom: 0.75rem;
}

.opportunity-card p {
  color: var(--muted);
  font-size: var(--body-size);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  text-align: justify;
}

.opportunity-card .card__read-more {
  margin-top: auto;
}

@media (max-width: 900px) {
  .opportunity-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }

  .opportunity-card {
    min-height: 0;
  }
}

/* ============================================================
   ABOUT PAGE + TEAM GRID
   ============================================================ */

.about-welcome {
  padding-top: 6rem;
}

.about-welcome .split__text h1 {
  font-size: var(--h2-size);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}

.about-welcome .split__text p {
  font-size: var(--body-size);
  line-height: 1.75;
  color: var(--text);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 240px);
  gap: 1.75rem;
  margin: 2.5rem auto 0;
  justify-content: center;
}

.team-card {
  width: 240px;
  background: var(--white);
  border: 1px solid var(--primary);
  padding: 2rem 1.25rem;
  text-align: center;
}

.team-card__avatar {
  width: 105px;
  height: 105px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-alt);
}

.team-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.team-card__name {
  font-family: var(--font-head);
  font-size: var(--h3-size);
  color: var(--primary);
  line-height: 1.05;
  margin-bottom: 0.35rem;
  text-align: center;
}

.team-card__role {
  font-family: var(--font-ui);
  font-size: var(--label-size);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  text-align: center;
}

/* ============================================================
   CONSTITUTION BLOCK
   ============================================================ */

.constitution-block {
  background: var(--bg-alt);
  padding: 2.75rem;
  max-width: 780px;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  border: 1px solid var(--primary);
}

.constitution-block__icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.constitution-block__text p {
  color: var(--muted);
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.contact-info p {
  color: var(--muted);
}

.contact-info__links {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.contact-info__link {
  font-family: var(--font-ui);
  font-size: var(--body-size);
  color: var(--text);
}

.contact-info__link a {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

.socials-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--primary);
  color: var(--primary);
  transition: background 0.2s ease, color 0.2s ease;
}

.social-icon:hover {
  background: var(--primary);
  color: var(--white);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field label {
  font-family: var(--font-ui);
  font-size: var(--small-size);
  font-weight: 600;
  color: var(--primary);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--primary);
  background: var(--white);
  font-family: var(--font-body);
  font-size: var(--body-size);
  color: var(--text);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 1.5px solid var(--primary);
  border-color: var(--primary);
}

.form-field textarea {
  min-height: 145px;
  resize: vertical;
}

/* ============================================================
   POST LAYOUT
   ============================================================ */

.post-section {
  padding-top: 5rem;
}

.post-content {
  max-width: var(--prose-w);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: var(--h1-size);
  margin-bottom: 1rem;
}

.post-meta {
  font-family: var(--font-ui);
  font-size: var(--small-size);
  color: var(--muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-meta span + span::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-ui);
  font-size: var(--small-size);
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

/* Post image under the text */
.post-hero-img {
  width: min(100%, 760px);
  aspect-ratio: 4 / 3;
  margin: 3rem auto 0;
  background: var(--bg-alt);
  overflow: hidden;
}

.post-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

/* ============================================================
   MORE UPDATES
   ============================================================ */

.more-updates-section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.more-updates-head {
  margin-bottom: 1.75rem;
}

.more-updates-head h2 {
  font-size: var(--h3-size);
}

.more-updates-grid {
  justify-content: center;
}

/* Makes the whole update card clickable */
.card__link-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card__link-wrap:hover {
  color: inherit;
}

.card__read-more {
  display: inline-block;
  margin-top: auto;
  font-family: var(--font-ui);
  font-size: var(--label-size);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding-bottom: 2px;
  align-self: flex-start;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.card__read-more:hover {
  color: var(--logo-green);
  border-bottom-color: var(--logo-green);
}

/* Outputs page: stacked full-width rows (image left when present, text
   right). Rows stack independently, so posts with and without photos
   never create grid height gaps. */
.cards-section {
  padding: 4.5rem 0 6rem;
}

.cards-section .section__inner {
  width: min(var(--wide), calc(100% - 3rem));
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  /* grid-auto-rows is set by JS to the tallest card so every card
     matches across all pages without clipping any titles */
}

.card-grid .card__link-wrap {
  flex-direction: row;
  align-items: stretch;
}

.card-grid .card__thumb {
  flex: 0 0 200px;
  aspect-ratio: auto;
}

.card-grid .card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-grid .card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.7rem;
}

.card__authors {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.outputs-controls {
  margin-bottom: 2.5rem;
}

.outputs-search {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: var(--white);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 1.15rem;
}

.outputs-search:focus {
  outline: none;
  border-color: var(--logo-teal);
}

.outputs-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.outputs-chip {
  padding: 0.4rem 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: var(--white);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--primary);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.outputs-chip:hover {
  border-color: var(--logo-teal);
  color: var(--logo-teal);
}

.outputs-chip.is-active {
  background: var(--logo-teal);
  border-color: var(--logo-teal);
  color: var(--white);
}

.outputs-count {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.outputs-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 0;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3.5rem;
}

.pagination__btn {
  min-width: 42px;
  height: 42px;
  padding: 0 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: var(--white);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pagination__btn:hover:not(:disabled) {
  border-color: var(--logo-teal);
  color: var(--logo-teal);
}

.pagination__btn.is-active {
  background: var(--logo-teal);
  border-color: var(--logo-teal);
  color: var(--white);
}

.pagination__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* One column on tablets, image stacks on top on phones */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-auto-rows: auto;
  }

  .card-grid .card__link-wrap {
    flex-direction: column;
  }

  .card-grid .card__thumb {
    flex: none;
    aspect-ratio: 16 / 9;
  }
}

/* ============================================================
   PROSE / BLOG POSTS
   ============================================================ */

.prose {
  max-width: var(--prose-w);
  margin: 0 auto;
  font-size: var(--body-size);
  line-height: 1.85;
}

.prose h2 {
  margin-top: 2.5rem;
}

.prose h3 {
  margin-top: 1.75rem;
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.45rem;
  color: var(--muted);
}

.prose blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

.prose strong {
  color: var(--primary);
}

.prose a {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

/* ============================================================
   BLOG LISTING HEADER
   ============================================================ */

.blog-header {
  background: var(--bg-alt);
  padding: 5rem 0 3.75rem;
  border-bottom: 1px solid var(--primary);
  text-align: center;
}

.blog-header h1 {
  margin-bottom: 0;
  text-align: center;
}

/* ============================================================
   CONNECT FEATURE
   ============================================================ */

.connect-feature {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 520px;
  background: var(--bg-alt);
  overflow: hidden;
}

.connect-feature__image {
  height: 520px;
  overflow: hidden;
}

.connect-feature__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.connect-feature__panel {
  position: relative;
  margin-left: -3rem;
  margin-right: 0;
  padding: 4.5rem 3rem;
  background: var(--white);
  border: 2px solid var(--primary);
  text-align: center;
  z-index: 2;
}

.connect-feature__panel h2 {
  color: var(--primary);
  font-size: var(--h2-size);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.connect-feature__panel p {
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.75;
  margin-bottom: 2rem;
}

.connect-feature__panel p a {
  color: var(--logo-teal);
  border-bottom: 1px solid var(--logo-teal);
}

/* Contact page — single centered card, no image */
.contact-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h) - 8rem);
  padding: 5rem 1.5rem;
  background-color: var(--bg-alt);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)),
    url('../img/intro.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.contact-card {
  width: 100%;
  max-width: 620px;
  min-width: 0;
  margin: 0 auto;
  padding: 4.25rem 3.75rem;
  text-align: center;
  background: var(--bg-alt);
  border: 2px solid var(--primary);
  box-shadow: var(--shadow);
}

.contact-card h2 {
  color: var(--primary);
  font-size: var(--h2-size);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.contact-card p {
  color: var(--text);
  font-size: var(--body-size);
  line-height: 1.75;
  text-align: center;
  margin-bottom: 2rem;
}

.contact-card p a {
  color: var(--logo-teal);
  border-bottom: 1px solid var(--logo-teal);
}

/* ============================================================
   LAND ACKNOWLEDGEMENT
   ============================================================ */

.land-ack {
  background: var(--bg-alt);
  color: var(--primary);
  padding: 4.5rem 2rem 3.5rem;
  text-align: center;
}

.land-ack__inner {
  max-width: var(--wide);
  margin: 0 auto;
}

.land-ack h2 {
  color: var(--primary);
  font-family: var(--font-head);
  font-size: var(--h2-size);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 0.8rem;
}

.land-ack__subtitle {
  color: var(--primary);
  font-family: var(--font-head);
  font-size: var(--h3-size);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 2.5rem;
}

.land-ack__text {
  max-width: 900px;
  margin: 0 auto 3.5rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.75;
  font-weight: 400;
  text-align: justify;
}

.land-ack__socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.4rem;
}

.land-ack__socials a {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--primary);
  transition: background 0.2s ease, color 0.2s ease;
}

.land-ack__socials a:hover {
  background: var(--white);
  color: var(--primary);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: var(--white);
  color: var(--muted);
  padding: 2rem 0;
  border-top: 1px solid var(--primary);
}

.footer__inner {
  width: min(var(--wide), calc(100% - 3rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.footer__copy {
  font-family: var(--font-ui);
  font-size: var(--small-size);
  margin: 0;
}

.footer__brand {
  justify-self: center;
  display: inline-flex;
  line-height: 0;
}

.footer__brand img {
  width: 46px;
  height: 46px;
  display: block;
  transition: opacity 0.2s ease;
}

.footer__brand:hover img {
  opacity: 0.7;
}

.footer__links {
  justify-self: end;
}

.footer__socials {
  display: flex;
  gap: 0.9rem;
}

.footer__socials a {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  transition: background 0.2s ease, color 0.2s ease;
}

.footer__socials a:hover {
  background: var(--white);
  color: var(--primary);
}

.footer__socials svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 900px) {
  .split,
  .split--image-left,
  .split--image-right,
  .connect-feature {
    grid-template-columns: 1fr;
  }

  .split__text,
  .split__media,
  .split--image-left .split__text,
  .split--image-left .split__media,
  .split--image-right .split__text,
  .split--image-right .split__media {
    order: unset;
  }

  .split__text {
    padding: 3.5rem 2rem;
  }

  .split__media {
    min-height: 360px;
  }

  .connect-feature__image {
    height: 360px;
  }

  .connect-feature__panel {
    margin: -2rem 1rem 3rem;
    padding: 3rem 1.5rem;
  }

  .cards {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 76px;

    --h1-size: 3.4rem;
    --h2-size: 2.7rem;
    --h3-size: 1.9rem;
  }

  .outputs-list {
    columns: 1;
  }

  .nav__logo {
    width: 46px;
    height: 46px;
  }

  .nav__site-name {
    font-size: 1rem;
    max-width: 170px;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--primary);
    padding: 1.2rem 1.5rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    box-shadow: var(--shadow);
  }

  .nav__links.open {
    display: flex;
  }

  .hero {
    min-height: 520px;
  }

  .hero__body {
    padding: 5rem 0;
  }

  .section {
    padding: 4.25rem 0;
  }

  .section-head {
    margin-bottom: 2.75rem;
  }

  .land-ack {
    padding: 3.5rem 1.25rem 3rem;
  }

  .land-ack__text {
    text-align: center;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .footer__links {
    justify-self: center;
  }

  .footer__socials {
    justify-content: center;
  }

  .constitution-block {
    flex-direction: column;
    padding: 2rem;
  }
}

@media (max-width: 500px) {
  .wrap,
  .nav__inner,
  .hero__body,
  .footer__inner {
    width: min(100% - 2rem, var(--wide));
  }

  .btn {
    width: 100%;
    max-width: 260px;
  }

  .team-grid {
    grid-template-columns: 240px;
    justify-content: center;
  }

  .contact-page {
    padding: 4rem 1.25rem;
  }

  .contact-card {
    max-width: 340px;
    padding: 2.5rem 1.75rem;
  }

  /* The email address is one long token — let it wrap instead of widening
     the flex item past its max-width */
  .contact-card p {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 900px) {
  .opportunity-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }

  .opportunity-card {
    min-height: 0;
  }
}

.connect-feature__panel p {
  text-align: center;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.program-card {
  padding: 1.5rem;
  border: 1px solid rgba(0,0,0,0.14);
  border-left: 3px solid var(--logo-green);
  border-radius: 0;
  background: #fff;
}

/* Each card carries a different logo color on its left edge */
.program-card:nth-child(5n+1) { border-left-color: var(--logo-green); }
.program-card:nth-child(5n+2) { border-left-color: var(--logo-gold); }
.program-card:nth-child(5n+3) { border-left-color: var(--logo-purple); }
.program-card:nth-child(5n+4) { border-left-color: var(--logo-teal); }
.program-card:nth-child(5n+5) { border-left-color: var(--logo-red); }

.program-card h3 {
  margin-bottom: 0.25rem;
  opacity: 1;
  font-family: var(--font-ui);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.program-card h4 {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* ============================================================
   RESEARCH PROGRAM
   ============================================================ */

.research-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 56px;
  align-items: center;
}

.research-grid h2 {
  margin-bottom: 1.5rem;
}

.research-grid img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.research-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #bedee2;
  position: relative;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}

.research-banner__left {
  padding: 2rem 2.5rem;
  background: #a8d4d8;
  border-right: 1px solid #bedee2;
  display: flex;
  align-items: center;
}

.research-banner__left p {
  text-align: justify;
  margin-bottom: 0;
  line-height: 1.75;
  font-size: 0.92rem;
}

.research-banner__right {
  padding: 2rem 2.5rem;
  background: var(--bg-alt);
}

.research-banner__label {
  text-align: left;
  color: var(--logo-teal);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.research-banner__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.research-banner__list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--muted);
  font-size: 0.88rem;
  color: var(--primary);
  cursor: default;
}

.research-banner__list li:last-child {
  border-bottom: none;
}

/* Mobile: stack the research grid and banner. Placed after the base
   rules above so it actually overrides them. */
@media (max-width: 900px) {
  .research-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Image on top, text below, each full width */
  .research-grid img {
    order: -1;
    height: 280px;
  }

  .research-banner {
    grid-template-columns: 1fr;
  }

  .research-banner__left {
    border-right: none;
    border-bottom: 1px solid #bedee2;
  }
}

/* ============================================================
   PROGRAM AREAS
   ============================================================ */

.section--program-areas {
  margin-top: 0;
}

/* ============================================================
   OUTPUTS & COLLABORATIONS
   ============================================================ */

.collab-intro {
  max-width: 760px;
  margin-bottom: 2.75rem;
}

.collab-intro p {
  text-align: justify;
  margin-bottom: 0;
}

.outputs-label {
  text-align: left;
  color: var(--logo-teal);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

/* Two-column bulleted list with colored bullets.
   CSS multicolumn flows items down each column (items 1-3 | 4-6). */
.outputs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem 0;
  columns: 2;
  column-gap: 64px;
}

.outputs-list li {
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

/* Bullets, not numbers: the list is a set of output kinds, not a count of them.
   Gutter is narrower than the old numbered version — a single dot needs far
   less room than two digits, and a wide gap orphans it from its text. */
.outputs-list li::before {
  content: "\2022";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--logo-teal);
  flex-shrink: 0;
  min-width: 0.7rem;
  text-align: center;
}

/* Each bullet takes a different logo color, cycling the palette */
.outputs-list li:nth-child(5n+1)::before { color: var(--logo-green); }
.outputs-list li:nth-child(5n+2)::before { color: var(--logo-gold); }
.outputs-list li:nth-child(5n+3)::before { color: var(--logo-purple); }
.outputs-list li:nth-child(5n+4)::before { color: var(--logo-red); }
.outputs-list li:nth-child(5n+5)::before { color: var(--logo-teal); }

/* ============================================================
   FUNDING
   ============================================================ */

/* ============================================================
   MEMBERS
   ============================================================ */

.member-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  /* Centered flex so each group (3 leads, 5 team, 1 past) reads as an
     intentional, balanced row rather than a ragged grid */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem 2rem;
}

.member {
  flex: 0 0 auto;
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.member__photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.member__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member__initials {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.member__name {
  font-family: var(--font-head);
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--primary);
  margin: 0 0 0.3rem;
}

.member__name,
.member__note {
  /* Override the global justified <p> so member text stays centered */
  text-align: center;
}

.member__role {
  font-family: var(--font-ui);
  font-size: var(--label-size);
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--logo-teal);
  margin: 0;
  /* text-align:center overrides the global justified <p> rule, which
     otherwise spreads a multi-word role line edge-to-edge.
     max-width keeps longer roles wrapping tidily under the photo. */
  text-align: center;
  max-width: 13em;
  text-wrap: balance;
}

.member__note {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0.4rem 0 0;
}

.member-subhead {
  font-family: var(--font-head);
  font-size: var(--h3-size);
  letter-spacing: -0.01em;
  color: var(--primary);
  margin: 3rem 0 2rem;
}

.funding-intro {
  margin-bottom: 2.75rem;
}

.funding-intro p {
  text-align: justify;
  margin-bottom: 0;
}

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

.funding-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 2.5rem;
  padding: 1.85rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.funding-item:last-child {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.funding-item__stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.funding-item__amount {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
}

.funding-item__years {
  font-family: var(--font-ui);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--logo-teal);
}

.funding-item__title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--primary);
  margin: 0 0 0.55rem;
}

.funding-item__grant {
  font-family: var(--font-ui);
  font-size: var(--label-size);
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.55rem;
}

.funding-item__note {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.funding-item__note--current {
  color: var(--logo-green);
  font-weight: 600;
}

.funder-logos {
  margin-top: 3rem;
}

.funder-logos__heading {
  font-family: var(--font-ui);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.funder-logos__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 3rem;
}

.funder-logo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 460px;
}

.funder-logo__img {
  display: block;
  width: auto;
  height: 60px;
  /* keep clear, open space around each funder mark */
}

.funder-logo__img--alliance {
  height: 56px;
}

.funder-logo__ack {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.funder-logo__ack a {
  color: inherit;
  text-decoration: underline;
}

/* Mobile overrides for funding + members.
   NOTE: these must live AFTER the base rules above — equal-specificity
   media-query rules placed earlier in the file lose on source order. */
@media (max-width: 768px) {
  /* Justified text leaves ugly gaps in a narrow column */
  .funding-intro p {
    text-align: left;
  }

  /* Stack the grant: amount, then years, then the grant info — no columns */
  .funding-item {
    display: block;
    padding: 1.5rem 0;
  }

  .funding-item__stat {
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
  }

  .funding-item__amount {
    font-size: 1.45rem;
  }

  .funding-item__title {
    font-size: 1.3rem;
  }

  /* Never let a long title or grant number push the layout sideways */
  .funding-item__title,
  .funding-item__grant {
    overflow-wrap: anywhere;
  }

  .funder-logos {
    margin-top: 2.5rem;
  }

  .funder-logos__list {
    gap: 2.5rem;
  }

  .funder-logo {
    max-width: 100%;
  }

  /* SSHRC mark scales down to fit the viewport */
  .funder-logo__img {
    height: auto;
    width: 100%;
    max-width: 300px;
  }

  /* Alliance brand rule: hold the 50px digital minimum height. The mark is
     wide (~8:1), so let it scroll horizontally within its own box rather
     than shrink below the minimum. */
  .funder-logo--alliance {
    overflow-x: auto;
  }

  .funder-logo__img--alliance {
    height: 50px;
    width: auto;
    max-width: none;
  }

  /* Members: two per row on phones */
  .member-grid {
    gap: 2rem 1.25rem;
  }

  .member {
    width: 44%;
    max-width: 180px;
  }
}

/* ============================================================
   PAGE LEGEND (on-this-page jump nav)
   ============================================================ */

.page-legend {
  position: fixed;
  top: 50%;
  right: 1.75rem;
  transform: translateY(-50%);
  z-index: 50;
  width: 210px;
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.page-legend__title {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
  padding-left: 0.95rem;
}

.page-legend__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Each legend entry carries its own logo color */
.page-legend__list li:nth-child(1) { --legend-color: var(--logo-gold); }
.page-legend__list li:nth-child(2) { --legend-color: var(--logo-purple); }
.page-legend__list li:nth-child(3) { --legend-color: var(--logo-red); }

.page-legend__link {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--legend-color);
  border-left: 2px solid rgba(0, 0, 0, 0.15);
  padding: 0.15rem 0 0.15rem 0.95rem;
  transition: border-color 0.2s ease, font-weight 0.2s ease;
}

.page-legend__link:hover,
.page-legend__link.is-active {
  color: var(--legend-color);
  border-left-color: var(--legend-color);
  font-weight: 600;
}

/* Only show where there's room beside the centered content */
@media (max-width: 1320px) {
  .page-legend {
    display: none;
  }
}