/* Responsive layout for the State Landscape deck.
 *
 * reveal.js runs with disableLayout, so these rules size each slide to the
 * real viewport instead of scaling a fixed 1280x720 canvas. This file owns
 * sizing and spacing; _brand.scss owns colors and card styling.
 *
 *   Wide screens (900px and up): one screen per slide. The card grid fills
 *   the height below the headline, and type scales with the viewport.
 *   Card bodies scroll only as a last resort on very short screens.
 *
 *   Narrow screens (phones, portrait tablets): cards stack in one column at
 *   phone-readable sizes, and each slide scrolls vertically. reveal's own
 *   left/right swipe still moves between slides.
 */

:root {
  /* One type unit, tied to the smaller of width and height. */
  --wa-u: clamp(11.5px, min(1.05vw, 1.85vh), 21px);
}

/* ---- every screen ------------------------------------------------------ */

.reveal .slides > section.present.wa-deck,
.reveal .slides > section.present.wa-title {
  position: absolute;
  inset: 0;
  height: 100%;
  box-sizing: border-box;
}

.reveal .wcard { min-width: 0; min-height: 0; }

/* Title slide: content centered over the hero photo. */
.reveal .slides > section.present.wa-title {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 8vw;
}
.reveal section.wa-title h2 {
  font-size: clamp(32px, 4.6vw, 72px);
  line-height: 1.1;
  margin: 0 0 .35em;
}
.reveal section.wa-title p { font-size: clamp(16px, 1.5vw, 26px); }
.reveal section.wa-title .wa-meta { font-size: clamp(11px, .85vw, 15px); max-width: 70ch; }
.reveal .wtitle-lockup {
  height: clamp(34px, 4.2vw, 64px) !important;
  width: auto !important;
  align-self: flex-start; /* a flex column would otherwise stretch the logo */
}

/* ---- wide screens ------------------------------------------------------ */

@media (min-width: 900px) {
  .reveal .slides > section.present.wa-deck {
    display: flex !important;
    flex-direction: column;
    /* Side padding clears reveal's edge arrows; bottom clears the menu
       button and slide number. */
    padding: clamp(14px, 2.6vh, 34px) clamp(46px, 4vw, 72px) clamp(40px, 6vh, 64px);
  }
  .reveal section.wa-deck h2 {
    flex: 0 0 auto;
    font-size: calc(var(--wa-u) * 1.9);
    line-height: 1.15;
    margin: 0 0 calc(var(--wa-u) * .75);
  }
  .reveal .wgrid3,
  .reveal .wgrid2 {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    gap: calc(var(--wa-u) * 1.1);
  }
  .reveal .wcard-h { font-size: calc(var(--wa-u) * 1.05); }
  .reveal .wcard-b {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    margin-top: calc(var(--wa-u) * .5);
    padding: calc(var(--wa-u) * .7) calc(var(--wa-u) * .85);
  }
  .reveal .witem { font-size: var(--wa-u); line-height: 1.45; margin: 0 0 calc(var(--wa-u) * .65); }
  .reveal .wpill { font-size: calc(var(--wa-u) * .9); margin-top: calc(var(--wa-u) * .5); }
  .reveal .wkd { flex: 0 0 auto; font-size: calc(var(--wa-u) * .86); margin-top: calc(var(--wa-u) * .9); }
  .reveal .wtake { flex: 0 0 auto; font-size: calc(var(--wa-u) * .95); margin-top: calc(var(--wa-u) * .6); }
}

/* ---- narrow screens: phones and portrait tablets ----------------------- */

@media (max-width: 899.98px) {
  .reveal .slides > section.present.wa-deck {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* reveal sets touch-action: pinch-zoom on the deck. Each phone slide is a
       scroll container, which lets the browser pan it; pan-y keeps vertical
       drags as native scrolling and leaves horizontal swipes to reveal. */
    touch-action: pan-y pinch-zoom;
    padding: 16px 16px 88px;
  }
  .reveal section.wa-deck h2 {
    font-size: 22px;
    line-height: 1.2;
    margin: 4px 0 14px;
  }
  .reveal .wgrid3,
  .reveal .wgrid2 { grid-template-columns: 1fr; gap: 18px; }
  .reveal .wcard-h { font-size: 16px; }
  .reveal .wcard-b { max-height: none; overflow: visible; padding: 12px 14px; }
  .reveal .witem { font-size: 15px; line-height: 1.5; margin: 0 0 12px; }
  .reveal .wpill { font-size: 14px; }
  .reveal .wkd { font-size: 13.5px; margin-top: 16px; }
  .reveal .wtake { font-size: 14.5px; }
  .reveal .slides > section.present.wa-title { padding: 28px 22px; }
  /* A solid footer behind the menu button, slide number, and arrows, so
     scrolling text passes under them instead of colliding. Sits above the
     slides (z-index 1) and below reveal's controls (z-index 11 and up). */
  .reveal::after {
    content: "";
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 58px;
    background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0));
    z-index: 5;
    pointer-events: none;
  }
  .reveal.wa-title-active::after { display: none; }
}

/* ---- portrait tablets: two columns keep line length readable ------------ */

@media (min-width: 600px) and (max-width: 899.98px) {
  .reveal .wgrid3,
  .reveal .wgrid2 { grid-template-columns: 1fr 1fr !important; }
  .reveal .slides > section.present.wa-deck { padding: 22px 24px 88px; }
  .reveal section.wa-deck h2 { font-size: 26px; }
  .reveal .witem { font-size: 15.5px; }
}
