/* ══════════════════════════════════════════════════════════════════
   Pray Like This — Sacred Parchment
   Palette and type carried over from the book interior so the app and
   the printed page feel like one object.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg:            #F7F3EA;
  --bg-page:       #FAF8F2;
  --bg-raised:     #F3EDD8;
  --text:          #2A1A0E;
  --text-secondary:#5C3D2E;
  --text-light:    #8A6B52;
  --accent:        #8B6914;
  --accent-light:  #F0E6C8;
  --accent-rule:   #C4A96B;
  --border:        rgba(139, 105, 20, 0.18);
  --shadow:        0 1px 3px rgba(42, 26, 14, .06), 0 8px 28px rgba(42, 26, 14, .05);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;

  --measure: 34rem;
  --pad: clamp(1.15rem, 4vw, 2rem);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.14rem);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--text); }

/* ── top bar ─────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--pad);
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
  position: sticky; top: 0; z-index: 20;
  padding-top: max(0.85rem, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); }
.brand-mark { color: var(--accent); font-size: 1rem; opacity: .75; }
.brand-name { font-family: var(--font-display); font-size: 1.22rem; font-weight: 500; letter-spacing: .02em; }
.topnav { display: flex; gap: clamp(.7rem, 3vw, 1.4rem); }
.topnav a {
  font-family: var(--font-display); font-size: 1.02rem; color: var(--text-secondary);
  text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.topnav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent-rule); }

/* ── layout ──────────────────────────────────────────────────────── */
.view { flex: 1; width: 100%; max-width: var(--measure); margin: 0 auto; padding: clamp(1.6rem, 5vw, 3rem) var(--pad); }
.loading { color: var(--text-light); font-style: italic; text-align: center; padding: 3rem 0; }

/* ── the prayer ──────────────────────────────────────────────────── */
.prayer-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: 1.75rem;
}
.prayer-nav a {
  font-family: var(--font-display); font-size: 1.4rem; line-height: 1;
  color: var(--text-light); text-decoration: none; padding: .35rem .6rem;
  border-radius: 4px;
}
.prayer-nav a:hover { color: var(--accent); background: var(--accent-light); }
.prayer-date {
  font-family: var(--font-display); font-size: .95rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-light); text-align: center;
}

.prayer-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.95rem, 1.5rem + 2.2vw, 2.9rem);
  line-height: 1.15; text-align: center; margin-bottom: .9rem;
}
.divider { text-align: center; color: var(--accent-rule); margin: 1.1rem 0 1.9rem; font-size: .95rem; }

.epigraph {
  font-family: var(--font-display); font-size: 1.06rem; font-style: italic;
  color: var(--text-secondary); line-height: 1.65;
  background: var(--bg-page); border-left: 2px solid var(--accent-rule);
  padding: 1rem 1.15rem; margin-bottom: 2rem; border-radius: 0 4px 4px 0;
}

.prayer-body p { margin-bottom: 1.35rem; }
.prayer-body p:first-of-type::first-letter {
  font-family: var(--font-display); font-size: 3.1rem; line-height: .82;
  float: left; margin: .18rem .55rem 0 0; color: var(--accent); font-weight: 500;
}
.amen {
  font-family: var(--font-display); font-size: 1.3rem; font-style: italic;
  color: var(--accent); text-align: center; margin-top: 2rem;
}

.series-tag, .section-tag {
  display: inline-block; font-family: var(--font-display); font-size: .82rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-light);
}
.tagrow { text-align: center; margin-bottom: 1.4rem; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.series-tag { color: var(--accent); }

/* ── actions ─────────────────────────────────────────────────────── */
.actions { display: flex; gap: .6rem; justify-content: center; margin-top: 2.6rem; flex-wrap: wrap; }
.btn {
  font-family: var(--font-display); font-size: 1rem; letter-spacing: .03em;
  padding: .55rem 1.15rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-page); color: var(--text-secondary);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
}
.btn:hover { border-color: var(--accent-rule); color: var(--accent); }
.btn[aria-pressed="true"] { background: var(--accent-light); color: var(--accent); border-color: var(--accent-rule); }

.streak {
  text-align: center; margin-top: 2.2rem; padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-display); color: var(--text-light); font-size: .98rem;
}

/* ── browse + search ─────────────────────────────────────────────── */
.page-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.3rem);
  text-align: center; margin-bottom: 1.6rem;
}
.search {
  width: 100%; font-family: var(--font-body); font-size: 1rem;
  padding: .7rem .95rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-page); color: var(--text); margin-bottom: 1.8rem;
}
.search:focus { outline: 2px solid var(--accent-rule); outline-offset: 1px; }

.month-head {
  font-family: var(--font-display); font-size: 1.35rem; color: var(--accent);
  margin: 2rem 0 .3rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border);
}
.month-head:first-of-type { margin-top: 0; }

.plist { list-style: none; }
.plist li { border-bottom: 1px solid var(--border); }
.plist a {
  display: flex; gap: .9rem; align-items: baseline;
  padding: .72rem .2rem; text-decoration: none; color: var(--text);
}
.plist a:hover { background: var(--bg-page); }
.plist .d {
  font-family: var(--font-display); font-size: .88rem; color: var(--text-light);
  min-width: 2.6rem; flex-shrink: 0; letter-spacing: .04em;
}
.plist .t { font-size: .99rem; line-height: 1.45; }
.plist .fav { margin-left: auto; color: var(--accent); flex-shrink: 0; }

.empty { color: var(--text-light); font-style: italic; text-align: center; padding: 2.5rem 0; }

/* ── about ───────────────────────────────────────────────────────── */
.prose p { margin-bottom: 1.25rem; }
.prose h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; margin: 2rem 0 .7rem; color: var(--accent); }

/* ── footer ──────────────────────────────────────────────────────── */
.sitefoot {
  border-top: 1px solid var(--border); background: var(--bg-page);
  padding: 1.8rem var(--pad) calc(1.8rem + env(safe-area-inset-bottom));
  text-align: center;
}
.foot-cta { max-width: var(--measure); margin: 0 auto .5rem; font-size: .95rem; color: var(--text-secondary); line-height: 1.65; }
.foot-link { white-space: nowrap; font-weight: 500; }
.foot-sub { font-family: var(--font-display); font-size: .92rem; color: var(--text-light); }

@media (prefers-reduced-motion: no-preference) {
  .view > * { animation: rise .28s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120C; --bg-page: #1E1811; --bg-raised: #262017;
    --text: #EDE4D4; --text-secondary: #C9B79C; --text-light: #9A876E;
    --accent: #D6B25F; --accent-light: rgba(214, 178, 95, .13);
    --accent-rule: #8B6914; --border: rgba(214, 178, 95, .2);
  }
}
