/* =========================================================
   PedagogyVentures — responsive patch
   Loaded AFTER the per-page inline <style>. Purpose:
   plug gaps across complex layouts so every page holds up
   from 1440 down to 320.
   ========================================================= */

/* ---------- GLOBAL SAFETY NETS ---------- */
html, body { max-width: 100%; }
body { overflow-x: hidden; }

/* Don't let long words or display type blow the viewport. */
.pv-display, .pv-h1, .pv-h2, .pv-h3, .pv-lede,
.flightmag-title, .expertise-title, .expertise-lede,
.phonetic-title, .faq-card-q,
.testimonial-quote {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Nowrap strings that commonly overflow on phones — release them. */
@media (max-width: 720px) {
  .flightmag-title,
  .flightmag-byline,
  .flightmag-folio > span,
  .ethics-cta-col,
  .expertise-title,
  .expertise-lede,
  .service-packed-v,
  .read-more,
  .cases-cta { white-space: normal; }
}

/* Images never blow out their box. */
img { max-width: 100%; height: auto; }

/* Container gutters shrink on small screens. */
@media (max-width: 640px) {
  :root { --gutter: 20px; }
}
@media (max-width: 400px) {
  :root { --gutter: 16px; }
}

/* ---------- NAV — mobile hamburger (CSS-only) ---------- */
/* The Nav component ships: <nav.pv-nav>
     <div.pv-nav-inner>
       <a.brand>...</a>
       <div.links>... <a.nav-cta/> </div>
     </div></nav>
   We inject a checkbox + hamburger label via ::before/::after
   we can't use because there's no checkbox in the DOM. Instead,
   we add a tiny script shim AND a :has() fallback — see below. */

/* Breakpoint where desktop links stop fitting. */
@media (max-width: 860px) {
  .pv-nav-inner { position: relative; }
  .pv-nav .brand img { height: 56px; }

  .pv-nav .links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 18px 28px rgba(14,18,38,0.08);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .pv-nav.is-open .links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .pv-nav .links a:not(.btn) {
    padding: 14px 4px;
    border-bottom: 1px dashed var(--rule);
    font-size: 16px;
    white-space: normal;
  }
  .pv-nav .links a:not(.btn)::after { display: none !important; }
  .pv-nav .links .nav-cta {
    margin-top: 14px;
    align-self: flex-start;
  }

  /* Hamburger button — added via JS shim below. */
  .pv-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    color: var(--ink);
  }
  .pv-nav-toggle svg { width: 20px; height: 20px; display: block; }
}
@media (min-width: 861px) {
  .pv-nav-toggle { display: none; }
}

/* ---------- FOOTER ---------- */
@media (max-width: 720px) {
  .footer-top { grid-template-columns: 1fr 1fr !important; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr !important; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---------- TRUSTED-LOGO STRIP ---------- */
@media (max-width: 720px) {
  .trusted-logos { grid-template-columns: repeat(3, 1fr) !important; gap: 28px 20px; }
  .trusted-logos img { max-height: 48px; }
}
@media (max-width: 420px) {
  .trusted-logos { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ---------- HERO (index) ---------- */
@media (max-width: 640px) {
  .pv-hero { padding: 72px 0 96px; }
  .pv-hero .pv-display { font-size: clamp(40px, 11vw, 64px); }
  .flight-itinerary {
    flex-direction: column;
    align-items: flex-start;
    white-space: normal;
  }
  .flight-itinerary > span { white-space: normal; }
}

/* ---------- IN-FLIGHT MAGAZINE (index) ---------- */
@media (max-width: 900px) {
  .ethics-strip { grid-template-columns: 1fr !important; gap: 32px; }
  .flightmag-stamp { position: static !important; margin-top: 12px; transform: rotate(-4deg); }
  .flightmag-title { font-size: clamp(22px, 6vw, 32px) !important; white-space: normal !important; }
}
@media (max-width: 640px) {
  .flightmag-board-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 4px 12px !important;
  }
  .flightmag-board-row > *:nth-child(4),
  .flightmag-board-row > *:nth-child(5) { display: none; }
  .flightmag-board-head > *:nth-child(4),
  .flightmag-board-head > *:nth-child(5) { display: none; }
}

/* ---------- PHONETIC-ALPHABET GRID (index) ---------- */
@media (max-width: 480px) {
  .phonetic-card { min-height: 0; padding: 20px 18px 24px; }
  .phonetic-letter { font-size: clamp(80px, 22vw, 120px); }
}

/* ---------- CASE ROWS (index) ---------- */
@media (max-width: 560px) {
  .case-photo-wrap, .case-row.flip .case-photo-wrap { transform: none; }
  .case-photo-wrap .paper-stamp { right: 8px; bottom: 8px; }
}

/* ---------- TICKET / BOARDING-PASS CTA ---------- */
@media (max-width: 720px) {
  .ticket { grid-template-columns: 1fr !important; }
  .ticket-main { padding: 40px 28px 32px; }
  .ticket-stub { padding: 36px 28px; border-left: none; border-top: 1px dashed var(--rule-ink); }
  .ticket::before { display: none; }
}

/* ---------- TESTIMONIALS ---------- */
@media (max-width: 720px) {
  .testimonial-grid { grid-template-columns: 1fr !important; gap: 28px; }
  .testimonial-card { padding: 32px 24px 28px; }
}

/* ---------- LUGGAGE TAG ---------- */
@media (max-width: 480px) {
  .luggage-tag { width: 100%; max-width: 320px; }
  .luggage-body { width: 100%; max-width: 300px; }
}

/* ---------- CLIENT-WORK / ABOUT / WORK-WITH-US shared ---------- */
@media (max-width: 900px) {
  .values-grid,
  .cap-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 560px) {
  .values-grid,
  .cap-grid,
  .contactopts-grid,
  .ways-grid { grid-template-columns: 1fr !important; }
  .clientprocess-grid { grid-template-columns: 1fr !important; }
}

/* ---------- TEAM / IMPACT / APPROACH ---------- */
@media (max-width: 520px) {
  .team-grid,
  .impact-grid,
  .approach-steps,
  .principles-grid { grid-template-columns: 1fr !important; }
}

/* ---------- BLUEPRINT (work-with-us) ---------- */
@media (max-width: 560px) {
  .blueprint { padding: 24px 18px 32px !important; }
  .blueprint-titleblock-row { flex-direction: column; }
  .blueprint-titleblock-row > .tb-v { border-right: none !important; border-bottom: 1px dashed var(--rule); }
}

/* ---------- FAQ ---------- */
@media (max-width: 560px) {
  .faq-card-q { font-size: 17px !important; line-height: 1.35; }
  .faq-card-summary { padding: 20px 18px !important; }
  .faq-reply { padding: 18px 16px 20px !important; }
}

/* ---------- CONTACT POSTCARD ---------- */
@media (max-width: 560px) {
  .postcard { padding: 28px 20px !important; }
  .postcard .form-row { grid-template-columns: 1fr !important; }
}

/* ---------- SERVICE PACKED ROWS (client-work) ---------- */
@media (max-width: 720px) {
  .service-packed-v { flex-wrap: wrap; }
}

/* ---------- PAGEHEADER / COLLAPSED ARTIFACTS ---------- */
@media (max-width: 720px) {
  .pageheader-artifact,
  .team-artifact,
  .approach-artifact,
  .media-artifact,
  .expect-artifact,
  .cap-artifact,
  .faq-artifact,
  .services-artifact,
  .impact-artifact,
  .cases-header-tag,
  .flightmag-stamp {
    margin-top: 20px;
  }
}

/* ---------- FLIGHT SEARCH (index hero) — tighten < 420px ---------- */
@media (max-width: 420px) {
  .flight-field { padding: 12px 14px; min-height: 64px; }
  .flight-field-value, .flight-field-input { font-size: 16px; }
  .flight-search-cta { min-height: 64px; font-size: 15px; }
}

/* ---------- READY CTA paper ticket ---------- */
@media (max-width: 520px) {
  .pv-readycta { padding: 80px 0; }
}

/* ---------- CTA row — allow stack ---------- */
@media (max-width: 480px) {
  .cta-row { gap: 10px; }
  .btn { font-size: 14px; padding: 12px 20px; }
  .btn-outline { padding: 10.5px 18.5px; }
}

/* =========================================================
   FIX 1 — CHARTER CERTIFICATES (index — OurProjects)
   Styles never made it into the page; this is the full look.
   ========================================================= */
.charters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.charter {
  position: relative;
  background: var(--paper, #fdfbf4);
  border: 1px solid var(--rule-ink, rgba(14,18,38,0.16));
  box-shadow:
    0 1px 0 rgba(14,18,38,0.04),
    0 18px 32px rgba(14,18,38,0.08);
  display: flex;
  flex-direction: column;
}
.charter::before,
.charter::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  height: 0;
  border-top: 1px dashed rgba(14,18,38,0.18);
  pointer-events: none;
}
.charter::before { top: 10px; }
.charter::after  { bottom: 10px; }
.charter-inner {
  padding: 40px 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
}
.charter-ornament-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--pv-green, #3d7068) 0 14px,
      transparent 14px 22px
    );
  opacity: 0.85;
}
.charter-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 4px;
}
.charter-monogram {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, Georgia, serif);
  font-size: 26px;
  font-weight: 500;
  font-style: italic;
  line-height: 1;
}
.charter-head-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.charter-eyebrow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pv-green, #3d7068);
  white-space: nowrap;
}
.charter-num {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted, #6a6f85);
  text-transform: uppercase;
  white-space: nowrap;
}
.charter-identity {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  align-items: center;
}
.charter-logo {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--rule, rgba(14,18,38,0.12));
  padding: 6px;
  overflow: hidden;
}
.charter-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.charter-identity-text { min-width: 0; }
.charter-name {
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500;
  font-size: clamp(22px, 2vw, 26px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--ink, #161a2c);
}
.charter-mission {
  font-style: italic;
  color: var(--pv-green-700, #2b5d56);
  font-size: 15px;
  line-height: 1.35;
  margin: 0;
}
.charter-rule {
  position: relative;
  text-align: center;
  height: 12px;
}
.charter-rule::before,
.charter-rule::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 14px);
  height: 1px;
  background: var(--rule-ink, rgba(14,18,38,0.2));
}
.charter-rule::before { left: 0; }
.charter-rule::after  { right: 0; }
.charter-rule span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pv-green, #3d7068);
  opacity: 0.7;
  vertical-align: middle;
}
.charter-body {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--fg-2, #3a3f55);
  text-wrap: pretty;
}
.charter-facts {
  margin: 0;
  padding-top: 18px;
  border-top: 1px dashed var(--rule-ink, rgba(14,18,38,0.2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: end;
}
.charter-facts > div { min-width: 0; }
.charter-facts dt {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted, #6a6f85);
  margin: 0 0 4px;
}
.charter-facts dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink, #161a2c);
  line-height: 1.3;
  font-weight: 500;
}
.charter-cta {
  grid-column: 1 / -1;
  margin-top: 6px;
  justify-self: start;
}

/* Charter responsive */
@media (max-width: 1000px) {
  .charters-grid { grid-template-columns: 1fr; gap: 32px; }
  .charter-inner { padding: 32px 28px 28px; }
}
@media (max-width: 560px) {
  .charter-inner { padding: 28px 22px 24px; gap: 18px; }
  .charter-head { gap: 14px; }
  .charter-monogram { width: 48px; height: 48px; font-size: 22px; }
  .charter-identity { grid-template-columns: 56px 1fr; gap: 14px; }
  .charter-logo { width: 56px; height: 56px; }
  .charter-facts { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 380px) {
  .charter-facts { grid-template-columns: 1fr; }
}

/* =========================================================
   FIX 2 — FOOTER FLIGHT PATHS
   SVG uses preserveAspectRatio="none" so on narrow widths
   the dashed path compresses into a nearly-straight squiggle.
   Hide the big map on tablet/phone; the footer reads fine without it.
   ========================================================= */
@media (max-width: 900px) {
  .footer-map { display: none !important; }
}

/* =========================================================
   FIX 3 — FEATURED-READ STAMP
   On tablet widths (721–1100) the stamp overlaps the masthead
   because the article column is too narrow. Keep it absolute
   but shrink + reposition so it tucks under the folio row.
   ========================================================= */
@media (min-width: 721px) and (max-width: 1100px) {
  .flightmag-stamp {
    top: auto !important;
    bottom: 8px !important;
    right: 0 !important;
    transform: rotate(-4deg) scale(0.9) !important;
    transform-origin: bottom right;
    z-index: 2;
  }
}
/* And on phones we already set position:static (responsive above),
   but make sure the rotate/margin looks intentional. */
@media (max-width: 720px) {
  .flightmag-stamp {
    align-self: flex-start;
    margin: 12px 0 0 !important;
    transform: rotate(-3deg) !important;
  }
}

/* =========================================================
   FIX 4 — WAYS TO FLY (work-with-us)
   WAYS has 4 items, rendered as full boarding-pass cards.
   Use 2×2 at desktop, stack on mobile. (Orig was 3-col which
   left the 4th card orphaned on its own row.)
   ========================================================= */
.ways-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 28px; }
.way-card-feature { transform: none !important; }
/* Stack earlier — 2-col packs the cards too tight on typical
   phone/small-tablet widths, clipping the CTA row. */
@media (max-width: 820px) {
  .ways-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .way-card { padding: 28px 24px 30px !important; }
  .way-card-title { font-size: 22px !important; }
  .way-card-cta { white-space: normal !important; word-break: break-word; }
}

/* =========================================================
   FIX — BOARDING PASS CARDS (work-with-us Engagements)
   .bpass-grid was 1fr 1fr with no responsive rule → at 720–800px
   the cards kept 2-col and internal fixed-width pieces (boarding
   pass logo, route arc, specs) overflowed past the card edges.
   Stack to 1-col well before phones, and tame fixed widths.
   ========================================================= */
@media (max-width: 900px) {
  .bpass-grid { grid-template-columns: 1fr !important; gap: 24px; }
  .bpass-main { padding: 22px 20px !important; }
  .bpass-route-arc, .bpass-route-arc svg { width: 100% !important; max-width: 180px; }
  .bpass-title { font-size: 22px !important; line-height: 1.2 !important; }
}
@media (max-width: 520px) {
  .bpass-main { padding: 20px 16px !important; }
  .bpass-route { grid-template-columns: 1fr auto 1fr !important; gap: 8px !important; }
  .bpass-route-val { font-size: 18px !important; }
  .bpass-route-arc { width: 60px !important; }
  .bpass-route-arc svg { width: 60px !important; }
  .bpass-specs { grid-template-columns: 1fr 1fr !important; gap: 12px 16px !important; }
  .bpass-title { font-size: 20px !important; }
  .bpass-stub { padding: 18px 10px !important; }
}

/* =========================================================
   FIX — NEWSPAPER CLIPPINGS (about page)
   .clipping-grid stops at 2-col (max-1100); at phone widths
   two clippings per row are too cramped. Stack to 1-col.
   ========================================================= */
@media (max-width: 640px) {
  .clipping-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* =========================================================
   FIX 5 — SCRAP-BOOK ROW (work-with-us "All projects")
   .allproject-row.flip gives the text column the narrow 1fr
   share, which crunches copy at tablet widths. Rebalance.
   ========================================================= */
@media (min-width: 901px) and (max-width: 1200px) {
  .allproject-row,
  .allproject-row.flip {
    grid-template-columns: 1fr 1fr !important;
    gap: 40px !important;
  }
}
@media (max-width: 900px) {
  /* Page already stacks to 1fr at 1100; make sure gap is calm */
  .allproject-row,
  .allproject-row.flip {
    gap: 32px !important;
  }
}
/* The pair label column (100px) is too wide a fraction on narrow text cols —
   let it shrink, and ultimately stack on mobile. */
@media (max-width: 1100px) {
  .allproject-pair { grid-template-columns: 88px 1fr; gap: 18px; }
}
@media (max-width: 520px) {
  .allproject-pair { grid-template-columns: 1fr; gap: 6px; padding: 14px 0; }
  .pair-label { padding-top: 0; }
}

/* Featured Read — center the book + caption when column stacks on mobile.
   .ethics-strip already gets text-align:center below 720; the book flex
   column still left-aligns its children, so explicitly center them. */
@media (max-width: 720px) {
  .flightmag-left { align-items: center; }
  .flightmag-book { align-items: center; }
  .flightmag-masthead { width: 100%; text-align: center; }
  .flightmag-caption { justify-content: center; text-align: center; }
  .flightmag-figtag { text-align: center; }
}

/* =========================================================
   FIX — SCRAP-BOOK ROWS (client-work)
   Issues on desktop:
   - Non-flip rows leave huge void on right of body (text
     floats in a 700px column but only fills half).
   - Flip rows leave an empty gap between photo (right) and
     body (left).
   Root cause: body column stretches to 1fr with no cap, and
   the flip's 300px photo col looks stranded.
   Fix: balance columns (photo col larger on flip, body col
   gets a tight-ish max-width so the pair line ends under the
   content, not off in dead space). Snap to single column on
   tablet + below.
   ========================================================= */
/* Grow flip's photo column so it doesn't look orphaned */
.scrap-page.flip {
  grid-template-columns: minmax(0, 1fr) 360px !important;
  gap: 56px !important;
}
/* Keep non-flip balanced too */
.scrap-page {
  grid-template-columns: 360px minmax(0, 1fr) !important;
}
/* Let the body breathe but not stretch to a useless width */
.scrap-page .scrap-body { max-width: 640px; }
.scrap-page.flip .scrap-body {
  max-width: 640px;
  margin-left: auto; /* hug the photo column on the right */
}
/* The pair's dashed line was going to the far edge of body;
   tighten it to end at the text block */
.scrap-pair-line { min-width: 0; }

/* Location bar alignment on flip: stick to the body's right
   edge (which is now capped) rather than the column's right */
.scrap-page.flip .scrap-locationbar { align-self: flex-start; }

/* Tablet: stack everything, photo on top */
@media (max-width: 1100px) {
  .scrap-page,
  .scrap-page.flip {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 32px 28px 32px !important;
  }
  .scrap-page .scrap-body,
  .scrap-page.flip .scrap-body {
    max-width: none;
    margin-left: 0;
  }
  .scrap-page.flip .scrap-photo-col { order: 0; align-items: flex-start; }
  .scrap-page.flip .scrap-body { order: 1; }
}
@media (max-width: 640px) {
  .scrap-page,
  .scrap-page.flip {
    padding: 28px 22px 28px !important;
    gap: 22px !important;
  }
}
