@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;700&display=swap');

:root {
    --primary: #ff6a00;
    --accent: #ee0979;
    --bg: #f5f5f7;
    --surface: #fff;
    --text: #1d1d1f;
    --text-muted: #86868b;
    --radius: 12px;
}

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

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

body {
    font-family: 'Noto Sans Devanagari', -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.6;
}

a { color: var(--primary); }
a:hover { color: var(--accent); }

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

h1, h2, h3, h4, h5, h6 { line-height: 1.3; }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2...) no-repeat 1rem/1.8rem;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #b00;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Lightbox (global — appended to body via JS) */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    cursor: pointer;
}
.lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    color: #fff;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
    opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-caption {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.5);
    padding: 4px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
}
.loading-spinner--fullpage {
    min-height: 60vh;
}
.loading-spinner__ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #f0f0f0;
    border-top-color: #ee0979;
    animation: sanatan-spin 0.7s linear infinite;
}
.loading-spinner__text {
    font-size: 0.82rem;
    color: #86868b;
}
@keyframes sanatan-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .loading-spinner__ring { animation: none; opacity: 0.8; }
}

/* #region Dharma tree (ported from old SanatanApp tile layout) */
.dharma-banner { width: 100%; min-height: 100px; border-radius: 12px; display: block; }
.dharma-header { background: linear-gradient(135deg, #ff6a00, #ee0979); color: #fff; text-align: center; font-weight: 700; font-size: 1.6rem; padding: 16px; margin: 16px 0 20px; border-radius: 12px; }
.dharma-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; text-align: center; margin-bottom: 1rem; }
.dharma-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.dharma-grid .span-12 { grid-column: span 12; }
.dharma-grid .span-6 { grid-column: span 6; }
.dharma-grid .span-4 { grid-column: span 4; }
.dharma-grid .span-12 img { width: 100%; border-radius: 12px; aspect-ratio: 2/1; object-fit: cover; display: block; }
.dharma-grid .span-6 img, .dharma-grid .span-4 img { width: 100%; border-radius: 12px; aspect-ratio: 1/1; object-fit: cover; display: block; }
.dharma-tile { width: 100%; background: #fff; border-radius: 12px; padding-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.12); overflow: hidden; transition: transform .15s; }
.dharma-tile:active { transform: scale(.98); }
.dharma-tile a { text-decoration: none !important; color: #222 !important; }
.dharma-tile h1, .dharma-tile h2, .dharma-tile h3, .dharma-tile h4, .dharma-tile h5 { margin: 10px 6px 0; font-weight: 600; }
.dharma-tile h1 { font-size: 1.5rem; } .dharma-tile h2 { font-size: 1.3rem; } .dharma-tile h5 { font-size: 1rem; }
.dharma-tile p { margin: 4px 8px 0; font-size: .85rem; color: #666; }
.dharma-noimg { aspect-ratio: 1/1; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #fff; background: linear-gradient(135deg, #ff6a00, #ee0979); }
.dharma-tabs { display: flex; width: 100%; border-bottom: 2px solid #fc8e07; }
.dharma-tabs > div { flex: 1; text-align: center; padding: 10px; font-weight: 500; cursor: pointer; background: #f5f5f5; border: 1px solid #ddd; border-right: none; white-space: nowrap; }
.dharma-tabs > div:last-child { border-right: 1px solid #ddd; }
.dharma-tabs > div.active { background: linear-gradient(135deg, #ff6a00, #ee0979); color: #fff; border-color: transparent; }
.dharma-tabtopic { font-size: 1.6rem; font-weight: 700; color: #333; margin: 20px 0; text-align: center; }
/* #endregion */

/* #region Old SanatanApp article pages (WikiPage / GodPage / WikiTabs) */
.dharma-header h1 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.contentWrapper { word-wrap: break-word; overflow-wrap: break-word; box-sizing: border-box; text-align: justify; }
.contentWrapper h2 { text-align: center; font-size: 1.5em; margin: .83em 0; font-weight: bold; }
.rdfFieldset { padding: 20px; border: 1px solid #ddd; border-radius: 12px; background: #fff; }
.patrika-container { margin-bottom: 16px; border-radius: 12px; overflow: hidden; }
.patrika-header { background-color: #781010; padding: 20px; text-align: center; margin: 0; color: #fff; font-weight: bold; }
.patrika-content { padding: 20px; background-color: navajowhite; color: #000; text-align: justify; }
.patrika-content h2, .patrika-content h3 { text-align: center; }
.image-gallery { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.image-item { width: calc(33.333% - 10px); border-radius: 6px; overflow: hidden; background: #f6f6f6; aspect-ratio: 1 / 1; }
.image-item img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.wiki-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; justify-content: center; align-items: center; z-index: 1100; }
.wiki-modal { background: #fff; padding: 10px; border-radius: 8px; max-width: 90%; max-height: 90%; text-align: center; }
.popup-image { max-width: 100%; max-height: 80vh; border-radius: 4px; }
/* #endregion */

/* ─── Bhakt (user segment) ─── */
.bk-card { background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.07); padding: 16px; }
.bk-btn { background: linear-gradient(135deg, #ff6a00, #ee0979); color: #fff !important; border: none; font-weight: 600; }
.bk-btn:disabled { opacity: .55; }
.bk-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.bk-avatar--empty { background: linear-gradient(135deg, #ff6a00, #ee0979); color: #fff; font-weight: 700; }
.bk-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: #fff3e8; color: #c2410c; text-decoration: none; }
.bk-body { white-space: pre-line; word-break: break-word; }
.bk-body--clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.bk-media { display: grid; gap: 2px; background: #000; }
.bk-media--grid { grid-template-columns: 1fr 1fr; }
.bk-media img, .bk-media video { width: 100%; max-height: 520px; object-fit: cover; display: block; }
.bk-media--grid img, .bk-media--grid video { aspect-ratio: 1/1; max-height: none; }
.bk-action { color: #555; border: none; border-radius: 999px; }
.bk-action:hover { background: #f3f3f3; }
.bk-action--on { color: #ee0979; font-weight: 600; }
.bk-religions { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.bk-religion { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; border: 2px solid #e5e5e5; background: #fff; color: #444; }
.bk-religion.on { border-color: #ee0979; background: #fff0f6; color: #b0005a; }
.bk-religion i { font-size: 1.2rem; }
.bk-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.bk-page { position: relative; border: 2px solid transparent; border-radius: 12px; background: #fff; padding: 6px; text-align: center; font-size: .78rem; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.bk-page img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; }
.bk-page.on { border-color: #ee0979; }
.bk-page .bk-check { position: absolute; top: 4px; right: 6px; color: #ee0979; font-size: 1.1rem; }
.bk-list .list-group-item { display: flex; align-items: center; gap: 12px; }
.bk-list .list-group-item > i:first-child { font-size: 1.2rem; color: #ee0979; width: 24px; text-align: center; }
.bk-heat { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; overflow-x: auto; }
.bk-heat span { border-radius: 3px; background: #eee; }
.bk-heat span.l1 { background: #fdba74; } .bk-heat span.l2 { background: #f97316; } .bk-heat span.l3 { background: #c2410c; }
.bk-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.bk-steps span { width: 28px; height: 4px; border-radius: 2px; background: #ddd; }
.bk-steps span.on { background: #ee0979; }
.min-w-0 { min-width: 0; }
