/* ---------- RESPONSIVE ---------- */

/* ===== LARGE LAPTOP (1440+) ===== */
/* Default styles handle this well - illustration flexes to fill */

/* ===== MEDIUM LAPTOP (1024-1439) ===== */
@media (max-width: 1439px) {
  .stats-bar {
    max-width: 480px;
  }
}

@media (max-width: 1024px) {
  .stats-bar {
    max-width: 420px;
  }

  .hero {
    padding-top: 75px;
  }

  .hero-logo {
    width: clamp(100px, 14vw, 150px);
  }
}

/* ===== SHORT LAPTOPS (e.g. 1366×768) ===== */
@media (max-height: 750px) {
  .hero {
    padding-top: 68px;
    padding-bottom: 38px;
  }

  .hero-content {
    margin-top: 0;
  }

  .hero-logo {
    width: clamp(80px, 12vw, 120px);
    margin: -4px auto 4px;
  }

  .hero-title {
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    margin-bottom: 2px;
  }

  .hero-tagline {
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    margin-bottom: 4px;
  }

  .hero-location {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  .stats-bar {
    margin-top: 12px;
  }

  .stat-item {
    padding: 6px 4px;
  }

  .stat-number {
    font-size: clamp(1rem, 2vw, 1.2rem);
  }

  .stat-label {
    font-size: 0.55rem;
  }

  .hero-illustration {
    max-height: 40vh;
    min-height: 100px;
  }

  .hero-illustration svg {
    max-height: 40vh;
  }
}

/* ===== VERY SHORT SCREENS (e.g. 1366×600, ultra-wide) ===== */
@media (max-height: 620px) {
  .hero {
    padding-top: 60px;
    padding-bottom: 34px;
    min-height: 400px;
  }

  .hero-logo {
    width: clamp(60px, 10vw, 100px);
    margin: 0 auto 2px;
  }

  .hero-title {
    font-size: clamp(1.2rem, 3vw, 2rem);
  }

  .hero-tagline {
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    margin-bottom: 2px;
  }

  .hero-location {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }

  .stats-bar {
    margin-top: 8px;
  }

  .stat-item {
    padding: 5px 4px;
  }

  .hero-illustration {
    max-height: 35vh;
    min-height: 80px;
  }

  .hero-illustration svg {
    max-height: 35vh;
  }
}

/* ===== TABLET (768-1024) ===== */
@media (max-width: 768px) {
  :root {
    --section-gap: 80px;
  }

  .container {
    padding: 0 20px;
  }

  /* --- Hero --- */
  .hero {
    height: auto;
    min-height: calc(100vh - 42px);
    min-height: calc(100dvh - 42px);
    padding-top: 70px;
    padding-bottom: 0;
    overflow: visible;
  }

  .hero-content {
    margin-top: auto;
    margin-bottom: auto;
  }

  .hero-title {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
  }

  .hero-tagline {
    white-space: normal;
    font-size: 0.95rem;
  }

  .stats-bar {
    max-width: 100%;
    margin-top: 16px;
  }

  /* Three columns on a phone leave ~110px per tile, which the long labels
     can't hold on one line. Let them wrap instead of pushing the bar wide. */
  .stat-label {
    white-space: normal;
    font-size: 0.56rem;
    line-height: 1.3;
  }

  .hero-illustration {
    flex: 0 0 auto;
    max-height: none;
    min-height: 0;
  }

  .hero-illustration svg {
    width: 100%;
    height: auto;
    max-height: none;
  }

  /* --- Team Tabs: 2-3 per row wrapped pills so all sections visible at one glance --- */
  .team-tabs {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 6px;
    overflow-x: visible;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 12px;
  }

  .team-tab {
    padding: 6px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-fast);
  }

  .team-tab.active {
    background: rgba(0, 200, 83, 0.15);
    border-color: rgba(0, 200, 83, 0.4);
    color: var(--bull-green);
  }

  /* Tabs are filled pills at this width, so the underline has no job. */
  .team-tab::after {
    display: none;
  }

  /* --- Team Cards --- */
  .council-members-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }

  .group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .giant-photo-card {
    border-radius: 6px;
  }

  .giant-photo-overlay {
    padding: 24px 20px 18px;
  }

  .giant-photo-title {
    font-size: 1.2rem;
  }

  /* --- Events --- */
  .events-grid {
    grid-template-columns: 1fr;
  }

  .event-gallery {
    height: 240px;
  }

  /* --- Projects --- */
  .project-body {
    padding: 20px 8px 6px;
  }

  .project-card.featured .project-title {
    font-size: 1.32rem;
  }

  /* --- Research --- */
  .research-grid {
    grid-template-columns: 1fr;
  }

  .research-vertical {
    margin-top: 36px;
  }

  .research-vertical-count {
    display: none;
  }

  /* --- PDF Modal --- */
  .pdf-modal {
    padding: 16px;
  }

  /* --- Footer --- */
  .site-footer {
    padding: 40px 0 24px;
  }
}

/* ===== TABLET NAV (fits the full bar down to ~640) ===== */
@media (max-width: 900px) {
  .nav-links {
    gap: 24px;
    padding: 10px 22px;
  }

  .nav-links a {
    font-size: 0.8rem;
  }
}

/* ===== PHONE NAV (hamburger only below this) ===== */
@media (max-width: 640px) {
  /* --- Navbar --- */
  .navbar {
    pointer-events: auto;
  }

  .navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .nav-toggle {
    display: flex;
    pointer-events: auto;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    background: rgba(10, 15, 26, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    padding: 20px 24px;
    gap: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-accent);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    z-index: 1000;
  }

  .nav-links.open { display: flex; }

}

/* ===== MOBILE (≤480) ===== */
@media (max-width: 480px) {
  :root {
    --section-gap: 60px;
  }

  .container {
    padding: 0 16px;
  }

  /* --- Hero --- */
  .hero {
    height: auto;
    min-height: calc(100vh - 42px);
    min-height: calc(100dvh - 42px);
    padding-top: 64px;
    padding-bottom: 0;
    overflow: visible;
  }

  .hero-logo {
    width: clamp(80px, 22vw, 120px);
    margin: 0 auto 4px;
  }

  .hero-illustration {
    flex: 0 0 auto;
    max-height: none;
    min-height: 0;
  }

  .hero-illustration svg {
    width: 100%;
    height: auto;
    max-height: none;
  }

  /* --- Team Tabs --- */
  .team-tabs {
    gap: 6px 4px;
  }

  .team-tab {
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  /* --- Team Cards --- */
  .council-members-list {
    grid-template-columns: 1fr;
  }

  .group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-body {
    padding: 10px;
  }

  .card-name {
    font-size: 0.85rem;
  }

  .council-subgroup-title {
    padding: 0 16px;
  }

  /* --- Events --- */
  .event-gallery {
    height: 200px;
  }

  .event-body {
    padding: 18px;
  }

  .event-title {
    font-size: 1.05rem;
  }

  /* --- Research --- */
  .research-card {
    padding: 20px;
  }

  .research-vertical-tag {
    font-size: 0.7rem;
    letter-spacing: 1px;
    padding: 6px 11px;
  }

  /* --- PDF Modal --- */
  .pdf-modal {
    padding: 10px;
  }

  .pdf-modal-download span {
    display: none;
  }

  .pdf-modal-download {
    padding: 7px 9px;
  }

  /* --- Past Council --- */
  .council-members-list {
    padding: 12px 16px 16px;
  }

  .council-year-header {
    padding: 14px 18px;
    font-size: 0.9rem;
  }

  /* --- Footer --- */
  .site-footer {
    padding: 32px 0 20px;
  }
}
