/* ═══════════════════════════════════════════════════════════════
   Grace Memorial Devotional — site stylesheet
   Grace palette + canvas devotional design system
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Noto+Sans:ital,wght@0,300;0,400;0,600;1,400&display=swap');

:root {
  /* Grace Memorial brand */
  --navy: #082846;
  --navy-mid: #0d3b66;
  --gold: #c8922a;
  --gold-light: #e8b45a;
  --cream: #f9f5ee;
  --white: #ffffff;

  /* Canvas devotional system extended */
  --ink: #1a1a1a;
  --text-mid: #4a4a4a;
  --muted: #6b6b6b;
  --divider: #d4cfc4;
  --accent: #c8922a;
  --accent-soft: #e8b45a;
  --highlight: #f4efe4;
  --source-bg: #efeadf;
  --scroll-bg: #fcf9f2;

  --font-serif: 'EB Garamond', 'Georgia', serif;
  --font-sans: 'Noto Sans', 'Helvetica Neue', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

img { max-width: 100%; height: auto; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   SITE HEADER — responsive nav with dropdowns
   ═══════════════════════════════════════════════════════════════ */

.site-header {
  width: 100%;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  padding: 0 1rem;
}

.site-header-inner {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  gap: 0.5rem;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--white);
  flex-shrink: 0;
}

.site-title a {
  color: var(--white);
  text-decoration: none;
}

.site-title a:hover { color: var(--gold-light); }

.site-title .subtitle {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.05rem;
}

/* ── Nav bar ─────────────────────────────────────────────────── */

.site-nav {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav > a {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.74);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  transition: all 0.15s;
  white-space: nowrap;
}

.site-nav > a:hover { color: var(--white); background: rgba(255,255,255,0.1); }

/* ── Dropdown ────────────────────────────────────────────────── */

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.74);
  background: none;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-dropdown-btn:hover,
.nav-dropdown.open .nav-dropdown-btn {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

/* Dropdown panel */
.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--divider);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 0.6rem 0;
  max-height: 70vh;
  overflow-y: auto;
}

.nav-dropdown.open .nav-dropdown-content,
.nav-dropdown:hover .nav-dropdown-content {
  display: block;
}

.nav-group {
  padding: 0.3rem 0.8rem;
}

.nav-group + .nav-group {
  border-top: 1px solid var(--divider);
  margin-top: 0.3rem;
  padding-top: 0.5rem;
}

.nav-group-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  display: block;
  margin-bottom: 0.2rem;
}

.nav-group a {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink);
  text-decoration: none;
  display: block;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  transition: background 0.1s;
}

.nav-group a:hover {
  background: var(--highlight);
  color: var(--navy);
}

/* ── Mobile nav: hamburger ───────────────────────────────────── */

.nav-toggle {
  display: none;
  font-size: 1.3rem;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

@media (max-width: 720px) {
  .site-header-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    max-height: 60vh;
    overflow-y: auto;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-btn {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.6rem;
  }

  .nav-dropdown-content {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 0 0.8rem;
    max-height: none;
    overflow-y: visible;
    background: rgba(255,255,255,0.04);
  }

  .nav-dropdown:hover .nav-dropdown-content {
    display: none;
  }

  .nav-dropdown.open .nav-dropdown-content {
    display: block;
  }

  .nav-group a {
    color: rgba(255,255,255,0.8);
    padding: 0.3rem 0.4rem;
  }

  .nav-group a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
  }

  .nav-group-label {
    color: var(--gold-light);
  }

  .site-nav > a {
    padding: 0.5rem 0.6rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT — responsive
   ═══════════════════════════════════════════════════════════════ */

.main-content {
  max-width: 840px;
  width: 100%;
  padding: 2rem 1rem 3rem;
}

@media (max-width: 600px) {
  .main-content { padding: 1.2rem 0.5rem 2rem; }
}

/* ── Welcome / Hero ──────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--gold);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.hero p {
  font-size: 1rem;
  color: var(--text-mid);
  margin-top: 0.6rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.9rem; }
}

/* ── Section heading ─────────────────────────────────────────── */

.section-heading {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 0.8rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--divider);
}

/* ── Card grid ───────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--scroll-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  display: block;
}

.card:hover { background: var(--highlight); }

.card .card-ref {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 600;
  font-family: var(--font-sans);
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.1rem;
  color: var(--navy);
}

.card p {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* ── Daily devotional card (featured) ─────────────────────────── */

.daily-spot {
  background: var(--navy);
  border-radius: 4px;
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
  color: var(--white);
}

.daily-spot .daily-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}

.daily-spot .daily-title {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 0.1rem;
}

.daily-spot .daily-ref {
  font-size: 0.85rem;
  color: var(--gold-light);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.daily-spot .daily-refrain {
  font-size: 1rem;
  font-style: italic;
  color: rgba(255,255,255,0.8);
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,0.06);
  border-radius: 0 3px 3px 0;
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.daily-spot .daily-text {
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.88);
}

.daily-spot .daily-text p { margin-bottom: 0.6rem; }

.daily-spot .daily-link {
  display: inline-block;
  margin-top: 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  text-decoration: none;
}

.daily-spot .daily-link:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .daily-spot { padding: 1rem 1.2rem; }
  .daily-spot .daily-title { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════════════════════
   A/B TOGGLE
   ═══════════════════════════════════════════════════════════════ */

.view-toggle {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-bottom: 1.5rem;
  border: 1px solid var(--divider);
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.view-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.view-btn.active {
  background: var(--gold);
  color: var(--white);
}
.view-btn:not(.active):hover { color: var(--ink); }

@media (max-width: 400px) {
  .view-btn { font-size: 0.65rem; padding: 0.35rem 0.7rem; }
}

.view-text-content,
.view-devotional-content {
  display: none;
}
.view-text-content.active,
.view-devotional-content.active {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════
   PREV / NEXT NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.page-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
}

.page-nav-btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--gold);
  background: none;
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.page-nav-btn:hover { background: var(--highlight); border-color: var(--accent-soft); }
.page-nav-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.page-nav-btn:disabled:hover { background: none; border-color: var(--divider); }

.page-nav-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 400px) {
  .page-nav-row { flex-direction: column; gap: 0.5rem; }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL / CONTENT STYLES
   ═══════════════════════════════════════════════════════════════ */

.scroll {
  max-width: 760px;
  width: 100%;
  padding: 2.5rem 2.8rem;
  background: var(--scroll-bg);
  border-radius: 4px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.07);
}

@media (max-width: 600px) {
  .scroll { padding: 1.5rem 1.2rem; }
}

.header {
  text-align: center;
  margin-bottom: 2.2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--divider);
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.header .sub {
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.3rem;
  font-weight: 400;
}

.header .sigla {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-top: 0.6rem;
}

@media (max-width: 600px) {
  .header h1 { font-size: 1.3rem; }
  .header .sub { font-size: 0.85rem; }
  .header .sigla { font-size: 0.65rem; }
}

.colophon {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
  letter-spacing: 0.04em;
}

/* ── Greek block ─────────────────────────────────────────────── */

.greek-block {
  margin: 2rem 0 1.5rem;
  padding: 1.2rem 1rem;
  background: var(--highlight);
  border-left: 3px solid var(--gold);
  border-radius: 0 4px 4px 0;
}

@media (max-width: 600px) {
  .greek-block { margin: 1rem 0 0.8rem; padding: 0.8rem; }
}

.greek {
  font-size: 1.15rem;
  line-height: 2;
  font-style: italic;
}

@media (max-width: 600px) {
  .greek { font-size: 0.95rem; }
}

.greek .verse-num {
  font-size: 0.7rem;
  vertical-align: super;
  color: var(--gold);
  font-weight: 600;
  font-style: normal;
  margin-right: 0.1em;
}

.greek .translit {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  font-style: normal;
  margin-left: 0.2em;
}

@media (max-width: 600px) {
  .greek .translit { font-size: 0.72rem; display: inline; }
}

.greek .break { display: block; margin-top: 0.6rem; }

.english {
  font-size: 1.05rem;
  line-height: 1.9;
  margin: 1.5rem 0;
}

@media (max-width: 600px) {
  .english { font-size: 0.95rem; }
}

.english .verse-num {
  font-size: 0.7rem;
  vertical-align: super;
  color: var(--gold);
  font-weight: 600;
  margin-right: 0.15em;
}

.english .break { display: block; margin-top: 0.5rem; }

.alternate {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--muted);
  font-style: italic;
  margin: 1rem 0 1.5rem;
  padding: 0.8rem 1rem;
  border-left: 2px solid var(--divider);
  background: var(--cream);
  border-radius: 0 4px 4px 0;
}

.alternate strong {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
}

.note {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--divider);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--muted);
}

.note strong { color: var(--ink); font-weight: 600; }
.note p { margin-bottom: 0.6rem; }

/* ── Devotional body ─────────────────────────────────────────── */

.refrain {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gold);
  font-style: italic;
  text-align: center;
  margin: 1.5rem 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--gold);
  background: var(--highlight);
  border-radius: 0 4px 4px 0;
}

.body-text p { margin-bottom: 1rem; text-indent: 0; }
.body-text p.first { margin-top: 0; }

.body-text .dropcap {
  float: left;
  font-size: 3.2em;
  line-height: 0.8;
  padding-right: 0.15em;
  padding-top: 0.08em;
  color: var(--gold);
  font-weight: 600;
}

@media (max-width: 600px) {
  .body-text .dropcap { font-size: 2.4em; }
}

.section-break {
  text-align: center;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  margin: 1.2rem 0;
}

.sources {
  margin-top: 2rem;
  padding: 1.2rem;
  background: var(--source-bg);
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
}

.sources h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.sources p { margin-bottom: 0.5rem; }
.sources strong { color: var(--ink); font-weight: 600; }
.sources em { font-style: italic; }

/* ── Keyboard hint ──────────────────────────────────────────── */

.keyboard-hint {
  text-align: center;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 1rem;
}
.keyboard-hint kbd {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  border: 1px solid var(--divider);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  background: var(--highlight);
}

/* ── Site Footer ─────────────────────────────────────────────── */

.site-footer {
  width: 100%;
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  text-align: center;
  padding: 1.2rem 1rem;
  margin-top: auto;
  font-family: var(--font-sans);
}

.site-footer a {
  color: var(--gold-light);
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }
