/* Layout system: shared rules that keep sections balanced across the site.
   Loaded after the base stylesheet on every page. */

/* Two-column splits: equal columns, one image shape, text centred against the image */
.split > img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.split > div > :first-child { margin-top: 0; }
.split > div > :last-child { margin-bottom: 0; }
@media (min-width: 800px) {
  .split, .split.flip { grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
}

/* Two balanced columns of content (text + panel, details + form) */
.duo { display: grid; gap: 2rem; }
.duo > * { min-width: 0; }
.duo > * > :first-child { margin-top: 0; }
.duo > * > :last-child { margin-bottom: 0; }
@media (min-width: 900px) {
  .duo { grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: start; }
  .duo.center { align-items: center; }
  .sticky-col { position: sticky; top: 6.5rem; }
}

/* A bordered surface for forms, tables and calls to action */
.panel { background: var(--paper); border: 1px solid var(--line); padding: 1.5rem 1.5rem 1.75rem; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel h2, .panel h3 { font-size: clamp(1.45rem, 2.2vw, 1.85rem); margin: 0 0 .6rem; }
.band .panel { background: var(--sand); }
.forest-band .panel { background: #1c433a; border-color: #2c5b50; color: #f6f1e8; }
.panel .facts { margin-bottom: 1rem; }
.panel form.plain { max-width: none; }

/* Tiles: an even grid of panels */
.tiles { display: grid; gap: 1rem; }
@media (min-width: 700px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* Card grids with fixed column counts, so every row fills */
@media (min-width: 700px) {
  .cards.c3, .cards.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.span2, .card.full { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card.span2 { grid-column: span 2; }
  .card.full { grid-column: 1 / -1; }
}
@media (min-width: 700px) {
  .card.span2, .card.full { flex-direction: row; }
  .card.span2 > img, .card.full > img { width: 50%; aspect-ratio: auto; height: auto; min-height: 100%; object-fit: cover; }
  .card.span2 .card-body, .card.full .card-body { justify-content: center; padding: 1.5rem 1.75rem; }
  .card.span2 .card-body p, .card.full .card-body p { flex: 0 0 auto; }
}

/* Quest pages: description beside a details column that holds the booking button */
.quest-layout { display: grid; gap: 2rem; }
.quest-main { max-width: 44rem; }
.quest-main > :first-child { margin-top: 0; }
.quest-aside > :first-child { margin-top: 0; }
.quest-aside .facts th { width: 44%; }
.quest-aside .btn { width: 100%; }
@media (min-width: 900px) {
  .quest-layout { grid-template-columns: minmax(0, 1fr) 23rem; gap: 4rem; align-items: start; }
  .quest-main { grid-column: 1; grid-row: 1; }
  .quest-aside { grid-column: 2; grid-row: 1; position: sticky; top: 6.5rem; }
}
.quest-main .split { grid-template-columns: 1fr; gap: 1.25rem; }
.quest-main .split > img { aspect-ratio: 16 / 9; }

/* Section heads line up with the content edge below them */
.section-head > :last-child { margin-bottom: 0; }
.wrap > .section-head + .duo,
.wrap > .section-head + .tiles { margin-top: 2rem; }

/* Partner logos inside a panel */
.panel .partners { margin-top: 1rem; }

/* Space between a card grid and the two columns that follow it */
.cards + .duo { margin-top: 3.5rem; }


/* Homepage split hero: mission text beside a land-and-ocean photo grid.
   Overrides the old full-bleed video/photo hero in the base stylesheet. */
.home-hero.home-hero-split {
  position: relative;
  display: block;
  min-height: 0;
  background: var(--sand);
  color: var(--ink);
  overflow: visible;
  align-items: stretch;
}
.home-hero-split-inner {
  display: grid;
  gap: 1.5rem;
  padding: 1.15rem 0 1.5rem;
}
.home-hero.home-hero-split .home-hero-copy {
  position: static;
  z-index: auto;
  padding: 0;
  max-width: 36rem;
}
.home-hero.home-hero-split .kicker {
  color: var(--clay);
}
.home-hero.home-hero-split h1 {
  color: var(--ink);
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  margin: 0 0 .7rem;
}
.home-hero.home-hero-split .mission-statement {
  color: var(--ink);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.45;
  margin-bottom: .7rem;
}
.home-hero.home-hero-split .support {
  color: var(--muted);
  font-size: 1rem;
  max-width: none;
}
.home-hero.home-hero-split .actions {
  margin-top: 1.1rem;
}
.home-hero.home-hero-split .btn {
  background: var(--forest);
  color: #f6f1e7;
  border-color: var(--forest);
}
.home-hero.home-hero-split .btn:hover {
  background: #24564a;
  color: #fff;
}
.home-hero.home-hero-split .btn.ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.home-hero.home-hero-split .btn.ghost:hover {
  background: #1a3c3414;
  color: var(--forest);
}
.home-hero.home-hero-split :focus-visible {
  outline-color: var(--forest);
}
.home-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .4rem;
}
.home-hero-cell {
  margin: 0;
  overflow: hidden;
  background: #1a3c34;
  aspect-ratio: 1 / 1;
}
.home-hero-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-hero-cell-ocean img { object-position: 40% 62%; }
.home-hero-cell-land img { object-position: 48% 42%; }
.home-hero-cell-loi img { object-position: 50% 45%; }

@media (min-width: 800px) {
  .home-hero-split-inner {
    grid-template-columns: minmax(18rem, .92fr) 1.2fr;
    gap: 2.25rem;
    align-items: stretch;
    padding: 2.25rem 0 2.75rem;
    min-height: calc(100svh - 8.75rem);
  }
  .home-hero.home-hero-split .home-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .home-hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.15fr 1fr;
    gap: .65rem;
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .home-hero-cell-ocean {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    min-height: 0;
    height: 100%;
  }
  .home-hero-cell-land,
  .home-hero-cell-loi {
    aspect-ratio: auto;
    min-height: 0;
    height: 100%;
  }
}

.home-hero-cell picture {
  width: 100%;
  height: 100%;
  display: block;
}
/* Keep the YouTube poster filling its frame when wrapped in picture */
.yt-frame picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.home-hero-mobile-media {
  display: none;
}

@media (max-width: 799px) {
  .home-hero.home-hero-split {
    min-height: 0;
  }
  .home-hero.home-hero-split .home-hero-copy {
    display: flex;
    flex-direction: column;
  }
  .home-hero.home-hero-split .kicker { order: 1; }
  .home-hero.home-hero-split h1 { order: 2; }
  .home-hero.home-hero-split .actions {
    order: 3;
    margin-top: .85rem;
    margin-bottom: 0;
  }
  .home-hero-mobile-media {
    display: block;
    order: 4;
    width: 100%;
    margin: 1rem 0 1.1rem;
  }
  .home-hero-mobile-media .yt {
    margin: 0;
  }
  .home-hero.home-hero-split .mission-statement {
    order: 5;
    margin-top: 0;
    margin-bottom: .55rem;
  }
  .home-hero.home-hero-split .support {
    order: 6;
    font-size: .95rem;
    margin-bottom: 0;
  }
  .home-hero-grid {
    display: none;
  }
  .home-hero-split-inner {
    padding: 1rem 0 1.35rem;
  }
  .home-hero.home-hero-split h1 {
    font-size: clamp(1.7rem, 8vw, 2.1rem);
  }
  /* Same film is offered in the mobile hero; don't show it again underneath. */
  .home-yt-section {
    display: none;
  }
}

/* Donorbox web-component widget (dbox-widget). It sizes itself and
   adjusts its own height, so the wrapper only caps the width and reserves
   space while the script loads to avoid a layout jump. */
.donate-widget {
  width: 100%;
  max-width: 520px;
  min-height: 560px;
  margin-top: 1rem;
}
.donate-widget dbox-widget {
  display: block;
  width: 100%;
}

/* Donate page: GivingTuesday layout. Uses existing tokens and components. */
.gt-hero { padding-top: 2rem; }
.gt-hero h1 { font-weight: 600; }
.gt-goal { font-weight: 700; color: var(--forest); margin: .25rem 0 0; }
.gt-org { font-size: .95rem; color: var(--muted); }
.gt-form-col h2 { margin-top: 0; scroll-margin-top: 6rem; }
.gt-fallback { font-size: .92rem; color: var(--muted); max-width: 520px; }
.gt-why img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.gt-why h2, .section-head h2, #how-to-give h2 { font-weight: 600; }
.gt-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gt-cards .card img { aspect-ratio: 4 / 3; }
.gt-num { flex: 0 0 auto !important; margin: 0; font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--clay); letter-spacing: .08em; }
.gt-statement p { margin: 0 auto; max-width: 46rem; text-align: center; font-family: var(--serif); font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.35; }
.gt-amounts { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; max-width: 30rem; }
.gt-amounts a { display: flex; align-items: center; justify-content: center; min-height: 56px; background: var(--forest); color: #f6f1e7; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; text-decoration: none; }
.gt-amounts a:hover, .gt-amounts a:focus-visible { background: #24564a; color: #fff; }
.gt-share .btn { margin-top: .6rem; }
.gt-share-btn.btn.ghost { background: transparent; color: var(--forest); }
.gt-share-btn.btn.ghost:hover { background: var(--forest); color: #f6f1e7; }
.gt-seed-photo { margin: 0 0 1.5rem; }
.gt-seed-photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 60%; }
/* Phones and tablets (below the .duo 900px breakpoint): show the Donorbox form
   right after the hero body, before the goal and EIN lines. The hero copy
   column's children join the grid so they can be reordered around the single
   form column (no duplicate widget). Desktop is unchanged. */
@media (max-width: 899px) {
  .gt-hero .duo { display: flex; flex-direction: column; gap: 0; }
  .gt-hero .gt-hero-copy { display: contents; }
  .gt-hero .gt-hero-copy > .kicker { order: 1; }
  .gt-hero .gt-hero-copy > h1 { order: 2; }
  .gt-hero .gt-hero-copy > .lede { order: 3; margin-bottom: 1.25rem; }
  .gt-hero .gt-form-col { order: 4; margin-bottom: 1.25rem; }
  .gt-hero .gt-hero-copy > .gt-goal { order: 5; }
  .gt-hero .gt-hero-copy > .gt-org { order: 6; margin-bottom: 0; }
  .gt-hero .gt-hero-copy > .gt-photo-group { order: 7; margin-top: 1.5rem; }
  .gt-hero .gt-form-col .donate-widget { margin-top: 0; }
  /* The heading is redundant here; keep it for screen readers as the form label. */
  .gt-hero .gt-form-col > h2 {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
}

/* Donorbox goal meter above the form; match the rendered form width (Donorbox caps it at 425px). */
.donate-meter { width: 100%; max-width: 425px; margin: 0 0 .75rem; }
.donate-meter iframe { display: block; width: 100%; max-width: 100% !important; border: 0; }
@media (max-width: 899px) {
  .gt-hero .gt-form-col .donate-meter { margin-top: 0; }
}

/* Donate hero photo group: reuses the homepage collage cells
   (.home-hero-grid / .home-hero-cell). Canoe across the top, planting and
   loʻi below. Sized by aspect ratio here, not by the homepage hero height. */
.home-hero-grid.gt-photo-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: .5rem;
  height: auto;
  margin-top: 1.5rem;
}
.gt-photo-group .home-hero-cell { height: auto; aspect-ratio: 1 / 1; }
.gt-photo-group .home-hero-cell-canoe { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gt-photo-group .home-hero-cell-canoe img { object-position: 50% 60%; }
@media (min-width: 900px) {
  .gt-photo-group .home-hero-cell { aspect-ratio: 4 / 3; }
  .gt-photo-group .home-hero-cell-canoe { aspect-ratio: 16 / 9; }
}
