/* ============================================================
   PAGES.CSS — Shared components for the expanded content pages
   (visit guides, temple/faith, festivals, caves, blog, utility).
   Builds on base.css tokens + components.css. Load AFTER components.css.
   ============================================================ */

/* ---- Readable prose ---- */
.rich {
    max-width: 760px;
    margin: 0 auto;
}
.rich.wide { max-width: 920px; }

.rich p,
.rich li {
    font-size: 1rem;
    color: #333;
}
.rich p { margin-bottom: 18px; }

.rich h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    color: var(--maroon);
    margin: 40px 0 14px;
}
.rich h3 {
    font-size: 1.2rem;
    color: var(--maroon);
    margin: 28px 0 10px;
}
.rich ul,
.rich ol {
    margin: 0 0 18px 1.2em;
}
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }
.rich li { margin-bottom: 8px; }
.rich a {
    color: var(--maroon);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rich a:hover { color: var(--saffron); }
.rich strong { font-weight: 600; }

.lead {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #444;
    font-weight: 300;
}

/* ---- Answer-first summary (good for visitors and AI retrieval) ---- */
.answer-card {
    background: var(--cream);
    border: 1px solid #f0d98a;
    border-left: 4px solid var(--saffron);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 0 auto 36px;
    max-width: 760px;
}
.answer-card h2 {
    font-size: 1.05rem;
    color: var(--maroon);
    margin-bottom: 8px;
}
.answer-card p { margin-bottom: 0; color: #4a3b00; }

/* ---- Table of contents ---- */
.toc {
    background: var(--white);
    border: 1px solid rgba(128, 0, 32, 0.12);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 0 auto 32px;
    max-width: 760px;
}
.toc h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; color: #777; margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; columns: 2; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--maroon); font-weight: 500; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---- Data / info tables ---- */
.info-table-wrap { overflow-x: auto; margin: 24px auto; max-width: 920px; }
.info-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    font-size: 0.92rem;
}
.info-table th,
.info-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.info-table thead th {
    background: var(--maroon);
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
}
.info-table tbody tr:nth-child(even) { background: rgba(128, 0, 32, 0.03); }
.info-table caption { caption-side: bottom; font-size: 0.78rem; color: #888; padding-top: 8px; text-align: left; }

/* ---- Verified-fact grid ---- */
.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 24px 0;
}

/* ---- Generic card grid (steps, options, highlights) ---- */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
    margin: 28px 0;
}
.guide-card {
    background: var(--white);
    border: 1px solid rgba(128, 0, 32, 0.1);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
}
.guide-card h3 { color: var(--maroon); font-size: 1.15rem; margin-bottom: 10px; }
.guide-card p { font-size: 0.95rem; color: #444; margin-bottom: 10px; }
.guide-card .guide-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }

/* ---- Numbered steps / itinerary timeline ---- */
.steps-list { counter-reset: step; max-width: 820px; margin: 24px auto; }
.steps-list .step {
    position: relative;
    padding: 4px 0 24px 56px;
    border-left: 2px solid rgba(128, 0, 32, 0.18);
    margin-left: 18px;
}
.steps-list .step:last-child { border-left-color: transparent; }
.steps-list .step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: -19px;
    top: 0;
    width: 36px;
    height: 36px;
    background: var(--saffron);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
}
.steps-list .step h3 { color: var(--maroon); font-size: 1.1rem; margin-bottom: 4px; }
.steps-list .step .step-meta { font-size: 0.8rem; color: #888; }
.steps-list .step p { font-size: 0.95rem; color: #444; margin: 6px 0 0; }

/* ---- Calendar / notice / news lists ---- */
.entry-list { max-width: 820px; margin: 24px auto; display: grid; gap: 16px; }
.entry {
    background: var(--white);
    border: 1px solid rgba(128, 0, 32, 0.1);
    border-left: 4px solid var(--saffron);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
}
.entry .entry-date { font-size: 0.78rem; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.entry h3 { color: var(--maroon); font-size: 1.1rem; margin: 4px 0 6px; }
.entry p { font-size: 0.93rem; color: #444; margin-bottom: 6px; }
.entry .entry-tag {
    display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    padding: 2px 8px; border-radius: 50px; background: #fff3e0; color: #9a6700; margin-right: 6px;
}
.entry.is-past { border-left-color: #bbb; opacity: 0.85; }

/* ---- Related guides block ---- */
.related {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 28px;
    margin: 40px auto 0;
    max-width: 920px;
}
.related h2 { font-size: 1.2rem; color: var(--maroon); margin-bottom: 16px; text-align: center; }
.related-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.related-links a {
    display: block; background: var(--white); border-radius: var(--radius-sm);
    padding: 14px 16px; box-shadow: var(--shadow-card); color: var(--maroon); font-weight: 600;
    border: 1px solid rgba(128, 0, 32, 0.08); transition: transform var(--transition), box-shadow var(--transition);
}
.related-links a:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--saffron); }
.related-links a span { display: block; font-size: 0.8rem; font-weight: 400; color: #777; margin-top: 2px; }

/* ---- Inline visitor CTA ---- */
.cta-inline {
    text-align: center;
    background: linear-gradient(135deg, var(--maroon), #5c0017);
    color: var(--white);
    border-radius: var(--radius);
    padding: 32px 24px;
    margin: 40px auto 0;
    max-width: 920px;
}
.cta-inline h2 { color: var(--gold); font-size: 1.4rem; margin-bottom: 8px; }
.cta-inline p { opacity: 0.9; margin-bottom: 18px; }

/* ---- Source list / citations ---- */
.source-list { max-width: 760px; margin: 32px auto 0; font-size: 0.85rem; color: #666; }
.source-list h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; color: #777; margin-bottom: 8px; }
.source-list li { margin-bottom: 6px; list-style: none; padding-left: 16px; text-indent: -16px; }
.source-list a { color: var(--maroon); }

/* ---- Glossary ---- */
.glossary { max-width: 760px; margin: 0 auto; }
.glossary dt { font-weight: 600; color: var(--maroon); margin-top: 16px; }
.glossary dd { margin: 4px 0 0; color: #444; }

/* ---- Two clearly-labelled columns: history vs tradition ---- */
.split-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 980px; margin: 24px auto; }
.split-col { border-radius: var(--radius); padding: 24px; }
.split-col.history { background: #eef3f7; border: 1px solid #cfe0ec; }
.split-col.tradition { background: #fff7ec; border: 1px solid #f0d9a8; }
.split-col h2 { font-size: 1.15rem; margin-bottom: 6px; }
.split-col.history h2 { color: #1b4965; }
.split-col.tradition h2 { color: #8a5a00; }
.split-col .split-tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.split-col.history .split-tag { color: #1b4965; }
.split-col.tradition .split-tag { color: #b07b00; }
.split-col p, .split-col li { font-size: 0.95rem; color: #3a3a3a; }

/* ---- Status banner for noindex/unpublished pages ---- */
.draft-banner {
    background: #fff3cd; border: 1px solid #ffe69c; color: #7a5b00;
    border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 auto 28px; max-width: 820px;
    font-size: 0.9rem; text-align: center;
}

/* ---- Simple content section heading offset for anchored links ---- */
.rich h2[id], .rich h3[id], section[id] { scroll-margin-top: calc(var(--nav-height) + 16px); }

/* ---- FAQ accordion (reusable; driven by js/faq.js) ---- */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-group-title { color: var(--maroon); font-size: 1.25rem; margin: 36px auto 14px; max-width: 820px; }
.faq-item {
    border: 1px solid rgba(128, 0, 32, 0.12);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: var(--white);
    overflow: hidden;
}
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--maroon);
}
.faq-question:hover { background: rgba(128, 0, 32, 0.03); }
.faq-toggle { font-size: 1.5rem; color: var(--saffron); transition: transform var(--transition); flex-shrink: 0; line-height: 1; }
.faq-item.active .faq-toggle { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height var(--transition-slow); }
.faq-item.active .faq-answer { max-height: 1200px; }
.faq-answer p { padding: 0 20px 18px; font-size: 0.95rem; color: #444; margin: 0; }
.faq-answer a { color: var(--maroon); font-weight: 600; text-decoration: underline; }

/* ---- Content images / figures ---- */
.content-figure { margin: 30px auto; max-width: 760px; }
.content-figure.wide { max-width: 920px; }
.content-figure img {
    width: 100%; height: auto; display: block;
    border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.content-figure figcaption {
    font-size: 0.8rem; color: #777; margin-top: 8px; text-align: center; line-height: 1.5;
}
.content-figure figcaption .credit { color: #999; }
.content-figure.float-right { float: right; max-width: 380px; margin: 6px 0 20px 28px; }
.content-figure.float-left { float: left; max-width: 380px; margin: 6px 28px 20px 0; }

/* two images side by side */
.figure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 920px; margin: 30px auto; }
.figure-row figure { margin: 0; }
.figure-row img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.figure-row figcaption { font-size: 0.78rem; color: #777; margin-top: 6px; text-align: center; }

@media (max-width: 680px) {
    .content-figure.float-right, .content-figure.float-left { float: none; max-width: 100%; margin: 26px auto; }
    .figure-row { grid-template-columns: 1fr; }
}

/* ---- Video embed (click-to-load facade; loaded by js/video.js) ---- */
.media-embed { max-width: 760px; margin: 30px auto; }
.video-embed {
    position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); cursor: pointer; background: #000;
}
.video-embed > img { width: 100%; height: 100%; object-fit: cover; opacity: 0.82; display: block; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed .play-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.video-embed .play-badge::before { content: ''; width: 70px; height: 70px; border-radius: 50%; background: rgba(128, 0, 32, 0.88); box-shadow: 0 4px 18px rgba(0,0,0,0.4); }
.video-embed .play-badge::after { content: ''; position: absolute; border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent #fff; transform: translateX(3px); }
.video-embed:hover .play-badge::before { background: var(--maroon); }
.video-embed:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; }
.media-caption { font-size: 0.8rem; color: #777; margin-top: 8px; text-align: center; line-height: 1.5; }
.media-caption .credit { color: #999; }

/* ---- Site search ---- */
.search-box { max-width: 640px; margin: 0 auto 24px; display: flex; gap: 8px; }
.search-box input {
    flex: 1; padding: 14px 18px; border: 1px solid rgba(128, 0, 32, 0.25);
    border-radius: 50px; font-family: var(--font-body); font-size: 1rem;
}
.search-box input:focus { outline: 3px solid var(--saffron); outline-offset: 1px; }
.search-count { text-align: center; color: #777; font-size: 0.85rem; margin-bottom: 16px; }
.search-results { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.search-hit {
    display: block; background: var(--white); border: 1px solid rgba(128, 0, 32, 0.1);
    border-left: 4px solid var(--saffron); border-radius: var(--radius-sm);
    padding: 14px 18px; box-shadow: var(--shadow-card);
}
.search-hit:hover { box-shadow: var(--shadow); }
.search-hit-title { display: block; color: var(--maroon); font-weight: 600; font-family: var(--font-heading); }
.search-hit-desc { display: block; color: #666; font-size: 0.88rem; margin-top: 3px; }
.search-empty { text-align: center; color: #666; }

/* ---- Responsive ---- */
@media (max-width: 760px) {
    .toc ul { columns: 1; }
    .split-cols { grid-template-columns: 1fr; }
    .answer-card, .toc, .rich { padding-left: 4px; padding-right: 4px; }
}
