/* ============================================================
   Kamloops 1st Ward — reverent serif theme.
   Mobile-first. Large, high-contrast, legible type for elderly
   readers (serif headings only; sans body; ≥44px tap targets).
   ============================================================ */

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
    --bg:           #f6f2e9;   /* warm stone / cream */
    --bg-2:         #efe8da;
    --surface:      #fffdf8;   /* card paper */
    --border:       #e2d8c4;
    --border-soft:  #efe7d7;

    --text:         #2b2620;   /* near-black warm */
    --text-muted:   #6c6253;

    --accent:       #1f3a63;   /* deep reverent navy */
    --accent-soft:  #2f5a96;
    --accent-deep:  #142844;

    --gold:         #b6852f;   /* temple gold */
    --gold-soft:    #f0e2c2;

    --sage:         #4a7c59;
    --sage-soft:    #dde9dd;

    --info-bg:      #e3ecf6;
    --info-fg:      #1f3a63;
    --ok-bg:        #dde9dd;
    --ok-fg:        #2c5238;
    --warn-bg:      #f6ead0;
    --warn-fg:      #6b4708;
    --error-bg:     #f4dcd6;
    --error-fg:     #7a2e1d;

    --shadow:       0 2px 8px rgba(40, 30, 10, 0.08);
    --shadow-lg:    0 10px 34px rgba(40, 30, 10, 0.16);
    --radius:       12px;
    --tap:          48px;

    --serif: "EB Garamond", Georgia, "Times New Roman", serif;
    --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ─── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(ellipse at top, rgba(255,255,255,0.6) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--sans);
    font-size: 18px;          /* large, legible base */
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 18px; }
.site-main { flex: 1 0 auto; padding-bottom: 2.5rem; }
.site-footer { flex-shrink: 0; }

a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--accent); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--accent); color: #fff; padding: .75rem 1rem; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

h1, h2, h3 { font-family: var(--serif); color: var(--accent-deep); line-height: 1.18; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

.eyebrow {
    display: block; font-family: var(--sans); font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .15em; color: var(--sage); margin: 0 0 .5rem;
}

/* ─── Banner + nav ───────────────────────────────────────── */
.site-banner {
    background: linear-gradient(180deg, var(--accent-deep), var(--accent));
    color: #fff; padding: 1.25rem 0; text-align: center;
    border-bottom: 4px solid var(--gold);
}
.brand { display: inline-block; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-name { display: block; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; letter-spacing: .01em; }
.brand-sub { display: block; font-size: .92rem; color: #d8e1ef; margin-top: .15rem; }

.site-nav { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.nav-row { display: flex; align-items: center; flex-wrap: wrap; }
.nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    min-height: var(--tap); margin: .35rem 0;
    background: none; border: 0; cursor: pointer; color: var(--accent-deep);
    font-family: var(--sans); font-size: 1.05rem; font-weight: 600; padding: 0 .25rem;
}
.nav-toggle .bar { display: block; width: 24px; height: 3px; background: var(--accent-deep); border-radius: 2px; }
.nav-toggle .bar + .bar { margin-top: 4px; }
.nav-toggle-text { margin-left: .35rem; }

.primary-nav { list-style: none; margin: 0; padding: 0; width: 100%; display: none; }
.primary-nav.open { display: block; padding-bottom: .5rem; }
.primary-nav li { border-top: 1px solid var(--border-soft); }
.primary-nav a {
    display: flex; align-items: center; min-height: var(--tap);
    padding: .35rem .25rem; color: var(--accent-deep); text-decoration: none;
    font-size: 1.1rem; font-weight: 500;
}
.primary-nav a.active { color: var(--gold); font-weight: 700; }

@media (min-width: 720px) {
    .nav-toggle { display: none; }
    .primary-nav { display: flex !important; width: auto; gap: .5rem; margin-left: auto; }
    .primary-nav li { border-top: 0; }
    .primary-nav a { padding: 0 .9rem; }
}

/* ─── Flash ──────────────────────────────────────────────── */
.flash { margin: 1rem 0 0; padding: .85rem 1rem; border-radius: var(--radius); font-weight: 600; }
.flash-success, .flash-ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash-info { background: var(--info-bg); color: var(--info-fg); }
.flash-error { background: var(--error-bg); color: var(--error-fg); }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.4rem 1.3rem; margin: 1.25rem 0;
}
.card > :last-child { margin-bottom: 0; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }

/* ─── Hero (theme of the week) ───────────────────────────── */
.hero {
    margin-top: 1.25rem; text-align: center; padding: 2rem 1.3rem;
    background: linear-gradient(180deg, var(--surface), var(--gold-soft));
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero.has-image { background-size: cover; background-position: center; color: #fff; }
.hero.has-image .hero-quote, .hero.has-image h1, .hero.has-image .hero-author { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.55); }
.hero-date { font-family: var(--sans); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; color: var(--sage); }
.hero h1 { margin: .35rem 0 .65rem; }
.hero-quote { font-family: var(--serif); font-style: italic; font-size: 1.4rem; line-height: 1.45; color: var(--accent-deep); margin: 0 auto .6rem; max-width: 36ch; }
.hero-author { font-weight: 600; color: var(--text-muted); }

/* ─── Big primary CTA (watch the meeting) ────────────────── */
.btn, button.btn { -webkit-appearance: none; appearance: none; cursor: pointer; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: var(--tap); padding: .7rem 1.4rem;
    font-family: var(--sans); font-size: 1.1rem; font-weight: 700;
    border-radius: 999px; border: 2px solid transparent; text-decoration: none; line-height: 1.1;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-deep); color: #fff; }
.btn-gold { background: var(--gold); color: #2b2008; border-color: var(--gold); }
.btn-gold:hover, .btn-gold:focus { filter: brightness(.95); color: #2b2008; }
.btn-ghost { background: var(--surface); color: var(--accent-deep); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent-soft); color: var(--accent-deep); }
.btn-danger { background: var(--error-bg); color: var(--error-fg); border-color: #e3b3a7; }
.btn-block { display: flex; width: 100%; }

.watch-cta { text-align: center; margin: 1.5rem 0; }
.watch-cta .btn { font-size: 1.25rem; padding: .95rem 1.8rem; box-shadow: var(--shadow-lg); }
.watch-cta .note { display: block; margin-top: .55rem; color: var(--text-muted); font-size: .95rem; }

/* ─── Order of service ───────────────────────────────────── */
.service-list { list-style: none; margin: 0; padding: 0; }
.service-item { padding: .75rem 0; border-bottom: 1px solid var(--border-soft); }
.service-item:last-child { border-bottom: 0; }
.service-label { font-family: var(--sans); font-weight: 700; color: var(--sage); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.service-value { font-family: var(--serif); font-size: 1.35rem; color: var(--accent-deep); margin-top: .1rem; }
.service-item.kind-ordinance .service-value,
.service-item.kind-business .service-value { font-style: italic; color: var(--text-muted); font-size: 1.15rem; }

.hymn-link {
    display: inline-flex; align-items: center; gap: .5rem; width: 100%;
    text-align: left; min-height: var(--tap); margin-top: .15rem;
    background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--gold);
    border-radius: 10px; padding: .55rem .85rem; cursor: pointer;
    font-family: var(--serif); font-size: 1.3rem; color: var(--accent-deep); text-decoration: none;
}
.hymn-link:hover, .hymn-link:focus { border-color: var(--accent-soft); border-left-color: var(--gold); color: var(--accent-deep); }
.hymn-link .hymn-icon { font-size: 1.2rem; color: var(--gold); }
.hymn-link .hymn-cue { margin-left: auto; font-family: var(--sans); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sage); }

/* ─── Announcements ──────────────────────────────────────── */
.ann { padding: 1rem 0; border-bottom: 1px solid var(--border-soft); }
.ann:last-child { border-bottom: 0; }
.ann h3 { margin: 0 0 .35rem; color: var(--accent); }
.ann p { margin: 0; white-space: pre-line; }

/* ─── Leadership directory ───────────────────────────────── */
.leaders { list-style: none; margin: 0; padding: 0; }
.leader-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; padding: .6rem 0; border-bottom: 1px solid var(--border-soft); }
.leader-row:last-child { border-bottom: 0; }
.leader-pos { font-weight: 700; color: var(--accent-deep); flex: 1 1 100%; }
.leader-name { color: var(--text); }
.leader-contact { margin-left: auto; }
.leader-contact a { min-height: var(--tap); display: inline-flex; align-items: center; font-weight: 600; }
@media (min-width: 560px) { .leader-pos { flex: 0 0 auto; min-width: 12rem; } }

/* ─── Insert / activity block ────────────────────────────── */
.insert-block { white-space: normal; }

/* ─── Forms (login + admin) ──────────────────────────────── */
.form-row { margin: 0 0 1rem; }
.form-row label { display: block; font-weight: 700; color: var(--accent-deep); margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=date], input[type=url],
input[type=email], input[type=tel], select, textarea {
    width: 100%; min-height: var(--tap); padding: .6rem .7rem; font: inherit;
    color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 10px;
}
textarea { min-height: 7rem; line-height: 1.5; resize: vertical; }
.field-help { color: var(--text-muted); font-size: .9rem; margin: .3rem 0 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.form { max-width: 26rem; margin: 1.5rem auto; }
.grid-2 { display: grid; gap: 0 1rem; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ─── Modal / overlay ────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-bg { position: absolute; inset: 0; background: rgba(20, 15, 5, 0.55); }
.modal-card {
    position: relative; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 88vh;
    overflow: auto; padding: 1.6rem 1.4rem; border-top: 5px solid var(--gold);
}
.modal-close {
    position: absolute; top: .4rem; right: .5rem; width: var(--tap); height: var(--tap);
    background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--text-muted); cursor: pointer;
}
.modal-close:hover { color: var(--accent-deep); }
.hymn-modal-num { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--sage); }
.hymn-modal-title { font-family: var(--serif); font-size: 1.7rem; color: var(--accent-deep); margin: .15rem 0 1rem; }
.hymn-lyrics { font-family: var(--serif); font-size: 1.3rem; line-height: 1.7; white-space: pre-wrap; color: var(--text); }

/* ─── Archive ────────────────────────────────────────────── */
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-item a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--tap); padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--accent-deep); margin-bottom: .6rem; }
.archive-item a:hover { border-color: var(--accent-soft); }
.archive-date { font-family: var(--serif); font-size: 1.25rem; }
.archive-cue { color: var(--gold); font-weight: 700; }

/* ─── Admin ──────────────────────────────────────────────── */
.admin-section { margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.admin-section > summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-family: var(--serif); font-size: 1.3rem; color: var(--accent-deep); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.admin-section > summary::-webkit-details-marker { display: none; }
.admin-section > summary::after { content: "▾"; color: var(--gold); }
.admin-section[open] > summary { border-bottom: 1px solid var(--border-soft); }
.admin-body { padding: 1.1rem 1.2rem; }
.admin-hint { background: var(--info-bg); color: var(--info-fg); padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; }
.item-row { display: flex; gap: .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border-soft); }
.item-row:last-child { border-bottom: 0; }
.item-row .grow { flex: 1; min-width: 0; }
.item-row .muted { color: var(--text-muted); font-size: .9rem; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 1rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 999px; }
.tag-published { background: var(--ok-bg); color: var(--ok-fg); }
.tag-draft { background: var(--warn-bg); color: var(--warn-fg); }

/* ============================================================
   Print: folded program. Used on /print/{date} (print.php) and
   when any page is sent to the printer.
   ============================================================ */
.print-only { display: none; }
.print-toolbar { text-align: center; margin: 1.25rem 0; }

@media print {
    @page { size: letter; margin: 0.5in; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .site-banner, .site-nav, .site-footer, .modal, .print-toolbar, .skip-link, .no-print { display: none !important; }
    .wrap { max-width: none; padding: 0; }
    a { color: #000; text-decoration: none; }
    .print-only { display: block; }

    .print-sheet { color: #000; }
    .print-sheet h1, .print-sheet h2, .print-sheet h3 { color: #000; }
    .print-cols { column-count: 2; column-gap: 0.5in; }
    .print-block { break-inside: avoid; margin-bottom: 12pt; }
    .print-title { text-align: center; font-family: var(--serif); }
    .print-rule { border: 0; border-top: 1px solid #000; margin: 6pt 0 10pt; }
    .print-service-row { display: flex; justify-content: space-between; gap: 1rem; padding: 3pt 0; }
    .print-service-row .lbl { font-weight: 700; }
    .print-hymn-lyrics { white-space: pre-wrap; font-family: var(--serif); font-size: 10pt; }
}
