/*
Theme Name: Cedar Grove
Theme URI: https://example.invalid/
Description: Block theme for Cedar Grove Fellowship, Tyler, Texas. Class prefix: cgf-
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: cedar-grove

Colors, each sampled from the church logo (design/logo-original.png):
  navy       #183454  the circle behind the tree and the CEDAR GROVE letters
  green      #2e6e4a  the cedar tree and the word "Fellowship"
  gold       #c49634  the cross and "Rooted in Christ" (decoration only, never body text)
  gold-deep  #7a5a0e  a darker shade of the logo gold that passes 4.5:1 on paper, used for text
  brown      #785430  the tree trunk (not used as a token)
Neutrals (paper, wash, ink, muted, line) are warm and chosen, not sampled.
Type: Literata Bold and Italic (display, SIL OFL), Manrope variable (body, SIL OFL), self-hosted.
*/

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; height: auto; }
a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--wp--preset--color--green); }
:focus-visible { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 2px; }
.cgf-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }
.cgf-main { display: block; }

/* ---------- Header ---------- */
.cgf-bar { position: sticky; top: 0; z-index: 50; background: var(--wp--preset--color--paper); border-bottom: 1px solid var(--wp--preset--color--line); }
.cgf-bar { position: relative; }
.cgf-scrolled .cgf-bar { box-shadow: 0 6px 18px -12px rgba(24, 52, 84, 0.45); }
.cgf-bar-in { max-width: 80rem; margin: 0 auto; padding: 0.6rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 6.25rem; }
.cgf-brand { display: block; flex: 0 0 auto; line-height: 0; }
.cgf-brand img { display: block; height: 5.25rem; width: auto; }
.cgf-nav { display: flex; align-items: center; gap: 0.25rem 1.6rem; }
.cgf-nav a, .cgf-panel a { text-decoration: none; color: var(--wp--preset--color--ink); font-weight: 700; font-size: 0.97rem; padding: 0.45rem 0; border-bottom: 2px solid transparent; }
.cgf-nav a:hover { color: var(--wp--preset--color--green); border-bottom-color: var(--wp--preset--color--gold); }
.cgf-nav a[aria-current="page"], .cgf-panel a[aria-current="page"] { border-bottom-color: var(--wp--preset--color--gold); }
.cgf-nav a.cgf-cta, .cgf-panel a.cgf-cta { background: var(--wp--preset--color--navy); color: #fff; padding: 0.75rem 1.3rem; border: 2px solid var(--wp--preset--color--navy); margin-left: 0.4rem; }
.cgf-nav a.cgf-cta:hover { background: var(--wp--preset--color--green); border-color: var(--wp--preset--color--green); color: #fff; }
.cgf-mobile { display: none; }
@media (max-width: 1040px) {
  .cgf-nav { display: none; }
  .cgf-mobile { display: block; }
  .cgf-bar-in { min-height: 4.75rem; padding: 0.5rem 1rem; }
  .cgf-brand img { height: 3.75rem; }
  .cgf-mobile summary { list-style: none; cursor: pointer; border: 2px solid var(--wp--preset--color--navy); padding: 0.6rem 1.1rem; font-weight: 800; color: var(--wp--preset--color--navy); }
  .cgf-mobile summary::-webkit-details-marker { display: none; }
  .cgf-mobile[open] summary { background: var(--wp--preset--color--navy); color: #fff; }
  .cgf-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--wp--preset--color--paper); border-bottom: 1px solid var(--wp--preset--color--line); padding: 0.5rem 1rem 1.25rem; display: flex; flex-direction: column; align-items: stretch; box-shadow: 0 18px 24px -18px rgba(24, 52, 84, 0.5); }
  .cgf-panel a { font-size: 1.1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
  .cgf-panel a.cgf-cta { margin: 1rem 0 0; text-align: center; border: 2px solid var(--wp--preset--color--navy); }
}

/* ---------- Layout ---------- */
.cgf-sec { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.cgf-sec + .cgf-sec { padding-top: 0; }
.cgf-sec.cgf-wash + .cgf-sec, .cgf-sec.cgf-band + .cgf-sec, .cgf-sec + .cgf-sec.cgf-wash, .cgf-sec + .cgf-sec.cgf-band { padding-top: clamp(3rem, 6vw, 5.5rem); }
.cgf-sec.cgf-wash { background: var(--wp--preset--color--wash); }
.cgf-wrap { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.cgf-measure { max-width: 44rem; }
.cgf-measure > * { margin-block: 0 1.1rem; }
.cgf-measure > *:last-child { margin-bottom: 0; }
.cgf-eyebrow { font-size: 0.9rem; font-weight: 800; color: var(--wp--preset--color--green); margin: 0 0 0.6rem; letter-spacing: 0.02em; }
.cgf-lede { font-size: var(--wp--preset--font-size--lede); line-height: 1.55; color: var(--wp--preset--color--ink); }
.cgf-wrap h1, .cgf-wrap h2, .cgf-wrap h3 { margin: 0 0 0.7rem; text-wrap: balance; }
.cgf-wrap h2 { margin-top: 0; }
.cgf-wrap p { margin-block: 0 1rem; }
.cgf-pagehead { padding-bottom: clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--wp--preset--color--line); }
.cgf-pagehead + .cgf-sec { padding-top: clamp(2.5rem, 5vw, 4rem); }
.cgf-back { font-weight: 700; font-size: 0.95rem; margin: 0 0 1.2rem; }
.cgf-back a { color: var(--wp--preset--color--green); }

.cgf-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.cgf-split.cgf-top { align-items: start; }
.cgf-split > * { min-width: 0; }
.cgf-split.cgf-table-split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.cgf-split.cgf-portrait-split { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); }
.cgf-split.cgf-flip > :first-child { order: 2; }
.cgf-split.cgf-narrow-media { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 820px) {
  .cgf-split, .cgf-split.cgf-narrow-media, .cgf-split.cgf-table-split, .cgf-split.cgf-portrait-split { grid-template-columns: minmax(0, 1fr); }
  .cgf-split.cgf-flip > :first-child { order: 0; }
}

/* Figures and plates */
.cgf-fig { margin: 0; }
.cgf-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--wp--preset--color--line); }
.cgf-fig figcaption { font-size: 0.9rem; color: var(--wp--preset--color--muted); margin-top: 0.55rem; text-align: left; }

/* Buttons */

/* ---------- Home opening ---------- */
.cgf-open { padding-top: clamp(2.5rem, 5vw, 4.5rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.cgf-open-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.cgf-open-grid > * { min-width: 0; }
.cgf-open h1 { font-size: var(--wp--preset--font-size--display-1); margin-bottom: 1.1rem; }
.cgf-motto { margin: 1.8rem 0 0; padding-left: 1.1rem; border-left: 4px solid var(--wp--preset--color--gold); font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: var(--wp--preset--font-size--display-3); color: var(--wp--preset--color--green); }
.cgf-motto span { display: block; font-family: var(--wp--preset--font-family--body); font-style: normal; font-size: 0.9rem; color: var(--wp--preset--color--muted); margin-top: 0.2rem; }
.cgf-times { background: var(--wp--preset--color--wash); border: 1px solid var(--wp--preset--color--line); border-top: 4px solid var(--wp--preset--color--navy); padding: 1.6rem 1.6rem 1.4rem; }
.cgf-times h2 { font-size: var(--wp--preset--font-size--display-3); margin-bottom: 0.4rem; }
.cgf-times dl, .cgf-faq dl { margin: 0; }
.cgf-times .cgf-row { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 0.2rem 1rem; padding: 0.8rem 0; border-top: 1px solid var(--wp--preset--color--line); }
.cgf-times dt { font-weight: 800; color: var(--wp--preset--color--navy); font-variant-numeric: tabular-nums; }
.cgf-times dd { margin: 0; }
.cgf-times .cgf-where { margin: 0.9rem 0 0; padding-top: 0.9rem; border-top: 1px solid var(--wp--preset--color--line); font-size: 0.97rem; }
.cgf-open-img { margin-top: clamp(2rem, 4vw, 3rem); }
@media (max-width: 860px) { .cgf-open-grid { grid-template-columns: minmax(0, 1fr); } }

/* First visit Q&A */
.cgf-faq .cgf-q { padding: 1rem 0; border-top: 1px solid var(--wp--preset--color--line); }
.cgf-faq .cgf-q:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.cgf-faq dt { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.2rem; color: var(--wp--preset--color--navy); margin-bottom: 0.25rem; }
.cgf-faq dd { margin: 0; }

/* Timeline (the years are real order) */
.cgf-tl { list-style: none; margin: 1.4rem 0 1.4rem; padding: 0; border-left: 2px solid var(--wp--preset--color--gold); }
.cgf-tl li { position: relative; padding: 0 0 1.4rem 1.4rem; margin: 0; }
.cgf-tl li::before { content: ""; position: absolute; left: -0.45rem; top: 0.55rem; width: 0.8rem; height: 0.8rem; background: var(--wp--preset--color--paper); border: 2px solid var(--wp--preset--color--gold); border-radius: 50%; }
.cgf-wash .cgf-tl li::before { background: var(--wp--preset--color--wash); }
.cgf-tl strong { display: block; font-family: var(--wp--preset--font-family--display); font-size: 1.35rem; color: var(--wp--preset--color--gold-deep); }

/* Tables (the week) */
.cgf-table { margin: 0; }
.cgf-table table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.cgf-table th, .cgf-table td { text-align: left; padding: 0.95rem 1rem 0.95rem 0; border-top: 1px solid var(--wp--preset--color--line); vertical-align: top; border-left: 0; border-right: 0; border-bottom: 0; }
.cgf-table tr:last-child td { border-bottom: 1px solid var(--wp--preset--color--line); }
.cgf-table th { font-weight: 800; color: var(--wp--preset--color--navy); width: 34%; }
.cgf-table td:last-child { font-variant-numeric: tabular-nums; }
.cgf-table thead th { border-top: 0; font-size: 0.9rem; color: var(--wp--preset--color--muted); border-bottom: 2px solid var(--wp--preset--color--navy); }
@media (max-width: 560px) { .cgf-table th, .cgf-table td { padding-right: 0.6rem; } .cgf-table th { width: 34%; } }

/* Hub rows: short sections with a Read more link */
.cgf-hubrow { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0.5rem 2.5rem; padding: 1.7rem 0; border-top: 1px solid var(--wp--preset--color--line); }
.cgf-hubrow:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.cgf-hubrow > * { min-width: 0; }
.cgf-hubrow h2, .cgf-hubrow h3 { font-size: var(--wp--preset--font-size--display-3); margin: 0; }
.cgf-hubrow p { margin: 0 0 0.7rem; max-width: 40rem; }
.cgf-more { font-weight: 800; margin: 0; }
.cgf-more a { color: var(--wp--preset--color--green); }
@media (max-width: 720px) { .cgf-hubrow { grid-template-columns: minmax(0, 1fr); } }
.cgf-hubrow-body > *:last-child { margin-bottom: 0; }

/* Pull quote and statement of faith */
.cgf-pull { margin: 0 0 2rem; padding: 0.2rem 0 0.2rem 1.3rem; border-left: 4px solid var(--wp--preset--color--gold); }
.cgf-pull p { font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: var(--wp--preset--font-size--display-2); line-height: 1.25; color: var(--wp--preset--color--green); margin: 0; }
.cgf-creed { margin: 0; padding: 0; list-style: none; max-width: 44rem; }
.cgf-creed li { padding: 1.1rem 0; border-top: 1px solid var(--wp--preset--color--line); font-size: 1.15rem; line-height: 1.6; margin: 0; }
.cgf-creed li:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }

/* Navy band (one per page at most, besides the footer) */
.cgf-band { background: var(--wp--preset--color--navy); color: #e3eaf2; }
.cgf-band h1, .cgf-band h2, .cgf-band h3 { color: #fff; }
.cgf-band p { color: #e3eaf2; }
.cgf-band figcaption { color: #cdd7e3; }
.cgf-portrait { max-width: 26rem; }
.cgf-band .cgf-eyebrow { color: #e5c36e; }
.cgf-band .cgf-motto { color: #fff; border-left-color: var(--wp--preset--color--gold); }

/* Map */
.cgf-map { margin-top: 1.5rem; width: 100%; aspect-ratio: 16 / 7; border: 1px solid var(--wp--preset--color--line); background: var(--wp--preset--color--wash); }
.cgf-map iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) { .cgf-map { aspect-ratio: 4 / 3; } }

.cgf-map-note { aspect-ratio: auto; display: block; padding: 2rem 1.75rem; border-top: 4px solid var(--wp--preset--color--green); }
.cgf-map-note > div { max-width: 40rem; }
.cgf-map-note p { margin: 0 0 0.5rem; }
.cgf-map-head { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.35rem; color: var(--wp--preset--color--navy); }

/* Embeds and video, ready for use */

/* Facts card (address, etc.) */
.cgf-facts { margin: 0; border-top: 4px solid var(--wp--preset--color--navy); background: var(--wp--preset--color--wash); border: 1px solid var(--wp--preset--color--line); border-top: 4px solid var(--wp--preset--color--navy); padding: 1.4rem 1.5rem; }
.cgf-facts p { margin: 0 0 0.8rem; }
.cgf-facts p:last-child { margin-bottom: 0; }
.cgf-facts strong { color: var(--wp--preset--color--navy); }

/* Forms */
.cgf-form p { margin: 0 0 1.1rem; }
.cgf-form label { display: block; font-weight: 800; margin-bottom: 0.35rem; color: var(--wp--preset--color--navy); }
.cgf-form input[type=text], .cgf-form textarea { width: 100%; font: inherit; padding: 0.75rem 0.85rem; border: 1px solid #7f8a96; border-radius: 0; background: #fff; color: var(--wp--preset--color--ink); }
.cgf-form input:focus, .cgf-form textarea:focus { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 0; }
.cgf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cgf-note { padding: 0.9rem 1.1rem; border-left: 4px solid var(--wp--preset--color--green); background: var(--wp--preset--color--wash); font-weight: 700; margin: 0 0 1.4rem; }
.cgf-note-err { border-left-color: var(--wp--preset--color--gold-deep); }

/* Blog/launch post */
.cgf-prose h2 { margin-top: 2rem; }
.cgf-prose p, .cgf-prose ul, .cgf-prose ol { margin-block: 0 1.1rem; }
.cgf-prose figure { margin: 1.6rem 0; }

/* ---------- Footer ---------- */
.cgf-footer-in { background: var(--wp--preset--color--navy); color: #e3eaf2; padding: clamp(2.5rem, 5vw, 4rem) 0 1.6rem; }
.cgf-footer-in p { margin: 0 0 0.8rem; }
.cgf-foot-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 2rem 3rem; }
.cgf-foot-grid > * { min-width: 0; }
.cgf-foot-name { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.4rem; color: #fff; }
.cgf-foot-motto { font-family: var(--wp--preset--font-family--display); font-style: italic; color: #e5c36e; }
.cgf-foot-head { font-weight: 800; color: #fff; }
.cgf-footer-in a { color: #fff; }
.cgf-footer-in a:hover { color: #e5c36e; }
.cgf-foot-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.5rem; }
.cgf-foot-links li { margin: 0 0 0.45rem; break-inside: avoid; }
.cgf-foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, 0.22); }
.cgf-foot-base p { margin: 0; font-size: 0.9rem; }
.cgf-copy { color: #cdd7e3; }
.fx-credit { margin: 0; font-size: 0.9rem; color: #cdd7e3; }
.fx-credit a { color: #cdd7e3; }
.fx-credit-about { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--wp--preset--color--line); font-size: 0.95rem; color: var(--wp--preset--color--muted); }
.fx-credit-about a { color: var(--wp--preset--color--navy); }
@media (max-width: 820px) { .cgf-foot-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Motion: one reveal, never repeating ---------- */
.js .cgf-rev { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .cgf-rev.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .cgf-rev { opacity: 1; transform: none; transition: none; }
}

.cgf-col, .cgf-foot-col { min-width: 0; }
.cgf-col > *:last-child, .cgf-foot-col > *:last-child { margin-bottom: 0; }
.cgf-mobile-label { display: inline-block; }
.cgf-wrap p + h2, .cgf-wrap .cgf-facts + h2, .cgf-wrap dl + h2 { margin-top: 2rem; }

@media (max-width: 560px) {
  .cgf-times .cgf-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cgf-open-img img { aspect-ratio: 4 / 3; object-fit: cover; }
  .cgf-table thead { position: absolute; left: -9999px; }
  .cgf-table table, .cgf-table tbody { display: block; }
  .cgf-table tr { display: block; padding: 0.8rem 0; border-top: 1px solid var(--wp--preset--color--line); }
  .cgf-table tr:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
  .cgf-table th, .cgf-table td { display: block; width: auto; border: 0; padding: 0; }
  .cgf-table tr:last-child td { border-bottom: 0; }
  .cgf-table td:nth-child(2) { font-weight: 700; }
}
