/* ===== Bayt ul-Ahzan luxury theme. ALL colours are variables; the admin ("Website content > Colours")
   overrides the --c-* / --rgb-* values below with a <style id="bh-theme"> block (see sitecontent/themes.py).
   The values here are the default "Green & cream" palette and are used when nothing is chosen. ===== */
:root {
    --c-primary:#14584a; --c-primary-2:#1b6b59; --c-primary-dark:#0f4a3c; --c-primary-deeper:#0c3b32;
    --c-accent:#3fa283; --c-accent-dark:#2a7a63; --c-accent-2:#4fb293; --c-accent-3:#5fbb9d; --c-accent-light:#6cc3a5; --c-accent-pale:#bfe8d8;
    --c-turq:#1a9e94; --c-turq-dark:#1a7a6c;
    --c-ink:#0c2b26; --c-ink-2:#082a23; --c-ink-4:#061f1a; --c-on-accent:#06241d;
    --c-bg:#f3f8f5; --c-card:#fbfdfc; --c-bg-2:#e3eee8; --c-bg-3:#e6f1ec; --c-bg-4:#e9f1ec; --c-bg-5:#f7f9f5; --c-card-2:#fdfefc;
    --c-border:#d3e4db; --c-pale:#e4f4ec; --c-soft:#d9e6df; --c-soft-2:#b9cbc3; --c-soft-3:#c8d8d0;
    --c-tint-1:#b9d9cb; --c-tint-2:#bcd0c7; --c-tint-3:#d0d8c6;
    --c-text:#1e3834; --c-body:#1d3531; --c-subtext:#556a66; --c-muted:#b0b9ae; --c-salam:#fff3d2;
    --c-kicker:#87661a; --c-gold:#e8c766; --c-pattern:#e8c766;
    --rgb-primary:20,88,74; --rgb-accent:63,162,131; --rgb-accent-light:108,195,165;
    --rgb-ink:12,43,38; --rgb-ink-2:8,42,35; --rgb-ov-a:6,38,31; --rgb-ov-b:8,48,40; --rgb-turq:26,158,148; --rgb-bg:243,248,245;
    --hero-a:.62; --hero-b:.34; --hero-c:.86;

    --primary: var(--c-primary);
    --secondary: var(--c-accent);
    --light: var(--c-bg);
    --dark: var(--c-ink);
    --bh-cream-2: var(--c-bg-2);
    --bh-turquoise: var(--c-turq);
    --bh-gold: var(--c-accent);
    --bh-emerald: var(--c-primary);
    --bh-emerald-dark: var(--c-primary-deeper);
    --bh-ink: var(--c-text);
    --bs-primary: var(--c-primary);
}

html { scroll-behavior: smooth; }
body { overflow-x: clip; }  /* hidden dropdown menus must never create a sideways scrollbar */
body {
    background: var(--light);
    color: var(--c-text);
    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(--c-kicker); }
.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, var(--c-primary-2), var(--c-primary-dark));
    border: 1px solid var(--c-primary-dark); box-shadow: 0 6px 16px rgba(var(--rgb-primary),.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, var(--c-accent), var(--c-accent-dark));
    border-color: var(--c-accent-dark); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(var(--rgb-accent),.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: var(--c-on-accent); }
.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(var(--rgb-turq),.18); }
.form-control { background-color: var(--c-card); border-color: var(--c-border); }

/* --- navbar --- */
.sticky-top.bg-white, .navbar.bg-white, .navbar-light { background-color: rgba(var(--rgb-bg),.96) !important; }
.navbar { border-bottom: 1px solid var(--c-border); }
.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(--c-kicker); }
.navbar .dropdown-menu { background: var(--c-card) !important; border: 1px solid var(--c-border); box-shadow: 0 12px 28px rgba(var(--rgb-ink),.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(var(--rgb-ink),.28)) drop-shadow(0 14px 14px rgba(var(--rgb-ink),.18));
    animation: bh-float 5s ease-in-out infinite;
    will-change: transform;
}
.navbar-brand:hover img {
    filter: drop-shadow(0 10px 8px rgba(var(--rgb-ink),.35)) drop-shadow(0 22px 20px rgba(var(--rgb-accent),.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, var(--c-primary-deeper) 0%, var(--c-primary) 55%, var(--c-turq-dark) 100%);
}
.bh-header::before {
    content: ""; position: absolute; inset: -50%;
    background-color: var(--c-pattern); opacity: .17;
    -webkit-mask-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%23000%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"); mask-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%23000%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");
    -webkit-mask-size: 420px 280px; mask-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: var(--c-salam) !important; text-shadow: 0 2px 12px rgba(0,0,0,.30);
}
.bh-header .breadcrumb-item a:hover { color: var(--c-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 var(--c-border); border-radius: 14px; background: var(--c-card);
    box-shadow: 0 8px 24px rgba(var(--rgb-ink),.07); overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(var(--rgb-ink),.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(--c-kicker) !important; }
.footer .fst-italic.text-primary, .carousel-caption .fst-italic.text-primary, .video .fst-italic.text-primary { color: var(--c-accent-light) !important; }
.section-title::before, .section-title::after { background: var(--c-gold) !important; }
.btn-square { background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary-dark)) !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, var(--c-primary-deeper), var(--c-ink-2)) !important; color: var(--c-soft); }
.footer h4, .footer .text-primary { color: var(--c-gold) !important; }
.footer .btn.btn-link { color: var(--c-soft); }
.footer .btn.btn-link:hover { color: var(--c-gold); }
.copyright { background: var(--c-ink-4) !important; color: var(--c-soft-2); }
.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: var(--c-on-accent) !important; background: linear-gradient(135deg, var(--c-accent-light), var(--c-accent));
    box-shadow: 0 10px 26px rgba(var(--rgb-accent),.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(var(--rgb-accent),.45), 0 0 0 0 rgba(var(--rgb-accent),.45); }
    50% { box-shadow: 0 10px 26px rgba(var(--rgb-accent),.45), 0 0 0 12px rgba(var(--rgb-accent),0); }
}

/* --- donation panel --- */
.bh-donate-card {
    background: var(--c-card); border: 1px solid var(--c-border); border-radius: 18px;
    box-shadow: 0 14px 36px rgba(var(--rgb-ink),.10); padding: 2rem;
}
.bh-donate-card .bh-iban {
    font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: .5px;
    background: var(--c-bg-3); 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: var(--c-primary-deeper); color: var(--c-bg-2); 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: var(--c-bg-2); text-decoration: none; font-weight: 700; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; }
.bh-langs a:hover, .bh-langs a.on { background: var(--c-accent-light); color: var(--c-on-accent); }
.bh-social { display: inline-flex; gap: .55rem; align-items: center; }
.bh-social a { color: var(--c-bg-2); display: inline-flex; }
.bh-social a:hover { color: var(--c-accent-light); }
.bh-prayer-inner::-webkit-scrollbar { display: none; }
.bh-prayer-inner b { color: var(--c-accent-light); font-weight: 700; margin-inline-end: .25rem; }
.bh-prayer-city { color: #fff !important; font-weight: 700; text-decoration: none; }
.bh-prayer-city:hover { color: var(--c-accent-light) !important; }
.bh-prayer-table tr.bh-next { background: var(--c-bg-3); 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: var(--c-bg);
    background: radial-gradient(ellipse at 50% 0%, var(--c-turq-dark) 0%, var(--c-primary-dark) 42%, var(--c-ink-2) 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(var(--rgb-accent-light),.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: var(--c-accent-light); 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: var(--c-pale) !important;
    text-shadow: 0 0 22px rgba(var(--rgb-accent-light),.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(var(--rgb-accent-light),.35), 0 2px 6px rgba(0,0,0,.35); }
                     50%     { text-shadow: 0 0 34px rgba(var(--rgb-accent-light),.75), 0 2px 6px rgba(0,0,0,.35); } }
.bh-mahdi-text { max-width: 640px; margin-inline: auto; font-size: 1.1rem; color: var(--c-bg-4); }
.bh-mahdi-salam { font-family: "Scheherazade New", "Amiri", "Traditional Arabic", Tahoma, serif; font-size: 1.5rem; color: var(--c-accent-light); }
.bh-mahdi-friday {
    display: inline-block; padding: .55rem 1.2rem; border-radius: 999px;
    border: 1px solid rgba(var(--rgb-accent-light),.6); background: rgba(var(--rgb-accent-light),.12); color: var(--c-pale);
}
/* 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(var(--rgb-accent-light),.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, .bh-welcome::before { 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: var(--c-ink); 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: var(--c-text); }
.bh-tr { margin-top: .35rem; padding-inline: .25rem; }
.bh-ayah-block { padding: 1rem 0; border-bottom: 1px solid var(--c-border); }
.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 var(--c-border); border-radius: 14px; background: var(--c-card); color: inherit;
    text-decoration: none; box-shadow: 0 6px 18px rgba(var(--rgb-ink),.06); transition: transform .2s ease, box-shadow .2s ease;
}
.bh-lib-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(var(--rgb-ink),.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, var(--c-primary-2), var(--c-primary-dark)); 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, var(--c-bg-2), var(--c-bg)); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.bh-hadith-kicker { color: var(--c-accent-dark); letter-spacing: 2px; text-transform: uppercase; font-weight: 700; font-size: .85rem; }

/* ===== shop category tiles ===== */
.bh-cat-tile {
    display: block; text-align: center; background: var(--c-card); border: 1px solid var(--c-border); border-radius: 16px;
    overflow: hidden; box-shadow: 0 8px 22px rgba(var(--rgb-ink),.08); transition: transform .25s ease, box-shadow .25s ease;
}
.bh-cat-tile:hover { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(var(--rgb-ink),.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: var(--c-bg); padding: clamp(4rem, 12vh, 8rem) 0;
    background:
        linear-gradient(180deg, rgba(var(--rgb-ov-a),var(--hero-a)) 0%, rgba(var(--rgb-ov-b),var(--hero-b)) 40%, rgba(var(--rgb-ov-a),var(--hero-c)) 100%),
        linear-gradient(var(--hero-tint, transparent), var(--hero-tint, transparent)),
        var(--bh-hero) center / cover no-repeat;
    background-blend-mode: normal, var(--hero-blend, normal), normal;   /* mourning: photo turns grey */
}
.bh-welcome::before {   /* the dua of the Imam of the Time, softly repeated behind the picture */
    content: ""; position: absolute; inset: -30% -10%; pointer-events: none;
    background-color: var(--c-pattern); opacity: .13;
    -webkit-mask-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%23000%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"); mask-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%23000%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");
    -webkit-mask-size: 640px 427px; mask-size: 640px 427px;
    animation: bh-pattern-hero 180s linear infinite;
}
@keyframes bh-pattern-hero { to { transform: translate(640px, 427px); } }
.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: var(--c-salam) !important;
    text-shadow:  0 0 26px rgba(var(--rgb-accent-light),.55), 0 2px 10px rgba(0,0,0,.65); margin-bottom: 1.5rem;
}
.bh-welcome-hadith {
    max-width: 680px; padding: 1.4rem 1.6rem; border-radius: 18px;
    background: rgba(var(--rgb-ink-2),.58); border: 1px solid rgba(var(--rgb-accent-light),.45); backdrop-filter: blur(3px);
}
.bh-welcome-ar { font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", Tahoma, serif; font-size: 1.7rem; color: var(--c-accent-pale); line-height: 2; }
.bh-welcome-hadith p { font-size: 1.1rem; }
.bh-welcome-source { color: var(--c-soft-3); }
.bh-btn-gold { background: linear-gradient(135deg, var(--c-accent-light), var(--c-accent)); color: var(--c-on-accent); 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, var(--c-primary-2), var(--c-accent-light));
}
.bh-story-ph { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; font-size: 3rem;
    background: linear-gradient(135deg, var(--c-primary-2), var(--c-accent)); color: var(--c-bg); }
.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, var(--c-primary-deeper), var(--c-primary)); }
.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: var(--c-bg); 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: var(--c-accent-light); color: var(--c-on-accent); font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 0 rgba(var(--rgb-accent-light),.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: var(--c-card); border: 1px solid var(--c-border); font-size: 1.05rem; }
.bh-quiz .opt:hover { border-color: var(--bh-emerald); }
.bh-quiz .opt.ok { background: var(--c-pale); 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: var(--c-card); border: 1px solid var(--c-border); border-radius: 18px; box-shadow: 0 14px 36px rgba(var(--rgb-ink),.10); padding: 1.6rem; }
.bh-news-row { display: flex; gap: .8rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--c-border); }
.bh-news-row:first-of-type { border-top: 0; }
@media (prefers-reduced-motion: reduce) { .bh-news-badge, .bh-urgent-dot { animation: none; } }

/* ===== Fonts: Persian (self-hosted, optional) ===== */
@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;
}
:root {
    /* Vazirmatn first (if the files are in static/fonts), then good system fonts for Arabic script. NO Georgia/serif here. */
    --bh-fa-font: "Vazirmatn", "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, "Geeza Pro", Arial, sans-serif;
}
/* Only text elements get the Persian font. Icon fonts (Font Awesome etc.) are never touched. */
html[lang="fa"] body,
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, html[lang="fa"] h4, html[lang="fa"] h5, html[lang="fa"] h6,
html[lang="fa"] .display-1, html[lang="fa"] .display-2, html[lang="fa"] .display-3, html[lang="fa"] .display-4,
html[lang="fa"] .display-5, html[lang="fa"] .display-6, html[lang="fa"] .navbar-brand,
html[lang="fa"] input, html[lang="fa"] select, html[lang="fa"] textarea, html[lang="fa"] button, html[lang="fa"] .btn {
    font-family: var(--bh-fa-font);
    letter-spacing: 0;              /* letter-spacing breaks the joined letters of Persian script */
    word-spacing: 0;
    text-transform: none;           /* no upper-casing effects */
    font-variant-ligatures: common-ligatures;
}
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, html[lang="fa"] h4, html[lang="fa"] h5, html[lang="fa"] h6,
html[lang="fa"] .display-1, html[lang="fa"] .display-2, html[lang="fa"] .display-3, html[lang="fa"] .display-4,
html[lang="fa"] .display-5, html[lang="fa"] .display-6 { font-weight: 700; line-height: 1.5; }
html[lang="fa"] body { line-height: 1.95; font-size: 1.02rem; }
html[lang="fa"] .fst-italic, html[lang="fa"] em, html[lang="fa"] i:not(.fa):not(.fas):not(.far):not(.fab):not(.bi) { font-style: normal !important; } /* italic Persian looks broken */
html[lang="fa"] .text-uppercase { text-transform: none !important; }
html[lang="fa"] .display-1, html[lang="fa"] .display-2 { line-height: 1.4; }
html[lang="fa"] .navbar .navbar-nav .nav-link, html[lang="fa"] .dropdown-item, html[lang="fa"] .footer .btn.btn-link { text-transform: none; }

/* Icon fonts must keep their own font-family in every language */
.fa, .fas, .far { font-family: "Font Awesome 5 Free" !important; }
.fab { font-family: "Font Awesome 5 Brands" !important; }
.bi::before { font-family: "bootstrap-icons" !important; }

/* Quran / Arabic text (all languages) */
.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", "Noto Naskh Arabic", Tahoma, serif !important; letter-spacing: 0 !important; }
[lang="ar"] { letter-spacing: 0; }

/* ===== Navbar (all languages): logo in normal flow, compact links, grouped dropdowns ===== */
.navbar { padding: .25rem 1rem; }
.navbar .navbar-brand {
    position: static; width: auto; height: auto; padding: .15rem 0; margin: 0; margin-inline-end: 1.2rem; flex: 0 0 auto;
}
.navbar .navbar-nav .nav-link {
    margin: 0; padding: 22px 10px; font-size: .92rem; white-space: nowrap; text-transform: none; letter-spacing: 0;
}
.navbar .navbar-nav .dropdown-toggle::after { margin-left: 0; margin-inline-start: 6px; }
.navbar .navbar-nav .bh-ico-label { margin-inline-start: .5rem; }
.bh-toggler { margin-inline-start: auto; }
.bh-nav-main { align-items: center; }
.bh-nav-tools, .bh-nav-lang { align-items: center; }
.bh-nav-tools { margin-inline-start: auto; }
.bh-nav-lang { border-inline-start: 1px solid var(--c-border); margin-inline-start: .4rem; padding-inline-start: .3rem; }
.bh-search-menu { min-width: 250px; }
.bh-search-menu .btn { margin-inline-start: .4rem; }
.navbar .dropdown-divider { border-top-color: var(--c-border); }
@media (min-width: 1200px) {
    .navbar-expand-xl .navbar-collapse { align-items: center; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* style.css makes dropdowns hover-only from 992px; with the collapsed menu they must open by click instead */
    .navbar .nav-item .dropdown-menu { display: none; opacity: 1; visibility: visible; top: auto; }
    .navbar .nav-item .dropdown-menu.show { display: block; }
}
@media (max-width: 1199.98px) {
    .navbar .navbar-nav { margin-top: 0; border-top: 1px solid var(--c-bg-2); }
    .navbar .navbar-nav .nav-link { padding: 10px 6px; }
    .navbar .navbar-nav .dropdown-menu { border: 0; box-shadow: none; background: transparent !important; padding-inline-start: 1rem; }
    .bh-nav-tools { margin-inline-start: 0; }
}

/* ===== 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: var(--c-primary-deeper);
    box-shadow: 0 10px 26px rgba(var(--rgb-ink),.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(var(--rgb-ink),.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(var(--rgb-ink-2),.90) 0%, rgba(var(--rgb-ink-2),.18) 55%, rgba(var(--rgb-ink-2),0) 100%); }
.bh-acc .bh-expand-shade { background: linear-gradient(0deg, rgba(var(--rgb-ink-2),.45) 0%, rgba(var(--rgb-ink-2),0) 45%); }
.bh-expand-vtitle {
    position: absolute; inset-inline: 0; bottom: 1rem; text-align: center; color: var(--c-bg); 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: var(--c-bg); 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(var(--rgb-bg),.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: var(--c-bg-4); }
.bh-expand-num { position: absolute; inset-inline-start: .8rem; top: .7rem; background: rgba(var(--rgb-ink-2),.55); color: var(--c-pale); 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(var(--rgb-ink-2),.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: var(--c-ink-2); color: var(--c-bg); }
.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(var(--rgb-ink-2),.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(var(--rgb-ink-2),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: var(--c-accent-light); font-weight: 700; letter-spacing: 2px; margin: 0 0 .2rem; text-transform: uppercase; font-size: .85rem; }
.bh-sx-hint { color: var(--c-bg); 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: var(--c-bg) !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: var(--c-accent-light); }
.bh-sx-skip { position: absolute; bottom: 1.2rem; inset-inline-end: 1.2rem; z-index: 5; border: 1px solid rgba(var(--rgb-bg),.5); background: rgba(var(--rgb-ink-2),.55); color: var(--c-bg); 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%, var(--c-turq-dark) 0%, var(--c-primary-dark) 42%, var(--c-ink-2) 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; } }

/* ===== single-colour polish (hero intro line, directional icons in RTL) ===== */
.bh-welcome .bh-mahdi-kicker { color: var(--c-gold); text-shadow: 0 1px 8px rgba(0,0,0,.7); letter-spacing: 2px; }
html[lang="fa"] .bh-welcome .bh-mahdi-kicker { letter-spacing: 0; font-size: .95rem; }

/* sections that used old photo/olive backgrounds */
.bh-members { background: linear-gradient(180deg, var(--c-bg-2) 0%, var(--c-bg) 100%); }
.carousel-caption { background: rgba(var(--rgb-ink-2), .50); }
.carousel-caption .text-dark, .carousel-caption h1, .carousel-caption h2, .carousel-caption h3, .carousel-caption strong,
.video .text-dark, .testimonial .text-dark { color: var(--c-bg) !important; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.carousel-caption .text-primary, .video .text-primary, .testimonial .text-primary { color: var(--c-accent-pale) !important; }
.carousel-caption .bg-white .text-primary, .carousel-caption .text-primary.bg-white { color: var(--c-primary) !important; }

/* menus at the far end of the bar open inward (Bootstrap only does this after its JS has run once) */
.navbar .dropdown-menu.dropdown-menu-end { right: 0; left: auto; }

@media (min-width: 1200px) and (max-width: 1299.98px) {
    .navbar { padding-inline: .5rem; }
    .navbar .navbar-brand { margin-inline-end: .6rem; }
    .navbar .navbar-brand img { width: 80px !important; }
    .navbar .navbar-nav .nav-link { padding-inline: 6px; font-size: .86rem; }
    .navbar .navbar-nav .dropdown-toggle::after { margin-inline-start: 4px; }
}

/* footer */
.bh-footer-social { gap: .6rem; }
.bh-soc { display: inline-flex; align-items: center; justify-content: center; margin: 0 !important; }
.bh-soc svg { display: block; }
.footer .btn.btn-outline-light:hover { color: var(--c-ink); }
.footer .btn.btn-link { text-transform: none; }


/* ===== Free pages entered in the admin (rich text) ===== */
.bh-richtext { font-size: 1.08rem; line-height: 1.95; color: var(--bh-ink); }
.bh-richtext h1, .bh-richtext h2, .bh-richtext h3 { margin: 1.6rem 0 .8rem; }
.bh-richtext img { max-width: 100%; height: auto; border-radius: 12px; }
.bh-richtext blockquote { border-inline-start: 4px solid var(--bh-gold); padding: .4rem 1rem; background: var(--c-card); border-radius: 8px; }
.bh-richtext table { max-width: 100%; }

/* mourning / special schemes can soften the big photos */
.carousel-item img, .bh-expand-item img { filter: var(--photo-filter, none); }

/* ===== luxury typography: deep green-ink text, bronze-gold labels, warm ivory on dark ===== */
.text-muted, .text-body-secondary, small.text-muted, .text-black-50 { color: var(--c-subtext) !important; }
::selection { background: rgba(var(--rgb-accent), .28); color: var(--c-ink); }
.bh-header h1 { letter-spacing: .4px; }

/* ===== home page: events block (photo with text on top) =====
   On phones the text is taller than the photo, so the text used to run over the paragraph above it.
   Below 992px the photo becomes the background of a normal box that grows with the text. */
.bh-events { position: relative; }
@media (max-width: 991.98px) {
    .bh-events > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    .bh-events > .carousel-caption { position: relative; }
}

/* ===== consent banner for the optional visitor statistics (includes/consent.html, js/consent.js) ===== */
.bh-consent {
    position: fixed; inset-inline: 14px; bottom: 14px; z-index: 1085; max-width: 560px; margin-inline: auto;
    background: var(--c-bg); color: var(--c-text); border: 1px solid rgba(var(--rgb-primary), .35); border-radius: 16px;
    box-shadow: 0 14px 44px rgba(var(--rgb-ink), .35); padding: 18px 20px; font-size: .92rem; line-height: 1.6;
}
.bh-consent[hidden] { display: none; }
.bh-consent-title { margin: 0 0 6px; font-weight: 700; font-size: 1.02rem; color: var(--c-primary); }
.bh-consent-text { margin: 0 0 14px; color: var(--c-body); }
.bh-consent-text a { color: var(--c-primary); text-decoration: underline; white-space: nowrap; }
.bh-consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bh-consent-btn {
    flex: 1 1 140px; min-height: 44px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid var(--c-primary); background: transparent; color: var(--c-primary); font-weight: 600; font-size: .95rem;
}
.bh-consent-btn:hover, .bh-consent-btn:focus-visible { background: rgba(var(--rgb-primary), .1); }
.bh-consent-reopen { text-decoration: underline; }

/* ===== Liquid bottom bar (phones/tablets). Markup: includes/bottomnav.html, behaviour: js/liquid-nav.js.
   Idea: "Liquid Navbar / Waterline" (Nimbus UI, guglielmogiannattasio.it). Colours = site palette. ===== */
.bh-lnav-wrap { display: none; }
.bh-lnav {
    --n-tint: rgba(255,255,255,.74); --n-fg: var(--c-text); --n-fg-soft: rgba(var(--rgb-ink), .74); --n-rim: rgba(255,255,255,.85);
    position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; isolation: isolate;
    -webkit-font-smoothing: antialiased; user-select: none; -webkit-tap-highlight-color: transparent;
}
.bh-lnav[data-tone="dark"] { --n-tint: rgba(var(--rgb-ink-2), .76); --n-fg-soft: rgba(var(--rgb-bg), .74); --n-rim: rgba(255,255,255,.3); }
.bh-lnav-glass {
    position: absolute; inset: 0; border-radius: inherit; z-index: -2; overflow: hidden; background: var(--n-tint);
    -webkit-backdrop-filter: blur(12px) saturate(1.25) brightness(1.06); backdrop-filter: blur(12px) saturate(1.25) brightness(1.06);
    box-shadow: inset 0 1px 1px var(--n-rim), inset 0 0 0 1px rgba(255,255,255,.22), 0 12px 32px -14px rgba(var(--rgb-ink), .55), 0 2px 6px rgba(var(--rgb-ink), .12);
}
.bh-lnav-water { position: absolute; left: -14px; top: -14px; z-index: -1; pointer-events: none; }
.bh-lnav[data-gl="off"] .bh-lnav-water { display: none; }
.bh-lnav-drop {
    display: none; position: absolute; top: 6px; bottom: 6px; left: 0; border-radius: 999px; z-index: -1; pointer-events: none; will-change: transform, width;
    background: radial-gradient(120% 140% at 30% 0%, rgba(255,255,255,.75), rgba(255,255,255,0) 55%), rgba(255,255,255,.38);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.95), inset 0 -2px 6px rgba(var(--rgb-accent-light), .35), inset 0 0 0 1px rgba(255,255,255,.55), 0 6px 16px -6px rgba(var(--rgb-primary), .45);
}
.bh-lnav[data-gl="off"] .bh-lnav-drop { display: block; }
.bh-lnav-item {
    position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border: 0; border-radius: 999px;
    background: none; color: var(--n-fg-soft); font-weight: 600; font-size: 14px; line-height: 1; text-decoration: none; cursor: pointer; transition: color .25s;
}
.bh-lnav-item:hover, .bh-lnav-item[aria-current="page"] { color: var(--n-fg); }
.bh-lnav-item:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.bh-lnav .nv-ico { position: relative; display: inline-flex; flex: none; }
.bh-lnav .nv-ico svg { transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.bh-lnav-item[aria-current="page"] .nv-ico svg { transform: translateY(-1px) scale(1.08); }
.bh-lnav .nv-door { fill: transparent; }
.bh-lnav .bh-news-badge { position: absolute; top: -8px; inset-inline-end: -10px; margin: 0; }
.nv-ico[data-fx="pop"] svg { animation: nvPop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes nvPop { 0%{transform:scale(.72)} 60%{transform:scale(1.2)} 100%{transform:translateY(-1px) scale(1.08)} }
.nv-ico[data-fx="spin"] svg { animation: nvSpin 1s cubic-bezier(.2,.75,.25,1) both; }
@keyframes nvSpin { 0%{transform:perspective(80px) rotateY(0)} 100%{transform:perspective(80px) rotateY(360deg) translateY(-1px) scale(1.08)} }
.nv-ico[data-fx="glow"] svg { animation: nvHop .8s cubic-bezier(.3,1.4,.5,1) both; transform-origin: 50% 100%; }
@keyframes nvHop { 0%{transform:none} 30%{transform:translateY(-5px) scale(1.04,.96)} 55%{transform:translateY(0) scale(1.12,.88)} 75%{transform:translateY(-2px) scale(.98,1.04)} 100%{transform:translateY(-1px) scale(1.08)} }
.nv-ico[data-fx="glow"] .nv-door { animation: nvDoor 1.3s ease both; }
@keyframes nvDoor { 0%{fill:transparent} 30%{fill:var(--c-gold)} 100%{fill:rgba(var(--rgb-accent-light), .6)} }
.nv-ico[data-fx="wave"] svg { animation: nvWave .9s ease-in-out both; transform-origin: 50% 12%; }
@keyframes nvWave { 0%{transform:none} 20%{transform:rotate(-15deg)} 40%{transform:rotate(12deg)} 60%{transform:rotate(-8deg)} 80%{transform:rotate(4deg)} 100%{transform:translateY(-1px) scale(1.08)} }
@media (max-width: 520px) {
    .bh-lnav-item { padding: 0 14px; }
    .bh-lnav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .bh-lnav .nv-ico svg, .nv-ico .nv-door { animation: none !important; transition: none; } }

@media (max-width: 991.98px) {
    .bh-lnav-wrap {
        display: flex; position: fixed; left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        justify-content: center; z-index: 1040; pointer-events: none;
    }
    .bh-lnav-wrap > .bh-lnav { pointer-events: auto; }
    .copyright { padding-bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px)) !important; }   /* last line must not hide behind the bar */
    .bh-donate-fab { display: none !important; }                                                 /* "Donate" is in the bar */
    .back-to-top { bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ===== Dark mode. Switched by js/darkmode.js (attribute data-bh-mode="dark" on <html>, choice in localStorage "bh_mode").
   All dark colours are DERIVED from the active colour scheme with color-mix(), so every admin scheme gets its own dark version.
   The light-palette variables (--c-bg, --c-bg-2, --c-pale ...) are NOT changed because they are also used as light TEXT on photos/dark bands. ===== */
@supports (color: color-mix(in srgb, red 50%, blue)) {
    html[data-bh-mode="dark"] {
        color-scheme: dark;
        --bh-d-bg: var(--c-ink-4);
        --bh-d-bg-2: color-mix(in srgb, var(--c-ink-4) 88%, var(--c-primary) 12%);
        --bh-d-surface: color-mix(in srgb, var(--c-ink-4) 78%, var(--c-primary) 22%);
        --bh-d-surface-2: color-mix(in srgb, var(--c-ink-4) 64%, var(--c-primary) 36%);
        --bh-d-line: color-mix(in srgb, var(--c-ink-4) 48%, var(--c-primary) 52%);
        --c-card: var(--bh-d-surface); --c-card-2: var(--bh-d-surface); --c-border: var(--bh-d-line);
        --c-text: rgb(var(--rgb-bg)); --c-body: rgba(var(--rgb-bg), .9); --c-subtext: rgba(var(--rgb-bg), .68); --c-muted: rgba(var(--rgb-bg), .5);
        --bh-ink: var(--c-text); --bh-emerald-dark: var(--c-salam); --bh-emerald: var(--c-accent-light); --c-kicker: var(--c-gold);
    }
    html[data-bh-mode="dark"] body { background: var(--bh-d-bg) !important; color: var(--c-body) !important; }
    html[data-bh-mode="dark"] .bg-white, html[data-bh-mode="dark"] .bg-light { background-color: var(--bh-d-bg-2) !important; }
    html[data-bh-mode="dark"] .sticky-top.bg-white, html[data-bh-mode="dark"] .navbar.bg-white, html[data-bh-mode="dark"] .navbar-light {
        background-color: color-mix(in srgb, var(--c-ink-4) 94%, transparent) !important; }
    html[data-bh-mode="dark"] .bh-navwrap { border-bottom: 1px solid var(--bh-d-line); }
    html[data-bh-mode="dark"] .navbar-light .navbar-nav .nav-link, html[data-bh-mode="dark"] .navbar .nav-link { color: var(--c-text); }
    html[data-bh-mode="dark"] .navbar-light .navbar-nav .nav-link:hover, html[data-bh-mode="dark"] .navbar .nav-link.active { color: var(--c-gold); }
    html[data-bh-mode="dark"] .navbar-toggler { border-color: var(--bh-d-line); filter: invert(.9); }
    html[data-bh-mode="dark"] .navbar-brand img { background: rgba(var(--rgb-bg), .94); border-radius: 12px; padding: 4px; }
    html[data-bh-mode="dark"] .dropdown-menu, html[data-bh-mode="dark"] .navbar .dropdown-menu, html[data-bh-mode="dark"] .modal-content {
        background: var(--bh-d-surface) !important; border-color: var(--bh-d-line); color: var(--c-body); }
    html[data-bh-mode="dark"] .dropdown-item { color: var(--c-text); }
    html[data-bh-mode="dark"] .dropdown-item:hover, html[data-bh-mode="dark"] .dropdown-item:focus { background: var(--bh-d-surface-2); color: var(--c-gold); }
    html[data-bh-mode="dark"] .dropdown-divider { border-color: var(--bh-d-line); }
    html[data-bh-mode="dark"] .form-control, html[data-bh-mode="dark"] .form-select, html[data-bh-mode="dark"] input:not([type=checkbox]):not([type=radio]):not([type=range]),
    html[data-bh-mode="dark"] textarea, html[data-bh-mode="dark"] select {
        background-color: var(--bh-d-bg-2); color: var(--c-text); border-color: var(--bh-d-line); }
    html[data-bh-mode="dark"] ::placeholder { color: var(--c-muted); opacity: 1; }
    html[data-bh-mode="dark"] .card, html[data-bh-mode="dark"] .list-group-item, html[data-bh-mode="dark"] .accordion-item, html[data-bh-mode="dark"] .page-link {
        background-color: var(--bh-d-surface); color: var(--c-body); border-color: var(--bh-d-line); }
    html[data-bh-mode="dark"] .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(var(--rgb-bg), .05); --bs-table-hover-bg: rgba(var(--rgb-bg), .08); color: var(--c-body); border-color: var(--bh-d-line); }
    html[data-bh-mode="dark"] .table > :not(caption) > * > * { background-color: transparent; color: inherit; border-bottom-color: var(--bh-d-line); }
    html[data-bh-mode="dark"] .btn-light { background: var(--bh-d-surface-2); border-color: var(--bh-d-line); color: var(--c-text); }
    html[data-bh-mode="dark"] .btn-outline-primary { color: var(--c-accent-light); border-color: var(--c-accent-light); }
    html[data-bh-mode="dark"] .btn-outline-primary:hover { background: var(--c-accent-light); color: var(--c-on-accent); }
    html[data-bh-mode="dark"] .breadcrumb-item.active, html[data-bh-mode="dark"] .text-secondary { color: var(--c-subtext) !important; }
    html[data-bh-mode="dark"] hr { border-color: var(--bh-d-line); opacity: 1; }
    /* soft surfaces of the theme that used the light palette as background */
    html[data-bh-mode="dark"] .product, html[data-bh-mode="dark"] .bh-hadith-day, html[data-bh-mode="dark"] .bh-members { background: linear-gradient(180deg, var(--bh-d-bg-2), var(--bh-d-bg)); }
    html[data-bh-mode="dark"] .bh-donate-card .bh-iban, html[data-bh-mode="dark"] .bh-prayer-table tr.bh-next { background: var(--bh-d-surface-2); color: var(--c-text); }
    html[data-bh-mode="dark"] .bh-quiz .opt.ok { background: color-mix(in srgb, var(--bh-d-surface) 70%, var(--c-accent) 30%); }
    html[data-bh-mode="dark"] .bh-quiz .opt.bad { background: color-mix(in srgb, var(--bh-d-surface) 70%, #d62828 30%); }
    html[data-bh-mode="dark"] .bh-consent { background: var(--bh-d-surface); color: var(--c-text); border-color: var(--bh-d-line); }
    html[data-bh-mode="dark"] .bh-consent-title, html[data-bh-mode="dark"] .bh-consent-text a { color: var(--c-gold); }
    html[data-bh-mode="dark"] .footer { border-top: 1px solid var(--bh-d-line); }
    html[data-bh-mode="dark"] .back-to-top { color: var(--c-on-accent); }
    html[data-bh-mode="dark"] img:not(.bh-keep) { filter: brightness(.93); }
    html[data-bh-mode="dark"] .navbar-brand img { filter: none; }
    html.bh-mode-anim, html.bh-mode-anim *, html.bh-mode-anim *::before, html.bh-mode-anim *::after {
        transition: background-color .55s ease, color .55s ease, border-color .55s ease, box-shadow .55s ease !important; }
}

/* ===== Day/night switch (includes/nav*.html, js/darkmode.js) - "liquid" glass knob that stretches while pressed.
   Idea: "Liquid Toggle" (Nimbus UI, guglielmogiannattasio.it); shape/colours follow the site palette. ===== */
.bh-mode-item { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; }
.bh-mode-item[hidden] { display: none !important; }
.bh-mode {
    position: relative; flex: none; width: 54px; height: 30px; padding: 0; border: 0; border-radius: 999px; cursor: pointer; isolation: isolate;
    background: transparent; -webkit-tap-highlight-color: transparent;
}
.bh-mode:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.bh-mode-track {
    position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    background: linear-gradient(135deg, rgba(var(--rgb-accent-light), .55), rgba(var(--rgb-accent), .35));
    box-shadow: inset 0 2px 5px rgba(var(--rgb-ink), .25), inset 0 0 0 1px rgba(var(--rgb-primary), .3), 0 1px 0 rgba(255,255,255,.5);
    transition: background .5s ease, box-shadow .5s ease;
}
.bh-mode[aria-checked="true"] .bh-mode-track {
    background: linear-gradient(135deg, rgba(var(--rgb-ink-2), .95), rgba(var(--rgb-primary), .8));
    box-shadow: inset 0 2px 6px rgba(0,0,0,.45), inset 0 0 0 1px rgba(var(--rgb-accent-light), .35);
}
.bh-mode-knob {
    position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
    background: radial-gradient(120% 140% at 30% 0%, #fff, rgba(255,255,255,.62) 60%, rgba(255,255,255,.45));
    box-shadow: 0 3px 8px rgba(var(--rgb-ink), .4), inset 0 1px 1px #fff, inset 0 -2px 4px rgba(var(--rgb-accent-light), .45);
    transition: transform .6s cubic-bezier(.3,1.5,.5,1), width .25s ease, background .4s ease;
}
.bh-mode[aria-checked="true"] .bh-mode-knob { transform: translateX(24px); }
html[dir="rtl"] .bh-mode[aria-checked="true"] .bh-mode-knob { transform: translateX(-24px); }
.bh-mode:active .bh-mode-knob { width: 34px; }
.bh-mode[aria-checked="true"]:active .bh-mode-knob { transform: translateX(14px); }
html[dir="rtl"] .bh-mode[aria-checked="true"]:active .bh-mode-knob { transform: translateX(-14px); }
.bh-mode-knob svg { position: absolute; width: 15px; height: 15px; transition: opacity .35s ease, transform .6s cubic-bezier(.3,1.5,.5,1); }
.bh-mode-sun { color: var(--c-kicker); opacity: 1; transform: rotate(0) scale(1); }
.bh-mode-moon { color: var(--c-primary-deeper); opacity: 0; transform: rotate(-80deg) scale(.4); }
.bh-mode[aria-checked="true"] .bh-mode-sun { opacity: 0; transform: rotate(90deg) scale(.4); }
.bh-mode[aria-checked="true"] .bh-mode-moon { opacity: 1; transform: rotate(0) scale(1); }
.bh-mode-label { font-size: .9rem; color: var(--c-text); }
@media (prefers-reduced-motion: reduce) { .bh-mode-knob, .bh-mode-knob svg, .bh-mode-track { transition: none; } }

/* ===== Squeeze carousel for the home announcements (includes/home_news.html, js/squeeze.js) =====
   One slide is open; the others are thin "slats" that show a slice of their photo. Opening a slide squeezes the old one into a slat.
   Idea: "Squeeze Carousel" (21st.dev). Colours = site palette. ===== */
.bh-news-box.has-squeeze { padding: 1rem; }
.bh-squeeze { --sq-h: 320px; --sq-slat: 8px; --sq-gap: 8px; --sq-dur: 1000ms; --sq-radius: 6px; --sq-open-w: 100%; position: relative; }
.bh-sq-track { display: flex; gap: var(--sq-gap); height: var(--sq-h); }
.bh-sq-slide {
    position: relative; flex: 0 0 var(--sq-slat); flex-grow: 0; min-width: 0; overflow: hidden; border-radius: var(--sq-radius);
    background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary-deeper)); cursor: pointer;
    transition: flex-grow var(--sq-dur) cubic-bezier(.77, 0, .18, 1), flex-basis .25s ease, box-shadow .3s ease;
}
.bh-sq-slide:not(.is-open):hover { flex-basis: calc(var(--sq-slat) + 6px); }
.bh-sq-slide.is-open { flex-grow: 1; cursor: default; box-shadow: 0 14px 34px -14px rgba(var(--rgb-ink), .55); }
.bh-sq-media { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--sq-open-w); background-size: cover; background-position: center; }
.bh-sq-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--rgb-ov-b), .93) 6%, rgba(var(--rgb-ov-a), .45) 55%, rgba(var(--rgb-ov-a), .18)); }
.bh-sq-content {
    position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--sq-open-w); display: flex; flex-direction: column; justify-content: flex-end;
    padding: 1.2rem 1.3rem; color: var(--c-bg-2); opacity: 0; transform: translateY(10px); pointer-events: none;
    transition: opacity .35s ease, transform .5s ease;
}
.bh-sq-slide.is-open .bh-sq-content { opacity: 1; transform: none; pointer-events: auto; transition-delay: calc(var(--sq-dur) * .45); }
.bh-sq-date { font-size: .82rem; letter-spacing: .02em; color: var(--c-gold); margin: 0 0 .25rem; }
.bh-sq-title { font-size: clamp(1.15rem, 3.4vw, 1.55rem); line-height: 1.35; margin: 0 0 .4rem; color: var(--c-salam) !important; }
.bh-sq-text { font-size: .95rem; line-height: 1.6; margin: 0 0 .8rem; max-width: 40rem; color: var(--c-bg-4);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bh-sq-go { align-self: flex-start; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .9rem;
    text-decoration: none; color: var(--c-on-accent) !important; background: linear-gradient(135deg, var(--c-accent-light), var(--c-accent)); }
.bh-sq-go:hover { filter: brightness(1.06); }
.bh-sq-hit { position: absolute; inset: 0; z-index: 2; width: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; }
.bh-sq-slide.is-open .bh-sq-hit { display: none; }
.bh-sq-hit:focus-visible { outline: 2px solid var(--c-gold); outline-offset: -2px; }
.bh-sq-slide .bh-new-tag { position: absolute; top: .8rem; inset-inline-start: .8rem; z-index: 1; }
.bh-sq-controls { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }
.bh-sq-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--bh-emerald); display: inline-grid; place-items: center; cursor: pointer;
    transition: background .2s, transform .2s; }
.bh-sq-btn:hover { background: var(--c-pale); transform: translateY(-2px); }
.bh-sq-btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
html[dir="rtl"] .bh-sq-btn svg, [dir="rtl"] .bh-sq-btn svg { transform: scaleX(-1); }
@media (max-width: 575px) { .bh-squeeze { --sq-h: 360px; --sq-gap: 6px; } .bh-sq-content { padding: 1rem; } }
@media (prefers-reduced-motion: reduce) { .bh-squeeze { --sq-dur: 1ms; } .bh-sq-content { transition: none; transition-delay: 0s !important; } }
@supports (color: color-mix(in srgb, red 50%, blue)) { html[data-bh-mode="dark"] .bh-sq-btn:hover { background: var(--bh-d-surface-2); } }

/* ===== Gallery: glass folders (includes/glass_folders.html, js/gallery-folders.js) =====
   Idea: "Glass Folder Cards" (21st.dev). A folder with a milk/smoked-glass front over the cover photo; hover leans the glass, click opens it. ===== */
.bh-folders { display: flex; flex-wrap: wrap; justify-content: center; gap: 3rem 3.2rem; padding: 2.5rem 0 1.2rem; }
.bh-folder {
    --fw: 300px; --fh: 214px; position: relative; flex: none; width: min(var(--fw), 100%); height: var(--fh); margin: 0; padding: 0; border: 0; background: none;
    color: inherit; text-align: start; cursor: pointer; perspective: 900px; -webkit-tap-highlight-color: transparent;
    opacity: 0; animation: bh-fold-in .8s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--i, 0) * 140ms);
}
@keyframes bh-fold-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.bh-folder:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 8px; border-radius: 16px; }
.bh-folder-back {
    position: absolute; inset: 18px 0 0 0; border-radius: 8px 18px 18px 18px;
    background: linear-gradient(160deg, var(--c-primary-2), var(--c-primary-dark)); box-shadow: 0 22px 34px -18px rgba(var(--rgb-ink), .6);
}
.bh-folder-back::before { content: ""; position: absolute; top: -17px; inset-inline-start: 0; width: 44%; height: 20px; border-radius: 10px 10px 0 0; background: var(--c-primary-2); }
.bh-folder[data-tone="dark"] .bh-folder-back { background: linear-gradient(160deg, var(--c-primary-dark), var(--c-ink-2)); }
.bh-folder[data-tone="dark"] .bh-folder-back::before { background: var(--c-primary-dark); }
.bh-folder-sheet, .bh-folder-art {
    position: absolute; inset-inline: 14px; top: 16px; height: 74%; border-radius: 8px; transition: transform .6s cubic-bezier(.3,1.3,.5,1);
}
.bh-folder-sheet-2 { background: var(--c-soft-3); transform: translateY(2px) rotate(-2.2deg); inset-inline: 22px; }
.bh-folder-sheet-1 { background: var(--c-card); transform: translateY(4px) rotate(1.6deg); inset-inline: 18px; }
.bh-folder-art { inset-inline: 12px; top: 12px; background-color: var(--c-primary-2); background-size: cover; background-position: center; box-shadow: 0 2px 8px rgba(var(--rgb-ink), .35); }
.bh-folder-glass {
    position: absolute; inset: 56px 0 0 0; border-radius: 6px 6px 18px 18px; overflow: hidden; transform-origin: 50% 100%;
    background: linear-gradient(165deg, rgba(255,255,255,.46), rgba(255,255,255,.16) 55%, rgba(255,255,255,.28));
    -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(255,255,255,.5);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.85), inset 0 -18px 30px -18px rgba(var(--rgb-ink), .35), 0 14px 26px -14px rgba(var(--rgb-ink), .55);
    transition: transform .6s cubic-bezier(.3,1.3,.5,1);
}
.bh-folder[data-tone="dark"] .bh-folder-glass {
    background: linear-gradient(165deg, rgba(var(--rgb-ink-2), .5), rgba(var(--rgb-ink-2), .72));
    border-color: rgba(255,255,255,.22); box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 0 14px 26px -14px rgba(var(--rgb-ink), .7);
}
.bh-folder-shine { position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 38%); mix-blend-mode: soft-light; pointer-events: none; }
.bh-folder-label { position: absolute; inset-inline: 18px; bottom: 14px; display: flex; flex-direction: column; gap: .1rem; color: #fff; text-shadow: 0 1px 8px rgba(var(--rgb-ink), .65); pointer-events: none; }
.bh-folder-label strong { font-size: 1.12rem; font-weight: 700; line-height: 1.3; }
.bh-folder-label small { font-size: .82rem; opacity: .9; }
@media (hover: hover) {
    .bh-folder:hover .bh-folder-glass { transform: rotateX(-16deg); }
    .bh-folder:hover .bh-folder-art { transform: translateY(-9px); }
    .bh-folder:hover .bh-folder-sheet-1 { transform: translateY(-4px) rotate(2.4deg); }
    .bh-folder:hover .bh-folder-sheet-2 { transform: translateY(-2px) rotate(-3deg); }
}
.bh-folder.is-open .bh-folder-glass, .bh-folder:focus-visible .bh-folder-glass { transform: rotateX(-30deg); }
.bh-folder.is-open .bh-folder-art { transform: translateY(-18px); }
.bh-folders-hint { font-size: .9rem; margin: .5rem 0 0; }

.bh-gf-dialog {
    position: fixed; inset: 0; z-index: 1900; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw;
    background: rgba(var(--rgb-ink-2), .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s ease;
}
.bh-gf-dialog[hidden] { display: none; }
.bh-gf-dialog.is-in { opacity: 1; }
.bh-gf-sheet {
    width: min(1040px, 100%); max-height: 92vh; overflow: auto; background: var(--c-card); color: var(--c-text); border: 1px solid var(--c-border); border-radius: 20px;
    padding: 1.2rem 1.3rem 1.4rem; box-shadow: 0 30px 80px rgba(0,0,0,.5); transform: translateY(18px) scale(.98); transition: transform .45s cubic-bezier(.3,1.3,.5,1);
}
.bh-gf-dialog.is-in .bh-gf-sheet { transform: none; }
.bh-gf-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; position: sticky; top: -1.2rem; background: var(--c-card); padding: .6rem 0; z-index: 1; }
.bh-gf-head h2 { margin: 0; font-size: 1.5rem; }
.bh-gf-head small { color: var(--c-subtext); margin-inline-start: .6rem; font-size: .9rem; font-family: inherit; }
.bh-gf-x { width: 42px; height: 42px; flex: none; border-radius: 999px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.bh-gf-x:hover { background: var(--c-pale); }
.bh-gf-x:focus-visible, .bh-gf-thumb:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.bh-gf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.bh-gf-thumb { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--c-bg-3); }
.bh-gf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.bh-gf-thumb:hover img { transform: scale(1.06); }
.bh-gf-lb { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; background: rgba(var(--rgb-ink-2), .96); }
.bh-gf-lb[hidden] { display: none; }
.bh-gf-lb img { max-width: 100%; max-height: 90vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.bh-gf-lb-btn { position: absolute; width: 46px; height: 46px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(var(--rgb-ink), .55); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.bh-gf-lb-btn:hover { background: rgba(var(--rgb-ink), .85); }
.bh-gf-lb-x { top: 14px; inset-inline-end: 14px; } .bh-gf-lb-prev { inset-inline-start: 14px; top: 50%; } .bh-gf-lb-next { inset-inline-end: 14px; top: 50%; }
.bh-gf-lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.85); font-size: .9rem; }
body.bh-gf-lock { overflow: hidden; }
@media (max-width: 575px) { .bh-folders { gap: 2.4rem; } .bh-gf-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
    .bh-folder { animation: none; opacity: 1; } .bh-folder-glass, .bh-folder-art, .bh-folder-sheet, .bh-gf-sheet, .bh-gf-dialog { transition: none; }
    .bh-folder:hover .bh-folder-glass, .bh-folder.is-open .bh-folder-glass { transform: none; }
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
    html[data-bh-mode="dark"] .bh-gf-x:hover { background: var(--bh-d-surface-2); }
    html[data-bh-mode="dark"] .bh-gf-thumb { background: var(--bh-d-surface-2); }
}

/* ===== Home: event cards as glass folders (templates/pages/index*.html, js/event-folders.js) =====
   Same folder look as the gallery (.bh-folder*); the sheet shows the big photo, the full text and a link to the photo gallery. ===== */
.bh-folders.bh-ev { padding-top: 2rem; }
.bh-folders.bh-ev .bh-folder { animation: none; opacity: 1; }
.bh-folders.bh-ev .bh-folder-glass { -webkit-backdrop-filter: blur(3px) saturate(1.25); backdrop-filter: blur(3px) saturate(1.25); }
.bh-folders.bh-ev .bh-folder[data-tone="dark"] .bh-folder-glass { background: linear-gradient(165deg, rgba(var(--rgb-ink-2), .2), rgba(var(--rgb-ink-2), .68)); }
.bh-folders.bh-ev .bh-folder-glass::after { content: ""; position: absolute; inset: auto 0 0 0; height: 58%; background: linear-gradient(to top, rgba(var(--rgb-ink-2), .72), transparent); pointer-events: none; }
.bh-folders.bh-ev .bh-folder-label { z-index: 1; }
.bh-folder-art { overflow: hidden; }
.bh-folder-art img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.bh-ev-sheet { width: min(900px, 100%); }
.bh-ev-view { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.4rem; align-items: start; }
.bh-ev-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--c-bg-3); box-shadow: 0 10px 26px -14px rgba(var(--rgb-ink), .6); }
.bh-ev-text { margin: 0 0 1.2rem; color: var(--c-body); font-size: 1.05rem; line-height: 1.75; }
html[lang="fa"] .bh-ev-text { line-height: 2; }
@media (max-width: 767.98px) { .bh-ev-view { grid-template-columns: 1fr; gap: 1rem; } .bh-ev-photo { aspect-ratio: 16 / 10; } }
