/* ===========================================================
   Many Faiths — site stylesheet
   Editorial, neutral, scholarly. Warm "manuscript" paper with a
   single restrained bronze accent so no faith is visually favoured.
   Design language adapted from GeoMonix.
   =========================================================== */

:root {
    --paper:        #fbfaf7;   /* warm near-white page          */
    --paper-warm:   #f3f1ea;   /* section band                  */
    --paper-deep:   #1c1b18;   /* near-black band               */
    --ink:          #1c1b18;   /* headings                      */
    --ink-soft:     #46443e;   /* body text                     */
    --ink-mute:     #78756c;   /* captions, meta                */
    --line:         #e6e3da;   /* hairline borders              */
    --line-soft:    #efece4;
    --accent:       #8a6d3b;   /* restrained bronze             */
    --accent-dark:  #6f5629;
    --accent-wash:  #f0e9db;

    --ok:           #2e6d4f;
    --warn-bg:      #fbf0d9;
    --warn-ink:     #8a6300;

    --serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
    --sans:  'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --wrap: 1140px;
    --header-h: 76px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    color: var(--ink);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
strong { color: var(--ink); font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 820px; }

.skip-link {
    position: absolute; left: 16px; top: -100%;
    z-index: 400; padding: 10px 20px;
    background: var(--accent); color: #fff; font-weight: 600; border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* ── header ── */
.site-header {
    position: sticky; top: 0; z-index: 100; height: var(--header-h);
    background: rgba(251,250,247,0.94);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.brand .brand-mark { color: var(--accent); }
.brand-glyph { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }

.nav { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav a { display: block; padding: 9px 13px; font-size: 0.94rem; font-weight: 500; color: var(--ink-soft); border-radius: 6px; }
.nav a:hover { color: var(--ink); background: var(--line-soft); }
.nav a.current { color: var(--accent); }
.nav .nav-cta { margin-left: 8px; padding: 9px 18px; background: var(--ink); color: #fff; border-radius: 6px; }
.nav .nav-cta:hover { background: var(--accent); color: #fff; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .25s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; font-family: var(--sans); font-size: 0.96rem; font-weight: 600; border-radius: 7px; cursor: pointer; border: 1px solid transparent; transition: all .2s ease; }
.btn-solid { background: var(--ink); color: #fff; }
.btn-solid:hover { background: var(--accent); color: #fff; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--ink); color: var(--ink); }
.btn-full { width: 100%; justify-content: center; }

/* ── sections ── */
.section { padding: 92px 0; }
.section-warm { background: var(--paper-warm); }
.section + .section { border-top: 1px solid var(--line); }
.section-warm + .section, .section + .section-warm { border-top: none; }

.eyebrow { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-head { max-width: 700px; margin-bottom: 50px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-bottom: 14px; }
.section-head p { font-size: 1.08rem; }
.lead { font-size: 1.18rem; line-height: 1.65; color: var(--ink-soft); }

.hero-sub, .section-head p, .prose p, .card p, .lead { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }

/* ── hero ── */
.hero { padding: 88px 0 72px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.08; margin-bottom: 22px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 1.18rem; max-width: 62ch; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-note { font-size: 0.92rem; color: var(--ink-mute); padding-top: 22px; border-top: 1px solid var(--line); max-width: 70ch; }

/* ── principles strip ── */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.fact { padding: 26px 24px; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact-num { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.fact-label { font-size: 0.9rem; color: var(--ink-mute); margin-top: 8px; }

/* ── cards ── */
.cards { display: grid; gap: 24px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 30px 28px; transition: border-color .2s ease, transform .2s ease; }
.section-warm .card { background: #fff; }
.card:hover { border-color: var(--ink); }
a.card:hover { transform: translateY(-3px); }
.card h3 { font-size: 1.22rem; margin-bottom: 10px; }
.card p { font-size: 0.98rem; }
.card-more { display: inline-block; margin-top: 18px; font-size: 0.92rem; font-weight: 600; color: var(--accent); }
a.card:hover .card-more { color: var(--accent-dark); }
.card-list { list-style: none; margin-top: 16px; }
.card-list li { position: relative; padding-left: 18px; font-size: 0.93rem; color: var(--ink-mute); margin-top: 7px; }
.card-list li::before { content: ""; position: absolute; left: 0; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ── faith directory cards ── */
.faith-card { display: flex; flex-direction: column; }
.faith-card .faith-glyph { width: 44px; height: 44px; color: var(--accent); margin-bottom: 16px; }
.faith-card .faith-status { margin-top: auto; padding-top: 16px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-mute); }
.faith-card .faith-status.live { color: var(--ok); }

/* ── split ── */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: start; }
.prose p { margin-bottom: 18px; }
.prose p:last-child { margin-bottom: 0; }

/* ── article / faith content ── */
.article { padding: 56px 0 24px; }
.article .container { max-width: 820px; margin: 0 auto; padding: 0 28px; }
.article-content { font-size: 1.06rem; line-height: 1.78; color: var(--ink-soft); }
.article-content > p { margin-bottom: 20px; text-align: justify; hyphens: auto; }
.article-lead { font-size: 1.2rem; line-height: 1.6; color: var(--ink); margin-bottom: 26px; }
.article-content h2 { font-size: 1.6rem; margin: 44px 0 16px; }
.article-content h3 { font-size: 1.28rem; margin: 30px 0 12px; }
.article-content ul, .article-content ol { margin: 0 0 22px 22px; }
.article-content li { margin-bottom: 10px; }
.article-content blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 22px; margin: 22px 0; font-family: var(--serif); font-style: italic; color: var(--ink); }
.article-content .cite { display: block; font-style: normal; font-family: var(--sans); font-size: 0.86rem; color: var(--ink-mute); margin-top: 8px; }

.article-tag { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 11px; border-radius: 4px; background: var(--accent-wash); color: var(--accent-dark); }

/* jump / contents box */
.contents-box { background: var(--paper-warm); border: 1px solid var(--line); border-radius: 10px; padding: 22px 26px; margin: 0 0 36px; }
.contents-box h4 { font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 12px; }
.contents-box ul { list-style: none; }
.contents-box li { margin: 6px 0; }
.contents-box a { font-weight: 500; }

/* source list */
.source-list { border-top: 1px solid var(--line); margin-top: 12px; }
.source-item { display: grid; grid-template-columns: 30px 1fr; gap: 16px; padding: 18px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.source-item .src-num { font-family: var(--serif); color: var(--ink-mute); }
.source-item h4 { font-size: 1rem; margin-bottom: 4px; }
.source-item p { font-size: 0.9rem; color: var(--ink-mute); }

/* callout */
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--paper-warm); border-radius: 8px; padding: 20px 24px; margin: 26px 0; font-size: 0.98rem; }
.callout strong { color: var(--ink); }

/* ── CTA band ── */
.cta-band { background: var(--paper-deep); color: #cfcdc6; }
.cta-band h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.cta-band p { margin: 14px 0 28px; font-size: 1.08rem; }
.cta-band .btn-solid { background: var(--accent); }
.cta-band .btn-solid:hover { background: #fff; color: var(--ink); }
.cta-band .btn-line { color: #fff; border-color: rgba(255,255,255,0.3); }
.cta-band .btn-line:hover { border-color: #fff; }

/* ── footer ── */
.site-footer { background: var(--paper-deep); color: #a3a199; padding: 60px 0 30px; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 36px; }
.site-footer .brand { color: #fff; }
.site-footer .brand .brand-mark, .site-footer .brand-glyph { color: #fff; }
.footer-tag { margin-top: 12px; font-size: 0.92rem; max-width: 38ch; }
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
.footer-col a { display: block; color: #a3a199; font-size: 0.93rem; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.82rem; color: #7a786f; }

/* ===========================================================
   Disclaimer modal (mandatory on first visit)
   =========================================================== */
.modal-veil { position: fixed; inset: 0; z-index: 500; background: rgba(28,27,24,0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
.modal-veil.show { opacity: 1; visibility: visible; }
.modal { background: var(--paper); border-radius: 14px; max-width: 560px; width: 100%; padding: 38px 38px 32px; box-shadow: 0 24px 70px rgba(0,0,0,0.3); transform: translateY(12px); transition: transform .25s ease; max-height: 90vh; overflow-y: auto; }
.modal-veil.show .modal { transform: translateY(0); }
.modal .modal-glyph { width: 40px; height: 40px; color: var(--accent); margin-bottom: 16px; }
.modal h2 { font-size: 1.5rem; margin-bottom: 14px; }
.modal p { font-size: 0.98rem; margin-bottom: 14px; }
.modal ul { margin: 0 0 18px 20px; font-size: 0.95rem; }
.modal li { margin-bottom: 8px; }
.modal .modal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.modal .agree-row { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 20px; font-size: 0.92rem; color: var(--ink-soft); }
.modal .agree-row input { margin-top: 5px; }

/* ===========================================================
   AI chat — floating widget + full page
   =========================================================== */
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 300; width: 60px; height: 60px; border-radius: 50%; background: var(--ink); color: #fff; border: none; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center; transition: transform .2s ease, background .2s ease; }
.chat-fab:hover { transform: scale(1.06); background: var(--accent); }
.chat-fab svg { width: 26px; height: 26px; }

.chat-panel { position: fixed; right: 22px; bottom: 94px; z-index: 300; width: 400px; max-width: calc(100vw - 44px); height: 620px; max-height: calc(100vh - 130px); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.22); display: flex; flex-direction: column; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.98); transform-origin: bottom right; transition: all .22s ease; }
.chat-panel.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.chat-page-wrap { max-width: 900px; margin: 0 auto; padding: 0 28px; }
.chat-embed { height: min(72vh, 680px); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; background: var(--paper); }

.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--paper-warm); }
.chat-head .ch-title { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.chat-head .ch-sub { font-size: 0.78rem; color: var(--ink-mute); }
.chat-close { background: none; border: none; cursor: pointer; color: var(--ink-mute); font-size: 1.4rem; line-height: 1; padding: 2px 6px; }
.chat-close:hover { color: var(--ink); }

.chat-scope { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 0.85rem; background: var(--paper); }
.chat-scope label { color: var(--ink-mute); }
.chat-scope select { flex: 1; padding: 7px 10px; font-family: var(--sans); font-size: 0.88rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); }

.chat-log { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 12px; font-size: 0.95rem; line-height: 1.6; }
.msg-user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: var(--paper-warm); color: var(--ink-soft); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-bot .sources { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 0.82rem; }
.msg-bot .sources h5 { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px; }
.msg-bot .sources a, .msg-bot .sources span { display: block; color: var(--accent); margin: 3px 0; }
.msg-note { align-self: center; font-size: 0.8rem; color: var(--ink-mute); text-align: center; max-width: 90%; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; background: var(--ink-mute); border-radius: 50%; animation: blink 1.2s infinite both; }
.typing span:nth-child(2){animation-delay:.2s} .typing span:nth-child(3){animation-delay:.4s}
@keyframes blink { 0%,80%,100%{opacity:.2} 40%{opacity:1} }

.chat-input { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; background: var(--paper); }
.chat-input textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--sans); font-size: 0.92rem; color: var(--ink); max-height: 120px; outline: none; }
.chat-input textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.chat-send { background: var(--ink); color: #fff; border: none; border-radius: 8px; width: 44px; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-send:hover { background: var(--accent); }
.chat-send svg { width: 18px; height: 18px; }
.chat-disclaim { font-size: 0.72rem; color: var(--ink-mute); text-align: center; padding: 6px 12px 10px; background: var(--paper); }

/* ── forms / admin ── */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 12px 14px; font-family: var(--sans); font-size: 0.96rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.form-field textarea { resize: vertical; min-height: 120px; }

.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 44px 24px; text-align: center; color: var(--ink-mute); background: var(--paper-warm); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-wash); }
.dropzone svg { width: 40px; height: 40px; color: var(--accent); margin: 0 auto 12px; }

.badge { display: inline-block; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 10px; border-radius: 4px; }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-ok { background: #e4f0ea; color: var(--ok); }

.locked-note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 16px 20px; font-size: 0.92rem; margin-bottom: 26px; }

/* table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 24px 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.tbl th, table.tbl td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl thead th { background: var(--paper-warm); font-family: var(--serif); color: var(--ink); font-weight: 600; }
table.tbl tbody tr:last-child td { border-bottom: none; }

/* ── responsive ── */
@media (max-width: 940px) {
    .split, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
    .cards-3 { grid-template-columns: repeat(2, 1fr); }
    .facts { grid-template-columns: repeat(2, 1fr); }
    .fact:nth-child(3) { border-left: none; }
    .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
    .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
    body { font-size: 16px; }
    .section { padding: 60px 0; }
    .hero { padding: 52px 0 56px; }
    .nav-toggle { display: flex; }
    .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 20px 20px; transform: translateY(-130%); transition: transform .25s ease; }
    .nav.open { transform: translateY(0); }
    .nav a { padding: 13px 8px; font-size: 1.02rem; }
    .nav .nav-cta { margin: 8px 0 0; text-align: center; }
    .cards-3, .cards-2 { grid-template-columns: 1fr; }
    .facts { grid-template-columns: 1fr; }
    .fact + .fact { border-left: none; border-top: 1px solid var(--line); }
    .footer-top { grid-template-columns: 1fr; gap: 28px; }
    .chat-panel { right: 12px; left: 12px; bottom: 88px; width: auto; height: calc(100vh - 120px); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
