/* ============================================================
   Grace Valley Church — global mobile polish (injected at build
   time into every page by .eleventy.js — see addTransform).
   v2: real-phone hero fit (svh), swipe rails contained, menu
   quick-links, service strip stacking, staff rail, photo edge
   trims.
   ============================================================ */

/* ---------- all screen sizes ---------- */

/* About page pastor portrait: crop a hair past the frame so no
   edge artifact from the source photo can ever show. */
.pastor-photo { overflow: hidden; }
.pastor-photo img {
  width: calc(100% + 16px) !important;
  height: calc(100% + 16px) !important;
  max-width: none;
  margin: -8px;
  object-fit: cover;
}

/* Staff circles: zoom photos 6% inside the circle so edge slivers
   are cropped away — every circle reads clean like Tonilee's. */
.member .ph img { transform: scale(1.06); }

/* Menu quick links (injected row) — hidden on desktop, where the
   top tabs already show all six pages. */
.mo-quick { display: none; }

/* App phone mockup: keep "10:30 AM" on one line in the Sunday tile */
.sun .st span { white-space: nowrap; }

/* ---------- phones & small tablets ---------- */
@media (max-width: 680px) {

  /* never allow sideways page scroll */
  html, body { overflow-x: hidden; }
  .wrap { padding-left: 22px; padding-right: 22px; min-width: 0; }

  /* ----- homepage hero: fit the real phone screen ----- */
  .hero { min-height: 100vh; }
  @supports (height: 100svh) {
    .hero { min-height: 100svh !important; }
  }
  .hero-content { padding-top: 92px; padding-bottom: 7svh; }
  .hero h1 { font-size: clamp(2.4rem, 11.5vw, 3.6rem); }
  .hero-rule { margin: 1.6rem 0 1.3rem; }
  .hero-actions { gap: .7rem; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; padding: .95rem 1.4rem; }

  /* remove the rotating "scroll" cue on phones */
  .scrollcue { display: none !important; }

  /* ----- service strip: stack neatly, no overlap ----- */
  .svc-strip .wrap {
    flex-direction: column;
    gap: .3rem;
    padding: .9rem 22px;
    text-align: center;
    line-height: 1.5;
  }
  .svc-strip .dot { display: none; }

  /* ----- swipeable card rails ----- */
  .belief-grid, .ex-grid, .ages, .nsgrid, .fam-grid,
  .ry-grid, .ev-grid, .msg-grid, .g2-ways,
  .why-grid, .serv-grid, .tgrid {
    display: flex !important;
    grid-template-columns: none !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 4px 4px 18px;
    scrollbar-width: none;
  }
  .belief-grid::-webkit-scrollbar, .ex-grid::-webkit-scrollbar,
  .ages::-webkit-scrollbar, .nsgrid::-webkit-scrollbar,
  .fam-grid::-webkit-scrollbar, .ry-grid::-webkit-scrollbar,
  .ev-grid::-webkit-scrollbar, .msg-grid::-webkit-scrollbar,
  .g2-ways::-webkit-scrollbar, .why-grid::-webkit-scrollbar,
  .serv-grid::-webkit-scrollbar, .tgrid::-webkit-scrollbar {
    display: none;
  }

  .belief-grid > *, .ex-grid > *, .nsgrid > *, .fam-grid > *,
  .ry-grid > *, .ev-grid > *, .msg-grid > *, .g2-ways > *,
  .why-grid > *, .serv-grid > * {
    flex: 0 0 80%;
    max-width: 330px;
    min-width: 0;
    height: auto;
    scroll-snap-align: start;
  }

  /* sections that hold rails must not stretch the page */
  .kids, .around { overflow-x: clip; }

  /* ----- meet the team: tidy swipe rail ----- */
  .tgrid > * {
    flex: 0 0 56%;
    max-width: 230px;
    min-width: 0;
    scroll-snap-align: center;
    text-align: center;
  }
  .member .ph { width: 150px; height: 150px; margin: 0 auto 14px; }
  .member h3 { font-size: 1.02rem; }

  /* ----- mobile menu: SAME six tabs as desktop, nothing else ----- */
  .mo-quick {
    display: block;
    padding: 4px 0 28px;
  }
  .mo-quick a {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: .01em;
    padding: .9rem 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* the two secondary pages sit below the six main tabs, slightly smaller */
  .mo-quick a:nth-child(n+7) { font-size: 1.05rem; opacity: .92; }
  .mo-quick a:active { color: #E9A23B; }
  /* secondary pages under a small "More" label */
  .mo-quick-label {
    display: block;
    color: #E9A23B;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
    padding: 18px 2px 6px;
  }
  .mo-quick a:nth-of-type(n+7) { font-size: 1.05rem; opacity: .92; }
  /* search stays (it also reveals the detailed link groups while typing);
     hide only the duplicating button row. The link columns are hidden until
     a search is typed — the injected script toggles them. */
  .mo-search { max-width: 100%; margin: 4px 0 18px; }
  .mo-cols { display: none; grid-template-columns: 1fr !important; gap: 16px; padding-bottom: 8px; border-bottom: 0; }
  .mo-col a { opacity: 1; transform: none; padding: .35rem 0; }
  .mo-actions { display: none !important; }
  .mo-body { padding: 10px 26px 44px; }
  .mo-info { gap: 8px 20px; font-size: .82rem; }

  /* chips rows scroll sideways in one line */
  .chips {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 10px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chips > * { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }

  /* visit page reassure chips: wrap centered */
  .reassure { flex-wrap: wrap; justify-content: center; gap: 10px; }

  /* counseling page hero: its own .wrap zeroes side padding — restore it
     and center the hero on phones (desktop unchanged) */
  .gcc-hero .wrap {
    padding: 5.5rem 22px 3rem !important;
    text-align: center;
  }
  .gcc-hero .btn { justify-content: center; }

  /* visit page kids section: collapse any side-by-side layout so text
     wraps instead of clipping at the screen edge */
  .kids .wrap > *, .kids [class*="grid"] {
    max-width: 100%;
    min-width: 0;
  }
  .kids h2, .kids p { overflow-wrap: break-word; }

  /* keep images tidy inside rail cards */
  .belief-grid img, .nsgrid img, .fam-grid img, .ev-grid img,
  .msg-grid img { width: 100%; height: auto; }
}

/* extra-small phones: slightly wider cards */
@media (max-width: 400px) {
  .belief-grid > *, .ex-grid > *, .nsgrid > *, .fam-grid > *,
  .ry-grid > *, .ev-grid > *, .msg-grid > *, .g2-ways > *,
  .why-grid > *, .serv-grid > * {
    flex-basis: 86%;
  }
  .tgrid > * { flex-basis: 62%; }
}
