/* Journey Network — phone & tablet design. Loaded by the jn-mobile mu-plugin
   with media="(max-width: 1024px)", so desktop browsers never apply a single
   rule in this file: the desktop design stays exactly as it is.
   Pages carry heavy inline styles, hence the !important throughout.

   1. Layout fit (≤1024px)   2. Phone system (≤760px): header + menu, type,
   buttons, spacing, footer   3. Phone fixes per page. */

/* ── 1. Layout fit ────────────────────────────────────────────────────────
   Avada renders <body> as display:table + position:absolute, which
   shrink-wraps the page to its widest content; on a 390px phone the header
   nav pushed every page to 526–858px. Avada also adds 30px side padding to
   #main below its mobile breakpoint, on top of each page's own gutters. */
body {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
}
#boxed-wrapper, #wrapper, #main, #content, .fusion-row, .post-content, .jn-page {
  max-width: 100% !important;
  min-width: 0 !important;
}
#main {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.jn-page header > nav {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 760px) {

  /* ── 2a. Header: one 60px bar — logo · GIVE · menu ───────────────────── */
  .jn-page > div:not(.jn-grain):not([class])[style*="justify-content:space-between"] {
    padding: 7px 20px !important;
    font-size: 11px !important;
  }
  .jn-page header {
    padding: 0 12px 0 20px !important;
    height: 60px !important;
    min-height: 60px !important;
    flex-wrap: nowrap !important;
    column-gap: 10px !important;
  }
  .jn-page header > a:first-child img { height: 36px !important; }
  .jn-page header > nav { display: none !important; }
  .jn-page header > div {
    margin-left: auto !important;
    gap: 6px !important;
  }
  .jn-page header > div > a:not(.jn-btn-solid) { display: none !important; }
  .jn-page header .jn-btn-solid {
    padding: 9px 16px !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }
  .jnm-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .jnm-btn svg { display: block; }

  /* Menu sheet (built by jn-mobile.js) */
  .jnm-sheet {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex !important;
    flex-direction: column;
    background: #071631;
    color: #fff;
    padding: 0 20px calc(28px + env(safe-area-inset-bottom));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility 0s linear .2s;
  }
  .jnm-sheet.is-open { opacity: 1; visibility: visible; transition: opacity .2s ease; }
  .jnm-sheet.is-j3 { background: #0a1420; }
  .jnm-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    flex: none;
    margin-right: -8px;
  }
  .jnm-top img { height: 36px; width: auto; filter: brightness(0) invert(1); }
  .jnm-links { display: flex; flex-direction: column; margin-top: 12px; }
  .jnm-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
    font-family: 'Schibsted Grotesk', 'Libre Franklin', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #fff !important;
    text-decoration: none !important;
  }
  .jnm-links a::after { content: "→"; font-size: 18px; color: rgba(255,255,255,.4); }
  .jnm-links a[aria-current="page"] { color: #8fd8ff !important; }
  .jnm-sub { display: flex; gap: 10px; margin-top: 22px; }
  .jnm-sub a {
    flex: 1;
    text-align: center;
    padding: 13px 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
  }
  .jnm-give {
    display: block;
    margin-top: 12px;
    padding: 16px 0;
    border-radius: 999px;
    background: #fff;
    color: #071631 !important;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .04em;
    text-decoration: none !important;
  }
  .jnm-foot { margin-top: auto; padding-top: 28px; font-size: 14px; line-height: 1.7; color: rgba(255,255,255,.6); }
  .jnm-foot a { color: #fff !important; font-weight: 600; text-decoration: none !important; }
  html.jnm-lock, html.jnm-lock body { overflow: hidden !important; }

  /* ── 2b. Type: one scale on every Journey page ───────────────────────── */
  .jn-page main:not(.j3t) h1 {
    font-size: 40px !important;
    line-height: 1.06 !important;
    letter-spacing: -.02em !important;
  }
  .jn-page main:not(.j3t) h2 {
    font-size: 30px !important;
    line-height: 1.12 !important;
    letter-spacing: -.015em !important;
  }

  /* Heroes read left-aligned, like the rest of each page */
  .jnw-mo, .ab-hero, .jnx-hero, .jno-hero, .st-hero, .jw-close, .ab-close {
    text-align: left !important;
  }
  .jnw-mo-copy { text-align: left !important; align-items: flex-start !important; padding: 72px 20px 64px !important; }
  .jnw-mo { min-height: 0 !important; }
  .jnw-mo h1, .jnw-mo p, .ab-hero h1, .ab-hero p, .jnx-hero h1, .jnx-hero p,
  .jno-hero h1, .jno-hero p, .st-hero h1, .st-hero p {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* ── 2c. Buttons: one shape — 52px pill ──────────────────────────────── */
  .jn-page main:not(.j3t) :is(.hx-btn, .jnw-mo-btn, .jw-pill, .ab-pill, .cel-pill, .bk-btn, .st-btn, .jnw-now-btn, .jn-btn-solid) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    min-height: 52px !important;
    height: auto !important;
    padding: 0 26px !important;
    border-radius: 999px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    box-sizing: border-box !important;
  }
  /* Hero calls-to-action stack full width */
  .hx-btns, .bk-hero-btns { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  .jnx-hero > div[style*="display:flex"] { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  .jnx-hero > div[style*="display:flex"] > a { width: 100% !important; }
  .hx-btns > a, .bk-hero-btns > a, .jnw-mo .jnw-mo-btn, .cel-hero .cel-pill { width: 100% !important; }

  /* ── 2d. Footer ──────────────────────────────────────────────────────── */
  .jn-page > footer { padding: 40px 20px 28px !important; }
  .jn-page > footer > div[style*="position:absolute"] { opacity: .35; }
  .jn-page > footer > div[style*="grid-template-columns"] {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
    gap: 28px 16px !important;
    padding-bottom: 28px !important;
  }
  .jn-page > footer > div[style*="grid-template-columns"] > div:first-child { grid-column: 1 / -1; }
  .jn-page > footer > div[style*="grid-template-columns"] > div:empty { display: none; }
  .jn-page > footer > div:last-child[style*="justify-content:space-between"] { flex-direction: column; align-items: flex-start !important; }

  /* "On now" card under the dark heroes: sit in the flow instead of
     overlapping the next section (it's much taller on a phone) */
  .jnh-bar-wrap { height: auto !important; padding: 0 16px !important; margin-top: -56px !important; }
  .jnh-bar { transform: none !important; }
  .jnx-hero, .jno-hero { padding-bottom: 88px !important; }
  .jw-stats { padding-top: 56px !important; }

  /* One vertical rhythm: oversized desktop section gaps come down */
  .bk-statement, .st-statement { padding-top: 72px !important; padding-bottom: 56px !important; }
  .bk-form-sec, .st-shop, .cel-about, .st-gift { padding-top: 56px !important; }
  .j3t-ways, .jw-close, .bk-final, .st-final, .ab-close, .cel-updates { padding-top: 64px !important; padding-bottom: 64px !important; }

  /* Mailchimp's floating "VIP perks" tab covers content on a phone */
  #mc_embed_signup, .mc-banner, .mc-modal, div[id^="PopupSignupForm"], .mcjs-tab, [class*="mc-tab"] { display: none !important; }

  /* ── 3. Per page ─────────────────────────────────────────────────────── */

  /* Home */
  .hx-hero h1 { font-size: 42px !important; }
  .hx-ep-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; gap: 22px 14px !important; }
  .hx-ep-row > :nth-child(n+5) { display: none !important; }
  .hx-watch-row { grid-template-columns: minmax(0,1fr) !important; gap: 10px !important; }
  .hx-watch-row > * { min-height: 0 !important; height: auto !important; padding: 16px 20px !important; }
  .hx-watch-row > * > * { margin-top: 0 !important; }
  .hx-two { grid-template-columns: minmax(0,1fr) !important; }
  .hx-book { grid-template-columns: minmax(0,1fr) !important; gap: 28px !important; padding-top: 56px !important; padding-bottom: 56px !important; }
  .hx-book img { width: 100% !important; height: auto !important; }

  /* Watch Live: schedule table — drop the category column */
  table.jn-table th:nth-child(3), table.jn-table td:nth-child(3) { display: none !important; }
  table.jn-table td, table.jn-table th { padding: 14px 12px !important; }

  /* Schedule: one day at a time (day picker added by jn-mobile.js) */
  .jn-reveal { padding-left: 20px !important; padding-right: 20px !important; }
  table.jn-sched { min-width: 0 !important; }
  table.jn-sched.jnm-day th:not(.time-col):not(.jnm-col),
  table.jn-sched.jnm-day td:not(.time-col):not(.jnm-col) { display: none !important; }
  table.jn-sched td, table.jn-sched th { white-space: normal !important; }
  table.jn-sched .time-col { white-space: nowrap !important; width: 86px; }
  .jnm-days {
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    margin: 0 0 14px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .jnm-days::-webkit-scrollbar { display: none; }
  .jnm-days button {
    flex: none;
    min-width: 48px;
    padding: 10px 12px;
    border: 1px solid rgba(14,26,47,.16);
    border-radius: 999px;
    background: #fff;
    color: #0e1a2f;
    font: 700 14px 'Libre Franklin', sans-serif;
  }
  .jnm-days button.on { background: #0e1a2f; border-color: #0e1a2f; color: #fff; }

  /* Book JT: event-type chips wrap instead of running off the edge */
  .bk-bar, .bk-bar > * { flex-wrap: wrap !important; overflow: visible !important; }
  .bk-chip { padding: 10px 12px !important; font-size: 12px !important; }

  /* On-Demand: 4-across episode grids become 2-across */
  .jn-reveal div[style*="repeat(4,minmax(0,1fr))"] { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; gap: 14px !important; }
  .jn-reveal div[style*="align-items:baseline"] { flex-wrap: wrap !important; gap: 6px 16px; }

  /* Prayer: the hero grows to fit its text so the form card doesn't cover it */
  .pr-hero { height: auto !important; padding-bottom: 150px !important; }
  .pr-hero-copy { padding: 44px 20px 0 !important; }
  .jn-page main .pr-hero h1 { font-size: 60px !important; line-height: .95 !important; }

  /* J3 Radio: the show collages become a tidy 2×2 grid */
  .j3t-collage {
    height: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 10px;
  }
  .j3t-ct {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    transform: none !important;
  }
  .j3t-ct:nth-child(n+5) { display: none !important; }
  .j3t-ct img { width: 100% !important; height: 100% !important; object-fit: cover; }
  .j3t-group { margin-bottom: 48px !important; }
}
