/* ============================================================
   قصائد أبو عبدالله — public site styles
   Themes: baha (default), manuscript, najdi, night × light/dark
   ============================================================ */

@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Medium.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url(/fonts/thmanyahsans-Black.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Medium.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Text'; src: url(/fonts/thmanyahseriftext-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Medium.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Thmanyah Serif Display'; src: url(/fonts/thmanyahserifdisplay-Black.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }

/* ---------- Theme tokens ---------- */

:root,
[data-theme='baha'] {
  /* Al-Baha: juniper green, misty terraces, gold, Asiri terracotta */
  --bg: #f3f6f1;
  --bg-2: #e7eee5;
  --surface: #ffffff;
  --surface-2: #f8faf6;
  --ink: #17261f;
  --ink-2: #44574d;
  --muted: #6c7d73;
  --line: #d6e0d6;
  --brand: #1f5c43;
  --brand-2: #2f7a58;
  --brand-ink: #ffffff;
  --accent: #b88a2e;
  --accent-2: #b5603a;
  --verse: #14241c;
  --hero-1: #1b4d38;
  --hero-2: #2c6e50;
  --hero-ink: #f5f1e3;
  --m1: #9bb8a2;
  --m2: #4f8467;
  --m3: #1f5c43;
  --pattern: rgba(232, 200, 120, 0.09);
  --shadow: 0 1px 2px rgba(20, 50, 35, 0.06), 0 8px 24px rgba(20, 50, 35, 0.07);
  color-scheme: light;
}
[data-theme='baha'][data-mode='dark'] {
  --bg: #0e1814;
  --bg-2: #13211b;
  --surface: #16261f;
  --surface-2: #1b2d25;
  --ink: #e6efe8;
  --ink-2: #b6c8bc;
  --muted: #8ca093;
  --line: #27392f;
  --brand: #5fb58a;
  --brand-2: #79c9a0;
  --brand-ink: #0b1712;
  --accent: #d8b25a;
  --accent-2: #e0896a;
  --verse: #eef5ef;
  --hero-1: #0f2a1f;
  --hero-2: #17402f;
  --hero-ink: #f1ecd8;
  --m1: #2a4a3a;
  --m2: #1d3a2c;
  --m3: #12261d;
  --pattern: rgba(216, 178, 90, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

[data-theme='manuscript'] {
  --bg: #f6f0e1;
  --bg-2: #eee5cf;
  --surface: #fffaf0;
  --surface-2: #f9f2e2;
  --ink: #2b2118;
  --ink-2: #5a4a3a;
  --muted: #85735f;
  --line: #e2d5b8;
  --brand: #7a4e1d;
  --brand-2: #96652e;
  --brand-ink: #fffaf0;
  --accent: #a8843a;
  --accent-2: #8c3b2a;
  --verse: #231a12;
  --hero-1: #3a2a1a;
  --hero-2: #5b4127;
  --hero-ink: #f7ecd0;
  --m1: #d9c69c;
  --m2: #b79b67;
  --m3: #7a5a32;
  --pattern: rgba(232, 200, 120, 0.18);
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.06), 0 8px 24px rgba(60, 40, 10, 0.08);
  color-scheme: light;
}
[data-theme='manuscript'][data-mode='dark'] {
  --bg: #17120c;
  --bg-2: #1e1810;
  --surface: #221b12;
  --surface-2: #2a2117;
  --ink: #f1e6cf;
  --ink-2: #cdbd9c;
  --muted: #a08f72;
  --line: #3a2f20;
  --brand: #d4a35c;
  --brand-2: #e2b875;
  --brand-ink: #1a140d;
  --accent: #d9b56a;
  --accent-2: #d07a5e;
  --verse: #f6ecd6;
  --hero-1: #1f170e;
  --hero-2: #3a2b19;
  --m1: #3d3020;
  --m2: #2c2316;
  --m3: #1d170e;
  --pattern: rgba(217, 181, 106, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

[data-theme='najdi'] {
  --bg: #f4ece0;
  --bg-2: #ecdfcc;
  --surface: #fffaf3;
  --surface-2: #f8efe3;
  --ink: #2c1d14;
  --ink-2: #5e4434;
  --muted: #8a6f5c;
  --line: #e5d3bd;
  --brand: #9c4f2a;
  --brand-2: #b4623a;
  --brand-ink: #fffaf3;
  --accent: #c69445;
  --accent-2: #4f6b3a;
  --verse: #26180f;
  --hero-1: #6b3519;
  --hero-2: #9c5530;
  --hero-ink: #fbefdc;
  --m1: #e3c9a2;
  --m2: #c99a69;
  --m3: #9c5b34;
  --pattern: rgba(255, 236, 200, 0.2);
  --shadow: 0 1px 2px rgba(80, 40, 10, 0.06), 0 8px 24px rgba(80, 40, 10, 0.08);
  color-scheme: light;
}
[data-theme='najdi'][data-mode='dark'] {
  --bg: #1a120d;
  --bg-2: #22170f;
  --surface: #271a12;
  --surface-2: #2f2017;
  --ink: #f3e5d5;
  --ink-2: #d0b49c;
  --muted: #a88a73;
  --line: #3e2b1f;
  --brand: #e08a5a;
  --brand-2: #eba077;
  --brand-ink: #1a110b;
  --accent: #dcae63;
  --accent-2: #9cbc7d;
  --verse: #f8ebdc;
  --hero-1: #2c170c;
  --hero-2: #4d2815;
  --m1: #4a2f1f;
  --m2: #3a2416;
  --m3: #26170e;
  --pattern: rgba(220, 174, 99, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

[data-theme='night'] {
  --bg: #eef1f6;
  --bg-2: #e2e7f0;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #141c2b;
  --ink-2: #3f4b60;
  --muted: #6b7689;
  --line: #d5dce8;
  --brand: #1d3557;
  --brand-2: #2a4a75;
  --brand-ink: #ffffff;
  --accent: #b8913f;
  --accent-2: #7a4e9c;
  --verse: #101827;
  --hero-1: #0f1b2d;
  --hero-2: #1d3557;
  --hero-ink: #f3e7c6;
  --m1: #9fb0c9;
  --m2: #4d6487;
  --m3: #1d3557;
  --pattern: rgba(212, 178, 106, 0.16);
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.08);
  color-scheme: light;
}
[data-theme='night'][data-mode='dark'] {
  --bg: #0a111d;
  --bg-2: #0f1828;
  --surface: #121d30;
  --surface-2: #172438;
  --ink: #e7ecf5;
  --ink-2: #b4c0d6;
  --muted: #8794ad;
  --line: #233250;
  --brand: #d4b26a;
  --brand-2: #e3c584;
  --brand-ink: #0a111d;
  --accent: #d4b26a;
  --accent-2: #a98bd0;
  --verse: #f1f4fa;
  --hero-1: #070d17;
  --hero-2: #12223b;
  --m1: #1c2a43;
  --m2: #142036;
  --m3: #0c1526;
  --pattern: rgba(212, 178, 106, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Thmanyah Sans', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s, color 0.25s;
}
main { flex: 1; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.empty { color: var(--muted); padding: 32px 0; text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 0;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  transition: transform 0.15s, background 0.2s;
}
.btn:hover { background: var(--brand-2); color: var(--brand-ink); transform: translateY(-1px); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
[data-mode='dark'] .i-moon,
[data-mode='light'] .i-sun,
html:not([data-mode]) .i-sun { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}
.chip-media { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }

/* ---------- Announcement & top bar ---------- */

.announce {
  background: var(--accent);
  color: #1d160a;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 16px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: 'Thmanyah Serif Display', serif; font-weight: 700; font-size: 20px; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 4px; margin-inline-start: 12px; }
.nav a { color: var(--ink-2); padding: 8px 14px; border-radius: 10px; font-weight: 500; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a.on { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.tools { margin-inline-start: auto; display: flex; gap: 2px; }
.menu-btn { display: none; }
.theme-menu {
  position: absolute;
  inset-inline-end: 16px;
  top: 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  min-width: 190px;
}
.theme-menu[hidden] { display: none; }
.theme-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 10px; text-align: start; }
.theme-menu button:hover { background: var(--bg-2); }
.sw { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 2px solid var(--line); }
.sw-baha { background: linear-gradient(135deg, #1f5c43, #b88a2e); }
.sw-manuscript { background: linear-gradient(135deg, #f6f0e1, #a8843a); }
.sw-najdi { background: linear-gradient(135deg, #9c4f2a, #e3c9a2); }
.sw-night { background: linear-gradient(135deg, #0f1b2d, #d4b26a); }

@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    inset-inline: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 14px;
    margin: 0;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .brand span { font-size: 18px; }
}

/* ---------- Decorative art ---------- */

.mountains { display: block; width: 100%; height: 120px; }
.mountains .m1 { fill: var(--m1); opacity: 0.55; }
.mountains .m2 { fill: var(--m2); opacity: 0.75; }
.mountains .m3 { fill: var(--m3); }
.mountains .terrace { stroke: var(--accent); stroke-width: 1.2; opacity: 0.35; }

/* Asiri-style triangle band, used as a subtle pattern on hero areas. */
.hero-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(135deg, var(--pattern) 25%, transparent 25%),
    linear-gradient(225deg, var(--pattern) 25%, transparent 25%);
  background-size: 28px 28px;
  background-position: 0 0, 14px 0;
  mask-image: linear-gradient(to bottom, #000 0, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 70%);
}

/* ---------- Hero ---------- */

.hero {
  margin: 0;
  position: relative;
  overflow: hidden;
  color: var(--hero-ink);
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(160deg, var(--hero-1), var(--hero-2));
}
.hero .mountains { margin-top: -10px; height: 110px; }
.hero .mountains .m3 { fill: var(--bg); }
.hero .mountains .m2 { fill: color-mix(in srgb, var(--bg) 40%, var(--hero-2)); opacity: 0.6; }
.hero .mountains .m1 { fill: color-mix(in srgb, var(--bg) 20%, var(--hero-2)); opacity: 0.45; }
.hero-in { position: relative; text-align: center; padding: 56px 16px 8px; }
.hero-photo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; border: 3px solid var(--accent); }
.hero-title { font-family: 'Thmanyah Serif Display', serif; font-weight: 800; font-size: clamp(34px, 6vw, 58px); line-height: 1.25; margin: 0; letter-spacing: 0; }
.hero-poet { margin: 10px 0 0; font-size: 18px; color: color-mix(in srgb, var(--hero-ink) 88%, transparent); }
.hero-tag { margin: 6px auto 0; max-width: 560px; color: color-mix(in srgb, var(--hero-ink) 70%, transparent); font-size: 16px; }
.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  margin: 26px auto 0;
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
}
.hero-search svg { color: var(--muted); flex: none; }
.hero-search input { flex: 1; border: 0; background: none; outline: none; padding: 10px 0; font-size: 16px; min-width: 0; }
.hero-search.big { margin: 0 0 18px; max-width: none; box-shadow: var(--shadow); }

/* ---------- Sections & cards ---------- */

section { margin: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-family: 'Thmanyah Serif Display', serif; font-size: 26px; margin: 0; position: relative; padding-inline-start: 16px; }
.section-head h2::before { content: ''; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%; width: 5px; border-radius: 3px; background: linear-gradient(var(--accent), var(--brand)); }
.more { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.poem-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.poem-card::after { content: ''; position: absolute; inset-inline-end: -40px; top: -40px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.poem-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--ink); }
.pc-head { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.pc-title { font-family: 'Thmanyah Serif Display', serif; font-size: 22px; line-height: 1.4; margin: 0; }
.pc-lines { font-family: 'Thmanyah Serif Text', serif; color: var(--ink-2); font-size: 16px; flex: 1; }
.pc-lines p { margin: 0 0 6px; display: flex; flex-direction: column; }
.pc-lines span:nth-child(2) { padding-inline-start: 28px; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.pc-read { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 600; }

.featured-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px;
  box-shadow: var(--shadow);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}
.featured-card:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.featured-card h3 { font-family: 'Thmanyah Serif Display', serif; font-size: 30px; margin: 8px 0 14px; }
.featured-verses { margin-bottom: 18px; }
.featured-verses .verse { font-size: 19px; }
.featured-img { width: 220px; height: 220px; object-fit: cover; border-radius: 18px; }
@media (max-width: 700px) {
  .featured-card { grid-template-columns: 1fr; padding: 22px; }
  .featured-img { width: 100%; height: 200px; order: -1; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 15px;
}
.chip-link small { color: var(--muted); font-size: 12px; }
.chip-link:hover { border-color: var(--brand); color: var(--brand); }
.chip-link.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip-link.on small { color: inherit; opacity: 0.8; }
.filters { display: grid; gap: 10px; margin-bottom: 22px; }

.media-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media-tile { color: var(--ink); }
.media-thumb {
  aspect-ratio: 1;
  border-radius: 18px;
  background: linear-gradient(150deg, var(--hero-1), var(--hero-2)) center / cover;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.play-badge { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #1b2a22; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.media-tile:hover .play-badge { transform: scale(1.08); }
.media-title { display: block; margin-top: 8px; font-weight: 600; }

/* ---------- Pages ---------- */

.page { padding-top: 32px; padding-bottom: 40px; }
.page-title { font-family: 'Thmanyah Serif Display', serif; font-size: clamp(28px, 4vw, 40px); margin: 0 0 14px; }

/* ---------- Poem page ---------- */

.poem-head { position: relative; text-align: center; padding: 34px 0 10px; }
.crumbs { display: flex; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.poem-title { font-family: 'Thmanyah Serif Display', serif; font-weight: 800; font-size: clamp(30px, 5vw, 46px); line-height: 1.3; margin: 10px 0 12px; color: var(--ink); }
.poem-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--muted); font-size: 15px; }
.poem-meta span { display: inline-flex; align-items: center; gap: 6px; }
.poem-meta span + span::before { content: '•'; margin-inline-end: 12px; color: var(--line); }

.player { margin: 24px 0 8px; }
.video-player video { display: block; margin: 0 auto; width: 100%; max-width: 640px; max-height: 70vh; border-radius: 20px; background: #000; box-shadow: var(--shadow); }
.audio-player {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 72px;
  z-index: 10;
}
.ap-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.ap-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ap-body audio { width: 100%; height: 40px; }
.dl { text-align: center; font-size: 14px; }
.dl a { display: inline-flex; align-items: center; gap: 6px; }

.poem-intro { margin: 18px 0 0; padding: 14px 18px; background: var(--surface-2); border-inline-start: 4px solid var(--accent); border-radius: 12px; color: var(--ink-2); white-space: pre-line; }

.poem-body {
  --verse-size: 22px;
  margin: 26px 0 0;
  padding: 34px 28px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  position: relative;
}
.poem-body::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 18px;
  pointer-events: none;
}
.verses { font-family: 'Thmanyah Serif Text', serif; font-size: var(--verse-size); color: var(--verse); line-height: 1.9; }
.verse {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.verse .sadr { text-align: start; }
.verse .ajuz { text-align: end; }
.verse.single { grid-template-columns: 1fr; text-align: center; }
.verse.single .half { text-align: center; text-align-last: auto; }
.verse:hover,
.verse.sel { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.featured-verses .verse,
.featured-verses .verse:hover { cursor: inherit; background: none; padding: 2px 0; column-gap: 28px; }
.stanza-title { font-family: 'Thmanyah Serif Display', serif; color: var(--accent-2); font-size: 0.9em; text-align: center; margin: 18px 0 6px; }
.stanza-sep { text-align: center; color: var(--accent); margin: 12px 0; font-size: 14px; letter-spacing: 12px; }
.stanza-sep span::before,
.stanza-sep span::after { content: '✦'; }
.signature { text-align: center; color: var(--accent-2); margin: 22px 0 0; font-family: 'Thmanyah Serif Display', serif; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Wide screens: the two halves side by side. Narrower: stacked, the second half indented. */
.poem-page .wrap.narrow { max-width: 980px; }
@media (max-width: 920px) {
  .verse { grid-template-columns: 1fr; padding: 8px 10px; row-gap: 0; }
  .verse .ajuz { padding-inline-start: 16%; }
  .verse + .verse { border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); border-radius: 0; }
  .poem-page .wrap.narrow { max-width: 760px; }
}
@media (max-width: 700px) {
  .poem-body { --verse-size: 19px; padding: 24px 12px 20px; border-radius: 20px; }
  .poem-body::before { inset: 6px; border-radius: 15px; }
  .verse .ajuz { padding-inline-start: 12%; }
}

.original-image { margin: 16px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px; }
.original-image summary { cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 500; }
.original-image img { margin: 12px auto 4px; border-radius: 12px; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 6px; }
.act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 500;
  transition: all 0.15s;
}
.act:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.act-wa { color: #128c4b; }
.act-wa:hover { border-color: #25d366; color: #0f7a40; }
.act-like.liked { color: #c0392b; border-color: color-mix(in srgb, #c0392b 40%, var(--line)); }
.act-like.liked svg { fill: currentColor; }
.hint { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.reader-tools { display: flex; justify-content: center; gap: 6px; margin: 14px 0 0; }
.reader-tools button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 5px 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.reader-tools button[aria-pressed='false'] { opacity: 0.6; }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 34px 0 10px; }
.pn { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; color: var(--ink); font-weight: 600; font-family: 'Thmanyah Serif Display', serif; }
.pn small { display: block; color: var(--muted); font-family: 'Thmanyah Sans', sans-serif; font-weight: 400; font-size: 13px; }
.pn-prev { text-align: end; }
.pn:hover { border-color: var(--brand); color: var(--ink); }
.poem-contact { text-align: center; font-size: 15px; }
.poem-contact a { display: inline-flex; align-items: center; gap: 6px; }
.related { margin-top: 30px; }

/* Floating menu for a single verse */
.verse-pop {
  position: absolute;
  z-index: 60;
  display: flex;
  gap: 4px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px;
  padding: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateX(50%);
}
.verse-pop button { border: 0; background: none; color: inherit; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; font-size: 14px; }
.verse-pop button:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- About & contact ---------- */

.about { text-align: center; }
.about-photo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; border: 4px solid var(--accent); box-shadow: var(--shadow); }
.about-name { color: var(--brand); font-weight: 600; font-size: 19px; margin-top: -6px; }
.about-text { text-align: start; font-size: 18px; line-height: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 26px; margin: 22px 0; white-space: pre-line; }
.about-stats { display: flex; justify-content: center; gap: 16px; margin: 20px 0 26px; }
.about-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 28px; display: grid; }
.about-stats strong { font-size: 30px; color: var(--brand); font-family: 'Thmanyah Serif Display', serif; }

.contact-form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.contact-form label { display: grid; gap: 6px; font-weight: 500; color: var(--ink-2); }
.contact-form input,
.contact-form textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 11px 14px; outline: none; font-size: 16px; }
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.contact-form .btn { justify-self: start; }
.contact-poem { background: var(--surface-2); padding: 10px 14px; border-radius: 12px; color: var(--ink-2); }
.req { color: var(--accent-2); }
.form-status { margin: 0; font-weight: 500; }
.form-status.ok { color: var(--brand); }
.form-status.err { color: #c0392b; }

/* ---------- Search overlay ---------- */

.search-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(8, 14, 11, 0.5); backdrop-filter: blur(4px); display: grid; align-items: start; justify-items: center; padding: 70px 16px 16px; }
.search-overlay[hidden] { display: none; }
.search-box { width: 100%; max-width: 640px; background: var(--surface); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); overflow: hidden; }
.search-form { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); }
.search-form svg { color: var(--muted); }
.search-form input { flex: 1; border: 0; outline: none; background: none; font-size: 18px; padding: 10px 0; min-width: 0; }
.search-results { max-height: 60vh; overflow: auto; }
.sr-item { display: block; padding: 12px 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
.sr-item:hover,
.sr-item.active { background: var(--bg-2); color: var(--ink); }
.sr-item strong { display: block; font-family: 'Thmanyah Serif Display', serif; font-size: 18px; }
.sr-item span { color: var(--muted); font-size: 14px; font-family: 'Thmanyah Serif Text', serif; }
.sr-empty { padding: 18px; color: var(--muted); text-align: center; }
mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }

/* ---------- Modal (card generator, QR) ---------- */

.modal { position: fixed; inset: 0; z-index: 90; background: rgba(8, 14, 11, 0.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.modal-box { width: 100%; max-width: 900px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; font-family: 'Thmanyah Serif Display', serif; font-size: 22px; }
.modal-body { padding: 18px; }
.card-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.card-preview { background: var(--bg-2); border-radius: 18px; display: grid; place-items: center; padding: 14px; min-height: 300px; }
.card-preview canvas { max-width: 100%; max-height: 62vh; border-radius: 12px; box-shadow: var(--shadow); }
.card-opts { display: grid; gap: 14px; align-content: start; }
.card-opts h4 { margin: 0 0 6px; font-size: 15px; color: var(--ink-2); }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-row button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 6px 12px; font-size: 14px; }
.opt-row button.on { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.verse-pick { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.verse-pick label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; font-family: 'Thmanyah Serif Text', serif; font-size: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.verse-pick label:last-child { border-bottom: 0; }
.card-actions { display: grid; gap: 8px; }
.card-actions .btn { justify-content: center; }
.btn-ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
@media (max-width: 760px) {
  .card-layout { grid-template-columns: 1fr; }
}
.qr-box { display: grid; justify-items: center; gap: 12px; text-align: center; }
.qr-box img,
.qr-box canvas { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; padding: 12px; border-radius: 16px; }

/* ---------- Toast ---------- */

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 999px; font-weight: 500; z-index: 100; transition: transform 0.25s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Footer ---------- */

.footer { margin-top: 50px; }
.footer .mountains { height: 90px; margin-bottom: -2px; }
.footer-in { background: var(--m3); color: color-mix(in srgb, #fff 82%, var(--m3)); padding: 10px 0 28px; text-align: center; }
.footer-poet { display: inline-flex; align-items: center; gap: 8px; font-family: 'Thmanyah Serif Display', serif; font-size: 18px; margin: 0; }
.socials { display: flex; justify-content: center; gap: 10px; margin: 14px 0; }
.socials a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: inherit; background: rgba(255, 255, 255, 0.1); }
.socials a:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.footer-small { font-size: 13px; opacity: 0.7; margin: 8px 0 0; }

/* ---------- Password gate ---------- */

.gate-body,
.hub-body { background: linear-gradient(170deg, var(--hero-1), var(--hero-2)); }
.gate { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; }
.gate .mountains .m3 { fill: var(--bg); }
.gate-card { width: calc(100% - 32px); max-width: 420px; margin: 12vh auto 20px; background: var(--surface); border-radius: 26px; padding: 34px 28px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
.gate-logo { margin: 0 auto 10px; }
.gate-card h1 { font-family: 'Thmanyah Serif Display', serif; margin: 0; font-size: 30px; }
.gate-poet { color: var(--brand); margin: 4px 0 0; font-size: 15px; }
.gate-msg { color: var(--ink-2); margin: 16px 0; }
.gate-form { display: grid; gap: 10px; }
.gate-form input { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 12px 16px; text-align: center; font-size: 17px; outline: none; }
.gate-form input:focus { border-color: var(--brand); }
.gate-form .btn { justify-content: center; }
.gate-err { color: #c0392b; margin: 12px 0 0; font-weight: 500; }
.countdown { display: flex; justify-content: center; gap: 8px; margin: 0 0 18px; direction: rtl; }
.countdown div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; min-width: 64px; display: grid; }
.countdown strong { font-size: 24px; color: var(--brand); font-family: 'Thmanyah Serif Display', serif; }
.countdown span { font-size: 12px; color: var(--muted); }

/* ---------- obaid.blog landing ---------- */

.hub { margin: 0; position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; color: var(--hero-ink); overflow: hidden; }
.hub .mountains { height: 150px; }
.hub .mountains .m3 { fill: var(--bg); }
.hub-in { position: relative; text-align: center; padding: 70px 16px 10px; max-width: 1000px; margin: 0 auto; width: 100%; }
.hub-logo { margin: 0 auto 14px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.25)); }
.hub-title { font-family: 'Thmanyah Serif Display', serif; font-weight: 800; font-size: clamp(36px, 7vw, 64px); margin: 0; line-height: 1.25; }
.hub-sub { color: color-mix(in srgb, var(--hero-ink) 78%, transparent); font-size: 18px; margin: 8px 0 0; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 40px; }
.hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 22px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  text-align: center;
}
a.hub-card:hover { transform: translateY(-4px); color: var(--ink); }
.hub-card strong { font-family: 'Thmanyah Serif Display', serif; font-size: 26px; }
.hub-card > span:not(.hub-icon):not(.btn):not(.soon-badge) { color: var(--muted); font-size: 15px; }
.hub-card .btn { margin-top: 8px; }
.hub-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.hub-card.soon { opacity: 0.75; background: color-mix(in srgb, var(--surface) 82%, transparent); }
.soon-badge { margin-top: 8px; font-size: 13px; padding: 4px 14px; border-radius: 999px; background: var(--bg-2); color: var(--muted); }
.hub-mode { position: absolute; top: 16px; inset-inline-end: 16px; color: var(--hero-ink); }
.hub-mode:hover { background: rgba(255, 255, 255, 0.12); color: var(--hero-ink); }

/* ---------- Print ---------- */

@media print {
  .topbar, .footer, .actions, .hint, .reader-tools, .prev-next, .related, .poem-contact, .player, .dl, .announce, .original-image, .crumbs, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .poem-body { box-shadow: none; border: 0; padding: 0; }
  .poem-body::before { display: none; }
  .verse { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
