/* ===== Bayt ul-Ahzan luxury theme: cream + emerald + gold (no external fonts) ===== */
:root {
    --primary: #14584A;      /* emerald */
    --secondary: #C9A24B;    /* gold */
    --light: #FBF6EA;        /* cream */
    --dark: #0C2B26;         /* deep green-black */
    --bh-cream-2: #F3EAD3;
    --bh-turquoise: #1A9E94;
    --bh-gold: #C9A24B;
    --bh-emerald: #14584A;
    --bh-emerald-dark: #0C3B32;
    --bs-primary: #14584A;
}

html { scroll-behavior: smooth; }
body {
    background: var(--light);
    color: #2b2f2e;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Tahoma, Arial, sans-serif;
    line-height: 1.7;
}
h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6, .navbar-brand {
    font-family: Georgia, "Palatino Linotype", "Book Antiqua", "Times New Roman", Tahoma, serif;
    color: var(--bh-emerald-dark);
    letter-spacing: .2px;
}
#spinner { display: none !important; }

/* --- colour overrides for Bootstrap 5.0 hard-coded greens --- */
a { color: var(--bh-emerald); }
a:hover { color: var(--bh-gold); }
.text-primary { color: var(--bh-emerald) !important; }
.bg-primary { background-color: var(--bh-emerald) !important; }
.border-primary { border-color: var(--bh-emerald) !important; }
.btn-primary {
    color: #fff; background: linear-gradient(135deg, #1B6B59, #0F4A3C);
    border: 1px solid #0F4A3C; box-shadow: 0 6px 16px rgba(20,88,74,.25);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    color: #fff; background: linear-gradient(135deg, #C9A24B, #A9832F);
    border-color: #A9832F; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(201,162,75,.35);
}
.btn-outline-primary { color: var(--bh-emerald); border-color: var(--bh-emerald); }
.btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary {
    color: #fff; background: var(--bh-emerald); border-color: var(--bh-emerald);
}
.btn-link { color: var(--bh-emerald); }
.btn-secondary { background: var(--bh-gold); border-color: var(--bh-gold); color: #1d1a0f; }
.dropdown-item.active, .dropdown-item:active { background-color: var(--bh-emerald); }
.page-link { color: var(--bh-emerald); }
.page-item.active .page-link { background-color: var(--bh-emerald); border-color: var(--bh-emerald); }
.form-control:focus { border-color: var(--bh-turquoise); box-shadow: 0 0 0 .2rem rgba(26,158,148,.18); }
.form-control { background-color: #fffdf7; border-color: #e5dcc2; }

/* --- navbar --- */
.sticky-top.bg-white, .navbar.bg-white, .navbar-light { background-color: rgba(251,246,234,.96) !important; }
.navbar { border-bottom: 1px solid #eadfc4; }
.navbar .navbar-nav .nav-link { color: var(--bh-emerald-dark); font-weight: 600; }
.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active { color: var(--bh-gold); }
.navbar .dropdown-menu { background: #fffdf7 !important; border: 1px solid #eadfc4; box-shadow: 0 12px 28px rgba(12,43,38,.12); }

/* --- 3D logo (pure CSS + tiny JS tilt in main.js) --- */
.navbar-brand { perspective: 700px; }
.navbar-brand img {
    transform-style: preserve-3d;
    transition: transform .25s ease-out, filter .25s ease-out;
    filter: drop-shadow(0 6px 6px rgba(12,43,38,.28)) drop-shadow(0 14px 14px rgba(12,43,38,.18));
    animation: bh-float 5s ease-in-out infinite;
    will-change: transform;
}
.navbar-brand:hover img {
    filter: drop-shadow(0 10px 8px rgba(12,43,38,.35)) drop-shadow(0 22px 20px rgba(201,162,75,.30));
}
@keyframes bh-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -4px; }
}

/* --- page header band with slow-moving Islamic star pattern --- */
.bh-header {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #0C3B32 0%, #14584A 55%, #1A7A6C 100%);
}
.bh-header::before {
    content: ""; position: absolute; inset: -50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27420%27 height=%27280%27 viewBox=%270 0 420 280%27%3E%3Cg font-family=%27Scheherazade New%2C Amiri%2C Traditional Arabic%2C Arial%2C Tahoma%2C serif%27 font-size=%2740%27 fill=%27%23E8C766%27 fill-opacity=%27.13%27 text-anchor=%27middle%27%3E%3Ctext x=%27210%27 y=%2780%27%3E%D8%A7%D9%84%D9%84%D9%8E%D9%91%D9%87%D9%8F%D9%85%D9%8E%D9%91 %D8%B9%D9%8E%D8%AC%D9%90%D9%91%D9%84%D9%92 %D9%84%D9%90%D9%88%D9%8E%D9%84%D9%90%D9%8A%D9%90%D9%91%D9%83%D9%8E %D8%A7%D9%84%D9%92%D9%81%D9%8E%D8%B1%D9%8E%D8%AC%D9%8E%3C/text%3E%3Ctext x=%270%27 y=%27220%27%3E%D8%A7%D9%84%D9%84%D9%8E%D9%91%D9%87%D9%8F%D9%85%D9%8E%D9%91 %D8%B9%D9%8E%D8%AC%D9%90%D9%91%D9%84%D9%92 %D9%84%D9%90%D9%88%D9%8E%D9%84%D9%90%D9%8A%D9%90%D9%91%D9%83%D9%8E %D8%A7%D9%84%D9%92%D9%81%D9%8E%D8%B1%D9%8E%D8%AC%D9%8E%3C/text%3E%3Ctext x=%27420%27 y=%27220%27%3E%D8%A7%D9%84%D9%84%D9%8E%D9%91%D9%87%D9%8F%D9%85%D9%8E%D9%91 %D8%B9%D9%8E%D8%AC%D9%90%D9%91%D9%84%D9%92 %D9%84%D9%90%D9%88%D9%8E%D9%84%D9%90%D9%8A%D9%90%D9%91%D9%83%D9%8E %D8%A7%D9%84%D9%92%D9%81%D9%8E%D8%B1%D9%8E%D8%AC%D9%8E%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-size: 420px 280px;
    animation: bh-pattern 140s linear infinite;
    will-change: transform;
}
.bh-header > .container { position: relative; z-index: 1; }
.bh-header h1, .bh-header .text-dark, .bh-header .breadcrumb-item,
.bh-header .breadcrumb-item a, .bh-header .breadcrumb-item + .breadcrumb-item::before {
    color: #FBF6EA !important; text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.bh-header .breadcrumb-item a:hover { color: var(--bh-gold) !important; }
@keyframes bh-pattern { to { transform: translate(420px, 280px); } }

/* --- cards, images, sections --- */
img { max-width: 100%; height: auto; }
.card, .testimonial-item, .team-item, .service-item, .product-item {
    border: 1px solid #eadfc4; border-radius: 14px; background: #fffdf7;
    box-shadow: 0 8px 24px rgba(12,43,38,.07); overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(12,43,38,.16); }
.card-img-top, .img-fluid { transition: transform .5s ease; }
.card:hover .card-img-top { transform: scale(1.04); }
.rounded, .img-fluid.rounded { border-radius: 14px !important; }
.section-title p, .fst-italic.text-primary { color: var(--bh-gold) !important; }
.section-title::before, .section-title::after { background: var(--bh-gold) !important; }
.btn-square { background: linear-gradient(135deg, #1B6B59, #0F4A3C) !important; color: #fff; }
.contact .btn-square { background: var(--bh-emerald) !important; }
.bg-light { background-color: var(--bh-cream-2) !important; }

/* --- footer --- */
.footer { background: linear-gradient(180deg, #0C3B32, #082a23) !important; color: #d9e6df; }
.footer h4, .footer .text-primary { color: var(--bh-gold) !important; }
.footer .btn.btn-link { color: #d9e6df; }
.footer .btn.btn-link:hover { color: var(--bh-gold); }
.copyright { background: #061f1a !important; color: #b9cbc3; }
.copyright a { color: var(--bh-gold); }
.back-to-top { background: var(--bh-gold) !important; border-color: var(--bh-gold) !important; }

/* --- floating donate button (all pages) --- */
.bh-donate-fab {
    position: fixed; left: 18px; bottom: 22px; z-index: 1030;
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .7rem 1.2rem; border-radius: 999px; font-weight: 700; text-decoration: none;
    color: #1d1a0f !important; background: linear-gradient(135deg, #E8C766, #C9A24B);
    box-shadow: 0 10px 26px rgba(201,162,75,.45);
    animation: bh-pulse 2.6s ease-in-out infinite;
}
.bh-donate-fab:hover { transform: translateY(-3px); color: #000 !important; }
@keyframes bh-pulse {
    0%, 100% { box-shadow: 0 10px 26px rgba(201,162,75,.45), 0 0 0 0 rgba(201,162,75,.45); }
    50% { box-shadow: 0 10px 26px rgba(201,162,75,.45), 0 0 0 12px rgba(201,162,75,0); }
}

/* --- donation panel --- */
.bh-donate-card {
    background: #fffdf7; border: 1px solid #eadfc4; border-radius: 18px;
    box-shadow: 0 14px 36px rgba(12,43,38,.10); padding: 2rem;
}
.bh-donate-card .bh-iban {
    font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: .5px;
    background: #f6efdc; border-radius: 10px; padding: .6rem .9rem; display: inline-block; direction: ltr;
}
.bh-paypal-btn {
    display: inline-flex; align-items: center; gap: .6rem; padding: .9rem 2rem; border-radius: 999px;
    background: #FFC439; color: #111 !important; font-weight: 800; text-decoration: none;
    box-shadow: 0 8px 20px rgba(255,196,57,.45); transition: transform .2s ease;
}
.bh-paypal-btn:hover { transform: translateY(-3px); }

/* --- accessibility / performance --- */
@media (prefers-reduced-motion: reduce) {
    .navbar-brand img, .bh-header::before, .bh-donate-fab { animation: none !important; }
    html { scroll-behavior: auto; }
}
@media (max-width: 575px) { .bh-donate-fab span { display: none; } .bh-donate-fab { padding: .8rem; } }

/* --- prayer-times bar (top of every page) --- */
.bh-prayer-bar { background: #0C3B32; color: #F3EAD3; font-size: .85rem; }
.bh-prayer-inner {
    display: flex; gap: 1.2rem; align-items: center; justify-content: space-between;
    padding: .3rem .75rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.bh-prayer-times { display: flex; gap: 1.2rem; align-items: center; }
.bh-bar-right { display: flex; gap: .9rem; align-items: center; margin-inline-start: auto; }
.bh-langs { display: inline-flex; gap: .15rem; background: rgba(255,255,255,.10); border-radius: 999px; padding: .1rem; }
.bh-langs a { color: #F3EAD3; text-decoration: none; font-weight: 700; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; }
.bh-langs a:hover, .bh-langs a.on { background: #E8C766; color: #1d1a0f; }
.bh-social { display: inline-flex; gap: .55rem; align-items: center; }
.bh-social a { color: #F3EAD3; display: inline-flex; }
.bh-social a:hover { color: #E8C766; }
.bh-prayer-inner::-webkit-scrollbar { display: none; }
.bh-prayer-inner b { color: #E8C766; font-weight: 700; margin-inline-end: .25rem; }
.bh-prayer-city { color: #fff !important; font-weight: 700; text-decoration: none; }
.bh-prayer-city:hover { color: #E8C766 !important; }
.bh-prayer-table tr.bh-next { background: #f6efdc; border-radius: 10px; }
.bh-week th { background: var(--bh-emerald); color: #fff; font-size: .8rem; }
.bh-week td, .bh-week th { padding: .5rem .4rem; }

/* ===== Imam az-Zaman (a.s.) atmosphere: light of dawn, gold on deep emerald ===== */
.bh-mahdi {
    position: relative; overflow: hidden; color: #FBF6EA;
    background: radial-gradient(ellipse at 50% 0%, #1A7A6C 0%, #0F4A3C 42%, #082a23 100%);
}
.bh-mahdi-rays {
    position: absolute; left: 50%; top: -60%; width: 220%; aspect-ratio: 1; translate: -50% 0;
    background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(232,199,102,.14) 0deg 4deg, transparent 4deg 14deg);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
            mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
    animation: bh-rays 120s linear infinite; will-change: transform;
}
@keyframes bh-rays { to { transform: rotate(360deg); } }
.bh-mahdi-kicker { color: #E8C766; letter-spacing: 3px; text-transform: uppercase; font-weight: 700; font-size: .85rem; }
.bh-mahdi-dua {
    font-family: "Scheherazade New", "Amiri", "Traditional Arabic", "Noto Naskh Arabic", Tahoma, serif;
    font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.7; color: #F6E3A6 !important;
    text-shadow: 0 0 22px rgba(232,199,102,.55), 0 2px 6px rgba(0,0,0,.35);
    animation: bh-glow 4.5s ease-in-out infinite;
}
@keyframes bh-glow { 0%,100% { text-shadow: 0 0 14px rgba(232,199,102,.35), 0 2px 6px rgba(0,0,0,.35); }
                     50%     { text-shadow: 0 0 34px rgba(232,199,102,.75), 0 2px 6px rgba(0,0,0,.35); } }
.bh-mahdi-text { max-width: 640px; margin-inline: auto; font-size: 1.1rem; color: #e9f1ec; }
.bh-mahdi-salam { font-family: "Scheherazade New", "Amiri", "Traditional Arabic", Tahoma, serif; font-size: 1.5rem; color: #E8C766; }
.bh-mahdi-friday {
    display: inline-block; padding: .55rem 1.2rem; border-radius: 999px;
    border: 1px solid rgba(232,199,102,.6); background: rgba(232,199,102,.12); color: #F6E3A6;
}
/* soft "nur" glow on every page title band */
.bh-header::after {
    content: ""; position: absolute; left: 50%; top: -40%; width: 70%; height: 120%; translate: -50% 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(232,199,102,.28), transparent 65%);
    animation: bh-nur 6s ease-in-out infinite; pointer-events: none;
}
@keyframes bh-nur { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .bh-mahdi-rays, .bh-mahdi-dua, .bh-header::after { animation: none !important; }
}

/* ===== Library: duas, Quran, tafsir, hadith ===== */
@font-face {
    font-family: "QuranFont";
    src: local("Amiri Quran"), local("AmiriQuran-Regular"), url("../fonts/AmiriQuran-Regular.woff2") format("woff2"), url("../fonts/AmiriQuran-Regular.ttf") format("truetype");
    font-display: swap;
}
.bh-arabic {
    --bh-fs: 100%;
    font-family: "QuranFont", "Amiri Quran", "Amiri", "Scheherazade New", "Traditional Arabic", "Noto Naskh Arabic", Tahoma, serif;
    font-size: calc(1.7rem * var(--bh-fs)); line-height: 2.3; color: #0C2B26; text-align: right; direction: rtl;
}
#bh-reading { --bh-fs: 100%; }
#bh-reading .bh-arabic { --bh-fs: inherit; font-size: calc(1.7rem * var(--bh-fs)); }
.bh-arabic.text-center { text-align: center; }
.bh-translation, .bh-tr { font-size: calc(1rem * var(--bh-fs, 100%)); line-height: 1.9; color: #2b2f2e; }
.bh-tr { margin-top: .35rem; padding-inline: .25rem; }
.bh-ayah-block { padding: 1rem 0; border-bottom: 1px solid #eadfc4; }
.bh-ayah-no {
    display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; margin-inline: .4rem;
    border: 1.5px solid var(--bh-gold); border-radius: 50%; color: var(--bh-emerald); font: 700 .8rem/1 system-ui, sans-serif;
    vertical-align: middle;
}
.bh-lib-card {
    padding: 1rem 1.2rem; border: 1px solid #eadfc4; border-radius: 14px; background: #fffdf7; color: inherit;
    text-decoration: none; box-shadow: 0 6px 18px rgba(12,43,38,.06); transition: transform .2s ease, box-shadow .2s ease;
}
.bh-lib-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(12,43,38,.14); color: inherit; }
.bh-lib-title { font-weight: 700; color: var(--bh-emerald-dark); }
.bh-surah-no {
    display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; flex: none;
    background: linear-gradient(135deg, #1B6B59, #0F4A3C); color: #fff; border-radius: 50%; font-weight: 700; font-size: .85rem;
}
.bh-arabic-name { font-family: "QuranFont", "Amiri", "Scheherazade New", "Traditional Arabic", Tahoma, serif; font-size: 1.4rem; color: var(--bh-emerald); }
.bh-hadith-day { background: linear-gradient(180deg, #F3EAD3, #FBF6EA); border-top: 1px solid #eadfc4; border-bottom: 1px solid #eadfc4; }
.bh-hadith-kicker { color: var(--bh-gold); letter-spacing: 2px; text-transform: uppercase; font-weight: 700; font-size: .85rem; }

/* ===== shop category tiles ===== */
.bh-cat-tile {
    display: block; text-align: center; background: #fffdf7; border: 1px solid #eadfc4; border-radius: 16px;
    overflow: hidden; box-shadow: 0 8px 22px rgba(12,43,38,.08); transition: transform .25s ease, box-shadow .25s ease;
}
.bh-cat-tile:hover { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(12,43,38,.16); }
.bh-cat-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.bh-cat-tile span { display: block; padding: .8rem .5rem; font-weight: 700; color: var(--bh-emerald-dark); }

/* ===== Welcome hero (Jamkaran) ===== */
.bh-welcome {
    position: relative; overflow: hidden; color: #FBF6EA; padding: clamp(4rem, 12vh, 8rem) 0;
    background:
        linear-gradient(180deg, rgba(8,42,35,.58) 0%, rgba(12,59,50,.22) 42%, rgba(8,42,35,.80) 100%),
        var(--bh-hero) center / cover no-repeat;
}
.bh-welcome-salam {
    font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", Tahoma, serif;
    font-size: clamp(1.8rem, 5vw, 3.2rem); line-height: 1.8; color: #F6E3A6 !important;
    text-shadow: 0 0 24px rgba(232,199,102,.55), 0 2px 8px rgba(0,0,0,.5); margin-bottom: 1.5rem;
}
.bh-welcome-hadith {
    max-width: 680px; padding: 1.4rem 1.6rem; border-radius: 18px;
    background: rgba(8,42,35,.58); border: 1px solid rgba(232,199,102,.45); backdrop-filter: blur(3px);
}
.bh-welcome-ar { font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", Tahoma, serif; font-size: 1.7rem; color: #E8C766; line-height: 2; }
.bh-welcome-hadith p { font-size: 1.1rem; }
.bh-welcome-source { color: #c8d8d0; }
.bh-btn-gold { background: linear-gradient(135deg, #E8C766, #C9A24B); color: #1d1a0f; font-weight: 700; border: 0; }
.bh-btn-gold:hover { color: #000; transform: translateY(-2px); }

/* ===== Kids, videos, questions ===== */
.bh-kids-chip { font-weight: 700; }
.bh-story-card { height: 100%; display: flex; flex-direction: column; }
.bh-story-card .bh-story-img {
    aspect-ratio: 16 / 10; object-fit: cover; width: 100%;
    background: linear-gradient(135deg, #1B6B59, #E8C766);
}
.bh-story-ph { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; font-size: 3rem;
    background: linear-gradient(135deg, #1B6B59, #C9A24B); color: #FBF6EA; }
.bh-story-text { font-size: 1.2rem; line-height: 2; }
.bh-video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #0C3B32, #14584A); }
.bh-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bh-video-play {
    position: absolute; inset: 0; width: 100%; border: 0; color: #FBF6EA; background: transparent;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1rem; text-align: center;
}
.bh-video-play .bh-play-icon {
    width: 64px; height: 64px; border-radius: 50%; background: #E8C766; color: #1d1a0f; font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 0 rgba(232,199,102,.6); animation: bh-pulse 2.6s ease-in-out infinite;
}
.bh-quiz { max-width: 640px; margin-inline: auto; }
.bh-quiz .opt { display: block; width: 100%; text-align: start; margin-bottom: .6rem; border-radius: 12px; padding: .8rem 1rem;
    background: #fffdf7; border: 1px solid #e5dcc2; font-size: 1.05rem; }
.bh-quiz .opt:hover { border-color: var(--bh-emerald); }
.bh-quiz .opt.ok { background: #dff3e6; border-color: #2f9e5b; }
.bh-quiz .opt.bad { background: #fbe3df; border-color: #c0392b; }
@media (prefers-reduced-motion: reduce) { .bh-video-play .bh-play-icon { animation: none; } }

/* ===== Announcements: red badge, new tag, urgent bar, home box ===== */
.bh-news-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
    margin-inline-start: .35rem; border-radius: 999px; background: #d62828; color: #fff; font-size: .7rem; font-weight: 800; line-height: 1;
    vertical-align: middle; animation: bh-badge 2s ease-in-out infinite;
}
.bh-news-badge[hidden] { display: none; }
@keyframes bh-badge { 0%,100% { box-shadow: 0 0 0 0 rgba(214,40,40,.55); } 50% { box-shadow: 0 0 0 6px rgba(214,40,40,0); } }
.bh-new-tag { background: #d62828; color: #fff; border-radius: 6px; padding: .1rem .45rem; font-size: .72rem; font-weight: 800; }
.bh-new-tag[hidden] { display: none; }
.bh-urgent-bar { background: #b01919; color: #fff; text-align: center; padding: .45rem .8rem; font-size: .92rem; }
.bh-urgent-bar a { color: #ffe8a3; text-decoration: none; font-weight: 800; }
.bh-urgent-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #fff; margin-inline-end: .5rem; animation: bh-badge 1.4s infinite; }
.bh-news-box { background: #fffdf7; border: 1px solid #eadfc4; border-radius: 18px; box-shadow: 0 14px 36px rgba(12,43,38,.10); padding: 1.6rem; }
.bh-news-row { display: flex; gap: .8rem; align-items: center; padding: .7rem 0; border-top: 1px solid #eadfc4; }
.bh-news-row:first-of-type { border-top: 0; }
@media (prefers-reduced-motion: reduce) { .bh-news-badge, .bh-urgent-dot { animation: none; } }

/* ===== 3D logo (software-rendered turntable sprite, 21 frames) ===== */
.bh-logo3d {
    display: inline-block; width: 132px; height: 110px; vertical-align: middle;
    background-image: var(--bh-sprite); background-repeat: no-repeat;
    background-size: 700% 300%; background-position: 50% 50%;
}
.navbar-brand { padding: 0; }
@media (max-width: 575px) { .bh-logo3d { width: 99px; height: 82px; } }

/* ===== Persian typography: attractive Persian font (add the font file, see static/fonts/README.txt) ===== */
@font-face {
    font-family: "Vazirmatn";
    src: local("Vazirmatn"), local("Vazirmatn Regular"),
         url("../fonts/Vazirmatn-Regular.woff2") format("woff2"), url("../fonts/Vazirmatn-Regular.ttf") format("truetype");
    font-weight: 400; font-display: swap;
}
@font-face {
    font-family: "Vazirmatn";
    src: local("Vazirmatn Bold"),
         url("../fonts/Vazirmatn-Bold.woff2") format("woff2"), url("../fonts/Vazirmatn-Bold.ttf") format("truetype");
    font-weight: 700; font-display: swap;
}
:lang(fa), [dir="rtl"], .bh-fa {
    font-family: "Vazirmatn", "Vazir", "Sahel", "IRANSansX", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
    letter-spacing: 0;
}
:lang(fa) h1, :lang(fa) h2, :lang(fa) h3, :lang(fa) h4, :lang(fa) h5, :lang(fa) h6,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: "Vazirmatn", "Vazir", "Sahel", "Noto Naskh Arabic", Tahoma, sans-serif; font-weight: 700; line-height: 1.5;
}
.bh-quran-ar, .bh-arabic-title, .bh-welcome-salam, .bh-mahdi-dua, .bh-mahdi-salam, .bh-welcome-ar { font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", Tahoma, serif !important; }

.navbar-brand { flex: 0 0 auto; }

/* ===== Expanding cards / image accordion (hover or click opens one) ===== */
.bh-expand { display: flex; gap: .7rem; width: 100%; height: clamp(360px, 66vh, 540px); }
.bh-acc { height: clamp(300px, 58vh, 500px); }
.bh-expand-item {
    position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; border-radius: 20px; cursor: pointer; background: #0C3B32;
    box-shadow: 0 10px 26px rgba(12,43,38,.18); outline-offset: 3px;
    transition: flex .55s cubic-bezier(.22,.8,.24,1), box-shadow .3s ease;
}
.bh-expand-item.active { flex: 7 1 0; cursor: default; box-shadow: 0 18px 40px rgba(12,43,38,.30); }
.bh-acc .bh-expand-item.active { cursor: zoom-in; }
.bh-expand-item > img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: saturate(.8) brightness(.78); transition: transform .9s ease, filter .45s ease;
}
.bh-expand-item.active > img { filter: none; transform: scale(1.04); }
.bh-expand-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,42,35,.90) 0%, rgba(8,42,35,.18) 55%, rgba(8,42,35,0) 100%); }
.bh-acc .bh-expand-shade { background: linear-gradient(0deg, rgba(8,42,35,.45) 0%, rgba(8,42,35,0) 45%); }
.bh-expand-vtitle {
    position: absolute; inset-inline: 0; bottom: 1rem; text-align: center; color: #FBF6EA; font-weight: 700; letter-spacing: .5px;
    writing-mode: vertical-rl; transform: rotate(180deg); margin-inline: auto; width: 2rem; transition: opacity .3s ease;
}
.bh-expand-item.active .bh-expand-vtitle { opacity: 0; pointer-events: none; }
.bh-expand-label { position: absolute; inset-inline: 0; bottom: 0; padding: 1.1rem 1.2rem; color: #FBF6EA; display: flex; align-items: flex-end; gap: .8rem; opacity: 0; transition: opacity .45s ease .15s; }
.bh-expand-item.active .bh-expand-label { opacity: 1; }
.bh-expand-icon { flex: 0 0 auto; width: 2.8rem; height: 2.8rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(251,246,234,.2); backdrop-filter: blur(4px); font-size: 1.3rem; }
.bh-expand-title { font-size: 1.35rem; font-weight: 800; line-height: 1.3; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.bh-expand-body p { margin: .35rem 0 .7rem; max-width: 34rem; font-size: .98rem; line-height: 1.6; color: #eaf1ed; }
.bh-expand-num { position: absolute; inset-inline-start: .8rem; top: .7rem; background: rgba(8,42,35,.55); color: #F6E3A6; border-radius: 999px; padding: .05rem .55rem; font-size: .8rem; font-weight: 700; }
@media (max-width: 767px) {
    .bh-expand, .bh-acc { flex-direction: column; height: auto; }
    .bh-expand-item { flex: none; height: 82px; transition: height .5s cubic-bezier(.22,.8,.24,1), box-shadow .3s ease; }
    .bh-expand-item.active { height: 340px; }
    .bh-expand-vtitle { writing-mode: horizontal-tb; transform: none; width: auto; bottom: auto; top: 50%; translate: 0 -50%; font-size: 1.05rem; }
}
.bh-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(5,20,16,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 2vh 2vw; }
.bh-lightbox img { max-width: 100%; max-height: 96vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* ===== Scroll-to-expand hero (works without JS: shows the expanded state) ===== */
.bh-sx { --p: 1; position: relative; background: #082a23; color: #FBF6EA; }
.bh-sx-stage { position: relative; height: 100vh; min-height: 560px; overflow: hidden; }
.bh-sx-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: calc(1 - var(--p)); transform: scale(calc(1.08 - var(--p) * .08)); }
.bh-sx-overlay { position: absolute; inset: 0; background: rgba(8,42,35,.55); opacity: calc(1 - var(--p) * .5); }
.bh-sx-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bh-sx-media {
    position: relative; overflow: hidden; border-radius: calc(26px - var(--p) * 18px); box-shadow: 0 24px 70px rgba(0,0,0,.45);
    width: calc(300px + (min(95vw, 1500px) - 300px) * var(--p));
    height: calc(400px + (min(84vh, 780px) - 400px) * var(--p));
}
.bh-sx-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bh-sx-mediashade { position: absolute; inset: 0; background: rgba(8,42,35,calc(.32 - var(--p) * .26)); }
.bh-sx-meta { position: absolute; bottom: 9vh; text-align: center; opacity: calc(1 - var(--p) * 2.2); pointer-events: none; }
.bh-sx-date { color: #E8C766; font-weight: 700; letter-spacing: 2px; margin: 0 0 .2rem; text-transform: uppercase; font-size: .85rem; }
.bh-sx-hint { color: #FBF6EA; margin: 0; opacity: .85; animation: bh-hint 2s ease-in-out infinite; }
@keyframes bh-hint { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.bh-sx-title {
    position: absolute; display: flex; gap: .4em; align-items: baseline; justify-content: center; margin: 0; width: 100%; pointer-events: none;
    font-size: clamp(2.6rem, 9vw, 7rem); font-weight: 800; color: #FBF6EA !important; text-shadow: 0 4px 30px rgba(0,0,0,.5);
    mix-blend-mode: normal; opacity: calc(1 - var(--p) * .9);
}
.bh-sx-a { transform: translateX(calc(var(--p) * -42vw)); }
.bh-sx-b { transform: translateX(calc(var(--p) * 42vw)); color: #E8C766; }
.bh-sx-skip { position: absolute; bottom: 1.2rem; inset-inline-end: 1.2rem; z-index: 5; border: 1px solid rgba(251,246,234,.5); background: rgba(8,42,35,.55); color: #FBF6EA; border-radius: 999px; padding: .35rem 1rem; font-size: .85rem; opacity: calc(1 - var(--p)); }
.bh-sx.bh-sx-done .bh-sx-skip { display: none; }
.bh-sx-content {
    position: relative; padding: 4rem 0 4.5rem; text-align: center;
    background: radial-gradient(ellipse at 50% 0%, #1A7A6C 0%, #0F4A3C 42%, #082a23 100%);
}
.bh-sx.bh-sx-ready .bh-sx-content { opacity: clamp(0, calc((var(--p) - .7) * 3.4), 1); }
@media (max-width: 575px) { .bh-sx-media { width: calc(230px + (94vw - 230px) * var(--p)); height: calc(320px + (74vh - 320px) * var(--p)); } .bh-sx-a { transform: translateX(calc(var(--p) * -36vw)); } .bh-sx-b { transform: translateX(calc(var(--p) * 36vw)); } }
@media (prefers-reduced-motion: reduce) { .bh-sx-hint { animation: none; } }
