/* mobile.css — Stage 1 iPhone safety + responsive hardening
   Loaded AFTER base.css, editorial.css, pages.css.
   Goal: eliminate horizontal overflow, respect iPhone notch/safe areas,
   give every tap target room to breathe, and keep large display type
   from blowing past the viewport on narrow screens. */

/* ============================================================
   1. GLOBAL SAFETY RAIL
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Respect iPhone notch / safe-area on landscape and home-bar pages */
body {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

img, video, iframe, svg, canvas, picture {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tables can blow out narrow viewports — let them scroll inside their wrapper */
table { max-width: 100%; }
pre, code { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

/* Long unbroken strings (URLs, emails) should wrap on mobile */
a, p, li, h1, h2, h3, h4, h5, h6, blockquote, cite, small, span, div { overflow-wrap: anywhere; word-break: break-word; }

/* Buttons and links: minimum 44x44 tap target */
.btn,
.btn-primary,
.btn-ghost,
.btn-download,
button[type="submit"],
.email-form button,
.product-cta-buttons a,
.ba-cta,
.lk-cta,
.ty-cta,
.bmhg-footer__social a,
.bmhg-cta-primary,
.bmhg-cta-secondary {
  min-height: 44px;
}

/* ============================================================
   2. MASTHEAD — wrap top strip + nav on small screens
   ============================================================ */
.masthead-top {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  text-align: center;
}
.masthead-nav {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

/* Department strip already wraps; ensure it doesn't crowd */
.departments-inner { row-gap: 0.75rem; }

/* ============================================================
   3. COVER / HERO — keep big display type inside the viewport
   ============================================================ */
.cover h2 {
  /* Slightly tame the upper bound so 60px+ heroes don't overflow 375px iPhones */
  font-size: clamp(2.25rem, 9vw, 5rem);
}
.masthead-name h1 {
  font-size: clamp(2.25rem, 11vw, 6rem);
}

/* Variant strip — make tappable and wrappable */
.variant-strip { flex-wrap: wrap; padding: 0.6rem 1rem; line-height: 1.5; }
.variant-strip a { display: inline-block; margin: 0.25rem 0 0.25rem 1rem; }

/* ============================================================
   4. GRIDS — collapse to single column earlier on iPhone
   ============================================================ */
@media (max-width: 768px) {
  .cover-grid,
  .feature-grid,
  .author-grid,
  .product-hero-grid,
  .prose-two-grid,
  .articles-lead-grid,
  .speaking-topics,
  .specs-grid,
  .page-head-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  .prose-side .label-block { position: static; }
  .feature-image,
  .author-image,
  .cover-image,
  .lead-image,
  .product-cover {
    max-width: 100%;
    margin-inline: auto;
  }
  .cover-image,
  .feature-image,
  .author-image {
    aspect-ratio: 16/11; /* shorter on mobile so the hero photo doesn't push CTAs off-screen */
  }
}

@media (max-width: 768px) {
  .chapter-list,
  .press-grid,
  .article-list,
  .stat-grid {
    grid-template-columns: 1fr !important;
  }
  .chapter, .press-card, .article-card, .stat { padding: 1.25rem; }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr !important;
  }
  .product { border-right: none !important; }
}

/* ============================================================
   5. COLOPHON / FOOTER
   ============================================================ */
@media (max-width: 768px) {
  .colophon-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 480px) {
  .colophon-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .colophon-bottom { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* ============================================================
   6. CONTAINERS — make sure padding never produces neg space
   ============================================================ */
@media (max-width: 480px) {
  .container, .container-wide, .container-narrow {
    padding-inline: 1rem;
  }
}

/* ============================================================
   7. EMAIL FORM stacking
   ============================================================ */
@media (max-width: 640px) {
  .email-form {
    flex-direction: column;
    max-width: 100%;
  }
  .email-form input,
  .email-form button {
    width: 100%;
    padding: 1rem;
  }
}

/* ============================================================
   8. PRODUCT HERO — bible cover scale
   ============================================================ */
@media (max-width: 768px) {
  .product-cover { padding: 1.5rem; max-width: 360px; margin-inline: auto; }
  .product-cover-num { font-size: clamp(3rem, 14vw, 5rem); }
}

/* ============================================================
   9. BREAKPOINT-SPECIFIC TYPE TAMING
   ============================================================ */
@media (max-width: 480px) {
  h1, h2 { letter-spacing: -0.02em; }
  .page-title { font-size: clamp(2rem, 9vw, 3rem); }
  .lead-headline { font-size: clamp(1.75rem, 8vw, 2.5rem); }
  .product-info h1 { font-size: clamp(1.75rem, 8vw, 2.5rem); }
  .cover h2 { font-size: clamp(2rem, 10vw, 3.25rem); line-height: 1.02; }
  .feature blockquote { font-size: clamp(1.25rem, 5vw, 1.75rem); }
  .stat-big { font-size: clamp(2.25rem, 11vw, 3rem); }
}

/* ============================================================
   10. ABSOLUTE/FIXED ELEMENTS — keep inside viewport
   ============================================================ */
.product-cover-stamp,
.product-cover-volume,
.cover-image-tag,
.lead-tag-overlay {
  max-width: calc(100% - 2rem);
}

/* ============================================================
   11. NEW PAGE STYLES (series, preview, article)
   ============================================================ */
.bible-series-hero {
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  text-align: center;
}
.bible-series-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 7vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: var(--space-5);
}
.bible-series-hero h1 .ital { font-style: italic; color: var(--brand-red); }
.bible-series-hero .dek {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 56ch;
  margin: 0 auto var(--space-6);
  line-height: 1.4;
}

.vol-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
  margin-block: clamp(2rem, 5vw, 4rem);
}
.vol-card {
  border: 1px solid var(--ink);
  background: var(--color-surface);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.vol-card.coming-soon { background: var(--color-surface-2); opacity: 0.92; }
.vol-card .vol-tag {
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-red);
  font-weight: 700;
}
.vol-card.coming-soon .vol-tag { color: var(--color-text-faint); }
.vol-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.vol-card h2 .ital { font-style: italic; color: var(--brand-red); }
.vol-card .vol-price {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--ink);
}
.vol-card .vol-desc { color: var(--color-text-muted); font-size: var(--text-base); line-height: 1.5; flex: 1; }
.vol-card .vol-cover {
  aspect-ratio: 3/4;
  border: 1px solid var(--color-border-strong);
  margin-bottom: var(--space-4);
}
.vol-card.bible .vol-cover { background: linear-gradient(160deg, #1A1814 0%, #2A1810 60%, #C8102E 100%); }
.vol-card.coming-soon .vol-cover { background: linear-gradient(160deg, #1A1814 0%, #3A2E10 60%, #C9A227 100%); opacity: 0.5; }

/* CTA buttons */
.bmhg-cta-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  background: var(--ink); color: var(--color-bg);
  font-size: var(--text-sm); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ink);
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.bmhg-cta-primary:hover { background: var(--brand-red); border-color: var(--brand-red); }
.bmhg-cta-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  background: transparent; color: var(--ink);
  font-size: var(--text-sm); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ink);
}
.bmhg-cta-secondary:hover { background: var(--ink); color: var(--color-bg); }

/* Article reader */
.bmhg-article {
  padding-block: clamp(3rem, 6vw, 5rem);
}
.bmhg-article-head {
  max-width: 720px;
  margin: 0 auto var(--space-10);
  text-align: left;
}
.bmhg-article-head .eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-red);
  font-weight: 700;
  margin-bottom: var(--space-4);
}
.bmhg-article-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin-bottom: var(--space-4);
}
.bmhg-article-head .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.35;
  margin-bottom: var(--space-6);
  max-width: 56ch;
}
.bmhg-article-head .byline {
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}
.bmhg-article-head .byline .author { color: var(--brand-red); }
.bmhg-article-body {
  max-width: 680px;
  margin: 0 auto;
  font-size: var(--text-base);
  line-height: 1.75;
}
.bmhg-article-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: var(--space-12);
  margin-bottom: var(--space-5);
}
.bmhg-article-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 500;
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}
.bmhg-article-body p { margin-bottom: var(--space-5); }
.bmhg-article-body p strong { color: var(--brand-red); font-weight: 600; }
.bmhg-article-body ul, .bmhg-article-body ol { margin: 0 0 var(--space-5) 1.5rem; }
.bmhg-article-body li { margin-bottom: var(--space-2); }
.bmhg-article-body blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  line-height: 1.4;
  border-left: 3px solid var(--brand-red);
  padding-left: var(--space-5);
  margin: var(--space-8) 0;
  color: var(--ink);
}
.bmhg-article-body hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-10) 0;
}
.bmhg-article-cta {
  max-width: 680px;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  padding: var(--space-8);
  background: var(--ink);
  color: var(--color-bg);
  text-align: center;
  border-left: 4px solid var(--brand-red);
}
.bmhg-article-cta h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  margin-bottom: var(--space-4);
  color: var(--color-bg);
}
.bmhg-article-cta p { color: rgba(245,241,232,0.85); margin-bottom: var(--space-5); }
.bmhg-article-cta .bmhg-cta-primary {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}
.bmhg-article-cta .bmhg-cta-primary:hover { background: var(--color-bg); color: var(--ink); }
.bmhg-article-back {
  max-width: 680px;
  margin: 0 auto var(--space-6);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}
.bmhg-article-back a { color: var(--brand-red); text-decoration: none; }
.bmhg-article-back a:hover { color: var(--ink); }

/* Preview page */
.preview-hero {
  padding-block: clamp(3rem, 6vw, 5rem);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.preview-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: var(--space-4);
}
.preview-hero h1 .ital { font-style: italic; color: var(--brand-red); }
.preview-hero .dek {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 56ch;
  margin: 0 auto;
}
.preview-toc {
  padding-block: clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--color-border);
}
.toc-list {
  list-style: none;
  border-top: 1px solid var(--ink);
  max-width: 760px;
  margin: 0 auto;
}
.toc-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  align-items: baseline;
}
.toc-list .num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--brand-red);
  font-size: var(--text-lg);
  min-width: 2.5rem;
}
.toc-list .title { font-size: var(--text-base); color: var(--ink); line-height: 1.3; }
.toc-list .title small { display: block; color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 2px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.preview-watermark {
  padding-block: clamp(2rem, 5vw, 4rem);
  background: var(--color-surface-2);
  border-block: 1px solid var(--ink);
  text-align: center;
}
.preview-watermark img {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  filter: blur(1.2px) saturate(0.8);
  opacity: 0.78;
  border: 1px solid var(--color-border-strong);
}
.preview-watermark .stamp {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brand-red);
  font-weight: 700;
}
.preview-cta-final {
  padding-block: clamp(4rem, 8vw, 6rem);
  text-align: center;
  background: var(--ink);
  color: var(--color-bg);
}
.preview-cta-final h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--space-5);
  max-width: 22ch;
  margin-inline: auto;
}
.preview-cta-final h2 em { color: var(--brand-red); font-style: italic; }
.preview-cta-final .bmhg-cta-primary {
  background: var(--brand-red); border-color: var(--brand-red); color: #fff;
}
.preview-cta-final .bmhg-cta-primary:hover { background: var(--color-bg); color: var(--ink); }

/* ============================================================
   12. BMHG SHARED FOOTER (Stage 1)
   ============================================================ */
.bmhg-footer {
  background: var(--ink);
  color: var(--color-bg);
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}
.bmhg-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.bmhg-footer__brand .bmhg-footer__logo {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-bg);
  text-decoration: none;
}
.bmhg-footer__brand .bmhg-footer__logo img { width: 36px; height: 36px; }
.bmhg-footer__brand .bmhg-footer__slogan {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-base);
  color: var(--brand-gold);
  margin-bottom: var(--space-4);
}
.bmhg-footer__brand p {
  color: rgba(245,241,232,0.6);
  font-size: var(--text-sm);
  line-height: 1.5;
  max-width: 30ch;
}
.bmhg-footer__col h4 {
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-gold);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.bmhg-footer__col ul {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
}
.bmhg-footer__col a {
  color: rgba(245,241,232,0.85);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color 200ms ease;
}
.bmhg-footer__col a:hover { color: var(--brand-red); }
.bmhg-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.bmhg-footer__social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid rgba(245,241,232,0.25);
  color: rgba(245,241,232,0.85);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.bmhg-footer__social a:hover { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }
.bmhg-footer__bottom {
  max-width: 1240px;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding: var(--space-5) clamp(1rem, 4vw, 2rem) 0;
  border-top: 1px solid rgba(245,241,232,0.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(245,241,232,0.55);
  letter-spacing: 0.06em;
}
.bmhg-footer__disclosure {
  max-width: 1240px;
  margin: var(--space-4) auto 0;
  padding-inline: clamp(1rem, 4vw, 2rem);
  font-size: 11px;
  color: rgba(245,241,232,0.45);
  letter-spacing: 0.04em;
  max-width: min(100%, 1240px);
}
@media (max-width: 920px) {
  .bmhg-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .bmhg-footer__inner { grid-template-columns: 1fr; }
  .bmhg-footer__bottom { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* Hide the OLD .colophon footer when the new shared footer is present */
body.bmhg-shared-footer .colophon { display: none; }
