/* =====================================================================
   MuslimKH v3 — Professional Design System
   Emerald & Gold · Mobile-first · Light/Dark · LTR/RTL
   ===================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand scale (fills: hero, buttons, footer) */
  --brand-950: #04251a;
  --brand-900: #073a2a;
  --brand-800: #0a4d38;
  --brand-700: #0e5c44;
  --brand-600: #137a5a;
  --brand-500: #1a936c;

  /* Legacy names kept: pages use them inline */
  --emerald: #0e5c44;
  --emerald-dark: #073a2a;
  --emerald-light: #137a5a;
  --emerald-soft: rgba(14, 92, 68, 0.09);
  --gold: #d4a644;
  --gold-deep: #a97c1f;
  --gold-light: #f3dca2;
  --gold-soft: rgba(212, 166, 68, 0.16);

  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-alt: #efebe0;
  --text: #14211b;
  --text-muted: #5b6a63;
  --border: rgba(14, 92, 68, 0.14);
  --border-strong: rgba(14, 92, 68, 0.28);

  --accent: var(--brand-700);          /* text/icon accent on surfaces */
  --accent-hover: var(--brand-900);
  --on-accent: #ffffff;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-xs: 0 1px 2px rgba(10, 48, 36, 0.06);
  --shadow: 0 8px 28px rgba(10, 48, 36, 0.07);
  --shadow-hover: 0 18px 44px rgba(10, 48, 36, 0.14);
  --ring: 0 0 0 4px rgba(14, 92, 68, 0.2);

  --font-main: 'Kantumruy Pro', 'Plus Jakarta Sans', 'Battambang', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Kantumruy Pro', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-moul: 'Moul', 'Kantumruy Pro', serif;
  --font-ar: 'Amiri', 'Traditional Arabic', serif;

  --header-h: 72px;
  --bottom-nav-h: 66px;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23e6c571' stroke-opacity='.2' stroke-width='1'%3E%3Crect x='24' y='24' width='40' height='40'/%3E%3Crect x='24' y='24' width='40' height='40' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='9'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="dark"] {
  --emerald: #46c79a;
  --emerald-light: #67d8ae;
  --emerald-soft: rgba(70, 199, 154, 0.14);
  --gold: #e0b653;
  --gold-deep: #e8c673;

  --bg: #08110e;
  --surface: #0f1b16;
  --surface-alt: #15251f;
  --text: #eaf1ed;
  --text-muted: #9db1a8;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.2);

  --accent: #6fdcb3;
  --accent-hover: #a5efd0;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 4px rgba(111, 220, 179, 0.25);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
main { flex: 1; }
h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.35; font-weight: 800; letter-spacing: 0; }
a { color: var(--accent); text-decoration: none; transition: color .2s, background .2s, border-color .2s, transform .2s, box-shadow .2s; }
a:hover { color: var(--accent-hover); }
img, svg, video { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--gold); color: #1a1a1a; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
audio { width: 100%; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: clamp(1rem, 3.5vw, 2rem); }
.section-pad { padding: clamp(1.5rem, 4vw, 2.75rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Utilities (names used across pages) */
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.25rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: clamp(2.25rem, 5vw, 3.5rem); }
.mb-3 { margin-bottom: 1.25rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -120px; z-index: 5000;
  background: var(--brand-700); color: #fff; padding: .65rem 1.1rem; border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- 3. Top bar + Header ---------- */
.topbar { background: var(--brand-950); color: rgba(255,255,255,.78); font-size: .8rem; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 38px; }
.topbar a { color: rgba(255,255,255,.78); }
.topbar a:hover { color: var(--gold-light); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.topbar i { color: var(--gold); margin-inline-end: .35rem; }

.site-header { position: sticky; top: 0; z-index: 1000; isolation: isolate; transition: box-shadow .25s; }
/* Blur lives on a pseudo-element so it never becomes the containing block of the mobile drawer */
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(16px); backdrop-filter: saturate(170%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled { box-shadow: 0 8px 30px rgba(8, 40, 30, .1); }
[data-theme="dark"] .site-header.is-scrolled { box-shadow: 0 8px 30px rgba(0,0,0,.5); }

.site-header .container, .topbar .container { max-width: 1440px; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-logo { height: 42px; width: 42px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.2rem; color: var(--brand-700); letter-spacing: -.02em; }
[data-theme="dark"] .brand-name { color: var(--gold-light); }
.brand-sub { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }

.main-nav { display: flex; align-items: center; gap: .15rem; margin-inline: auto; }
.nav-link {
  position: relative; background: none; border: 0; cursor: pointer;
  color: var(--text); font-size: .92rem; font-weight: 600; white-space: nowrap;
  padding: .55rem .8rem; border-radius: 12px;
  display: inline-flex; align-items: center; gap: .45rem;
}
.nav-link i:not(.fa-chevron-down) { color: var(--accent); font-size: .95em; }
.nav-link:hover, .nav-link.active { background: var(--emerald-soft); color: var(--accent); }
.nav-link.active::after {
  content: ''; position: absolute; inset-inline: .8rem; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gold);
}
.nav-highlight { background: var(--gold-soft); border: 1px solid rgba(212,166,68,.4); }
.nav-link .fa-chevron-down { font-size: .65rem; opacity: .7; transition: transform .2s; }
.nav-dropdown.open .nav-link .fa-chevron-down { transform: rotate(180deg); }

/* Dropdowns — no hover gap: the menu starts flush under the button and carries an invisible bridge */
.nav-dropdown, .lang-switch { position: relative; }
.dropdown-menu, .lang-menu {
  position: absolute; top: 100%; inset-inline-start: 0;
  min-width: 270px; max-width: 92vw;
  padding-top: 10px;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .22s;
  z-index: 1200;
}
.lang-menu { inset-inline-start: auto; inset-inline-end: 0; min-width: 210px; }
.dropdown-menu > .menu-panel, .lang-menu > .menu-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-hover); padding: .5rem; display: flex; flex-direction: column; gap: 2px;
}
.dropdown-menu a, .lang-menu a {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem;
  border-radius: 12px; color: var(--text); font-size: .92rem; font-weight: 600;
}
.dropdown-menu a .ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--emerald-soft); color: var(--accent); font-size: .9rem;
}
.dropdown-menu a:hover, .lang-menu a:hover, .lang-menu a.active { background: var(--emerald-soft); color: var(--accent); }
.dropdown-menu a:hover .ico { background: var(--brand-700); color: #fff; }
.nav-dropdown.open > .dropdown-menu, .lang-switch.open > .lang-menu,
.nav-dropdown:focus-within > .dropdown-menu, .lang-switch:focus-within > .lang-menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s;
}
@media (hover: hover) and (pointer: fine) and (min-width: 1261px) {
  .nav-dropdown:hover > .dropdown-menu, .lang-switch:hover > .lang-menu {
    opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s;
  }
  .nav-dropdown:hover .nav-link .fa-chevron-down { transform: rotate(180deg); }
}

.nav-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.icon-btn {
  background: var(--surface-alt); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; height: 42px; min-width: 42px; padding: 0 .7rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  cursor: pointer; font-size: .88rem; font-weight: 700;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--emerald-soft); }
.icon-btn:active { transform: scale(.95); }
.mobile-toggle { display: none; }
.nav-drawer-head, .nav-drawer-extra { display: none; }
.nav-overlay { display: none; }

/* ---------- 4. Buttons ---------- */
.btn-primary, .btn-gold, .btn-outline, .btn-sm-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: inherit; font-weight: 700; border-radius: 14px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; line-height: 1.2; white-space: nowrap;
  transition: transform .18s, box-shadow .18s, background .2s, color .2s, border-color .2s;
}
.btn-primary { background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); color: #fff; padding: .8rem 1.45rem; font-size: .95rem; box-shadow: 0 6px 18px rgba(14,92,68,.28); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(14,92,68,.36); }
.btn-gold { background: linear-gradient(135deg, #efcb73, var(--gold)); color: #1b1608; padding: .8rem 1.45rem; font-size: .95rem; box-shadow: 0 6px 18px rgba(212,166,68,.3); }
.btn-gold:hover { color: #1b1608; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(212,166,68,.42); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--border-strong); padding: .78rem 1.4rem; font-size: .95rem; }
.btn-outline:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; transform: translateY(-2px); }
.btn-sm-primary { background: var(--brand-700); color: #fff; padding: .55rem 1.05rem; font-size: .86rem; border-radius: 12px; }
.btn-sm-primary:hover { background: var(--brand-900); color: #fff; }
.btn-ghost { background: var(--emerald-soft); color: var(--accent); padding: .6rem 1.1rem; font-size: .88rem; }
.btn-ghost:hover { background: var(--brand-700); color: #fff; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.02rem; border-radius: 16px; }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-sm-primary { background: linear-gradient(135deg, #18a07a, #0e6b50); }
/* Outline buttons placed on dark gradient heroes become white */
.hero .btn-outline, .hero-banner .btn-outline, .page-hero .btn-outline, .cta-band .btn-outline {
  color: #fff !important; border-color: rgba(255,255,255,.45) !important; background: rgba(255,255,255,.06);
}
.hero .btn-outline:hover, .hero-banner .btn-outline:hover, .page-hero .btn-outline:hover, .cta-band .btn-outline:hover {
  background: #fff; color: var(--brand-900) !important; border-color: #fff !important;
}

/* ---------- 5. Heroes ---------- */
.hero, .hero-banner {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1100px 520px at 88% -10%, rgba(212,166,68,.28), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(26,147,108,.45), transparent 60%),
    linear-gradient(135deg, var(--brand-950) 0%, var(--brand-900) 45%, var(--brand-700) 100%);
}
.hero::before, .hero-banner::before {
  content: ''; position: absolute; inset: 0; background-image: var(--pattern); background-size: 88px 88px; opacity: .7; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%); mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 0; }
.hero-banner { padding: 3.5rem 0; }
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero-inner { position: relative; z-index: 2; }
.hero-title { font-size: clamp(1.85rem, 4.2vw, 3.2rem); font-weight: 800; line-height: 1.4; margin: 1rem 0 1.1rem; letter-spacing: 0; }
.hero-title .accent { color: var(--gold-light); }
.hero-subtitle { font-size: clamp(1rem, 1.6vw, 1.15rem); opacity: .9; max-width: 680px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }

.hero-search {
  display: flex; gap: .5rem; max-width: 640px; margin-top: 1.75rem; padding: .5rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); border-radius: 20px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hero-search input {
  flex: 1; min-width: 0; background: #fff; color: #14211b; border: 0; border-radius: 14px;
  padding: .9rem 1.15rem; font-family: inherit; font-size: 1rem; outline: none;
}
.hero-search input::placeholder { color: #7a8a83; }
.hero-search .btn-gold { border-radius: 14px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.hero-chips a {
  color: #fff; font-size: .82rem; font-weight: 600; padding: .38rem .85rem; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
}
.hero-chips a:hover { background: var(--gold); color: #1b1608; border-color: var(--gold); }

/* Live prayer panel (hero, right column) */
.prayer-panel {
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.26); border-radius: var(--radius-lg);
  padding: 1.5rem; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.pp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.pp-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-light); font-weight: 700; }
.pp-city { font-weight: 700; font-size: .95rem; margin-top: .15rem; }
.pp-date { font-size: .8rem; opacity: .8; text-align: end; }
.pp-next { margin: 1.1rem 0 1.2rem; text-align: center; padding: 1.1rem; border-radius: var(--radius); background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.12); }
.pp-next-name { font-size: 1.05rem; font-weight: 700; color: var(--gold-light); }
.pp-countdown { font-size: clamp(2rem, 4vw, 2.7rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.2; }
.pp-times { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.pp-time { text-align: center; padding: .65rem .2rem; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.pp-time span { display: block; font-size: .7rem; opacity: .8; }
.pp-time strong { font-size: .92rem; }
.pp-time.is-next { background: var(--gold); color: #1b1608; border-color: #fff3; box-shadow: 0 6px 18px rgba(212,166,68,.4); }
.pp-time.is-next span { opacity: .85; }
.pp-foot { margin-top: 1rem; text-align: center; font-size: .86rem; }
.pp-foot a { color: var(--gold-light); font-weight: 700; }
.pp-foot a:hover { color: #fff; }

/* Stats strip that overlaps the hero edge */
.stats-strip { position: relative; z-index: 3; margin-top: clamp(2rem, 5vw, 3.5rem); transform: translateY(50%); }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-hover); overflow: hidden;
}
.stat { padding: 1.3rem 1rem; text-align: center; position: relative; color: var(--text); }
.stat + .stat::before { content: ''; position: absolute; inset-inline-start: 0; top: 22%; bottom: 22%; width: 1px; background: var(--border); }
.stat-num { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .84rem; color: var(--text-muted); margin-top: .2rem; font-weight: 600; }
.hero-spacer { height: clamp(3rem, 6vw, 4.5rem); }

/* Inner page hero */
.page-hero {
  position: relative; overflow: hidden; color: #fff;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem);
  border-radius: var(--radius-lg); margin-bottom: 2rem;
  background:
    radial-gradient(700px 320px at 95% -20%, rgba(212,166,68,.3), transparent 60%),
    linear-gradient(135deg, var(--brand-950), var(--brand-800) 60%, var(--brand-700));
  box-shadow: 0 20px 50px rgba(7,58,42,.25);
}
.page-hero::before { content: ''; position: absolute; inset: 0; background-image: var(--pattern); background-size: 88px 88px; opacity: .55; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 100%); mask-image: linear-gradient(90deg, transparent 20%, #000 100%); }
[dir="rtl"] .page-hero::before { -webkit-mask-image: linear-gradient(270deg, transparent 20%, #000 100%); mask-image: linear-gradient(270deg, transparent 20%, #000 100%); }
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(1.55rem, 3.4vw, 2.4rem); margin: .75rem 0 .6rem; }
.page-hero p { opacity: .92; max-width: 780px; line-height: 1.8; }
.page-hero select, .page-hero input { background: #fff; color: #14211b; border-color: transparent; }

.badge-gold {
  display: inline-flex; align-items: center; gap: .45rem; max-width: 100%;
  background: rgba(212,166,68,.18); color: var(--gold-light);
  border: 1px solid rgba(212,166,68,.5); padding: .32rem .95rem;
  border-radius: 999px; font-size: .8rem; font-weight: 700; line-height: 1.4;
}
.tag-emerald {
  display: inline-flex; align-items: center; gap: .4rem; background: var(--emerald-soft); color: var(--accent);
  padding: .25rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
}
.tag-gold { background: var(--gold-soft); color: var(--gold-deep); }
a.tag-emerald:hover { background: var(--brand-700); color: #fff; }

/* ---------- 6. Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card-hover:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.pad-sm { padding: 1rem; }
.pad-md { padding: clamp(1.1rem, 2.4vw, 1.5rem); }
.pad-lg { padding: clamp(1.4rem, 3vw, 2.1rem); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); display: flex; align-items: center; gap: .6rem; }
.sec-head h2::before { content: ''; width: 5px; height: 1.3em; border-radius: 4px; background: linear-gradient(var(--gold), var(--brand-600)); flex-shrink: 0; }
.sec-head .eyebrow { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-deep); font-weight: 800; }
.read-more { font-weight: 700; font-size: .9rem; color: var(--accent); display: inline-flex; align-items: center; gap: .3rem; }
.read-more:hover { gap: .55rem; }

/* Service tiles (home) */
.service-tile { display: flex; flex-direction: column; gap: .35rem; color: var(--text); position: relative; overflow: hidden; }
.service-tile:hover { color: var(--text); }
.service-tile .ico {
  width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; color: #fff; margin-bottom: .6rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800)); box-shadow: 0 8px 18px rgba(14,92,68,.3);
}
.service-tile:nth-child(3n+2) .ico { background: linear-gradient(135deg, #e6bd5c, #b58420); box-shadow: 0 8px 18px rgba(181,132,32,.32); }
.service-tile:nth-child(4n+3) .ico { background: linear-gradient(135deg, #2aa6a0, #0e5d63); box-shadow: 0 8px 18px rgba(14,93,99,.3); }
.service-tile h3 { font-size: 1.04rem; }
.service-tile p { font-size: .86rem; color: var(--text-muted); line-height: 1.6; }
.service-tile::after { content: '\f061'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; inset-inline-end: 1.1rem; top: 1.3rem; font-size: .85rem; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: .25s; }
[dir="rtl"] .service-tile::after { content: '\f060'; transform: translateX(6px); }
.service-tile:hover::after { opacity: 1; transform: none; }

/* Daily source cards */
.source-card { display: flex; flex-direction: column; position: relative; overflow: hidden; }
.source-card::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--brand-500), var(--gold)); }
.source-card .arabic-text { margin-top: .9rem; }
.source-foot { margin-top: auto; padding-top: 1.1rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .85rem; flex-wrap: wrap; }

/* Audience path cards */
.path-card { position: relative; overflow: hidden; }
.path-card .path-ico { position: absolute; inset-inline-end: -14px; top: -14px; font-size: 7.5rem; opacity: .06; color: var(--brand-700); transform: rotate(-12deg); }
[dir="rtl"] .path-card .path-ico { transform: rotate(12deg); }
.path-card.is-emerald { border-top: 4px solid var(--brand-600); }
.path-card.is-gold { border-top: 4px solid var(--gold); }
.path-card h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); position: relative; }
.path-card p { position: relative; }
.path-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; position: relative; }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  background: radial-gradient(600px 280px at 100% 0%, rgba(212,166,68,.35), transparent 60%), linear-gradient(135deg, var(--brand-950), var(--brand-700));
  box-shadow: 0 24px 60px rgba(7,58,42,.28);
}
.cta-band::before { content: ''; position: absolute; inset: 0; background-image: var(--pattern); background-size: 88px 88px; opacity: .5; pointer-events: none; }
.cta-band > * { position: relative; }
.cta-band h2 { font-size: clamp(1.35rem, 3vw, 2rem); margin-bottom: .4rem; }
.cta-band p { opacity: .9; max-width: 620px; }

/* News cards */
.news-card { overflow: hidden; display: flex; flex-direction: column; }
.card-thumb { width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover; background: var(--surface-alt); transition: transform .5s; }
.news-card:hover .card-thumb { transform: scale(1.05); }
.news-card .thumb-wrap { overflow: hidden; }
.card-body { padding: 1.35rem; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); margin-bottom: .7rem; }
.news-card h3 { font-size: 1.1rem; line-height: 1.5; margin-bottom: .55rem; }
.news-card h3 a { color: var(--text); }
.news-card h3 a:hover { color: var(--accent); }
.news-card p { font-size: .92rem; color: var(--text-muted); margin-bottom: 1rem; flex: 1; }

/* Article body (news-detail) */
.article-body { color: var(--text); }
.article-body p { margin-bottom: 1.1rem; }
.article-body h2, .article-body h3, .article-body h4 { margin: 1.8rem 0 .8rem; }
.article-body ul, .article-body ol { padding-inline-start: 1.5rem; margin-bottom: 1.1rem; }
.article-body blockquote { border-inline-start: 4px solid var(--gold); background: var(--surface-alt); padding: 1rem 1.25rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.25rem 0; }
.article-body img { border-radius: var(--radius); margin: 1.25rem auto; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }

/* Arabic typography */
.arabic-text { font-family: var(--font-ar); font-size: 1.7rem; line-height: 2.2; direction: rtl; text-align: right; color: var(--text); }
.khmer-moul { font-family: var(--font-moul); font-weight: 400; }

/* ---------- 7. Forms ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.filter-bar input, .filter-bar select, .form-control, select.form-control, textarea.form-control {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: .8rem 1.05rem; font-family: inherit; font-size: .98rem;
  outline: none; width: 100%; transition: border-color .2s, box-shadow .2s; min-height: 48px;
}
textarea.form-control { min-height: 120px; resize: vertical; line-height: 1.6; }
.filter-bar input { flex: 2 1 240px; }
.filter-bar select { flex: 1 1 170px; }
.filter-bar > form { flex-basis: min(100%, 260px) !important; min-width: 0; }
.filter-bar .btn-gold, .filter-bar .btn-primary, .filter-bar .btn-outline { min-height: 48px; }
.form-control:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: var(--brand-600); box-shadow: var(--ring); }
.form-control::placeholder, .filter-bar input::placeholder { color: var(--text-muted); opacity: .8; }
select, select.form-control {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23708077' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-inline-end: 2.4rem;
}
[dir="rtl"] select { background-position: left 1rem center; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 700; margin-bottom: .4rem; font-size: .92rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-600); width: 1.05rem; height: 1.05rem; }

/* ---------- 8. Content components ---------- */
.accordion-item { margin-bottom: .85rem; overflow: hidden; }
.accordion-item summary {
  padding: 1.1rem 1.35rem; cursor: pointer; font-weight: 700;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; transition: background .2s;
}
.accordion-item summary:hover { background: var(--emerald-soft); }
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after {
  content: ''; width: .55rem; height: .55rem; flex-shrink: 0; margin-inline-start: auto;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .25s; margin-top: -4px;
}
.accordion-item[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.accordion-item[open] summary { background: var(--emerald-soft); }
.accordion-body { padding: 1.1rem 1.35rem 1.3rem; color: var(--text-muted); border-top: 1px solid var(--border); line-height: 1.85; }

.alert-box { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; background: var(--gold-soft); border: 1px solid rgba(212,166,68,.55); border-inline-start-width: 5px; color: var(--text); }
.alert-success { background: rgba(26,147,108,.12); border-color: var(--brand-500); }
.alert-danger { background: rgba(220,38,38,.09); border-color: #dc2626; }
.alert-box code { background: rgba(0,0,0,.08); padding: .1rem .4rem; border-radius: 6px; font-size: .88em; }

.pagination { display: flex; justify-content: center; gap: .45rem; margin-top: 2.25rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 44px; height: 44px; padding: 0 .9rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700;
}
.pagination a.active, .pagination a:hover { background: var(--brand-700); color: #fff; border-color: var(--brand-700); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data-table th, table.data-table td { padding: .9rem 1.05rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
table.data-table th { background: var(--surface-alt); font-weight: 800; font-size: .86rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); position: sticky; top: 0; }
table.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-alt) 45%, transparent); }
table.data-table tbody tr:hover { background: var(--emerald-soft); }
table.data-table tbody tr:last-child td { border-bottom: 0; }

hr { border: 0; height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ---------- 9. Footer ---------- */
.site-footer {
  position: relative; margin-top: auto; color: rgba(255,255,255,.86); overflow: hidden;
  background: linear-gradient(180deg, var(--brand-900), var(--brand-950));
}
.site-footer::before { content: ''; position: absolute; inset: 0; background-image: var(--pattern); background-size: 88px 88px; opacity: .35; pointer-events: none; -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%); }
.site-footer > * { position: relative; }
.footer-bismillah { text-align: center; padding: 2.25rem 1rem 0; font-family: var(--font-ar); font-size: clamp(1.5rem, 3.5vw, 2.1rem); color: var(--gold-light); line-height: 1.8; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(1.5rem, 3vw, 3rem); padding-top: 2.25rem; padding-bottom: 2.75rem; }
.footer-logo { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; font-size: 1.4rem; font-weight: 800; color: var(--gold-light); }
.footer-logo img { height: 46px; width: 46px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.footer-desc { font-size: .92rem; opacity: .82; line-height: 1.85; max-width: 420px; }
.site-footer h4 { color: var(--gold-light); font-size: 1rem; margin-bottom: 1.1rem; position: relative; padding-bottom: .65rem; }
.site-footer h4::after { content: ''; position: absolute; inset-inline-start: 0; bottom: 0; width: 28px; height: 3px; border-radius: 3px; background: var(--gold); }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: .55rem; }
.site-footer a { color: rgba(255,255,255,.8); font-size: .92rem; }
.site-footer li a:hover { color: var(--gold-light); padding-inline-start: .3rem; }
.footer-socials { display: flex; gap: .6rem; margin-top: 1.25rem; }
.footer-socials a { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.footer-socials a:hover { background: var(--gold); color: #1b1608; transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 1.15rem 0; font-size: .84rem; opacity: .85; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; }
.footer-bottom a { font-size: .84rem; }

/* ---------- 10. Floating UI ---------- */
.back-to-top {
  position: fixed; inset-inline-end: 1.25rem; bottom: 1.25rem; z-index: 900;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #efcb73, var(--gold)); color: #1b1608; font-size: 1rem;
  box-shadow: 0 10px 26px rgba(0,0,0,.28); opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: .25s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { transform: translateY(-3px); }

.toast-wrap { position: fixed; inset-inline: 0; bottom: 5.5rem; z-index: 3000; display: flex; justify-content: center; pointer-events: none; padding: 0 1rem; }
.toast { background: var(--brand-950); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-size: .9rem; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 0; transform: translateY(12px); transition: .3s; border: 1px solid rgba(212,166,68,.5); }
.toast.show { opacity: 1; transform: none; }

.bottom-nav { display: none; }

/* Scroll reveal (applied by main.js only to below-the-fold items) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 11. Responsive ---------- */
@media (min-width: 1261px) {
  .nav-home { display: none; }               /* the logo already links home */
}
@media (max-width: 1480px) {
  .nav-link { padding: .5rem .65rem; font-size: .9rem; }
  .main-nav .nav-link i:not(.fa-chevron-down) { display: none; }
  .main-nav .nav-highlight i { display: inline-block !important; }
  .brand-sub { display: none; }
}
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1260px) {
  :root { --header-h: 64px; }
  .topbar { display: none; }
  .brand-sub { display: none; }
  .nav-wrap { min-height: var(--header-h); }
  .brand-logo { height: 38px; width: 38px; }

  .mobile-toggle { display: inline-flex; }
  .nav-actions .nav-search, .nav-actions .nav-login { display: none; }

  /* Off-canvas drawer */
  .main-nav {
    position: fixed; top: 0; bottom: 0; inset-inline-end: 0; inset-inline-start: auto;
    width: min(88vw, 390px); height: 100vh; height: 100dvh; margin: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px;
    background: var(--surface); padding: 0 1rem 2rem; overflow-y: auto; overscroll-behavior: contain;
    box-shadow: -20px 0 60px rgba(0,0,0,.3); z-index: 1400;
    transform: translateX(105%); visibility: hidden; transition: transform .32s cubic-bezier(.3,.8,.3,1), visibility 0s linear .32s;
  }
  [dir="rtl"] .main-nav { transform: translateX(-105%); box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .main-nav.is-open { transform: none; visibility: visible; transition-delay: 0s; }
  .nav-overlay { display: block; position: fixed; inset: 0; z-index: 990; background: rgba(4,37,26,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: .3s; }
  .nav-overlay.show { opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }

  .nav-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 1rem 0 .85rem; margin-bottom: .35rem; border-bottom: 1px solid var(--border); }
  .nav-drawer-head .brand-name { font-size: 1.1rem; }
  .nav-drawer-extra { display: block; }
  .drawer-search { display: flex; gap: .5rem; margin: .5rem 0 .6rem; }
  .drawer-search input { flex: 1; min-width: 0; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); border-radius: 14px; padding: .75rem 1rem; font-family: inherit; font-size: .95rem; outline: none; }
  .drawer-search input:focus { border-color: var(--brand-600); box-shadow: var(--ring); }
  .drawer-search button { width: 48px; border: 0; border-radius: 14px; background: var(--brand-700); color: #fff; cursor: pointer; }
  .drawer-cta { display: flex; gap: .6rem; margin-top: 1rem; }
  .drawer-cta a { flex: 1; }
  .drawer-langs { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: 1.25rem; }
  .drawer-langs a { text-align: center; padding: .6rem .5rem; border: 1px solid var(--border); border-radius: 12px; font-size: .86rem; font-weight: 700; color: var(--text); }
  .drawer-langs a.active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
  .drawer-label { margin-top: 1.25rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 800; }

  .main-nav .nav-link { width: 100%; padding: .85rem .9rem; font-size: 1rem; justify-content: flex-start; border-radius: 14px; }
  .main-nav .nav-link i:not(.fa-chevron-down) { display: inline-block; }
  .main-nav .nav-link .fa-chevron-down { margin-inline-start: auto; }
  .main-nav .nav-link.active::after { display: none; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown > .dropdown-menu {
    position: static; display: none; opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    min-width: 0; max-width: none; padding: 0 0 .4rem; transition: none;
  }
  .nav-dropdown.open > .dropdown-menu { display: block; }
  .nav-dropdown > .dropdown-menu > .menu-panel { box-shadow: none; border: 0; background: var(--surface-alt); border-radius: 16px; padding: .4rem; margin-top: .2rem; }

  /* Bottom tab bar */
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 950;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); background: color-mix(in srgb, var(--surface) 94%, transparent);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border); box-shadow: 0 -8px 30px rgba(0,0,0,.08);
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--bottom-nav-h); color: var(--text-muted); font-size: .68rem; font-weight: 700; background: none; border: 0; cursor: pointer; padding: 0 2px; min-width: 0; }
  .bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bn-item i { font-size: 1.15rem; }
  .bn-item.active { color: var(--accent); }
  .bn-item.active i { transform: translateY(-1px); }
  .bn-item.bn-main i { width: 50px; height: 50px; margin-top: -22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-800)); box-shadow: 0 8px 22px rgba(14,92,68,.45); border: 4px solid var(--bg); }
  .back-to-top { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + .9rem); inset-inline-end: 1rem; width: 44px; height: 44px; }
  .toast-wrap { bottom: calc(var(--bottom-nav-h) + 4.5rem); }
}
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3)::before { display: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .hero-search { flex-direction: column; padding: .6rem; }
  .hero-search .btn-gold { width: 100%; min-height: 48px; }
  .hero-actions .btn-gold, .hero-actions .btn-outline, .hero-actions .btn-primary { flex: 1 1 100%; }
  .cta-band { text-align: center; justify-content: center; }
  .cta-band .btn-gold { width: 100%; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
  .service-tile { padding: 1rem; }
  .service-tile .ico { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 14px; }
  .service-tile h3 { font-size: .95rem; }
  .service-tile p { display: none; }
  .brand-name { font-size: 1.05rem; }
  .nav-actions { gap: .35rem; }
  .icon-btn { height: 40px; min-width: 40px; }
  .lang-btn span { display: none; }
  .lang-menu { position: fixed; top: calc(var(--header-h) - 6px); inset-inline-end: .75rem; inset-inline-start: auto; width: min(260px, 90vw); }
  .page-hero { border-radius: 20px; }
  .pp-times { gap: .35rem; }
  .pp-time { padding: .55rem .1rem; }
  .pp-time strong { font-size: .8rem; }
  .arabic-text { font-size: 1.45rem; line-height: 2.1; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-bottom-inner { justify-content: center; text-align: center; }
}

@media print {
  .site-header, .topbar, .site-footer, .bottom-nav, .back-to-top, .toast-wrap, .nav-overlay { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
