/* Nur ala Nur — theme built from the logo: deep navy, crest blue, silver, soft gold */
:root {
  --navy-950: #070f29;
  --navy-900: #0b1639;
  --navy-800: #12224f;
  --navy-700: #1b3170;
  --blue-500: #3a5bb0;
  --blue-300: #8fa6dc;
  --silver: #c9cdd6;
  --silver-light: #eef0f5;
  --gold: #c9a54a;
  --gold-light: #e6cf8a;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a2340;
  --muted: #5b6684;
  --border: #dde2ee;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(11, 22, 57, .10);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1.2'%3E%3Crect x='20' y='20' width='40' height='40'/%3E%3Crect x='20' y='20' width='40' height='40' transform='rotate(45 40 40)'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
a { color: var(--blue-500); }
a:hover { color: var(--navy-700); }
img { max-width: 100%; }
.container { width: min(1180px, 92%); margin: 0 auto; }
.arabic { font-family: "Traditional Arabic", "Amiri", "Scheherazade New", "Segoe UI", serif; direction: rtl; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header / nav ---------- */
.site-header {
  background: radial-gradient(120% 140% at 50% -40%, rgba(201, 165, 74, .18), transparent 60%), var(--navy-900) var(--pattern);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .4);
  border-top: 3px solid var(--gold);
}
/* gold ornamental line under the header */
.site-header::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 15%, var(--gold-light) 50%, var(--gold) 85%, transparent);
}
.site-header .container { width: min(1480px, 96%); }   /* the header may use more of a wide screen than the page */
.nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand links tools"; align-items: center; column-gap: .9rem; position: relative; min-height: 72px; }
.brand { grid-area: brand; display: flex; align-items: center; gap: .5rem; text-decoration: none; padding: .45rem 0; }
.brand img.emblem { height: 58px; width: auto; filter: drop-shadow(0 0 10px rgba(230, 207, 138, .35)); }
.brand img.title { height: 44px; width: auto; }
.nav-panel { display: contents; }
.nav-tools { grid-area: tools; justify-self: end; display: flex; align-items: center; gap: .75rem; }
.nav-links {
  grid-area: links; display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: clamp(.05rem, .3vw, .25rem); list-style: none; margin: 0; padding: .5rem 0;
  min-width: 0; align-items: center; padding-inline-start: .8rem; border-inline-start: 1px solid rgba(201, 165, 74, .35);
}
.nav-links a, .sitemap-btn {
  position: relative;
  color: var(--silver-light);
  text-decoration: none;
  padding: .3em .85em .3em .3em;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: clamp(.78rem, .4rem + .4vw, .92rem);
  white-space: nowrap;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  display: inline-flex; align-items: center; gap: .45rem;
}
.nav-ic {
  display: inline-grid; place-items: center; width: 2.25em; height: 2.25em; border-radius: 50%; font-size: 1.45em; line-height: 1;
  background: rgba(201, 165, 74, .14); box-shadow: inset 0 0 0 1px rgba(230, 207, 138, .35);
}
.nav-links a::after, .sitemap-btn::after {
  content: ""; position: absolute; inset-inline: 1.1rem; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform .25s;
}
.nav-links a:hover, .sitemap-btn:hover, .sitemap-btn[aria-expanded=true] { color: var(--gold-light); background: rgba(255, 255, 255, .06); border-color: rgba(230, 207, 138, .3); }
.nav-links a:hover::after, .sitemap-btn:hover::after { transform: scaleX(1); }
.nav-links a.active {
  color: var(--navy-900); background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 2px 10px rgba(201, 165, 74, .45);
}
.nav-links a.active .nav-ic { background: rgba(11, 22, 57, .12); box-shadow: inset 0 0 0 1px rgba(11, 22, 57, .25); }
.nav-links a.active::after { display: none; }
.sitemap-btn .caret { font-size: .75em; transition: transform .15s; }
.sitemap-btn[aria-expanded=true] .caret { transform: rotate(180deg); }
.has-menu { position: relative; }
.sitemap-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: min(720px, 92vw); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
  background: #fff; color: var(--text); border-radius: var(--radius); border-top: 3px solid var(--gold);
  box-shadow: 0 16px 40px rgba(7, 15, 41, .35); padding: 1.2rem 1.4rem; z-index: 60;
}
.sitemap-menu[hidden] { display: none; }
.sitemap-col h3 { margin: 0 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sitemap-col ul { list-style: none; margin: 0; padding: 0; }
.sitemap-col a { display: flex; gap: .45rem; align-items: center; padding: .35rem .4rem; border-radius: 7px; color: var(--navy-800); text-decoration: none; font-weight: 500; }
.sitemap-col a:hover { background: var(--silver-light); color: var(--navy-700); }
.sitemap-col a::after { display: none; }
.nav-search { display: flex; align-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(230, 207, 138, .35); border-radius: 999px; padding-block: 2px; padding-inline: 12px 4px; min-width: 0; }
.nav-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 165, 74, .25); }
.nav-search input { background: transparent; border: 0; color: #fff; outline: none; width: 0; min-width: 0; font: inherit; padding: .35rem 0; transition: width .25s; }
.nav-search { padding-inline: 4px; }
.nav-search.open { padding-inline: 12px 4px; }
.nav-search.open input { width: 170px; }
.nav-search input::placeholder { color: var(--blue-300); }
.nav-search button { background: var(--gold); border: 0; border-radius: 999px; width: 32px; height: 32px; flex-shrink: 0; cursor: pointer; color: var(--navy-900); display: grid; place-items: center; }
.nav-search button:hover { background: var(--gold-light); }
.lang-pick { display: inline-flex; align-items: center; gap: .3rem; margin: 0; color: var(--silver-light); font-weight: 500; }
.lang-pick select {
  width: auto; background: transparent; color: var(--silver-light); border: 1px solid rgba(230, 207, 138, .35);
  border-radius: 999px; padding: .35rem .7rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.lang-pick select:hover, .lang-pick select:focus { border-color: var(--gold); outline: none; }
.lang-pick select option { color: var(--text); background: #fff; }
.menu-toggle {
  display: none; width: 46px; height: 42px; background: none; border: 1px solid rgba(230, 207, 138, .45);
  border-radius: 10px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--gold-light); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav.open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .menu-toggle span:nth-child(2) { opacity: 0; }
.nav.open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) {
  .nav { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand links toggle" "panel panel panel"; column-gap: .5rem; min-height: 60px; }
  .menu-toggle { display: flex; grid-area: toggle; }
  .nav-panel { display: contents; }
  .nav-links {
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-block: .45rem; padding-inline-start: .5rem;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 14px), transparent 100%);
            mask-image: linear-gradient(90deg, #000 calc(100% - 14px), transparent 100%);
  }
  [dir=rtl] .nav-links { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(270deg, #000 calc(100% - 14px), transparent 100%); }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li { flex-shrink: 0; }
  .nav-links a::after, .sitemap-btn::after { display: none; }
  /* the Site Map menu opens below the header, across the screen */
  .sitemap-menu { position: fixed; left: 12px; right: 12px; width: auto; transform: none; top: var(--menu-top, 76px); grid-template-columns: 1fr; gap: .6rem; max-height: calc(100vh - var(--menu-top, 76px) - 12px); overflow-y: auto; padding: .9rem 1rem; }
  .nav-tools { grid-area: panel; display: none; flex-direction: column; align-items: stretch; justify-self: stretch; gap: .6rem; padding: .3rem 0 .9rem; }
  .nav.open .nav-tools { display: flex; }
  .nav-search, .nav-search.open { width: 100%; padding-inline: 12px 4px; }
  .nav-search input, .nav-search.open input { width: 100%; flex: 1; padding: .55rem 0; }
  .lang-pick { align-self: flex-start; }
  .lang-pick select { padding: .5rem .9rem; font-size: 1rem; }
  .brand img.title { height: 32px; }
  .brand img.emblem { height: 44px; }
}
@media (max-width: 420px) { .brand img.title { display: none; } }
/* Not enough room for the names: icons only (the name shows on hover; the current page keeps its name) */
.nav-compact .nav-links a:not(.active) .nav-tx { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-compact .nav-links a:not(.active) { padding: .3em; }
.nav-compact .sitemap-btn { padding: .3em .45em .3em .3em; gap: .2rem; }
.nav-compact .sitemap-btn .nav-tx { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-compact .nav-ic { width: 2.2em; height: 2.2em; font-size: 1.7em; }

/* ---------- Hero ---------- */
.hero {
  background: var(--navy-900) var(--pattern);
  color: #fff;
  text-align: center;
  padding: 3.5rem 0 3rem;
}
.hero img.title { height: 110px; width: auto; }
.hero h1 { margin: .5rem 0 .25rem; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: .5px; }
.hero p { color: var(--silver); margin: 0 auto; max-width: 640px; }
.hero .ayah { color: var(--gold-light); font-size: 1.4rem; margin-top: .75rem; }
.page-hero { padding: 2.2rem 0 2rem; }
.page-hero h1 { margin: 0; }

/* ---------- Layout / cards ---------- */
.section { padding: 2.5rem 0; }
.section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.45rem; margin: 0 0 1.1rem; color: var(--navy-800); }
.section-title::before { content: ""; width: 6px; height: 1.3em; background: linear-gradient(var(--gold), var(--blue-500)); border-radius: 3px; }
.layout-home { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
@media (max-width: 920px) { .layout-home { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.link-card {
  display: flex; flex-direction: column; gap: .35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
}
.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue-300); color: var(--text); }
.link-card h3 { margin: 0; font-size: 1.05rem; color: var(--navy-700); }
.link-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.link-card .tag { align-self: flex-start; font-size: .75rem; background: var(--silver-light); color: var(--navy-700); border-radius: 999px; padding: .1rem .6rem; }
.link-card .ext { position: absolute; top: .9rem; inset-inline-end: 1rem; color: var(--blue-300); font-size: .85rem; }

.category { margin-bottom: 2rem; }
.category h3.cat-title { margin: 0 0 .75rem; color: var(--navy-700); font-size: 1.1rem; display: flex; gap: .5rem; align-items: center; }

/* ---------- Prayer side panel ---------- */
.prayer-panel {
  position: sticky; top: 96px;
  background: var(--navy-900) var(--pattern);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--navy-700);
}
.prayer-panel h2 { margin: 0 0 .25rem; font-size: 1.2rem; color: var(--gold-light); }
.prayer-panel .clock { font-size: 2rem; font-weight: 600; letter-spacing: 1px; }
.prayer-panel .date { color: var(--silver); font-size: .9rem; }
.prayer-panel ul { list-style: none; padding: 0; margin: 1rem 0; }
.prayer-panel li { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed rgba(255, 255, 255, .15); }
.prayer-panel li span:last-child { color: var(--silver); font-size: .85rem; }
.prayer-panel .note { font-size: .8rem; color: var(--blue-300); margin: .75rem 0 0; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--navy-700); color: #fff; border: 0; border-radius: 10px;
  padding: .65rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--blue-500); color: #fff; }
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy-900); }
.btn-light { background: var(--silver-light); color: var(--navy-800); }
.btn-light:hover { background: var(--border); color: var(--navy-800); }
.btn-block { width: 100%; }
label { font-weight: 600; display: block; margin-bottom: .3rem; color: var(--navy-800); }
input[type=text], input[type=email], input[type=number], textarea, select {
  width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue-300); border-color: var(--blue-500); }
.form-row { margin-bottom: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  background: none; border: 0; font: inherit; font-weight: 600; color: var(--muted);
  padding: .7rem 1.1rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: var(--navy-700); }
.tab[aria-selected=true] { color: var(--navy-800); border-bottom-color: var(--gold); }
.tab-panel[hidden] { display: none; }

/* ---------- Tools ---------- */
.tool { scroll-margin-top: 100px; margin-bottom: 2.5rem; }
.tool-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.tool-nav a { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .45rem 1rem; text-decoration: none; color: var(--navy-700); font-weight: 600; }
.tool-nav a:hover { border-color: var(--gold); }

.notepad textarea { min-height: 300px; resize: vertical; line-height: 1.7; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.toolbar .spacer { flex: 1; }

.calc { max-width: 380px; background: var(--navy-900) var(--pattern); border-radius: 18px; padding: 1rem; box-shadow: var(--shadow); }
.calc-display { direction: ltr; background: #0a1230; border: 1px solid var(--navy-700); border-radius: 12px; padding: .75rem 1rem; text-align: right; color: #fff; margin-bottom: .9rem; min-height: 92px; word-break: break-all; }
.calc-expr { color: var(--blue-300); font-size: 1rem; min-height: 1.5em; font-family: Consolas, monospace; }
.calc-result { font-size: 2rem; font-weight: 600; }
.calc-result.error { color: #ff9b9b; font-size: 1.1rem; }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.calc-keys button { border: 0; border-radius: 10px; padding: .85rem 0; font: inherit; font-size: 1.1rem; font-weight: 600; cursor: pointer; background: var(--navy-700); color: #fff; }
.calc-keys button:hover { background: var(--blue-500); }
.calc-keys button.op { background: #24407f; color: var(--gold-light); }
.calc-keys button.fn { background: #182a5c; color: var(--silver); font-size: .95rem; }
.calc-keys button.eq { background: var(--gold); color: var(--navy-900); }
.calc-keys button.clear { background: #6b2a3a; }

.counter { text-align: center; max-width: 520px; margin: 0 auto; }
.counter-tap {
  user-select: none; cursor: pointer; border-radius: 50%; width: min(300px, 75vw); aspect-ratio: 1; margin: 0 auto 1.2rem;
  display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--navy-700), var(--navy-900)); color: #fff;
  border: 6px solid var(--silver); box-shadow: 0 0 0 6px var(--navy-800), var(--shadow);
  transition: transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.counter-tap:active { transform: scale(.97); }
.counter-tap .value { font-size: clamp(3.5rem, 12vw, 5.5rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.counter-tap .hint { font-size: .85rem; color: var(--blue-300); margin-top: .4rem; }
.counter-tap.done { border-color: var(--gold); }
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue-500), var(--gold)); transition: width .2s; }
.counter-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.dhikr-presets { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .35rem .85rem; cursor: pointer; font: inherit; color: var(--navy-700); }
.chip.active, .chip:hover { border-color: var(--gold); background: #fffaf0; }

.surah-filter { max-width: 340px; margin-bottom: 1rem; }
.surah-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.surah { display: flex; align-items: center; gap: .65rem; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .55rem .75rem; text-decoration: none; color: var(--text); }
.surah:hover { border-color: var(--gold); color: var(--text); }
.surah .num { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; background: var(--navy-800); color: var(--gold-light); border-radius: 8px; font-weight: 700; font-size: .85rem; transform: rotate(45deg); }
.surah .num span { transform: rotate(-45deg); }
.surah small { display: block; color: var(--muted); font-size: .75rem; }

/* ---------- Organization page ---------- */
.org-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.org-badge { width: 78px; height: 78px; border-radius: 18px; background: var(--silver-light); color: var(--navy-800); display: grid; place-items: center; font-size: 2.2rem; border: 3px solid var(--gold); }
.org-list .link-card .meta { font-size: .82rem; color: var(--muted); }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { padding: .6rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .75rem; }
.info-list li strong { min-width: 120px; color: var(--navy-700); }
.event { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.event-date { min-width: 64px; text-align: center; background: var(--navy-800); color: #fff; border-radius: 10px; padding: .4rem; line-height: 1.2; }
.event-date b { display: block; font-size: 1.4rem; color: var(--gold-light); }
.event h4 { margin: 0 0 .2rem; color: var(--navy-700); }
.map-box { background: var(--navy-800) var(--pattern); color: #fff; border-radius: var(--radius); padding: 2rem; text-align: center; }
.badge-dummy { display: inline-block; background: #fff4d6; color: #7a5a00; border: 1px solid var(--gold-light); border-radius: 999px; padding: .1rem .7rem; font-size: .78rem; font-weight: 600; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 780px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid .card h2 { margin-top: 0; color: var(--navy-800); }
.vision-list { padding-inline-start: 1.2rem; }
.vision-list li { margin-bottom: .4rem; }

/* ---------- Search ---------- */
.result { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.result h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.result .where { font-size: .8rem; color: var(--muted); }
.result p { margin: .3rem 0 0; color: var(--muted); }
mark { background: #fbe9b5; color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950) var(--pattern);
  color: var(--silver);
  text-align: center;
  padding: 2.2rem 0 1.5rem;
  border-top: 2px solid var(--gold);
  margin-top: 3rem;
}
.site-footer .footer-logo { display: flex; justify-content: center; align-items: center; gap: .5rem; }
.site-footer .footer-logo img.emblem { height: 76px; }
.site-footer .footer-logo img.title { height: 52px; }
.site-footer .privacy {
  display: inline-flex; align-items: center; gap: .5rem;
  margin: 1rem auto .5rem; padding: .55rem 1.1rem; border: 1px solid rgba(201, 165, 74, .5); border-radius: 999px; color: var(--gold-light); font-size: .92rem;
}
.site-footer nav a { color: var(--silver); margin: 0 .6rem; text-decoration: none; font-size: .9rem; }
.site-footer nav a:hover { color: var(--gold-light); }
.site-footer .copy { font-size: .8rem; color: var(--blue-300); margin-top: .8rem; }

.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--navy-800); color: #fff; padding: .6rem 1.2rem; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; }

/* ---------- Arabic / RTL ---------- */
html[lang=ar] body { font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Traditional Arabic", sans-serif; }
.lang-btn { background: transparent; color: var(--silver-light); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.lang-btn:hover { border-color: var(--gold); color: var(--gold-light); }
@media (max-width: 920px) { .lang-btn { display: none; } .nav.open .lang-btn { display: block; margin-bottom: .75rem; } }

.skip-link { position: absolute; inset-inline-start: 1rem; top: -60px; z-index: 200; background: var(--gold); color: var(--navy-900); padding: .5rem 1rem; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: .5rem; }

/* ---------- Accessibility tools ---------- */
.a11y { position: fixed; bottom: 1.2rem; inset-inline-start: 1.2rem; z-index: 120; }
.a11y-btn { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--gold); background: var(--navy-700); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }
.a11y-btn:hover { background: var(--blue-500); }
.a11y-panel { position: absolute; bottom: 66px; inset-inline-start: 0; width: 290px; max-width: calc(100vw - 2.4rem); background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(11, 22, 57, .25); padding: 1rem; }
.a11y-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; color: var(--navy-800); }
.a11y-x { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.a11y-size { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; font-weight: 600; }
.a11y-size div { display: flex; align-items: center; gap: .4rem; direction: ltr; }
.a11y-size button { border: 1px solid var(--border); background: var(--silver-light); border-radius: 8px; padding: .3rem .6rem; font-weight: 700; cursor: pointer; color: var(--navy-800); }
.a11y-size output { min-width: 3.2em; text-align: center; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .75rem; }
.a11y-opt { display: flex; flex-direction: column; align-items: center; gap: .2rem; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: .55rem .3rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--navy-800); }
.a11y-opt span { font-size: 1.15rem; }
.a11y-opt[aria-pressed=true] { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }

html.a11y-gray { filter: grayscale(1); }
html.a11y-links a:not(.btn):not(.brand) { text-decoration: underline !important; text-underline-offset: 3px; font-weight: 700; }
html.a11y-links a.link-card { outline: 2px dashed var(--gold); }
html.a11y-readable body { letter-spacing: .04em; word-spacing: .12em; line-height: 1.95; }
html.a11y-noanim *, html.a11y-noanim *::before, html.a11y-noanim *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
html.a11y-focus :focus-visible { outline: 4px solid #ffbf00 !important; outline-offset: 2px; }
html.a11y-cursor, html.a11y-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 10-7 1.5L9.5 21z' fill='%23000' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") 4 2, auto !important; }
html.a11y-contrast body { background: #000; color: #fff; }
html.a11y-contrast .card, html.a11y-contrast .link-card, html.a11y-contrast .a11y-panel, html.a11y-contrast .chip, html.a11y-contrast .tool-tab, html.a11y-contrast .tab,
html.a11y-contrast input, html.a11y-contrast textarea, html.a11y-contrast select, html.a11y-contrast .editor, html.a11y-contrast .calc-history, html.a11y-contrast .a11y-opt, html.a11y-contrast .btn-light, html.a11y-contrast .np-toolbar, html.a11y-contrast .np-toolbar button, html.a11y-contrast .np-toolbar label.color, html.a11y-contrast .store-btn, html.a11y-contrast .os-badge, html.a11y-contrast .save-menu ul, html.a11y-contrast .save-menu li button, html.a11y-contrast .calc-history li button {
  background: #000 !important; color: #fff !important; border-color: #ffe066 !important;
}
html.a11y-contrast a { color: #ffe066 !important; }
html.a11y-contrast .muted, html.a11y-contrast .link-card p, html.a11y-contrast .small, html.a11y-contrast .section-title, html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3, html.a11y-contrast h4, html.a11y-contrast label, html.a11y-contrast .info-list strong, html.a11y-contrast .h-expr, html.a11y-contrast .a11y-head { color: #fff !important; }
html.a11y-contrast .a11y-opt[aria-pressed=true], html.a11y-contrast .tool-tab[aria-selected=true] { background: #ffe066 !important; color: #000 !important; }

/* ---------- Tool tabs ---------- */
.tool-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tool-tab { display: inline-flex; align-items: center; gap: .4rem; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .55rem 1.1rem; font: inherit; font-weight: 600; color: var(--navy-700); cursor: pointer; }
.tool-tab:hover { border-color: var(--gold); }
.tool-tab[aria-selected=true] { background: var(--navy-800); color: var(--gold-light); border-color: var(--navy-800); }

/* ---------- Rich notepad ---------- */
.np-toolbar { display: flex; flex-wrap: wrap; gap: .3rem; padding: .5rem; background: var(--silver-light); border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; }
.np-toolbar button, .np-toolbar select { border: 1px solid transparent; background: #fff; border-radius: 7px; min-width: 34px; height: 34px; padding: 0 .5rem; font: inherit; font-size: .9rem; cursor: pointer; color: var(--navy-800); }
.np-toolbar select { width: auto; padding: 0 .4rem; }
.np-toolbar button:hover { border-color: var(--blue-300); }
.np-toolbar .sep { width: 1px; background: var(--border); margin: 0 .2rem; }
.np-toolbar label.color { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; background: #fff; border-radius: 7px; cursor: pointer; margin: 0; font-weight: 700; }
.np-toolbar label.color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; }
.editor { min-height: 320px; max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 1rem 1.2rem; background: #fff; line-height: 1.7; outline: none; }
.editor:focus { border-color: var(--blue-500); box-shadow: 0 0 0 2px var(--blue-300); }
.editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.editor blockquote { border-inline-start: 4px solid var(--gold); margin: .5rem 0; padding: .2rem 1rem; color: var(--muted); }
.save-menu { position: relative; }
.save-menu ul { position: absolute; bottom: calc(100% + 6px); inset-inline-end: 0; list-style: none; margin: 0; padding: .35rem; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 190px; z-index: 5; }
.save-menu li button { width: 100%; text-align: start; background: none; border: 0; padding: .5rem .7rem; border-radius: 7px; font: inherit; cursor: pointer; color: var(--navy-800); }
.save-menu li button:hover { background: var(--silver-light); }

/* ---------- Calculator + history ---------- */
.calc-wrap { display: flex; gap: 1rem; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.calc-wrap .calc { flex: 0 1 380px; }
.calc-history { flex: 0 1 280px; min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 1rem; display: flex; flex-direction: column; max-height: 470px; }
.calc-history h3 { margin: 0; font-size: 1rem; color: var(--navy-800); }
.calc-history .hist-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.calc-history .hist-head button { background: none; border: 0; color: var(--blue-500); cursor: pointer; font: inherit; font-size: .85rem; }
.calc-history ol { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; direction: ltr; }
.calc-history li button { direction: ltr; unicode-bidi: isolate; width: 100%; text-align: right; background: none; border: 0; border-bottom: 1px solid var(--border); padding: .5rem .3rem; cursor: pointer; font: inherit; color: var(--text); }
.calc-history li button:hover { background: var(--silver-light); }
.calc-history li .h-expr { display: block; color: var(--muted); font-size: .85rem; font-family: Consolas, monospace; word-break: break-all; }
.calc-history li .h-res { font-weight: 700; font-size: 1.05rem; }

/* ---------- Browser & OS icons ---------- */
.store-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.store-btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding-block: .3rem; padding-inline: .4rem .75rem; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--navy-800); }
.store-btn:hover { border-color: var(--gold); color: var(--navy-800); }
.store-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.os-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.os-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; border-radius: 999px; padding-block: .15rem; padding-inline: .4rem .6rem; background: var(--silver-light); color: var(--navy-800); }
.os-badge svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- Quran frame ---------- */
.embed-frame { width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }

/* ---------- Home hero brand ---------- */
.hero-brand { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.hero-brand img.emblem { height: 120px; width: auto; }
.hero img.title { height: 110px; width: auto; }
@media (max-width: 600px) { .hero-brand img.emblem { height: 84px; } .hero img.title { height: 76px; } }

/* ---------- Embedded sites ---------- */
.credit { margin: 0 0 .75rem; color: var(--muted); font-size: .95rem; }
.credit a { font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.today { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; background: var(--navy-900) var(--pattern); color: var(--silver); border-radius: var(--radius); padding: .8rem 1.2rem; margin-bottom: 1rem; }
.today .clock { font-size: 1.6rem; font-weight: 700; color: #fff; }
.today #hijri-date { color: var(--gold-light); }

/* ---------- Counter fields ---------- */
.counter-fields { display: grid; grid-template-columns: 1fr auto; gap: .75rem; text-align: start; margin-bottom: 1.25rem; }
@media (max-width: 520px) { .counter-fields { grid-template-columns: 1fr; } }
.counter-fields label { white-space: nowrap; }
.counter-tap .hint { max-width: 80%; margin-inline: auto; overflow-wrap: anywhere; }

/* ---------- Organization page ---------- */
.back-row { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.back-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--card); color: var(--navy-800); text-decoration: none; font-weight: 600;
  border: 1px solid var(--border); border-radius: 999px; padding: .5rem 1.1rem .5rem .8rem;
  box-shadow: 0 2px 8px rgba(11, 22, 57, .08); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.back-btn svg { color: var(--gold); transition: transform .15s; }
[dir=rtl] .back-btn { padding: .5rem .8rem .5rem 1.1rem; }
[dir=rtl] .back-btn svg { transform: scaleX(-1); }
.back-btn:hover { border-color: var(--gold); box-shadow: var(--shadow); color: var(--navy-800); }
.back-btn:hover svg { transform: translateX(-3px); }
[dir=rtl] .back-btn:hover svg { transform: scaleX(-1) translateX(-3px); }
.org-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.org-badge:has(img) { overflow: hidden; background: #000; }
.org-logo-img { width: 26px; height: 26px; border-radius: 6px; vertical-align: -6px; object-fit: cover; }
.service-card { flex-direction: row; align-items: flex-start; gap: .7rem; }
.service-card p { color: var(--text); }
.service-dot { color: var(--gold); font-size: 1.1rem; line-height: 1.5; }

/* ---------- Language loading & scripts ---------- */
html.i18n-loading body { visibility: hidden; }
html[lang=hi] body { font-family: "Nirmala UI", "Mangal", "Noto Sans Devanagari", "Segoe UI", sans-serif; }
html[lang=zh] body { font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif; }
html[lang=ja] body { font-family: "Yu Gothic UI", "Meiryo", "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif; }

/* ---------- Contact form ---------- */
.narrow { max-width: 760px; }
.card-title { margin-top: 0; color: var(--navy-800); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.form-status { padding: .7rem 1rem; border-radius: 10px; background: var(--silver-light); color: var(--navy-800); margin: 0 0 1rem; }
.form-status.ok { background: #e7f6ec; color: #17633a; border: 1px solid #a8dcbb; }
.form-status.error { background: #fdecec; color: #9f1d1d; border: 1px solid #f2b8b8; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- 404 ---------- */
.nf-page { background: var(--navy-900) var(--pattern); color: #fff; display: flex; align-items: center; }
body:has(.nf-page) .site-footer { margin-top: 0; }
.nf { text-align: center; padding: 3rem 0 3.5rem; max-width: 680px; margin: 0 auto; }
.nf-art { position: relative; width: 220px; margin: 0 auto .5rem; }
.nf-lantern { width: 200px; height: 200px; animation: nf-sway 4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes nf-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.nf-code { font-size: clamp(4rem, 14vw, 7rem); font-weight: 800; line-height: 1; letter-spacing: .05em; background: linear-gradient(180deg, #fff 20%, var(--gold-light)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-top: -1rem; }
.nf h1 { margin: .5rem 0 .4rem; font-size: clamp(1.4rem, 4vw, 2rem); }
.nf-text { color: var(--silver); margin: 0 auto 1.5rem; max-width: 520px; }
.nf-help { color: var(--blue-300); margin: 2rem 0 .75rem; font-size: .95rem; }
.nf-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.nf-links a { display: inline-flex; gap: .4rem; align-items: center; padding: .5rem 1rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); color: var(--silver-light); text-decoration: none; }
.nf-links a:hover { border-color: var(--gold); color: var(--gold-light); }
.section .nf { color: var(--text); }
.section .nf .nf-text, .section .nf .nf-help { color: var(--muted); }
.section .nf .nf-links a { color: var(--navy-700); border-color: var(--border); background: #fff; }
.section .nf .nf-code { background: linear-gradient(180deg, var(--navy-700) 20%, var(--gold)); -webkit-background-clip: text; background-clip: text; }

/* ---------- Share ---------- */
.share-fab {
  position: fixed; bottom: 1.2rem; inset-inline-end: 1.2rem; z-index: 120;
  width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--navy-700);
  background: var(--gold); color: var(--navy-900); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow);
  transition: background .15s, transform .1s;
}
.share-fab:hover { background: var(--gold-light); }
.share-fab:active { transform: scale(.94); }
.share-dialog {
  border: 0; border-top: 4px solid var(--gold); border-radius: var(--radius); padding: 1.2rem 1.3rem 1.3rem;
  width: min(440px, calc(100vw - 2rem)); box-shadow: 0 20px 50px rgba(7, 15, 41, .45); color: var(--text); background: #fff;
}
.share-dialog::backdrop { background: rgba(7, 15, 41, .6); }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.share-head h2 { margin: 0; font-size: 1.2rem; color: var(--navy-800); display: flex; align-items: center; gap: .5rem; }
.share-close { background: none; border: 0; font-size: 1.1rem; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.share-close:hover { background: var(--silver-light); color: var(--navy-800); }
.share-what { margin: .3rem 0 .9rem; color: var(--muted); font-size: .92rem; }
.share-link { display: flex; gap: .5rem; }
.share-link input { flex: 1; min-width: 0; width: auto; font-size: .88rem; background: var(--silver-light); }
.share-link .btn { flex-shrink: 0; white-space: nowrap; }
.share-copy.done { background: #2f8f5b; color: #fff; }
.share-apps { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.share-app { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .5rem .2rem; border-radius: 10px; text-decoration: none; color: var(--navy-800); font-size: .8rem; text-align: center; }
.share-app:hover { background: var(--silver-light); color: var(--navy-800); }
.share-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.share-whatsapp .share-ico { background: #25d366; }
.share-telegram .share-ico { background: #229ed9; }
.share-app.share-x .share-ico { background: #111; }
.share-facebook .share-ico { background: #1877f2; }
.share-email .share-ico { background: var(--navy-700); }
.share-more { margin-top: 1rem; }
html.a11y-contrast .share-dialog { background: #000; color: #fff; border-color: #fff; }
html.a11y-contrast .share-dialog h2, html.a11y-contrast .share-app, html.a11y-contrast .share-what { color: #fff; }
@media (max-width: 760px) {
  .share-fab { width: 48px; height: 48px; bottom: .8rem; inset-inline-end: .8rem; }
  .share-apps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) {
  .share-link { flex-direction: column; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .section { padding: 1.6rem 0; }
  .hero { padding: 2.2rem 0 2rem; }
  .page-hero { padding: 1.6rem 0 1.4rem; }
  .hero h1 { font-size: 1.45rem; }
  .hero .ayah { font-size: 1.15rem; }
  /* Tab bars scroll sideways instead of stacking many rows */
  .tool-tabs, .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; padding-bottom: .4rem; scroll-snap-type: x proximity; }
  .tool-tab, .tab { flex-shrink: 0; scroll-snap-align: start; white-space: nowrap; }
  .card { padding: 1rem; }
  .grid { grid-template-columns: 1fr; }
  .info-list li { flex-wrap: wrap; gap: .2rem .75rem; }
  .info-list li strong { min-width: 0; width: 100%; }
  .event { gap: .75rem; }
  .embed-frame { height: 72vh; min-height: 440px; }
  .calc-wrap .calc, .calc-history { flex: 1 1 100%; max-width: 420px; }
  .calc-history { max-height: 280px; }
  .calc-keys button { padding: .95rem 0; }
  .np-toolbar { gap: .2rem; }
  .toolbar .spacer { display: none; }
  .org-head { justify-content: flex-start; }
  .org-badge { width: 64px; height: 64px; font-size: 1.8rem; }
  .map-box { padding: 1.4rem 1rem; }
  .back-row { margin-bottom: .75rem; }
  .site-footer .footer-logo img.emblem { height: 60px; }
  .site-footer .footer-logo img.title { height: 42px; }
  .site-footer .privacy { border-radius: 14px; font-size: .85rem; text-align: start; }
  .a11y { bottom: .8rem; inset-inline-start: .8rem; }
  .a11y-btn { width: 48px; height: 48px; }
  .today .clock { font-size: 1.3rem; }
}
@media (min-width: 761px) and (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 300px) { .brand img.title { display: none; } }
@media (max-width: 380px) {
  .brand img.title { height: 30px; }
  .brand img.emblem { height: 42px; }
  .counter-tap { width: 68vw; }
}
/* ---------- Content written in the dashboard (custom pages and custom home tabs) ---------- */
.rich-content { overflow-wrap: anywhere; }
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content h2, .rich-content h3 { color: var(--navy-700); }
.rich-content img { height: auto; border-radius: 10px; }
.rich-content blockquote { border-inline-start: 4px solid var(--gold); margin: 1rem 0; padding: .3rem 1rem; color: var(--muted); background: var(--silver-light); border-radius: 0 10px 10px 0; }
.rich-content table { border-collapse: collapse; width: 100%; }
.rich-content th, .rich-content td { border: 1px solid var(--border); padding: .45rem .7rem; text-align: start; }
/* ---------- Country filter on the home page (countries are set in the dashboard) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 1.1rem; }
.filter-bar[hidden] { display: none; }
.filter-label { font-weight: 600; color: var(--navy-700); margin-inline-end: .25rem; }
.filter-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .4rem .9rem; font: inherit; font-size: .92rem; color: var(--navy-700); cursor: pointer; }
.filter-chip:hover { border-color: var(--blue-300); }
.filter-chip[aria-pressed="true"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.filter-chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.filter-n { font-size: .78rem; opacity: .75; }
.filter-empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 1.5rem; }

/* ---------- Country filter (dropdown) ---------- */
.filter-select { width: auto; min-width: 220px; max-width: 100%; padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--navy-700); font: inherit; font-weight: 600; cursor: pointer; }
.filter-select:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.filter-bar .filter-label { margin: 0; display: inline; }

/* ---------- Page heroes with an icon ---------- */
.page-hero h1 span[aria-hidden] { margin-inline-end: .2rem; }

/* ---------- News & Articles ---------- */
.news-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.news-tags[hidden] { display: none; }
.news-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--navy-700); font: inherit; font-weight: 700; cursor: pointer; }
.news-tag:hover { border-color: var(--gold); }
.news-tag[aria-selected="true"] { background: var(--navy-800); border-color: var(--navy-800); color: var(--gold-light); box-shadow: 0 3px 10px rgba(11, 22, 57, .25); }
.news-window { background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem 1.3rem; }
.news-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.news-title { margin: 0; font-size: 1.25rem; color: var(--navy-800); }
.btn-sm { padding: .45rem .9rem; font-size: .9rem; }
.news-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.news-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); background: #fff; transition: transform .2s, box-shadow .2s; }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.news-card img, .news-noimg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--silver-light); }
.news-noimg { display: grid; place-items: center; font-size: 2rem; }
.news-body { display: flex; flex-direction: column; gap: .35rem; padding: .8rem .9rem 1rem; }
.news-body time { font-size: .8rem; color: var(--muted); }
.news-body strong { color: var(--navy-800); line-height: 1.35; }
.news-excerpt { font-size: .9rem; color: var(--muted); }
.news-msg { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 2rem 1rem; margin: 0; }
.news-note { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); margin: 0; }

/* ---------- Footer: last update ---------- */
.last-update { margin: .2rem 0; font-size: .9rem; color: var(--gold-light); }

/* ---------- Read aloud (accessibility menu) ---------- */
.a11y-read { margin: 0 0 .9rem; }
.a11y-read .btn { display: flex; align-items: center; justify-content: center; gap: .4rem; }
.a11y-speak[aria-pressed="true"] { background: var(--navy-800); color: var(--gold-light); }
.a11y-hint { margin: .35rem 0 0; font-size: .8rem; color: var(--muted); }


/* ---------- Public-data notice (under the header, and in the footer) ---------- */
.public-note { background: #fff8e6; border-bottom: 1px solid #ecd9a2; color: #5a4512; }
.public-note .container { display: flex; align-items: center; justify-content: center; gap: .55rem; padding-top: .55rem; padding-bottom: .55rem; text-align: center; }
.public-note svg { flex: none; color: #a8832a; }
.public-note p { margin: 0; font-size: .92rem; line-height: 1.45; }
.site-footer .public-data { display: flex; align-items: center; justify-content: center; gap: .45rem; margin: .3rem auto .6rem; max-width: 46rem; font-size: .88rem; color: var(--silver); }
.site-footer .public-data svg { flex: none; color: var(--gold-light); }
.site-footer .public-data strong { color: var(--gold-light); }
html.a11y-contrast .public-note { background: #000; color: #fff; border-color: #fff; }
html.a11y-contrast .public-note svg { color: #ffe066; }

/* ---------- Quiz ---------- */
.quiz-lead { color: var(--muted); margin: -.4rem 0 1.1rem; }
.qz-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.qz-topic { display: flex; flex-direction: column; align-items: center; gap: .35rem; cursor: pointer; font: inherit; color: var(--text); text-align: center; transition: transform .15s, border-color .15s; }
.qz-topic:hover, .qz-topic:focus-visible { transform: translateY(-2px); border-color: var(--gold); }
.qz-topic-ic { font-size: 2.2rem; line-height: 1; }
.qz-topic-name { font-weight: 700; font-size: 1.1rem; color: var(--navy-800); }
.qz-topic-n { font-size: .88rem; color: var(--muted); }
.qz-card { max-width: 760px; }
.qz-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.qz-tag { font-weight: 700; color: var(--navy-800); }
.qz-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .9rem; }
.qz-stat { border: 1px solid var(--border); border-radius: 10px; padding: .45rem .3rem; text-align: center; background: var(--silver-light); }
.qz-stat b { display: block; font-size: 1.3rem; line-height: 1.2; }
.qz-stat span { font-size: .8rem; color: var(--muted); }
.qz-score { background: var(--navy-800); border-color: var(--navy-800); }
.qz-score b { color: var(--gold-light); }
.qz-score span { color: var(--silver); }
.qz-c b { color: #1d7a45; }
.qz-w b { color: #b3261e; }
.qz-s b { color: var(--muted); }
.qz-bar { display: flex; gap: 4px; height: 12px; }
.qz-seg { flex: 1; border-radius: 6px; background: var(--border); transition: background .25s; }
.qz-seg.qz-c { background: #2e9e5b; }
.qz-seg.qz-w { background: #d9473c; }
.qz-seg.qz-s { background: #a7afc4; }
.qz-seg.qz-now { background: var(--gold); }
.qz-seg.qz-cur { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy-700); }
.qz-count { margin: .55rem 0 .2rem; font-size: .88rem; color: var(--muted); }
.qz-q { margin: 0 0 1rem; font-size: 1.25rem; color: var(--navy-800); line-height: 1.45; outline: none; }
.qz-options { display: grid; gap: .55rem; }
.qz-opt { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .75rem .9rem; border: 2px solid var(--border); border-radius: 12px; background: #fff; font: inherit; color: var(--text); text-align: start; cursor: pointer; transition: border-color .15s, background .15s; }
.qz-opt:hover:not([aria-disabled]) { border-color: var(--blue-500); background: #f3f6ff; }
.qz-opt[aria-disabled] { cursor: default; }
.qz-letter { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--silver-light); font-weight: 700; color: var(--navy-700); }
.qz-opt.qz-right { border-color: #2e9e5b; background: #eaf7ef; }
.qz-opt.qz-right .qz-letter { background: #2e9e5b; color: #fff; }
.qz-opt.qz-wrong { border-color: #d9473c; background: #fdeceb; }
.qz-opt.qz-wrong .qz-letter { background: #d9473c; color: #fff; }
.qz-opt.qz-dim { opacity: .6; }
.qz-fb { margin: .9rem 0 0; font-weight: 700; }
.qz-fb-ok { color: #1d7a45; }
.qz-fb-no { color: #b3261e; }
.qz-explain { margin: .35rem 0 0; color: var(--muted); }
.qz-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.qz-result { text-align: center; margin-inline: auto; }
.qz-result .qz-actions { justify-content: center; }
.qz-trophy { font-size: 3rem; }
.qz-sum { font-size: 1.05rem; margin: 0 0 1rem; }
.empty-note { color: var(--muted); }
@media (max-width: 520px) { .qz-stats { grid-template-columns: repeat(2, 1fr); } }
html.a11y-contrast .qz-opt, html.a11y-contrast .qz-stat { background: #000; color: #fff; border-color: #fff; }
html.a11y-contrast .qz-opt.qz-right { border-color: #5dff9b; }
html.a11y-contrast .qz-opt.qz-wrong { border-color: #ff7b72; }
html.a11y-contrast .qz-q, html.a11y-contrast .qz-tag, html.a11y-contrast .qz-topic-name { color: #fff !important; }

/* ---------- Islamic sources: search, filters, sorting, "show more" ---------- */
.org-list .filter-bar { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: .9rem 1rem; }
.src-search { position: relative; margin-bottom: .75rem; }
.src-search-ic { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); opacity: .6; pointer-events: none; }
.src-input { width: 100%; padding: .7rem 1rem; padding-inline-start: 2.5rem; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--bg, #fff); color: inherit; }
.src-input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.src-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem; }
.src-f { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 600; color: var(--navy-700); }
.src-f .filter-select { min-width: 0; width: 100%; font-weight: 500; font-size: .92rem; }
.src-f .filter-select.is-on { border-color: var(--navy-700); box-shadow: inset 0 0 0 1px var(--navy-700); }
.src-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .7rem; font-size: .9rem; color: var(--muted); }
.src-clear { background: none; border: 0; padding: .2rem .3rem; font: inherit; font-weight: 600; color: var(--navy-700); text-decoration: underline; cursor: pointer; }
.src-clear:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
html.a11y-contrast .org-list .filter-bar, html.a11y-contrast .src-input { background: #000; color: #fff; border-color: #fff; }
.src-more { display: flex; justify-content: center; margin-top: 1rem; }
.src-more:empty { display: none; }

/* ---------- Quiz page ---------- */
.quiz-how { margin-top: 1.5rem; }
.quiz-how h2 { margin-top: 0; color: var(--navy-700); font-size: 1.2rem; }
