/*
 * app.christchurchmiami.org — base theme
 * --------------------------------------
 * Extracted from the live christchurchmiami.org Snappages theme on 2026-05-07.
 * This is a starter — visually faithful enough to feel native, but mine to own.
 * Refactor freely. The sermon-page layout (sub-nav + hero + content) is defined
 * here; Snappages-only blocks (sp-section, sp-grid) are NOT replicated.
 *
 * Brand reference: see CLAUDE.md and `christchurch-brand-voice-profile.md`.
 *   Primary: black (#000) + white (#fff)
 *   Accent:  brand gold (#b58f3c)
 *   Display font: Amatic SC, 400/700 (logo + occasional display)
 *   Body font:    Lato, 400/700/900 (everything else)
 */

/* ---------- Tokens ---------- */
:root {
  --ccm-black: #000;
  --ccm-white: #fff;
  --ccm-gold: #b58f3c;            /* brand accent */
  --ccm-gold-soft: rgba(181, 143, 60, 0.12);
  --ccm-gold-strong: #9c7a30;     /* hover/active */
  --ccm-grey-100: #f5f4f1;
  --ccm-grey-200: #e8e5e0;
  --ccm-grey-500: #888;
  --ccm-grey-800: #222;
  --ccm-blue-secondary: #2596C9;  /* page-section accent (per brand book) */

  --ccm-font-display: "Amatic SC", "Arial Black", sans-serif;
  --ccm-font-body: "Lato", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --ccm-radius-sm: 4px;
  --ccm-radius-md: 8px;
  --ccm-radius-lg: 16px;

  --ccm-maxw: 1200px;
  --ccm-gutter: 24px;

  --ccm-shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.06);
  --ccm-shadow-md:   0 4px 20px rgba(0, 0, 0, 0.10);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ccm-font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ccm-black);
  background: var(--ccm-white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:hover { color: var(--ccm-gold); }

/* Headings — use Lato (uppercase) by default like Snappages, with brand-gold available */
h1, h2, h3, h4 {
  font-family: var(--ccm-font-body);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; text-transform: none; letter-spacing: 0; }

.ccm-display {  /* opt-in for Amatic SC display heads */
  font-family: var(--ccm-font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}
.ccm-gold { color: var(--ccm-gold); }
.ccm-text-center { text-align: center; }

/* ---------- Layout ---------- */
.ccm-container {
  max-width: var(--ccm-maxw);
  margin: 0 auto;
  padding: 0 var(--ccm-gutter);
}
.ccm-section { padding: 64px 0; }
.ccm-section--tight { padding: 32px 0; }
.ccm-section--dark { background: var(--ccm-black); color: var(--ccm-white); }
.ccm-section--gold { background: var(--ccm-gold); color: var(--ccm-white); }

/* ---------- Header / top nav ---------- */
/* Mirrors christchurchmiami.org Snappages header: black bar, gold logo + nav links.
   The Snappages source uses #f1c40f (yellow); CCM brand book uses gold #b58f3c.
   We move to brand gold here — looks tighter and unifies with everything else. */
.ccm-header {
  background: var(--ccm-black);
  color: var(--ccm-white);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.ccm-header__inner {
  max-width: var(--ccm-maxw);
  margin: 0 auto;
  padding: 0 var(--ccm-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.ccm-header__logo img { height: 56px; width: auto; }
.ccm-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; row-gap: 4px; }
.ccm-nav a {
  color: var(--ccm-gold);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--ccm-radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}
.ccm-nav a:hover { color: var(--ccm-white); background: var(--ccm-gold-soft); }
.ccm-nav__giving {
  border: 1.5px solid var(--ccm-gold);
  margin-left: 8px;
}

/* Dropdown groups (About / Sermons / Resources). Hover or keyboard-focus opens. */
.ccm-nav__group { position: relative; }
/* Thin chevron-style caret, matching the live christchurchmiami.org nav
   (FontAwesome fa-angle-down). Rotated square with two visible borders. */
.ccm-nav__caret {
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  vertical-align: 1px;
  opacity: 0.85;
  font-size: 0;        /* hide the legacy ▾ glyph inside the span */
  overflow: hidden;
}
.ccm-nav__menu {
  position: absolute;
  top: 100%; left: 0;
  min-width: 220px;
  background: var(--ccm-black);
  /* No border — match the live site's clean dropdown. The hit-area for hover
     extends up to the parent via padding-top so cursors don't lose the menu. */
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  display: none;
  flex-direction: column;
  z-index: 200;
  box-shadow: var(--ccm-shadow-md);
}
.ccm-nav__menu a {
  white-space: nowrap;
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--ccm-white);
  letter-spacing: 0.04em;
}
.ccm-nav__menu a:hover { background: var(--ccm-gold-soft); color: var(--ccm-white); }
.ccm-nav__group:hover > .ccm-nav__menu,
.ccm-nav__group:focus-within > .ccm-nav__menu { display: flex; }

/* Tighten nav spacing at narrower laptop widths so 11 items still fit on one
   row before wrapping kicks in. */
@media (max-width: 1200px) {
  .ccm-nav a { padding: 6px 8px; font-size: 0.88rem; letter-spacing: 0.02em; }
}

/* ---------- Hamburger button (mobile only) ---------- */
.ccm-hamburger {
  display: none;
  background: transparent;
  border: 0;
  color: var(--ccm-gold);
  cursor: pointer;
  padding: 8px;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.ccm-hamburger__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* ---------- Mobile menu overlay ---------- */
.ccm-mobile-menu[hidden] { display: none; }
.ccm-mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--ccm-black);
  color: var(--ccm-white);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ccm-mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 56px;
}
.ccm-mobile-menu__back,
.ccm-mobile-menu__close {
  background: transparent;
  border: 0;
  color: var(--ccm-white);
  cursor: pointer;
  padding: 8px;
  font-family: var(--ccm-font-body);
  font-weight: 400;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ccm-mobile-menu__back[hidden] { display: none; }
.ccm-mobile-menu__close { margin-left: auto; }
.ccm-mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ccm-mobile-menu__list[hidden] { display: none; }
.ccm-mobile-menu__list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
/* Match the live christchurchmiami.org snapages mobile nav: Lato 400 at
   1.6em, uppercase, no letter-spacing. Bigger and lighter than our desktop
   nav links — this scale is deliberate. */
.ccm-mobile-menu__list a,
.ccm-mobile-menu__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 22px;
  background: transparent;
  border: 0;
  color: var(--ccm-white);
  font-family: var(--ccm-font-body);
  font-weight: 400;
  font-size: 1.6em;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.ccm-mobile-menu__list a:hover,
.ccm-mobile-menu__group:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ccm-gold);
}
.ccm-mobile-menu__chevron {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: solid var(--ccm-gold);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg) translate(-1px, 1px);
  flex-shrink: 0;
  margin-left: 12px;
}

/* Lock body scroll while overlay is open */
body.ccm-menu-open { overflow: hidden; }

@media (max-width: 880px) {
  /* Stack header, hide inline nav, show hamburger centered below the logo. */
  .ccm-header__inner {
    flex-direction: column;
    gap: 4px;
    padding: 4px var(--ccm-gutter);
  }
  .ccm-header__logo { display: flex; justify-content: center; width: 100%; }
  .ccm-header__logo img { height: 44px; }
  .ccm-nav { display: none; }
  .ccm-hamburger { display: flex; }
}

@media (min-width: 881px) {
  /* Mobile menu always hidden on desktop, regardless of state. */
  .ccm-mobile-menu { display: none !important; }
}

/* ---------- Footer ---------- */
.ccm-footer {
  background: var(--ccm-grey-800);
  color: var(--ccm-white);
  padding: 56px 0 32px;
}
.ccm-footer__cols {
  display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 40px;
}
.ccm-footer h3 { color: var(--ccm-gold); font-size: 1.5rem; margin-bottom: 12px; }
.ccm-footer a { color: var(--ccm-white); text-decoration: none; }
.ccm-footer a:hover { color: var(--ccm-gold); }
.ccm-footer__legal {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem; color: rgba(255,255,255,0.6); text-align: center;
}
.ccm-social { display: flex; gap: 12px; margin-top: 12px; }
.ccm-social a {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ccm-gold); border-radius: var(--ccm-radius-sm);
  text-decoration: none;
}
.ccm-social a:hover { background: var(--ccm-gold); color: var(--ccm-black); }

@media (max-width: 880px) {
  .ccm-footer__cols { grid-template-columns: 1fr; }
}

/* ---------- Sub-nav (persistent in-page tabs) ---------- */
.ccm-subnav {
  background: var(--ccm-white);
  border-bottom: 1px solid var(--ccm-grey-200);
  position: sticky; top: 80px; z-index: 50;
}
.ccm-subnav__inner {
  max-width: var(--ccm-maxw);
  margin: 0 auto;
  padding: 0 var(--ccm-gutter);
  display: flex; gap: 4px; overflow-x: auto;
}
/* Center the subnav on mobile so the active item sits in view; on desktop
   keep it left-aligned so it lines up with the page heading. */
@media (max-width: 880px) {
  .ccm-subnav__inner { justify-content: center; }
}
.ccm-subnav__tab {
  display: inline-block;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--ccm-grey-500);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.ccm-subnav__tab:hover { color: var(--ccm-black); }
.ccm-subnav__tab.is-active {
  color: var(--ccm-black);
  border-bottom-color: var(--ccm-gold);
}

/* ---------- Sermon page hero ---------- */
.ccm-hero {
  background: var(--ccm-grey-100);
  padding: 48px 0 32px;
}
.ccm-hero__meta {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ccm-grey-500); margin-bottom: 8px;
}
.ccm-hero__title { margin: 0 0 12px; }
.ccm-hero__scripture {
  font-style: italic; color: var(--ccm-grey-800); font-size: 1.05rem;
}
/* Hero action button row — left on desktop, centered on mobile to match
   the .ccm-subnav behavior. */
.ccm-hero__actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 880px) {
  .ccm-hero__actions { justify-content: center; }
}

/* ---------- Devotional cards ---------- */
.ccm-devotional {
  display: grid; grid-template-columns: 1fr 400px; gap: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--ccm-grey-200);
}
.ccm-devotional:first-of-type { border-top: 0; }
.ccm-devotional__heading {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ccm-gold); font-weight: 700; margin-bottom: 4px;
}
.ccm-devotional__title { font-size: 1.75rem; margin-bottom: 16px; text-transform: none; letter-spacing: 0; }
.ccm-devotional__verse {
  border-left: 3px solid var(--ccm-gold);
  padding: 8px 0 8px 16px;
  margin: 16px 0;
  background: var(--ccm-gold-soft);
  font-style: italic;
}
.ccm-devotional__body p { margin: 0 0 1em; }
.ccm-devotional__prayer {
  background: var(--ccm-grey-100); padding: 16px; border-radius: var(--ccm-radius-md);
  margin-top: 20px;
}
.ccm-devotional__reflection {
  margin-top: 16px; font-weight: 700; color: var(--ccm-black);
}
.ccm-devotional__image img {
  border-radius: var(--ccm-radius-md);
  box-shadow: var(--ccm-shadow-md);
  width: 100%;
}

@media (max-width: 1100px) {
  .ccm-devotional { grid-template-columns: 1fr; }
  .ccm-devotional__image { order: -1; max-width: 400px; margin: 0 auto; }
}

/* ---------- Reading-plan callout (inside devotional) ---------- */
.ccm-reading-callout {
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid var(--ccm-gold);
  border-radius: var(--ccm-radius-md);
  background: var(--ccm-gold-soft);
}
.ccm-reading-callout__label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--ccm-gold-strong); margin-bottom: 4px;
}
.ccm-reading-callout__ref { font-weight: 700; }
.ccm-reading-callout__bridge { margin-top: 8px; }

/* ---------- Resource list ---------- */
.ccm-resource-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
  margin-top: 24px;
}
.ccm-resource-card {
  border: 1px solid var(--ccm-grey-200);
  border-radius: var(--ccm-radius-md);
  padding: 20px; background: var(--ccm-white);
  text-decoration: none; color: inherit; display: block;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ccm-resource-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ccm-shadow-md);
  border-color: var(--ccm-gold);
}
.ccm-resource-card__label {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 0.85rem; color: var(--ccm-gold); margin-bottom: 8px;
}
.ccm-resource-card__title { font-size: 1.1rem; margin: 0; }

/* ---------- Group questions ---------- */
.ccm-question {
  display: flex; gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--ccm-grey-200);
}
.ccm-question__n {
  flex: 0 0 40px; height: 40px;
  background: var(--ccm-gold); color: var(--ccm-white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem;
}
.ccm-question__prompt { flex: 1; font-size: 1.05rem; line-height: 1.5; }

/* ---------- Reading plan calendar (standalone page) ---------- */
.ccm-rp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
  margin-top: 24px;
}
.ccm-rp-day {
  border: 1px solid var(--ccm-grey-200);
  border-radius: var(--ccm-radius-sm);
  padding: 10px; text-decoration: none; color: var(--ccm-black);
  background: var(--ccm-white);
}
.ccm-rp-day:hover { border-color: var(--ccm-gold); background: var(--ccm-gold-soft); }
.ccm-rp-day.is-today { border-color: var(--ccm-gold); background: var(--ccm-gold); color: var(--ccm-white); }
.ccm-rp-day__date { font-size: 0.75rem; color: var(--ccm-grey-500); margin-bottom: 2px; }
.ccm-rp-day.is-today .ccm-rp-day__date { color: rgba(255,255,255,0.85); }
.ccm-rp-day__ref { font-weight: 700; font-size: 0.95rem; }
.ccm-rp-month {
  margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--ccm-grey-200);
}
.ccm-rp-month h2 { font-size: 1.5rem; }

/* ---------- Devotionals: This-Week 5-card row (1:1 96px thumbnails) ---------- */
.ccm-week-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.ccm-week-grid .ccm-rp-day {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 8px; text-align: center;
}
.ccm-week-grid .ccm-rp-day img {
  width: 100%; height: auto; aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
@media (max-width: 880px) {
  .ccm-week-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .ccm-week-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Buttons ---------- */
.ccm-btn {
  display: inline-block;
  padding: 12px 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  border-radius: var(--ccm-radius-sm);
  text-decoration: none;
  border: 2px solid var(--ccm-gold);
  background: var(--ccm-gold);
  color: var(--ccm-white);
  transition: background 0.15s, transform 0.15s;
}
.ccm-btn:hover {
  background: var(--ccm-gold-strong); border-color: var(--ccm-gold-strong);
  color: var(--ccm-white); transform: translateY(-1px);
}
.ccm-btn--ghost { background: transparent; color: var(--ccm-gold); }
.ccm-btn--ghost:hover { background: var(--ccm-gold); color: var(--ccm-white); }
