/*
Theme Name: St. John's Mite
Theme URI: https://stjohnsmite.com
Description: Modern, secure, accessible theme for St. John's Mite — the emergency relief fund of the Grand Lodge of Free and Accepted Masons of the District of Columbia. No page-builder dependencies; hardened and privacy-respecting (no third-party fonts, no trackers).
Version: 1.4.0
Author: jsmith
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sjm
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --navy-900: #0c2340;   /* deep Masonic blue */
  --navy-800: #123056;
  --navy-700: #1b436f;
  --gold-600: #b3902f;   /* antique gold */
  --gold-500: #c8a24a;
  --gold-300: #e3cf95;
  --paper:    #f7f5ef;   /* warm off-white */
  --paper-2:  #efe9dc;
  --ink:      #1c2430;
  --ink-soft: #333b47;   /* darkened so muted text still meets WCAG AAA (>=7:1) */
  --line:     #dcd5c5;
  --white:    #ffffff;

  --measure: 66ch;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(12,35,64,.10);
  --shadow-md: 0 8px 28px rgba(12,35,64,.14);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.15rem;   /* ~18.4px base — larger for older-visitor readability */
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--navy-900); font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
a { color: var(--navy-700); text-underline-offset: 2px; }
a:hover { color: var(--gold-600); }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Accessibility helpers */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--navy-900); color: #fff; padding: .75rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 4px solid var(--gold-500); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, 1120px); margin-inline: auto; }
.measure { max-width: var(--measure); }

/* ============================================================
   Header / navigation
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 35, 64, .97);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 2px solid var(--gold-600);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 76px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-logo {
  height: 64px; width: auto; display: block;
  border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.28);
}
@media (max-width: 520px) { .brand-logo { height: 52px; } }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand .brand-name { font-family: var(--serif); font-weight: 700; color: #fff; font-size: 1.18rem; letter-spacing: .01em; }
.brand .brand-sub { color: var(--gold-300); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; }

.nav-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,.4);
  color: #fff; border-radius: 8px; padding: .5rem .6rem; cursor: pointer;
}
.main-nav ul { list-style: none; display: flex; gap: .35rem; margin: 0; padding: 0; }
.main-nav a {
  display: block; color: #eaf0f7; text-decoration: none; font-weight: 600; font-size: .98rem;
  padding: .55rem .85rem; border-radius: 8px; letter-spacing: .01em;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { color: var(--navy-900); background: var(--gold-500); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: .4rem; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--navy-900); border-bottom: 2px solid var(--gold-600);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .main-nav.open { max-height: 60vh; }
  .main-nav ul { flex-direction: column; padding: .5rem 1.25rem 1rem; gap: .1rem; }
  .main-nav a { padding: .8rem .6rem; }
}

/* ============================================================
   Hero (front page)
   ============================================================ */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(200,162,74,.18), transparent 60%),
    linear-gradient(160deg, var(--navy-900), var(--navy-800));
  color: #eef2f7;
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  border-bottom: 3px solid var(--gold-600);
}
.hero .wrap { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero h1 { color: #fff; margin: 0 0 1rem; }
.hero .lede { font-size: 1.2rem; color: #dfe7f0; max-width: 46ch; }
.hero .eyebrow { color: var(--gold-300); text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700; margin-bottom: .9rem; }
.hero-art { justify-self: stretch; width: 100%; margin: 0; }
.hero-photo {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block;
  border-radius: 14px; box-shadow: var(--shadow-md);
  border: 4px solid rgba(255,255,255,.16);
}
/* When no feature photo is present, the hero is a clean full-width text band. */
.hero--text-only .wrap { grid-template-columns: 1fr; }
.hero--text-only .hero-copy { max-width: 60ch; }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: left; }
  .hero-art { order: -1; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: .8rem 1.35rem; border-radius: 8px; border: 2px solid transparent;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold-500); color: #141414; }
.btn-gold:hover { background: var(--gold-300); color: #141414; }
.btn-ghost { border-color: var(--gold-300); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.10); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* ============================================================
   Content sections
   ============================================================ */
main { display: block; }
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section.alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.page-head {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
  color: #fff; padding: clamp(2.2rem, 5vw, 3.4rem) 0; border-bottom: 3px solid var(--gold-600);
}
.page-head h1 { color: #fff; margin: 0; }
.page-head p { color: var(--gold-300); margin: .5rem 0 0; letter-spacing: .04em; }

.prose { max-width: var(--measure); }
.prose :is(h2,h3) { margin-top: 2rem; }
.prose h2 { padding-bottom: .3rem; border-bottom: 2px solid var(--gold-300); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: .35rem 0; }
.prose blockquote {
  margin: 1.5rem 0; padding: .6rem 1.25rem; border-left: 4px solid var(--gold-500);
  background: var(--white); color: var(--ink-soft); font-style: italic; border-radius: 0 8px 8px 0;
}

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 .4rem; color: var(--navy-800); }
.card p:last-child { margin-bottom: 0; }
.card .ico { font-size: 1.4rem; color: var(--gold-600); }

/* Eligibility / do-dont lists */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 680px) { .split { grid-template-columns: 1fr; } }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.panel.yes { border-top: 4px solid #2f7d4f; }
.panel.no  { border-top: 4px solid #9d3b3b; }
.panel h3 { margin-top: 0; }
.panel ul { margin: 0; padding-left: 1.15rem; }

/* FAQ (accordion via <details>) */
.faq { max-width: var(--measure); }
.faq details {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: .75rem; box-shadow: var(--shadow-sm); overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 1rem 1.25rem; font-weight: 700; color: var(--navy-800);
  font-family: var(--serif); font-size: 1.08rem; list-style: none; position: relative; padding-right: 2.75rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--gold-600); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .faq-body { padding: .25rem 1.25rem 1.1rem; color: var(--ink-soft); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.75rem; }
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }
.info-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.info-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.info-list strong { color: var(--navy-800); display: block; font-family: var(--serif); }

/* Notice / callout */
.callout {
  background: var(--navy-900); color: #eef2f7; border-radius: var(--radius);
  padding: 1.6rem 1.75rem; box-shadow: var(--shadow-md);
}
.callout h2, .callout h3 { color: #fff; }
.callout a { color: var(--gold-300); }
/* Buttons inside the callout keep the gold fill with black lettering
   (overrides the plain-link colour above). */
.callout .btn-gold { color: #141414; }
.callout .btn-gold:hover { color: #141414; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--navy-900); color: #c7d2df; margin-top: 3rem;
  border-top: 3px solid var(--gold-600); padding: 2.5rem 0 2rem;
}
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.5rem; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 .7rem; }
.site-footer a { color: #c7d2df; text-decoration: none; }
.site-footer a:hover { color: var(--gold-300); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: .2rem 0; }
.footer-brand p { max-width: 40ch; font-size: .95rem; }
.legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.75rem; padding-top: 1.25rem; font-size: .85rem; color: #9fb0c2; }

/* Utilities */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }

/* ============================================================
   Accessibility layer — WCAG AAA, optimized for older visitors.
   Larger type, high-contrast text, and large (>=48px) touch targets.
   ============================================================ */

/* Clear, readable site name in the header */
.brand .brand-name { font-size: 1.4rem; }
.brand .brand-sub  { font-size: .84rem; letter-spacing: .12em; }

/* Navigation: bigger text, >=48px targets, strong focus ring */
.main-nav a {
  display: inline-flex; align-items: center; min-height: 48px;
  font-size: 1.08rem; padding: .7rem 1.05rem;
}
.main-nav a:focus-visible { outline: 4px solid var(--gold-300); outline-offset: -2px; }
.nav-toggle { min-height: 48px; min-width: 48px; font-size: 1.4rem; padding: .5rem .8rem; }
@media (max-width: 820px) {
  .main-nav a { min-height: 54px; padding: .95rem .8rem; font-size: 1.14rem; }
}

/* Hero supporting text larger */
.hero .eyebrow { font-size: .92rem; letter-spacing: .16em; }
.hero .lede { font-size: 1.3rem; line-height: 1.6; max-width: 54ch; }

/* Buttons: large, centered, >=54px tall */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: .85rem 1.7rem; font-size: 1.1rem;
}

/* Component copy sizing */
.lead { font-size: 1.3rem; line-height: 1.6; }
.card h3, .panel h3 { font-size: 1.35rem; }
.card p, .panel li, .info-list li { font-size: 1.1rem; }
.info-list li { padding: .7rem 0; }
.info-list strong { font-size: 1.15rem; }

/* FAQ: larger question text + comfortable target */
.faq summary { font-size: 1.25rem; padding: 1.15rem 3rem 1.15rem 1.35rem; min-height: 56px; }
.faq .faq-body { font-size: 1.1rem; line-height: 1.65; padding: .4rem 1.35rem 1.25rem; }
.faq summary::after { font-size: 1.7rem; }

/* Underlined, thicker links in body copy so they read as links */
.prose a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 3px; }

/* Footer: lighter text for AAA contrast on the navy background, slightly larger */
.site-footer { color: #e4eaf2; }
.site-footer a { color: #e4eaf2; }
.site-footer h4 { font-size: .95rem; }
.footer-brand p { font-size: 1.08rem; line-height: 1.6; max-width: 44ch; }
.legal { color: #d6e0ec; font-size: 1rem; }

/* Guarantee a visible focus ring on every interactive control */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 4px solid var(--gold-500); outline-offset: 2px;
}
