:root {
  --color-pink: #f4a6c1;
  --color-blue: #6ec6e0;
  --color-dark: #1f2933;
  --color-text: #333;
  --color-bg: #fff;
  --font-body: "GothamRounded-Book", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max-width: 1100px;
}

* { box-sizing: border-box; }

@font-face {
  font-family: GothamRounded-Book;
  src: url(gothamrnd_book.otf);
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 250;
  color: var(--color-text);
  line-height: 1.6;
}

h2 {
  text-align: center;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 2rem;
  gap: 1rem;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.site-logo img {
  height: 250px;
  width: 250px;
  object-fit: contain;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--color-dark);
  font-size: 0.95rem;
}

.site-nav a:first-child {
  margin-left: 0;
}

.nav-toggle {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle-bar {
  width: 26px;
  height: 3px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
}

/* Hero */
.hero {
  position: relative;
  max-width: none;
  padding: 0;
  text-align: center;
  color: #fff;
}

.hero-banner {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(31,41,51,0.15), rgba(31,41,51,0.45));
}

.hero-text h1 {
  margin: 0.25rem 0;
  font-size: clamp(1.25rem, 4vw, 2.75rem);
}

/* Framework grid */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
  align-items: start;
  justify-items: center;
}

.framework-card h4 {
  text-align: center;
}

.framework-card p {
  text-align: justify;
}

.framework-card img {
  width: 50%;
  margin: 0 auto;
  justify-items: center;
  display: block;
}

/* Toolkit */

.toolkit {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(10px, auto);
  gap: 2rem;
}

/*
.toolkit-item {
  gap: 1rem;
  border-top: none;
  align-items: start;
}
*/

.toolkit-image {
  width: 100%;
  align-content: end;
}

.toolkit-textimage {
  width: 100%;
  align-items: start;
}

.toolkit.description {
  align-items: start;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.toggle-item {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.toggle-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-dark);
}

.toggle-item[open] summary {
  color: var(--color-blue);
}

/* Findings */
.findings-group {
  margin-bottom: 2.5rem;
}

.pub-list ul {
  padding-left: 1.25rem;
}

.pub-list li {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.team-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}

.team-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.team-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
}

/* Partners */
.partner-logos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: center;
}

.partner-logos img {
  width: 100%;
  object-fit: contain;
}

/* Funder note */
.funder-note {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.funder-note img {
  height: 60px;
}

.funder-note p {
  font-size: 0.85rem;
}

.site-footer {
  text-align: center;
  padding: 2rem;
  color: #FFF;
  background-color: rgb(36, 97, 167);
  font-size: 0.85rem;
}

.site-footer a {
  color: #FFF;
}

.site-footer .footer-nav {
  margin-top: 1rem;
}

.site-footer .footer-nav a {
  text-decoration: none;
  color: #FFF;
}

/* Intro (homepage) */
.intro {
  max-width: 900px;
}

.intro h4 {
  font-size: 1.25rem;
  font-weight: 500;
  text-align: center;
  color: var(--color-dark);
  color: rgb(36, 97, 167);
  text-transform: uppercase;
}

.intro-columns {
  column-count: 2;
  column-gap: 2.5rem;
}

.intro-columns p {
  margin-top: 0;
  break-inside: avoid; /* stops a paragraph from splitting awkwardly across the column break */
}

/* News (homepage) */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.news-item {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: border-color 0.15s ease;
}

.news-item:hover {
  border-color: var(--color-blue);
}

.news-item h4 {
  margin: 0 0 0.25rem;
  color: var(--color-dark);
}

.news-date {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #999;
}

.news-excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

/* Projects (homepage) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 10px;
  background-color: rgb(239, 239, 236);
}

.project-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.project-card h3 {
  margin: 0 0 0.5rem;
  color: var(--color-dark);
  font-weight: 500;
}

.project-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

.project-page h1 {
  color: rgb(36, 97, 167);
}

.project-page img {
  align-items: center;
  display:block;
  margin: auto;
}

.imgs-horz {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.view-all {
  display: inline-block;
  margin-top: 2rem;
  text-decoration: none;
  color: var(--color-blue);
  font-weight: 600;
}

.team-position {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
}

.team-alumni {
  padding-top: 0;
}

.alumni-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1.5rem;
}

.alumni-list li {
  font-size: 0.9rem;
  color: #555;
}

/*==================
 Publications page 
 ===================*/

.publications-page h1 {
  margin-bottom: 1.5rem;
}

.pub-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.pub-filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-dark);
  gap: 0.35rem;
}

.pub-filters select {
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 180px;
}

.pub-filters button {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.pub-filters button:hover {
  border-color: var(--color-blue);
}

.active-author-note {
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--color-dark);
}

.active-author-note button {
  margin-left: 0.5rem;
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #888;
}

.no-results {
  margin: 2rem 0;
  color: #888;
  font-style: italic;
}

.pub-year-group h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-dark);
  border-bottom: 2px solid var(--color-blue);
  display: inline-block;
  padding-bottom: 0.25rem;
}

.pub-item {
  margin: 0 0 1.25rem;
}

.pub-entry {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.pub-links {
  margin: 0.25rem 0 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pub-link-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-blue);
  border: 1px solid var(--color-blue);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
}

.pub-link-badge:hover {
  background: var(--color-blue);
  color: #fff;
}

.author-link {
  color: var(--color-dark);
  text-decoration: none;
  border-bottom: 1px dotted #999;
}

.author-link:hover {
  color: var(--color-blue);
  border-bottom-color: var(--color-blue);
}

/* --------------
Tools & Toys index 
---------------- */

.ttoy-index h1 {
  margin-bottom: 1.5rem;
}

.ttoy-year-group h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-dark);
  border-bottom: 2px solid var(--color-blue);
  display: inline-block;
  padding-bottom: 0.25rem;
}

.ttoy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

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

.ttoy-card img {
  margin-top: 1.5rem;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.ttoy-card-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f0f0f0;
  border-radius: 8px;
}

.ttoy-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--color-dark);
}

.ttoy-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #888;
}

/* Individual project page */
.ttoy-project {
  max-width: 800px;
}

.ttoy-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-blue);
  text-decoration: none;
}

.ttoy-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.ttoy-author {
  color: #888;
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.ttoy-body p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 1.5rem;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* ============================
   Responsive breakpoints
   ============================ */

/* Tablet and below */
@media (max-width: 768px) {
  section {
    padding: 2rem 1.25rem;
  }

  .hero-banner {
    height: 280px;
  }

  .toolkit-item {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .intro-columns {
    column-count: 1;
  }

  .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.25rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .framework-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .funder-note {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

/* Phone */
@media (max-width: 600px) {
  
  .site-logo img {
    height: 200px;
    width: 200px;
    object-fit: contain;
    display: block;
  }

  .site-header {
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.25rem;
  }

  .site-nav {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-nav a {
    margin-left: 0;
    padding: 0.25rem 0;
  }

  .site-nav a.active {
    text-decoration: underline;
    text-underline-offset: 4px; /* optional: adds a little breathing room */
  }

  .hero-banner {
    height: 200px;
  }

  .hero-text h1 {
    font-size: 1.1rem;
  }

  .intro h4 {
    font-size: 1.05rem;
  }

  section h2 {
    font-size: 1.35rem;
  }

  .toolkit-item {
    padding: 1.5rem 0;
  }

  .toolkit {
    grid-template-columns: 1fr; /* stack the 3 toolkit items on mobile too */
  }

  .partner-logos {
    gap: 1.25rem;
  }

  .partner-logos img {
    height: 36px;
  }

  .site-footer {
    padding: 1.5rem 1rem;
  }

  .site-footer .footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.75rem;
  }

  .pub-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .pub-filters select {
    min-width: 0;
    width: 100%;
  }

  .ttoy-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .nav-toggle { display: flex; }
  .site-nav { display: none; }
  body.nav-open { overflow: hidden; }

  body.nav-open .header-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #fff;
    padding: 1rem 1.25rem;
    z-index: 101;
  }

  body.nav-open .site-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: fixed;
    inset: 0;
    padding-top: 9rem;
    background: #fff;
    z-index: 100;
    overflow-y: auto;
  }

  body.nav-open .site-nav a {
    font-size: 1.5rem;
  }

}

/* Very small phones */
@media (max-width: 380px) {
  .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .hero-text h1 {
    font-size: 1rem;
  }
}
