/* ============================================================
   HORIZONTAL-OVERFLOW SAFETY NET
   ============================================================
   Applied to the content wrappers — never to html/body.
   `overflow-x: hidden` on html/body forces the other axis to compute to
   `auto`, turning the root into a scroll container; on iOS Safari that
   traps vertical scrolling. `clip` is used instead of `hidden` because it
   does NOT create a scroll container, so it can never trap scrolling and
   never breaks `position: sticky` (e.g. .bio-image-col on about.html).
   Wrapped in @supports so older browsers get no rule rather than a
   scroll-trapping `hidden` fallback. */
@supports (overflow-x: clip) {
  main,
  .footer {
    overflow-x: clip;
  }
}

.section {
  padding: var(--space-2xl) var(--space-sm);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* Page hero (short) */
.page-hero {
  height: 50vh;  /* fallback: browsers without svh support */
  height: 50svh; /* static small viewport — never resizes mid-scroll */
  min-height: 320px;
  background-color: var(--color-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--space-sm);
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-sage-dark) 0%, var(--color-sage) 100%);
  opacity: 0.9;
}

.page-hero-content {
  position: relative;
  z-index: 1;
  color: var(--color-white);
}

.page-hero-content h1 {
  color: var(--color-white);
  margin-bottom: var(--space-xs);
}

.breadcrumb {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-white);
}

/* Alt-row sections */
.alt-section {
  background-color: var(--color-white);
}

.alt-section:nth-child(even) {
  background-color: var(--color-offwhite);
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: var(--space-xl) var(--space-sm);
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
