/* ==========================================================================
   St. Louis Church of God — Concept 01 "Editorial Gateway"
   Shared stylesheet (supplements Tailwind utility classes)

   Aesthetic direction
   -------------------
   Editorial / magazine layout with Swiss typographic discipline.
   Warm limestone + St. Louis red-brick neutrals, cool Arch-steel accent.
   Grid-breaking hero, hairline rules, numbered section labels, fine grain.
   Motif is civic, not religious: the Gateway Arch catenary + riverfront.
   ========================================================================== */

:root {
  --bone:      #F7F4EF;
  --bone-2:    #F1ECE3;
  --sand:      #EAE3D7;
  --ink:       #16181C;
  --graphite:  #3A3F46;
  --slate:     #61666D;
  --brick:     #A8432A;
  --brick-dk:  #7E2F1C;
  --steel:     #2C4654;
  --steel-lt:  #86A6B4;
  --brass:     #C4913F;
}

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bone);
  color: var(--ink);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

/* Anchored headings clear the sticky header ------------------------------ */
[id] { scroll-margin-top: 6.5rem; }

/* --------------------------------------------------------------------------
   Focus visibility — WCAG 2.4.7 / 2.4.11
   -------------------------------------------------------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brick);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :where(a, button, input, select, textarea, summary):focus-visible {
  outline-color: var(--brass);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 200;
  background: var(--ink);
  color: var(--bone);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   Texture — fine film grain over dark/photographic areas
   -------------------------------------------------------------------------- */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-size: 170px 170px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='170' height='170' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Editorial furniture
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: Archivo, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Hairline rule that fades at both ends */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg,
              transparent,
              rgba(58, 63, 70, 0.22) 8%,
              rgba(58, 63, 70, 0.22) 92%,
              transparent);
}
.on-dark .rule {
  background: linear-gradient(90deg,
              transparent,
              rgba(247, 244, 239, 0.22) 8%,
              rgba(247, 244, 239, 0.22) 92%,
              transparent);
}

/* Numbered section marker — "01 —" */
.sec-num {
  font-family: Archivo, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.16em;
  font-size: 0.6875rem;
  color: var(--brick);
}

/* Drop-cap for the opening editorial paragraph */
.dropcap::first-letter {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  float: left;
  font-size: 4.1em;
  line-height: 0.78;
  padding: 0.07em 0.12em 0 0;
  color: var(--brick);
}

/* Underline that draws in on hover — used on text links */
.link-u {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.link-u:hover,
.link-u:focus-visible { background-size: 100% 1px; }

@media (prefers-reduced-motion: reduce) {
  .link-u { transition: none; }
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  transition: background-color 0.35s ease, box-shadow 0.35s ease,
              border-color 0.35s ease;
}
.site-header[data-scrolled="true"] {
  background-color: rgba(247, 244, 239, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: rgba(58, 63, 70, 0.14);
  box-shadow: 0 1px 24px -12px rgba(22, 24, 28, 0.5);
}

/* Interior pages have no dark hero behind the bar, so it is solid at rest */
.site-header:not([data-over-hero="true"]) {
  background-color: rgba(247, 244, 239, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: rgba(58, 63, 70, 0.14);
}

/* Over the home-page hero the bar is transparent with light type, until
   the page scrolls and the solid surface takes over */
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .hdr-title { color: var(--bone); }
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .hdr-sub   { color: rgba(247, 244, 239, 0.72); }
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .hdr-mark  { color: var(--brass); }
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .nav-link  { color: rgba(247, 244, 239, 0.88); }
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .nav-link:hover,
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .nav-link:focus-visible { color: var(--bone); }
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .nav-link::after { background: var(--brass); }
.site-header[data-over-hero="true"]:not([data-scrolled="true"]) .hdr-burger {
  color: var(--bone);
  border-color: rgba(247, 244, 239, 0.4);
}

/* ICG seal in the header and footer: a small white badge so the navy mark
   reads over the light bar, the dark hero photos, and the dark footer alike */
.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 5px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(58, 63, 70, 0.14);
}
.logo-chip img { display: block; height: 28px; width: auto; }

/* Nav link: brick tick mark under the current page */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.5rem;
  height: 2px;
  background: var(--brick);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .site-header, .nav-link::after { transition: none; }
}

/* Full-screen mobile navigation panel */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-1.25rem);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.mobile-nav[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .mobile-nav { transition: none; }
}
body[data-nav-open="true"] { overflow: hidden; }

/* --------------------------------------------------------------------------
   Buttons — minimum 44px touch target (WCAG 2.5.8)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 2.875rem;
  padding: 0.75rem 1.5rem;
  font-family: Archivo, system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, transform 0.25s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--brick); color: #FFF6F1; }
.btn-primary:hover { background: var(--brick-dk); }

.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: rgba(247, 244, 239, 0.45);
}
.btn-ghost:hover {
  background: rgba(247, 244, 239, 0.1);
  border-color: var(--bone);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: rgba(58, 63, 70, 0.3);
}
.btn-outline:hover { background: var(--sand); border-color: var(--graphite); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:active { transform: none; }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card-lift {
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1),
              box-shadow 0.4s ease, border-color 0.4s ease;
}
.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -28px rgba(22, 24, 28, 0.55);
  border-color: rgba(58, 63, 70, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  .card-lift { transition: none; }
  .card-lift:hover { transform: none; }
}

/* Thumbnail placeholder — stands in for a YouTube poster frame */
.thumb-ph {
  background:
    linear-gradient(135deg, rgba(44, 70, 84, 0.92), rgba(22, 24, 28, 0.96)),
    var(--steel);
  position: relative;
  overflow: hidden;
}
.thumb-ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg,
      rgba(247, 244, 239, 0.07) 0 1px, transparent 1px 34px);
}

/* Play affordance */
.play-dot {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  background: rgba(247, 244, 239, 0.14);
  border: 1px solid rgba(247, 244, 239, 0.55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  color: var(--bone);
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.group:hover .play-dot {
  background: var(--brick);
  border-color: var(--brick);
  transform: scale(1.06);
}
@media (prefers-reduced-motion: reduce) {
  .play-dot { transition: none; }
  .group:hover .play-dot { transform: none; }
}

/* --------------------------------------------------------------------------
   Beliefs accordion — native <details>, no JS required
   -------------------------------------------------------------------------- */
.belief summary {
  list-style: none;
  cursor: pointer;
  min-height: 3.25rem;
}
.belief summary::-webkit-details-marker { display: none; }
.belief summary .chev { transition: transform 0.3s ease; }
.belief[open] summary .chev { transform: rotate(180deg); }
.belief[open] summary .b-title { color: var(--brick); }
@media (prefers-reduced-motion: reduce) {
  .belief summary .chev { transition: none; }
}

/* --------------------------------------------------------------------------
   Long-form reading measure
   -------------------------------------------------------------------------- */
.prose-stl p {
  margin-bottom: 1.35em;
  line-height: 1.75;
  color: var(--graphite);
}
.prose-stl p:last-child { margin-bottom: 0; }
.prose-stl a { color: var(--brick); text-decoration: underline; text-underline-offset: 3px; }
.prose-stl a:hover { color: var(--brick-dk); }

/* --------------------------------------------------------------------------
   Scrollable reference table (holy-day matrix)
   Semantics kept intact; wrapper is keyboard-scrollable per WCAG 2.1.1
   -------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll:focus-visible { outline: 2px solid var(--brick); outline-offset: 2px; }
.ref-table { border-collapse: collapse; width: 100%; min-width: 46rem; }
.ref-table th,
.ref-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(58, 63, 70, 0.14);
  white-space: nowrap;
  font-size: 0.875rem;
}
.ref-table thead th {
  font-family: Archivo, system-ui, sans-serif;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--slate);
  border-bottom-color: rgba(58, 63, 70, 0.3);
  position: sticky;
  top: 0;
  background: var(--bone);
}
.ref-table tbody tr:hover { background: var(--bone-2); }
.ref-table th[scope="row"] {
  font-family: Fraunces, Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
}
.ref-table tr[data-current="true"] { background: rgba(168, 67, 42, 0.07); }
.ref-table tr[data-current="true"] th[scope="row"] { color: var(--brick); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field {
  width: 100%;
  min-height: 2.875rem;
  background: #FFFFFF;
  border: 1px solid rgba(58, 63, 70, 0.28);
  padding: 0.7rem 0.9rem;
  font-family: Archivo, system-ui, sans-serif;
  font-size: 0.9375rem;
  color: var(--ink);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field:hover { border-color: rgba(58, 63, 70, 0.5); }
.field:focus {
  border-color: var(--brick);
  box-shadow: 0 0 0 3px rgba(168, 67, 42, 0.14);
  outline: none;
}
.field::placeholder { color: #9AA0A6; }
select.field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233A3F46' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}
@media (prefers-reduced-motion: reduce) { .field { transition: none; } }

.label {
  display: block;
  font-family: Archivo, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 0.45rem;
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Windows High Contrast / forced-colors safety net */
@media (forced-colors: active) {
  .btn, .field, .card-lift { border: 1px solid ButtonText; }
  .thumb-ph::before { display: none; }
  .grain::after { display: none; }
}

/* --------------------------------------------------------------------------
   Hero rotator
   -------------------------------------------------------------------------- */
[data-hero-rotator] { position: absolute; inset: 0; }

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.hero-slide.is-active { opacity: 1; }

/* Reduced motion turns off only the crossfade — the rotation itself keeps
   running (Windows 11 reports reduce whenever Animation effects is off, and
   freezing the rotator would leave the other slides unreachable). */
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
}
