/*
Theme Name:   FMC Creek
Theme URI:    https://fmcbaptist.com
Description:  Child theme of Picostrap5 for Four Mile Creek Baptist Church. Bootstrap 5 base, custom brand tokens, warm serif headings, humanist sans body. Built for a non-technical volunteer to update pages, events, and sermons.
Author:       FMC Web
Template:     picostrap5
Version:      0.6.0
Text Domain:  fmc-creek
License:      GPL-2.0-or-later
*/

/* ---------- brand tokens ---------- */
/* Sampled from the 4-as-cross logo (2025/11/4Mile_Logo_ALX_R2). All text/bg
   pairs used in the theme were verified against WCAG AA at authoring time. */
:root {
  --brand-teal:        #3DA69B; /* logo mark, decorative accents */
  --brand-teal-dark:   #1F7966; /* links, secondary buttons (5.2:1 on white) */
  --brand-teal-darker: #053637; /* dark hero surfaces, deep headings */
  --brand-accent:      #A67319; /* primary CTA (warm gold, 5.6:1 on white) */
  --brand-accent-dark: #7F5714; /* CTA hover */

  --text:              #111827; /* body (16.7:1 on white) */
  --text-muted:        #4B5563; /* captions, meta */
  --text-inverse:      #FFFFFF;

  --bg:                #FFFFFF;
  --surface:           #F5F6F7; /* cards, alt sections */
  --surface-dark:      #053637; /* dark hero */
  --border:            #E5E7EB;

  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --font-body:    "Source Sans 3", system-ui, -apple-system, "Segoe UI",
                  Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure:      68ch; /* readable line length for body text */
  --radius:       0.375rem;
  --radius-lg:    0.75rem;
}

/* Bootstrap variable overrides (Picostrap re-exposes many bs vars) */
:root {
  --bs-primary:        var(--brand-teal-dark);
  --bs-primary-rgb:    31, 121, 102;
  --bs-body-color:     var(--text);
  --bs-body-bg:        var(--bg);
  --bs-body-font-family: var(--font-body);
  --bs-heading-color:  var(--brand-teal-darker);
  --bs-border-color:   var(--border);
  --bs-link-color:     var(--brand-teal-dark);
  --bs-link-hover-color: var(--brand-teal-darker);
}

/* ---------- typography ---------- */
body {
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--brand-teal-darker);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h1, .h1 { font-size: clamp(2rem, 3.6vw + 1rem, 3.25rem); font-weight: 700; }
h2, .h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem); }
h3, .h3 { font-size: clamp(1.25rem, 1vw + 1rem, 1.5rem); }
.lead { font-size: 1.25rem; color: var(--text); }

/* ---------- links & focus ---------- */
a { color: var(--brand-teal-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-teal-darker); }
:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- skip link (a11y) ----------
   Picostrap's bundle.css has `a.skip-link{position:fixed;top:0;right:0}` at
   specificity 0-1-1, which beats a plain `.skip-link` selector. We match
   that specificity here and explicitly clear right/position, otherwise the
   link stretches full-width across the top of the viewport as a solid
   dark bar covering the menu. */
a.skip-link {
  position: absolute !important;
  left: -9999px !important;
  right: auto !important;
  top: 0 !important;
  z-index: 10000;
  background: var(--text);
  color: var(--text-inverse);
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
  width: auto;
}
a.skip-link:focus {
  left: 0 !important;
  color: var(--text-inverse);
}

/* ---------- buttons ---------- */
.btn { font-weight: 600; letter-spacing: 0.01em; border-radius: var(--radius); }
.btn-primary,
.btn-primary:visited {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--text-inverse);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--brand-accent-dark);
  border-color: var(--brand-accent-dark);
  color: var(--text-inverse);
}
.btn-secondary,
.btn-secondary:visited {
  background: var(--brand-teal-dark);
  border-color: var(--brand-teal-dark);
  color: var(--text-inverse);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--brand-teal-darker);
  border-color: var(--brand-teal-darker);
  color: var(--text-inverse);
}
.btn-outline-primary {
  color: var(--brand-teal-dark);
  border-color: var(--brand-teal-dark);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--brand-teal-dark);
  color: var(--text-inverse);
}

/* ---------- announcement bar ---------- */
.fmc-announcement {
  background: var(--brand-teal-darker);
  color: var(--text-inverse);
  font-size: 0.9375rem;
  padding: 0.5rem 1rem;
  text-align: center;
}
.fmc-announcement a { color: var(--text-inverse); text-decoration: underline; }
.fmc-announcement a:hover { color: #cfe7e2; }

/* ---------- header ---------- */
.fmc-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: relative;
}
/* WordPress admin bar clearance. Only affects logged-in users (`body.admin-bar`
   is added by WP).
   Picostrap disables WP's default `_admin_bar_bump_cb` and replaces it with
   `html:has(body.admin-bar) { margin-top: 32px }` inside bundle.css — which
   fails silently if bundle.css doesn't load OR the browser doesn't support
   the :has() selector. So we cancel Picostrap's rule (in case it does fire,
   to avoid doubling) and add our own using body padding, which works
   everywhere. */
html { margin-top: 0 !important; }
body.admin-bar { padding-top: 32px; }
@media (max-width: 782px) {
  body.admin-bar { padding-top: 46px; }
}
.fmc-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.fmc-header__logo img {
  height: 64px;
  width: auto;
  max-width: 100%;
  display: block;
}
/* Smaller on tablet/mobile so it doesn't crowd the hamburger button. */
@media (max-width: 991.98px) {
  .fmc-header__logo img { height: 52px; }
}

/* ---------- primary nav ----------
   Standalone — does not depend on Bootstrap utility classes for layout,
   so the nav works even if bundle.css fails to load. */
.fmc-header__nav {
  position: relative;
}
.fmc-header__nav .menu,
.fmc-header__nav > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.fmc-header__nav .menu li,
.fmc-header__nav > ul > li {
  position: relative;
  list-style: none;
}
.fmc-header__nav a {
  display: inline-block;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  line-height: 1.2;
}
.fmc-header__nav a:hover,
.fmc-header__nav a:focus-visible,
.fmc-header__nav .current-menu-item > a {
  color: var(--brand-teal-darker);
  background: var(--surface);
}
.fmc-header__nav .menu-item-give > a {
  background: var(--brand-accent);
  color: var(--text-inverse);
  padding: 0.5rem 1rem;
}
.fmc-header__nav .menu-item-give > a:hover,
.fmc-header__nav .menu-item-give > a:focus-visible {
  background: var(--brand-accent-dark);
  color: var(--text-inverse);
}

/* ---------- About-style dropdowns ---------- */
.fmc-header__nav .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.4em;
  vertical-align: 0.2em;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.fmc-header__nav .sub-menu {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 100;
}
.fmc-header__nav .sub-menu li { list-style: none; }
.fmc-header__nav .sub-menu a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0;
  white-space: nowrap;
}
.fmc-header__nav .sub-menu a:hover,
.fmc-header__nav .sub-menu a:focus-visible {
  background: var(--surface);
}
/* Show submenu on hover OR when a descendant has focus (keyboard nav). */
.fmc-header__nav .menu-item-has-children:hover > .sub-menu,
.fmc-header__nav .menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

/* ---------- hamburger toggle (tablet + mobile) ----------
   Hidden on desktop. Below 992px (Bootstrap `lg` breakpoint) the button
   is visible and the nav collapses into a full-width drawer that pops
   below the header. Vanilla-JS toggled — no Bootstrap collapse dependency. */
.fmc-header__toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-weight: 600;
}
.fmc-header__toggle:hover,
.fmc-header__toggle:focus-visible { background: var(--surface); }
.fmc-header__toggle[aria-expanded="true"] {
  background: var(--surface);
}
.fmc-hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
}
.fmc-hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}
/* X-morph when expanded */
.fmc-header__toggle[aria-expanded="true"] .fmc-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.fmc-header__toggle[aria-expanded="true"] .fmc-hamburger span:nth-child(2) {
  opacity: 0;
}
.fmc-header__toggle[aria-expanded="true"] .fmc-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 991.98px) {
  .fmc-header__inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .fmc-header__toggle { display: inline-flex; }

  .fmc-header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 1.25rem 1rem;
    z-index: 90;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
  .fmc-header__nav.is-open { display: block; }

  .fmc-header__nav .menu,
  .fmc-header__nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .fmc-header__nav .menu > li,
  .fmc-header__nav > ul > li {
    border-bottom: 1px solid var(--border);
  }
  .fmc-header__nav .menu > li:last-child,
  .fmc-header__nav > ul > li:last-child {
    border-bottom: 0;
  }
  .fmc-header__nav a {
    display: block;
    padding: 0.9rem 0.25rem;
  }
  /* Sub-menus inline on mobile (no hover state on touch devices) */
  .fmc-header__nav .sub-menu {
    position: static;
    display: block;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.5rem 1rem;
    min-width: 0;
  }
  .fmc-header__nav .sub-menu li { border: 0; }
  .fmc-header__nav .sub-menu a { padding: 0.5rem 0.25rem; }
  .fmc-header__nav .menu-item-has-children > a::after { display: none; }

  /* Give still stands out inside the drawer */
  .fmc-header__nav .menu-item-give > a {
    background: var(--brand-accent);
    color: var(--text-inverse);
    text-align: center;
    border-radius: var(--radius);
    margin: 0.5rem 0;
  }
  .fmc-header__nav .menu-item-give { border-bottom: 0; }
}

/* No-JS fallback: if JS is disabled, always show the menu (no toggle possible). */
.no-js .fmc-header__nav { display: block !important; position: static !important; box-shadow: none !important; }
.no-js .fmc-header__toggle { display: none !important; }

/* ---------- hero ---------- */
.fmc-hero {
  padding: clamp(3rem, 8vw, 6rem) 0;
  background: var(--bg);
  text-align: center;
}
.fmc-hero__eyebrow {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-teal-dark);
  margin-bottom: 0.5rem;
}
.fmc-hero__title { margin: 0 auto 1rem; max-width: 22ch; }
.fmc-hero__lede { max-width: 40ch; margin: 0 auto 2rem; font-size: 1.25rem; color: var(--text-muted); }
.fmc-hero__cta { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* ---------- service times card ---------- */
.fmc-service {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 640px;
  margin: 0 auto;
}
.fmc-service__title { margin-top: 0; font-size: 1.25rem; }
.fmc-service__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.fmc-service__row:last-of-type { border-bottom: 0; }
.fmc-service__label { font-weight: 600; }
.fmc-service__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.fmc-service__actions .btn { flex: 1 1 auto; min-width: 140px; }

/* ---------- page title band ----------
   Renders above content on all `page.php` pages (not the homepage). One of
   the two attachment images is chosen per page in page.php; here we style
   the band that shows it, muted behind the title. */
.fmc-page-title {
  background-color: var(--surface); /* fallback if no image is set */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.fmc-page-title__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.fmc-page-title__heading {
  margin: 0;
  color: var(--brand-teal-darker);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ---------- page content ----------
   Picostrap's page.php wraps content in a wide `col-md-10 offset-md-1`
   (~950px). That's too wide for comfortable reading, and content sits
   left-aligned inside it. Override to a centered readable column so page
   content (Our Mission, About, Contact, etc.) reads well on desktop. */
#container-content-page {
  padding: 0 1rem;
}
#container-content-page > .row {
  display: block;   /* undo Bootstrap flex row */
  margin: 0;
}
#container-content-page > .row > [class*="col-"] {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 0;
  width: 100%;
  flex: none;
}

/* ---------- generic section ---------- */
.fmc-section { padding: clamp(3rem, 6vw, 5rem) 0; }
.fmc-section--muted { background: var(--surface); }
.fmc-section--dark { background: var(--surface-dark); color: var(--text-inverse); }
.fmc-section--dark h1, .fmc-section--dark h2, .fmc-section--dark h3 { color: var(--text-inverse); }
.fmc-section__title { text-align: center; margin-bottom: 2rem; }

/* ---------- footer ---------- */
.fmc-footer {
  background: var(--surface-dark);
  color: var(--text-inverse);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.fmc-footer a { color: #cfe7e2; }
.fmc-footer a:hover { color: var(--text-inverse); }
.fmc-footer h3 { color: var(--text-inverse); font-size: 1.125rem; margin-bottom: 1rem; }
.fmc-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.fmc-footer__map {
  border: 0;
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
}
.fmc-footer__social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1rem;
  text-decoration: none;
}
.fmc-footer__meta {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  text-align: center;
}

/* ---------- 404 page ---------- */
.fmc-404-search {
  max-width: 480px;
  margin: 1.5rem 0 2.25rem;
}
.fmc-404-search form { display: flex; gap: 0.5rem; }
.fmc-404-search input[type="search"] {
  flex: 1 1 auto;
  padding: 0.625rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  min-width: 0;
}
.fmc-404-search input[type="submit"],
.fmc-404-search button[type="submit"] {
  background: var(--brand-teal-dark);
  color: var(--text-inverse);
  border: 0;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
.fmc-404-search input[type="submit"]:hover,
.fmc-404-search button[type="submit"]:hover {
  background: var(--brand-teal-darker);
}

.fmc-404-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.fmc-404-card {
  display: block;
  padding: 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.fmc-404-card:hover,
.fmc-404-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--brand-teal-dark);
  text-decoration: none;
  color: var(--text);
}
.fmc-404-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--brand-teal-darker);
}
.fmc-404-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- video poster + modal ----------
   A button-that-looks-like-an-image, opens a <dialog> containing the
   video. JS in assets/js/video-modal.js drives open, autoplay, and
   auto-close on video end. */
.fmc-video-poster {
  display: inline-block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  max-width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.fmc-video-poster:hover,
.fmc-video-poster:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}
.fmc-video-poster img {
  display: block;
  width: 100%;
  height: auto;
}
.fmc-video-poster__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.18s ease;
}
.fmc-video-poster:hover .fmc-video-poster__play {
  background: rgba(0, 0, 0, 0.05);
}
.fmc-video-poster__play svg {
  width: clamp(64px, 10vw, 96px);
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.45));
}

/* Modal */
.fmc-video-modal {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(95vw, 1200px);
  width: 100%;
  color: #fff;
  overflow: visible;
}
.fmc-video-modal::backdrop {
  background: rgba(0, 0, 0, 0.88);
}
.fmc-video-modal video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 88vh;
  background: #000;
  border-radius: var(--radius-lg);
}
.fmc-video-modal__close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  border-radius: 50%;
  color: #fff;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.fmc-video-modal__close:hover,
.fmc-video-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  outline: none;
}
@media (max-width: 767.98px) {
  .fmc-video-modal__close { top: -2.5rem; }
}

/* ---------- utility ---------- */
.fmc-container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
img { max-width: 100%; height: auto; }

/* ---------- tap targets on mobile ---------- */
@media (max-width: 767.98px) {
  .fmc-header__nav a { padding: 0.75rem 1rem; }
  .btn { padding: 0.6rem 1rem; }
}

/* ---------- print ---------- */
@media print {
  .fmc-announcement, .fmc-header__nav, .fmc-footer__social, .btn { display: none !important; }
  a::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
}
