/* نور الإمام الحسين — shrine tilework palette: night-tile ink, kashi turquoise, dome gold */
:root {
  --ink: #0b2a33;
  --kashi: #17707a;
  --kashi-soft: #e3efee;
  --gold: #c8a04a;
  --gold-deep: #8a6a24;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --text: #15201f;
  --muted: #566664;
  --line: #d6dfdd;
  --radius: 10px;
  --display: "Reem Kufi", "Noto Naskh Arabic", serif;
  --body: "Noto Naskh Arabic", "Geeza Pro", serif;
  --ui: "IBM Plex Sans Arabic", "Geeza Pro", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1d23;
    --surface: #102a32;
    --text: #e8eeed;
    --muted: #9fb2b0;
    --line: #1f3f48;
    --kashi: #4fb3b9;
    --kashi-soft: #133740;
    --gold: #d9b45e;
    --gold-deep: #d9b45e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.85;
}
img { max-width: 100%; display: block; }
a { color: var(--kashi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-head { background: var(--ink); color: #f1ead8; }
.site-head .wrap { display: flex; align-items: center; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand img { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--gold); }
.brand b { font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1.2; display: block; }
.brand small { font-family: var(--ui); font-size: .8rem; color: #b9c9c6; }
.nav { display: flex; gap: 4px 18px; margin-inline-start: auto; flex-wrap: wrap; font-family: var(--ui); font-size: .95rem; }
.nav a { color: #e6ddc6; padding: 4px 2px; }
.nav a[aria-current] { color: var(--gold); border-bottom: 2px solid var(--gold); }

/* the signature: a kashi-tile frieze of eight-pointed stars, as on the shrine walls */
.frieze {
  height: 34px;
  background-color: var(--ink);
  background-image: url("tile.svg");
  background-size: 34px 34px;
  border-block: 2px solid var(--gold);
}

/* ---------- hero ---------- */
.hero { background: var(--ink); color: #f1ead8; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("tile.svg"); background-size: 120px 120px; opacity: .07;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; padding-block: 56px 64px; align-items: center; }
.hero blockquote { margin: 0; }
.hero .quote {
  font-family: var(--display); font-weight: 700; color: var(--gold);
  font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.25; margin: 0 0 14px;
}
.hero cite { font-style: normal; font-family: var(--ui); color: #b9c9c6; font-size: .95rem; }
.hero p.lead { font-size: 1.1rem; color: #dfe7e5; max-width: 34em; margin: 22px 0 0; }
.hero .feature { background: rgba(255,255,255,.04); border: 1px solid rgba(200,160,74,.45); border-radius: var(--radius); padding: 14px; }
.hero .feature h2 { font-family: var(--ui); font-size: .85rem; font-weight: 500; color: var(--gold); margin: 0 0 10px; }
.hero .feature h3 { font-size: 1.15rem; line-height: 1.6; margin: 12px 0 2px; }
.hero .feature h3 a { color: #f6f0e1; }
.hero .feature .meta { color: #b9c9c6; }

/* ---------- sections ---------- */
main { display: block; }
.section { padding-block: 44px 8px; }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sec-head h2 { font-family: var(--display); font-weight: 600; font-size: 1.85rem; margin: 0; line-height: 1.3; }
.sec-head h2::before { content: "۞"; color: var(--gold); font-size: .8em; margin-inline-end: 10px; }
.sec-head a { margin-inline-start: auto; font-family: var(--ui); font-size: .95rem; white-space: nowrap; }
.page-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.35; margin: 34px 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 24px; font-family: var(--ui); }

.meta { font-family: var(--ui); font-size: .85rem; color: var(--muted); }
.meta span + span::before { content: "·"; margin-inline: 8px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 18px; }
.card { display: flex; flex-direction: column; }
.card .thumb { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: var(--kashi-soft); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card .dur { position: absolute; bottom: 8px; left: 8px; background: rgba(11,42,51,.88); color: #fff; font-family: var(--ui); font-size: .78rem; padding: 1px 8px; border-radius: 5px; }
.card h3 { font-size: 1.02rem; line-height: 1.65; margin: 10px 0 2px; font-weight: 600; }
.card h3 a { color: var(--text); }
.tag { display: inline-block; font-family: var(--ui); font-size: .75rem; color: var(--kashi); background: var(--kashi-soft); border-radius: 99px; padding: 0 10px; margin-bottom: 4px; }

/* speakers */
.speakers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.speaker { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--gold); border-radius: var(--radius); padding: 12px 16px; color: var(--text); }
.speaker:hover { border-color: var(--kashi); text-decoration: none; }
.speaker b { font-family: var(--display); font-weight: 500; font-size: 1.12rem; }
.speaker span { font-family: var(--ui); font-size: .85rem; color: var(--muted); }

/* shorts */
.shorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; }
.short { all: unset; cursor: pointer; display: block; }
.short .thumb { aspect-ratio: 9/14; border-radius: var(--radius); overflow: hidden; background: var(--kashi-soft); }
.short img { width: 100%; height: 100%; object-fit: cover; }
.short p { font-size: .92rem; line-height: 1.6; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.short:focus-visible { outline: 3px solid var(--gold); }

/* texts list */
.texts { display: grid; gap: 14px; }
.text-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.text-item h3 { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.6; }
.text-item p { margin: 0; color: var(--muted); }

/* ---------- watch page ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; padding-block: 28px 10px; }
.player { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; }
.player button { all: unset; cursor: pointer; position: absolute; inset: 0; }
.player button img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.player button::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%230b2a33'/%3E%3C/svg%3E") center/38px no-repeat;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch h1 { font-family: var(--body); font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.6; margin: 18px 0 6px; }
.prose { font-size: 1.08rem; }
.prose p { margin: 0 0 1em; white-space: pre-line; }
.about-video { background: var(--kashi-soft); border-radius: var(--radius); padding: 14px 18px; font-family: var(--ui); font-size: .95rem; margin: 18px 0; }
.side h2 { font-family: var(--display); font-weight: 500; font-size: 1.3rem; margin: 0 0 12px; }
.side .mini { display: grid; grid-template-columns: 128px 1fr; gap: 10px; margin-bottom: 14px; color: var(--text); }
.side .mini img { border-radius: 8px; aspect-ratio: 16/9; object-fit: cover; width: 128px; }
.side .mini b { font-weight: 500; font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- filters / search ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { font-family: var(--ui); font-size: .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 99px; padding: 4px 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--gold); border-color: var(--ink); }
.search { display: flex; gap: 8px; margin: 0 0 24px; }
.search input { flex: 1; font: inherit; font-family: var(--ui); padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); min-width: 0; }
.results-count { font-family: var(--ui); color: var(--muted); margin-bottom: 14px; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 34px 0 10px; font-family: var(--ui); }
.pager a, .pager span { min-width: 40px; text-align: center; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.pager span { background: var(--ink); color: var(--gold); border-color: var(--ink); }

/* ---------- dialog for shorts ---------- */
dialog.short-view { border: 0; padding: 0; background: transparent; width: min(420px, 92vw); }
dialog.short-view::backdrop { background: rgba(5,18,22,.85); }
dialog.short-view .frame { aspect-ratio: 9/16; max-height: 82vh; margin-inline: auto; border-radius: 12px; overflow: hidden; background: #000; }
dialog.short-view iframe { width: 100%; height: 100%; border: 0; }
dialog.short-view .bar { display: flex; gap: 10px; align-items: center; margin-top: 10px; color: #f1ead8; font-family: var(--ui); font-size: .9rem; }
dialog.short-view .bar p { margin: 0; flex: 1; line-height: 1.5; }
dialog.short-view button { font: inherit; background: var(--gold); color: var(--ink); border: 0; border-radius: 8px; padding: 6px 14px; cursor: pointer; }

/* ---------- static pages ---------- */
.doc { max-width: 760px; padding-bottom: 30px; }
.doc h2 { font-family: var(--display); font-weight: 500; font-size: 1.4rem; margin: 30px 0 8px; }
.doc p, .doc li { font-size: 1.05rem; }

/* ---------- footer ---------- */
.site-foot { margin-top: 60px; background: var(--ink); color: #c9d5d3; font-family: var(--ui); font-size: .92rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; padding-block: 26px; align-items: center; }
.site-foot a { color: #e6ddc6; }
.site-foot .dedication { flex-basis: 100%; color: var(--gold); font-family: var(--body); font-size: 1rem; }

.ad-slot { margin: 26px 0; min-height: 0; }

@media (max-width: 860px) {
  .hero .wrap, .watch { grid-template-columns: 1fr; }
  .hero .wrap { padding-block: 36px 40px; gap: 26px; }
  .nav { margin-inline-start: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pager em { font-style: normal; padding: 4px 6px; color: var(--muted); }
.card[hidden] { display: none; }
.card .tag { align-self: flex-start; margin-top: 10px; }
.speaker { gap: 12px; }
.speaker b { line-height: 1.5; }
.speaker span { white-space: nowrap; }
