/* ==========================================================================
   design.css — final visual layer (loads last)

   Direction
   - Subject: a Quranic scientific institution of Al-Abbas Holy Shrine. Calm, dignified, warm.
   - Palette: walnut #2a1409 / #6f3f1b, gold #d9b45b, ivory #faf4ea. No greens, no cool greys.
   - Signature: an eight-point-star lattice (geometric, Islamic) + the hero ayah set large in
     Amiri gold. Everything else stays quiet.
   - Icons: monochrome line icons, never emoji.
   ========================================================================== */

:root {
  --ivory: #faf4ea;
  --ivory-2: #f3eadc;
  --walnut-950: #1a0d06;
  --walnut-900: #2a1409;
  --walnut-800: #3d1f0d;
  --walnut-700: #5a3014;
  --walnut-600: #6f3f1b;
  --gold-400: #e4c16f;
  --gold-500: #d9b45b;
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23d9b45b' stroke-opacity='.17' stroke-width='1'%3E%3Cpath d='M44 4l10.9 27.7L84 44 54.9 56.3 44 84 33.1 56.3 4 44l29.1-12.3z'/%3E%3Crect x='19' y='19' width='50' height='50' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='9'/%3E%3C/g%3E%3C/svg%3E");
}

/* --- Light theme: ivory instead of the old green wash ------------------------- */
html:not([data-theme="dark"]) {
  --body-background: linear-gradient(180deg, #fbf7f0 0%, #f4ece0 100%);
  --surface-muted: #f6efe4;
  --surface-card: #ffffff;
  --border-soft: #e6dac9;
  --border-strong: #cdb99f;
}

/* --- Dark theme: warm espresso instead of cool blue-black -------------------- */
html[data-theme="dark"] {
  --neutral-100: #120d09;
  --neutral-200: #1a130d;
  --neutral-400: #3a2d21;
  --neutral-700: #b9a792;
  --neutral-900: #eadfd2;
  --text-primary: #f7efe5;
  --text-secondary: #c0af9c;
  --surface-card: #1d1610;
  --surface-muted: #16100b;
  --surface-elevated: #281f16;
  --border-soft: #3b2e22;
  --border-strong: #6d5740;
  --body-background: #110c08;
  --header-background: rgba(17, 12, 8, 0.94);
  --header-border: rgba(247, 239, 229, 0.1);
  --header-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  --header-control-bg: #281f16;
  --header-control-border: #3b2e22;
  --header-control-hover: #3b2e22;
  --header-control-active: #54402e;
  --dropdown-background: #1d1610;
  --dropdown-border: #3b2e22;
  --dropdown-hover: #281f16;
  --brand-deep: #24130a;
}
html[data-theme="dark"] body { background: #110c08; }
html[data-theme="dark"] .section--accent { background: #17110c; }

/* --- Remove the clutter that read as glitches --------------------------------- */
.quran-scroll,
.ambient-background,
.bg-shape,
.hero__parallax { display: none !important; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero.hero--fullscreen {
  min-height: min(calc(100svh - var(--header-h, 76px)), 920px);
  background:
    radial-gradient(60% 75% at 82% -10%, rgba(217, 180, 91, 0.26), transparent 62%),
    radial-gradient(45% 60% at 8% 105%, rgba(140, 82, 38, 0.35), transparent 65%),
    linear-gradient(160deg, var(--walnut-950) 0%, var(--walnut-800) 58%, var(--walnut-700) 100%);
}
.hero.hero--fullscreen .hero__background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: var(--lattice);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
}
/* Slideshow photos are back: a walnut veil keeps the text readable, the lattice sits on top */
.hero.hero--fullscreen .hero__media-frame { visibility: visible; }
.hero.hero--fullscreen .hero__slide img {
  filter: saturate(1.05) contrast(1.05);
  -o-object-fit: cover;
     object-fit: cover;
}
.hero.hero--fullscreen .hero__overlay {
  display: block;
  background:
    radial-gradient(60% 80% at 82% 0%, rgba(217, 180, 91, 0.22), transparent 62%),
    linear-gradient(160deg, rgba(26, 13, 6, 0.9) 0%, rgba(61, 31, 13, 0.72) 52%, rgba(26, 13, 6, 0.9) 100%);
}

.hero.hero--fullscreen .hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 4vh, 3rem);
  padding: clamp(7.5rem, 15vh, 10rem) 5% clamp(3rem, 7vh, 5rem);
  text-align: center;
}
.hero.hero--fullscreen .hero__copy { order: 1; display: grid; justify-items: center; gap: 0; max-width: 56rem; margin: 0; }
.hero.hero--fullscreen .hero__notes { order: 2; }

.hero.hero--fullscreen .hero__eyebrow {
  margin: 0 0 1.4rem;
  padding: 0.4rem 1.3rem;
  border: 1px solid rgba(217, 180, 91, 0.45);
  border-radius: 999px;
  background: rgba(217, 180, 91, 0.1);
  color: var(--gold-400);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}
.hero.hero--fullscreen .hero__title {
  margin: 0 0 1.2rem;
  font-size: clamp(2.5rem, 5.6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  text-shadow: none;
}
.hero.hero--fullscreen .hero__subtitle {
  max-width: 40rem;
  margin: 0 0 2rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.9;
  color: rgba(250, 244, 234, 0.86);
}
.hero.hero--fullscreen .hero__cta { justify-content: center; gap: 0.9rem; margin-bottom: clamp(2rem, 5vh, 3.2rem); }

.hero.hero--fullscreen .btn--primary {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--walnut-950);
  box-shadow: 0 12px 28px rgba(217, 180, 91, 0.28);
}
.hero.hero--fullscreen .btn--primary:hover { background: var(--gold-400); filter: none; }
.hero.hero--fullscreen .btn--ghost {
  background: transparent;
  border: 1.5px solid rgba(250, 244, 234, 0.45);
  color: #fff;
}
.hero.hero--fullscreen .btn--ghost:hover { background: rgba(250, 244, 234, 0.12); }

/* The memorable element: the ayah, large, in gold calligraphy */
.hero.hero--fullscreen .hero__verse {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(217, 180, 91, 0.3);
  max-width: 44rem;
}
.hero.hero--fullscreen .hero__verse blockquote {
  margin: 0;
  font-family: "Amiri", "Noto Naskh Arabic", serif;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 1.9;
  color: var(--gold-400);
}
.hero.hero--fullscreen .hero__verse cite { font-style: normal; font-size: 0.95rem; color: rgba(250, 244, 234, 0.7); }

/* Mission / vision sit under the copy as one quiet row */
.hero.hero--fullscreen .hero__notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  width: min(100%, 60rem);
  margin: 0;
}
.hero.hero--fullscreen .hero__note {
  min-width: 0;
  padding: 1.3rem 1.6rem;
  border: 1px solid rgba(217, 180, 91, 0.25);
  border-radius: 18px;
  background: rgba(250, 244, 234, 0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  text-align: start;
  box-shadow: none;
}
.hero.hero--fullscreen .hero__note-label { margin: 0 0 0.35rem; color: var(--gold-400); font-size: 0.95rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.hero.hero--fullscreen .hero__note-text { margin: 0; color: rgba(250, 244, 234, 0.9); font-size: 1rem; line-height: 1.85; }
@media (max-width: 760px) {
  .hero.hero--fullscreen .hero__notes { grid-template-columns: 1fr; }
}

/* Announcement pill: walnut + gold (was green) */
.hero-breaking-news {
  background: rgba(26, 13, 6, 0.72);
  border: 1px solid rgba(217, 180, 91, 0.35);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}
.hero-breaking-news .breaking-label { background: var(--gold-500); color: var(--walnut-950); }
.hero-breaking-news .pulse-dot { background: var(--gold-500); }
.hero-breaking-news .breaking-content-scroll { color: #fff; }

/* ==========================================================================
   Icons: monochrome line icons replace the emoji
   ========================================================================== */
.portal-window__icon::before {
  content: "" !important;
  display: block;
  width: 1.9rem;
  height: 1.9rem;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.portal-window__icon--book     { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4.5h6a4 4 0 0 1 4 4V21a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 4.5h-6a4 4 0 0 0-4 4V21a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.portal-window__icon--calendar { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16' rx='2.5'/%3E%3Cpath d='M16 2.5v4M8 2.5v4M3 10h18'/%3E%3C/svg%3E"); }
.portal-window__icon--news     { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h13v14a2 2 0 0 0 2 2H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M17 9h3v10a2 2 0 0 1-2 2M7.5 9h6M7.5 13h6M7.5 17h3'/%3E%3C/svg%3E"); }
.portal-window__icon--camera   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='13' height='12' rx='2.5'/%3E%3Cpath d='m15.5 10.5 6-3.5v10l-6-3.5'/%3E%3C/svg%3E"); }
.portal-window__icon--share    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 4.5-9 4.5-9-4.5z'/%3E%3Cpath d='m3 12 9 4.5 9-4.5M3 16.5 12 21l9-4.5'/%3E%3C/svg%3E"); }
.portal-window__icon--network  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M2.5 12h19M12 2.5c2.7 2.6 4 5.8 4 9.5s-1.3 6.9-4 9.5c-2.7-2.6-4-5.8-4-9.5s1.3-6.9 4-9.5z'/%3E%3C/svg%3E"); }
.portal-window__icon--server   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4' width='19' height='12.5' rx='2'/%3E%3Cpath d='M8 21h8M12 16.5V21'/%3E%3C/svg%3E"); }
.portal-window__icon--map      { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-5.6-7-11.2a7 7 0 0 1 14 0C19 15.4 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.8' r='2.6'/%3E%3C/svg%3E"); }
.portal-window__icon--award    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='9' r='6'/%3E%3Cpath d='m8.5 14 -1.5 7 5-3 5 3-1.5-7'/%3E%3C/svg%3E"); }
.portal-window__icon--users    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.6-3.6 3.2-5.5 6.5-5.5s5.9 1.9 6.5 5.5'/%3E%3Cpath d='M16 4.7a3.5 3.5 0 0 1 0 6.6M18 14.8c1.9.7 3.2 2.4 3.5 5.2'/%3E%3C/svg%3E"); }
.portal-window__icon--heart    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20.5S3 15 3 8.8A4.8 4.8 0 0 1 12 6.4a4.8 4.8 0 0 1 9 2.4C21 15 12 20.5 12 20.5z'/%3E%3C/svg%3E"); }
.portal-window__icon--mic      { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2.5' width='6' height='11.5' rx='3'/%3E%3Cpath d='M5 11.5a7 7 0 0 0 14 0M12 18.5v3'/%3E%3C/svg%3E"); }
.portal-window__icon--layers   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='8' height='8' rx='1.5'/%3E%3Crect x='13' y='3' width='8' height='8' rx='1.5'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1.5'/%3E%3Crect x='13' y='13' width='8' height='8' rx='1.5'/%3E%3C/svg%3E"); }
.portal-window__icon--print    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9V3h11v6'/%3E%3Crect x='3' y='9' width='18' height='8' rx='2'/%3E%3Crect x='7' y='14' width='10' height='7' rx='1'/%3E%3C/svg%3E"); }
.portal-window__icon--hands    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.5 14.6 9H21l-5.2 4 2 6.5L12 15.7 6.2 19.5l2-6.5L3 9h6.4z'/%3E%3C/svg%3E"); }

/* Icon tile: soft gold, never multicolour */
.portal-directory-card__media {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--gold-500) 22%, transparent);
  color: var(--walnut-600);
  box-shadow: none !important;
}
html[data-theme="dark"] .portal-directory-card__media { background: rgba(217, 180, 91, 0.16); color: var(--gold-400); }
.portal-directory__grid--institutes .portal-directory-card__media { background: rgba(255, 255, 255, 0.16); color: #fff; }
.portal-directory-card__media .portal-directory-card__icon { width: 100%; height: 100%; font-size: 0; }

/* ==========================================================================
   Video / media posters (the bright green placeholder is replaced)
   ========================================================================== */
.media-item__thumbnail {
  background:
    var(--lattice),
    linear-gradient(150deg, var(--walnut-900), var(--walnut-700));
  background-size: 88px 88px, cover;
}
.media-item__thumbnail img[src*="media-placeholder"] { opacity: 0; }
.media-item__thumbnail::after { background: linear-gradient(180deg, transparent 40%, rgba(26, 13, 6, 0.55)); }
.media-item__duration { background: rgba(26, 13, 6, 0.78); color: var(--gold-400); }
.media-item__play,
.media-item__thumbnail [class*="play"] { color: #fff; }

/* ==========================================================================
   Grids: stretch to the container instead of leaving a gap on one side
   ========================================================================== */
.media-grid,
.cards-grid,
.audio-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
@media (min-width: 1000px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cards-grid > .empty-state, .media-grid > .empty-state { grid-column: 1 / -1; }

/* One radius language: 18px cards, pills for chips and buttons */
.card, .media-item, .publication, .program, .timeline__content, .holy-site-card,
.contact-overview__card, .contact-main__form-card, .nx-card, .publisher-card, .faq-item { border-radius: 18px; }

/* Section rhythm: alternate ivory / white (light) and two espresso tones (dark) */
html:not([data-theme="dark"]) .section--media { background: var(--ivory-2); }
html:not([data-theme="dark"]) .section--accent { background: #fff; }
html:not([data-theme="dark"]) #library { background: linear-gradient(180deg, #fbf7f0, #f1e7d8); }
html:not([data-theme="dark"]) .section--audio { background: var(--ivory-2); }

/* Signature divider before the footer */
.site-footer { position: relative; }
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 14px;
  background: var(--lattice) repeat-x center / 44px 14px, linear-gradient(90deg, transparent, rgba(217, 180, 91, 0.5), transparent);
  opacity: 0.55;
}

/* Focus ring in gold on dark surfaces */
html[data-theme="dark"] :focus-visible { outline-color: var(--gold-500); }

/* ==========================================================================
   Round 2 fixes (from reviewing real screenshots)
   ========================================================================== */

/* Hero: tighter vertical rhythm so the fold shows headline, CTAs and the ayah */
.hero.hero--fullscreen { min-height: 0; }
.hero.hero--fullscreen .hero__content { gap: clamp(1.6rem, 3vh, 2.4rem); padding-top: clamp(6.5rem, 12vh, 8rem); padding-bottom: clamp(2.5rem, 5vh, 4rem); }
.hero.hero--fullscreen .hero__title { font-size: clamp(2.4rem, 5vw, 4.1rem); margin-bottom: 1rem; }
.hero.hero--fullscreen .hero__subtitle { margin-bottom: 1.6rem; }
.hero.hero--fullscreen .hero__cta { margin-bottom: clamp(1.4rem, 3.5vh, 2.2rem); }
.hero.hero--fullscreen .hero__verse { padding-top: 1.2rem; }
.hero.hero--fullscreen .hero__verse blockquote { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.8; }

/* Section spacing: one value, no double padding between neighbours */
main > .section,
main > section.section { padding-block: clamp(2.75rem, 5vw, 4.5rem); }

/* Video posters get a real play affordance */
.media-item__thumbnail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: auto;
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232a1409' d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") 56% 50% / 46% no-repeat,
    var(--gold-500);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(217, 180, 91, 0.2);
  transition: transform 0.25s;
}
.media-item:hover .media-item__thumbnail::before { transform: scale(1.08); }

/* Category badges sit on photos: solid pill, readable on any image */
.card__badge,
.news-card__badge,
.news-detail-hero__badge {
  background: rgba(26, 13, 6, 0.86);
  color: var(--gold-400);
  border: 1px solid rgba(217, 180, 91, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Institutes: deep walnut with a gold edge (the saturated orange was off-brand) */
.portal-directory__grid--institutes .portal-directory-card {
  --directory-card-bg: linear-gradient(155deg, #7a4620 0%, #3d1f0d 100%);
  border-color: rgba(217, 180, 91, 0.35);
}
.portal-directory__special .portal-directory__subtitle { color: var(--text-primary); }

/* Badges: beat the earlier theme-scoped rules */
html .card__badge, html[data-theme] .card__badge,
html .news-card__badge, html[data-theme] .news-card__badge,
html .news-detail-hero__badge, html[data-theme] .news-detail-hero__badge {
  background: rgba(26, 13, 6, 0.88);
  color: var(--gold-400);
  border: 1px solid rgba(217, 180, 91, 0.45);
}

/* Native audio players follow the theme instead of glaring white */
html[data-theme="dark"] audio { color-scheme: dark; }
.audio-card__player { border-radius: 999px; }

/* Books section: no dead band after the carousel */
#library { padding-bottom: 2.5rem; }
.books-swiper { padding-bottom: 150px; }

/* ==========================================================================
   Splash screen: walnut + gold (was green/cream with a dark glitch box)
   ========================================================================== */
.loading-screen,
.loading-screen.is-text-active {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background:
    radial-gradient(55% 60% at 50% 38%, rgba(217, 180, 91, 0.2), transparent 70%),
    linear-gradient(165deg, var(--walnut-950) 0%, var(--walnut-800) 60%, var(--walnut-700) 100%);
  color: var(--ivory);
}
.loading-screen__pattern {
  background: var(--lattice) !important;
  opacity: 0.9;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000, transparent 80%);
  mask-image: radial-gradient(70% 70% at 50% 45%, #000, transparent 80%);
}
.loading-brand__glow { background: radial-gradient(circle, rgba(217, 180, 91, 0.35), transparent 68%) !important; }
.loading-brand__icon { background: var(--ivory) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important; }
.loading-brand__ring-track { stroke: rgba(217, 180, 91, 0.22) !important; }
.loading-brand__ring-progress { stroke: var(--gold-500) !important; }
.loading-screen__chant {
  font-family: "Amiri", "Noto Naskh Arabic", serif !important;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem) !important;
  color: var(--gold-400) !important;
}
.loading-screen__hint { color: rgba(250, 244, 234, 0.7) !important; }
.loading-goals { color: var(--ivory) !important; }
.loading-goals__label { color: var(--gold-400) !important; letter-spacing: 0 !important; text-transform: none !important; font-size: 0.95rem !important; }
.loading-goals__label::before { background: rgba(217, 180, 91, 0.6) !important; }
.loading-goals__text::after { display: none !important; }   /* the dark multiply box */
.loading-goals__text { color: #fff; }

/* Water-drop transition overlay after the splash: same palette */
#transition-overlay { background: linear-gradient(165deg, var(--walnut-950), var(--walnut-700)); }

/* About page: four identity cards in one row, readable measure for the lead text */
.identity-cards,
.identity-pillars__grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.identity__lead { max-width: 62ch; }
.identity__column--primary .identity__lead + .identity__lead { margin-top: 0; }

/* ==========================================================================
   Round 3: library cards, events badge, phone numbers, publisher dashboard
   ========================================================================== */

/* extra line icons */
.portal-window__icon--edit   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19.5 8.5a2.1 2.1 0 0 0-3-3L5 17z'/%3E%3Cpath d='m14.5 7.5 3 3'/%3E%3C/svg%3E"); }
.portal-window__icon--image  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2.5'/%3E%3Ccircle cx='9' cy='10' r='1.8'/%3E%3Cpath d='m21 16-5-5-8 8'/%3E%3C/svg%3E"); }
.portal-window__icon--search { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }

/* Library: flat, even cards (the 3D covers overlapped each other and the container) */
.library-collection__grid { gap: 1.5rem; }
.publication {
  margin: 0 !important;
  align-items: stretch !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: var(--surface-card) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1) !important;
}
.publication__cover {
  display: grid;
  place-items: center;
  width: 100%;
  height: 17rem;
  margin: 0;
  padding: 1.4rem 1rem 0.4rem;
  transform: none !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold-500) 16%, transparent), transparent);
}
.publication__cover::before,
.publication__cover::after { display: none !important; }
.publication__cover img {
  position: static;
  width: auto;
  max-width: 100%;
  height: 100%;
  transform: none !important;
  object-fit: contain !important;
  border-radius: 4px !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3) !important;
}
.publication__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: start;
}
.publication:hover .publication__body { transform: none; }

/* Events: status badge flows inside the card instead of covering the title */
.card__body .card__badge,
.card--news .card__body > .card__badge {
  position: static !important;
  align-self: flex-start;
  margin: 0 0 0.6rem;
}

/* Phone numbers keep their natural left-to-right order inside Arabic text */
a[href^="tel:"],
.contact-main__hotline-value,
.contact-overview__card--featured .contact-overview__title {
  direction: ltr;
  unicode-bidi: isolate;
}
.contact-overview__card--featured .contact-overview__title { text-align: right; font-size: clamp(1.4rem, 2vw, 1.8rem); white-space: nowrap; }

/* Publisher dashboard: walnut hero, quiet stat tiles, line icons */
.publisher-dashboard__hero {
  background:
    radial-gradient(50% 90% at 85% 0%, rgba(217, 180, 91, 0.22), transparent 65%),
    linear-gradient(150deg, var(--walnut-950), var(--walnut-700));
}
.publisher-dashboard__hero .publisher-metric,
.publisher-dashboard__hero [class*="publisher-metric"] { border-color: rgba(217, 180, 91, 0.35) !important; }
.publisher-metric {
  background: rgba(250, 244, 234, 0.08) !important;
  border: 1px solid rgba(217, 180, 91, 0.3) !important;
  border-inline-end: 1px solid rgba(217, 180, 91, 0.3) !important;
}
.publisher-metric__value { color: var(--gold-400); }
.publisher-quick-action__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold-500) 22%, transparent);
  color: var(--walnut-600);
  font-size: 0;
}
html[data-theme="dark"] .publisher-quick-action__icon { color: var(--gold-400); background: rgba(217, 180, 91, 0.16); }
.publisher-quick-action__icon::before { width: 1.5rem; height: 1.5rem; }

/* Library covers: fixed image height so wide covers never blow out the grid */
.library-collection__grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.publication { min-width: 0; }
.publication__cover { height: auto; padding: 1.4rem 1rem 0.6rem; }
.publication__cover img { height: 15rem; max-height: 15rem; width: auto; max-width: 100%; }
.publication { width: auto !important; max-width: none !important; min-width: 0 !important; }
.publication__cover { flex: none !important; }
.publication__cover { aspect-ratio: auto !important; min-height: 0 !important; }

/* ==========================================================================
   Social icons: line icons instead of emoji
   ========================================================================== */
.icon::before {
  content: "" !important;
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  background: currentColor;
  -webkit-mask: var(--glyph, var(--icon)) center / contain no-repeat;
  mask: var(--glyph, var(--icon)) center / contain no-repeat;
}
.icon--facebook  { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M13.5 21v-7.5h2.6l.4-3h-3V8.6c0-.9.3-1.5 1.600-1.500h1.600V4.400c-.3 0-1.200-.1-2.300-.1-2.300 0-3.900 1.400-3.900 4v2.200H8v3h2.500V21z'/%3E%3C/svg%3E"); }
.icon--instagram { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M17.500 6.500h.01'/%3E%3C/svg%3E"); }
.icon--x         { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='m4 4 16 16M20 4 4 20'/%3E%3C/svg%3E"); }
.icon--youtube   { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M22.500 7.200a2.600 2.600 0 0 0-1.800-1.800C19 5 12 5 12 5s-7 0-8.700.4A2.600 2.600 0 0 0 1.500 7.200C1 9 1 12 1 12s0 3 .5 4.800a2.600 2.600 0 0 0 1.800 1.800C5 19 12 19 12 19s7 0 8.700-.4a2.600 2.600 0 0 0 1.800-1.800C23 15 23 12 23 12s0-3-.5-4.800zM10 15V9l5.200 3z'/%3E%3C/svg%3E"); }
.icon--telegram  { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13M22 2l-7 20-4-9-9-4z'/%3E%3C/svg%3E"); }
.icon--external  { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14 21 3'/%3E%3C/svg%3E"); }
/* the portal-window icons keep their own bigger size */
.portal-window__icon::before { width: 1.9rem; height: 1.9rem; }

/* Branch cards: readable secondary action */
.structure-card__footer .btn--ghost {
  background: transparent;
  color: var(--primary-600);
  border: 1.5px solid var(--border-strong);
}
.structure-card__footer .btn--ghost:hover { background: var(--primary-100); }
.structure-card__social-link .icon { display: inline-grid; place-items: center; }
.structure-card__social-link .icon,
.structure-social__link .icon,
.news-detail__social .icon {
  background: linear-gradient(140deg, #7a4620, #3d1f0d);
  color: var(--gold-400);
}
.icon { background: linear-gradient(140deg, #7a4620, #3d1f0d); color: var(--gold-400); }
@media (max-width: 480px) {
  .portal-directory__grid > .portal-directory-card { flex-basis: calc((100% - 1.25rem) / 2); min-width: 0; }
  .portal-directory-card__link { padding: 1.2rem 0.8rem; }
  .portal-directory-card__title { font-size: 0.95rem; }
}

/* Contrast fixes found by the automated sweep */
html[data-theme="dark"] .structure-card__contact dt,
html[data-theme="dark"] .publisher-calendar__title,
html[data-theme="dark"] h3.publisher-calendar__title { color: var(--primary-600); }
html:not([data-theme="dark"]) .publisher-calendar__channel,
html:not([data-theme="dark"]) .publisher-calendar__time,
html:not([data-theme="dark"]) .publisher-dashboard__support p span { color: var(--text-secondary); }
.structure-card__contact dt { font-weight: 600; }
html[data-theme="dark"] .publisher-calendar__day h3 { color: var(--primary-600); }
.publisher-resource--pending span,
.publisher-resource span { color: var(--text-secondary); }
.hero.hero--fullscreen .hero__note { display: flex; flex-direction: column; justify-content: flex-start; }

/* Readable text over the slideshow: real veil (the old rule blended it away) */
.hero.hero--fullscreen .hero__overlay {
  mix-blend-mode: normal !important;
  background:
    radial-gradient(60% 80% at 82% 0%, rgba(217, 180, 91, 0.16), transparent 62%),
    linear-gradient(160deg, rgba(26, 13, 6, 0.9) 0%, rgba(42, 20, 9, 0.8) 50%, rgba(26, 13, 6, 0.92) 100%) !important;
}
.hero.hero--fullscreen .hero__title { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55); }
.hero.hero--fullscreen .hero__subtitle { color: #fbf6ee; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6); }
.hero.hero--fullscreen .hero__eyebrow { background: rgba(26, 13, 6, 0.6); }
.hero.hero--fullscreen .hero__verse blockquote { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6); }
.hero.hero--fullscreen .hero__verse cite { color: rgba(251, 246, 238, 0.85); }
.hero.hero--fullscreen .hero__note {
  background: rgba(26, 13, 6, 0.68);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.hero.hero--fullscreen .hero__note-text { color: #fbf6ee; }
.hero.hero--fullscreen .btn--ghost { background: rgba(26, 13, 6, 0.45); }
.hero-breaking-news { background: rgba(26, 13, 6, 0.82); }

/* ==========================================================================
   Accent-driven brand palette: the colour picker in the header recolours the
   header, hero, footer, institute cards, splash and the dark/light surfaces.
   ========================================================================== */
html[data-accent="brown"], html:not([data-accent]) {
  --walnut-950: #1a0d06; --walnut-900: #2a1409; --walnut-800: #3d1f0d; --walnut-700: #5a3014; --walnut-600: #6f3f1b;
  --gold-400: #e4c16f; --gold-500: #d9b45b;
  --ivory: #faf4ea; --ivory-2: #f3eadc;
  --accent-color: #8c5226;
  --lattice: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='88'%20height='88'%20viewBox='0%200%2088%2088'%3E%3Cg%20fill='none'%20stroke='%23d9b45b'%20stroke-opacity='.17'%20stroke-width='1'%3E%3Cpath%20d='M44%204l10.9%2027.7L84%2044%2054.9%2056.3%2044%2084%2033.1%2056.3%204%2044l29.1-12.3z'/%3E%3Crect%20x='19'%20y='19'%20width='50'%20height='50'%20transform='rotate%2845%2044%2044%29'/%3E%3Ccircle%20cx='44'%20cy='44'%20r='9'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="dark"][data-accent="brown"], html[data-theme="dark"]:not([data-accent]) {
  --body-background: #110c08; --surface-card: #1d1610; --surface-muted: color-mix(in srgb, #110c08 60%, #1d1610);
  --surface-elevated: #281f16; --border-soft: #3b2e22; --brand-deep: #2a1409;
  --header-control-bg: #281f16; --header-control-border: #3b2e22; --header-control-hover: #3b2e22;
  --dropdown-background: #1d1610; --dropdown-border: #3b2e22; --dropdown-hover: #281f16;
}
html[data-theme="dark"][data-accent="brown"], html[data-theme="dark"]:not([data-accent]) body { background: #110c08; }
html[data-accent="blue"] {
  --walnut-950: #08122b; --walnut-900: #0e1d45; --walnut-800: #152c63; --walnut-700: #1d3f8f; --walnut-600: #1d4ed8;
  --gold-400: #8ec1ff; --gold-500: #5aa4fa;
  --ivory: #f4f7fc; --ivory-2: #e8eff9;
  --accent-color: #2563eb;
  --lattice: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='88'%20height='88'%20viewBox='0%200%2088%2088'%3E%3Cg%20fill='none'%20stroke='%235aa4fa'%20stroke-opacity='.17'%20stroke-width='1'%3E%3Cpath%20d='M44%204l10.9%2027.7L84%2044%2054.9%2056.3%2044%2084%2033.1%2056.3%204%2044l29.1-12.3z'/%3E%3Crect%20x='19'%20y='19'%20width='50'%20height='50'%20transform='rotate%2845%2044%2044%29'/%3E%3Ccircle%20cx='44'%20cy='44'%20r='9'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="dark"][data-accent="blue"] {
  --body-background: #080d18; --surface-card: #101827; --surface-muted: color-mix(in srgb, #080d18 60%, #101827);
  --surface-elevated: #18233a; --border-soft: #27364f; --brand-deep: #0e1d45;
  --header-control-bg: #18233a; --header-control-border: #27364f; --header-control-hover: #27364f;
  --dropdown-background: #101827; --dropdown-border: #27364f; --dropdown-hover: #18233a;
}
html[data-theme="dark"][data-accent="blue"] body { background: #080d18; }
html[data-accent="gold"] {
  --walnut-950: #2a1604; --walnut-900: #3d2006; --walnut-800: #5c3209; --walnut-700: #7c4509; --walnut-600: #b45309;
  --gold-400: #fcd34d; --gold-500: #fbbf24;
  --ivory: #fdf8ec; --ivory-2: #f7eed6;
  --accent-color: #d97706;
  --lattice: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='88'%20height='88'%20viewBox='0%200%2088%2088'%3E%3Cg%20fill='none'%20stroke='%23fbbf24'%20stroke-opacity='.17'%20stroke-width='1'%3E%3Cpath%20d='M44%204l10.9%2027.7L84%2044%2054.9%2056.3%2044%2084%2033.1%2056.3%204%2044l29.1-12.3z'/%3E%3Crect%20x='19'%20y='19'%20width='50'%20height='50'%20transform='rotate%2845%2044%2044%29'/%3E%3Ccircle%20cx='44'%20cy='44'%20r='9'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="dark"][data-accent="gold"] {
  --body-background: #120d04; --surface-card: #201709; --surface-muted: color-mix(in srgb, #120d04 60%, #201709);
  --surface-elevated: #2d200c; --border-soft: #44331a; --brand-deep: #3d2006;
  --header-control-bg: #2d200c; --header-control-border: #44331a; --header-control-hover: #44331a;
  --dropdown-background: #201709; --dropdown-border: #44331a; --dropdown-hover: #2d200c;
}
html[data-theme="dark"][data-accent="gold"] body { background: #120d04; }
html[data-accent="green"] {
  --walnut-950: #041a10; --walnut-900: #072a1b; --walnut-800: #0b3d28; --walnut-700: #0b5a3d; --walnut-600: #0f6d4a;
  --gold-400: #e4c16f; --gold-500: #d9b45b;
  --ivory: #f6faf5; --ivory-2: #e9f2ea;
  --accent-color: #0f6d4a;
  --lattice: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='88'%20height='88'%20viewBox='0%200%2088%2088'%3E%3Cg%20fill='none'%20stroke='%23d9b45b'%20stroke-opacity='.17'%20stroke-width='1'%3E%3Cpath%20d='M44%204l10.9%2027.7L84%2044%2054.9%2056.3%2044%2084%2033.1%2056.3%204%2044l29.1-12.3z'/%3E%3Crect%20x='19'%20y='19'%20width='50'%20height='50'%20transform='rotate%2845%2044%2044%29'/%3E%3Ccircle%20cx='44'%20cy='44'%20r='9'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="dark"][data-accent="green"] {
  --body-background: #07110c; --surface-card: #0f1d16; --surface-muted: color-mix(in srgb, #07110c 60%, #0f1d16);
  --surface-elevated: #16281f; --border-soft: #243c30; --brand-deep: #072a1b;
  --header-control-bg: #16281f; --header-control-border: #243c30; --header-control-hover: #243c30;
  --dropdown-background: #0f1d16; --dropdown-border: #243c30; --dropdown-hover: #16281f;
}
html[data-theme="dark"][data-accent="green"] body { background: #07110c; }

/* Header / navigation follow the accent */
html:root { --header-background: var(--walnut-900); --primary-maqura: var(--primary-700); }
html[data-theme="dark"] { --header-background: color-mix(in srgb, var(--walnut-950) 94%, transparent); }
.nav-btn-special { background-color: var(--primary-700); }
.language-switcher__link.is-active { background: color-mix(in srgb, var(--gold-400) 22%, transparent); }

/* Page backgrounds */
html:not([data-theme="dark"]) { --body-background: linear-gradient(180deg, color-mix(in srgb, var(--ivory) 55%, #fff) 0%, var(--ivory-2) 100%); --surface-muted: var(--ivory-2); }
html:not([data-theme="dark"]) #library { background: linear-gradient(180deg, color-mix(in srgb, var(--ivory) 55%, #fff), var(--ivory-2)); }
html[data-theme="dark"] .section--accent { background: color-mix(in srgb, var(--body-background) 80%, var(--surface-card)); }
html[data-theme="dark"] .section--media,
html[data-theme="dark"] .section--audio { background: var(--surface-muted); }

/* Footer, institute cards, icon chips, posters */
body .site-footer { background: linear-gradient(180deg, var(--walnut-800), var(--walnut-950)); }
html[data-theme="dark"] body .site-footer,
html[data-theme="dark"] .site-footer { background: linear-gradient(180deg, color-mix(in srgb, var(--brand-deep) 85%, #000), var(--brand-deep)); }
.portal-directory__grid--institutes .portal-directory-card { --directory-card-bg: linear-gradient(155deg, var(--walnut-700) 0%, var(--walnut-900) 100%); border-color: color-mix(in srgb, var(--gold-500) 35%, transparent); }
.icon, .structure-card__social-link .icon, .structure-social__link .icon, .news-detail__social .icon { background: linear-gradient(140deg, var(--walnut-700), var(--walnut-900)); color: var(--gold-400); }
.media-item__thumbnail { background: var(--lattice), linear-gradient(150deg, var(--walnut-900), var(--walnut-700)); background-size: 88px 88px, cover; }
.publisher-dashboard__hero { background: radial-gradient(50% 90% at 85% 0%, color-mix(in srgb, var(--gold-500) 22%, transparent), transparent 65%), linear-gradient(150deg, var(--walnut-950), var(--walnut-700)); }
.card__badge, .news-card__badge, .news-detail-hero__badge { background: color-mix(in srgb, var(--walnut-950) 88%, transparent) !important; color: var(--gold-400) !important; border-color: color-mix(in srgb, var(--gold-500) 45%, transparent) !important; }
.loading-screen, .loading-screen.is-text-active { background: radial-gradient(55% 60% at 50% 38%, color-mix(in srgb, var(--gold-500) 20%, transparent), transparent 70%), linear-gradient(165deg, var(--walnut-950) 0%, var(--walnut-800) 60%, var(--walnut-700) 100%); }
#transition-overlay { background: linear-gradient(165deg, var(--walnut-950), var(--walnut-700)); }

/* Hero (photos + veil + lattice) in the accent hue */
.hero.hero--fullscreen { background: radial-gradient(60% 75% at 82% -10%, color-mix(in srgb, var(--gold-500) 26%, transparent), transparent 62%), linear-gradient(160deg, var(--walnut-950) 0%, var(--walnut-800) 58%, var(--walnut-700) 100%); }
.hero.hero--fullscreen .hero__overlay {
  background:
    radial-gradient(60% 80% at 82% 0%, color-mix(in srgb, var(--gold-500) 16%, transparent), transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--walnut-950) 90%, transparent) 0%, color-mix(in srgb, var(--walnut-900) 80%, transparent) 50%, color-mix(in srgb, var(--walnut-950) 92%, transparent) 100%) !important;
}
.hero.hero--fullscreen .hero__eyebrow { border-color: color-mix(in srgb, var(--gold-500) 45%, transparent); background: color-mix(in srgb, var(--walnut-950) 60%, transparent); }
.hero.hero--fullscreen .btn--primary { background: var(--gold-500); border-color: var(--gold-500); color: var(--walnut-950); }
.hero.hero--fullscreen .hero__note { background: color-mix(in srgb, var(--walnut-950) 68%, transparent); border-color: color-mix(in srgb, var(--gold-500) 28%, transparent); }
.hero.hero--fullscreen .hero__verse { border-top-color: color-mix(in srgb, var(--gold-500) 30%, transparent); }
.hero-breaking-news { background: color-mix(in srgb, var(--walnut-950) 82%, transparent); border-color: color-mix(in srgb, var(--gold-500) 35%, transparent); }

.hero.hero--fullscreen .btn--ghost { background: color-mix(in srgb, var(--walnut-950) 45%, transparent); }

/* ==========================================================================
   Site search: header trigger, Ctrl+K dialog, /search results page
   ========================================================================== */
.search-trigger {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--header-text-color, #fff);
  border: 1px solid rgba(255, 255, 255, .2); transition: background .2s ease, border-color .2s ease;
}
.search-trigger svg { width: 18px; height: 18px; }
.search-trigger:hover, .search-trigger:focus-visible { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .4); }

html.search-open { overflow: hidden; }
.search-modal { position: fixed; inset: 0; z-index: 2000; display: grid; justify-items: center; align-items: start; padding: 9vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-modal__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--walnut-950) 72%, transparent); backdrop-filter: blur(6px); }
.search-modal__dialog {
  position: relative; width: min(680px, 100%); max-height: min(78vh, 640px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface-card, #fff); color: var(--text-color, #2a1409); border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--gold-500) 40%, var(--border-soft, #e6dccb));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
}
.search-modal__form { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft, #e6dccb); }
.search-modal__form > svg { width: 20px; height: 20px; flex: none; color: var(--gold-500); }
.search-modal__input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 1.05rem; padding: 6px 0;
  -webkit-appearance: none; appearance: none;
}
.search-modal__input::placeholder { color: color-mix(in srgb, currentColor 50%, transparent); }
.search-modal__input::-webkit-search-cancel-button { display: none; }
.search-modal__form:focus-within { box-shadow: inset 0 -2px 0 var(--gold-500); }
.search-modal__esc {
  flex: none; cursor: pointer; font: inherit; font-size: .72rem; padding: 4px 8px; border-radius: 6px;
  background: var(--surface-muted, #f3eadc); color: inherit; border: 1px solid var(--border-soft, #e6dccb);
}
.search-modal__body { overflow-y: auto; padding: 10px; overscroll-behavior: contain; min-height: 120px; }
.search-modal.is-loading .search-modal__body { opacity: .65; transition: opacity .15s; }
.search-group { margin-bottom: 6px; }
.search-group__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 4px; }
.search-group__title { margin: 0; padding: 8px 10px 4px; font-size: .78rem; font-weight: 700; color: color-mix(in srgb, currentColor 62%, transparent); }
.search-group__head .search-group__title { padding: 0; }
.search-clear { cursor: pointer; background: none; border: 0; color: var(--primary-600, #6f3f1b); font: inherit; font-size: .78rem; }
html[data-theme="dark"] .search-clear { color: var(--gold-400); }

.search-result {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; text-decoration: none; color: inherit;
  border: 1px solid transparent; transition: background .15s ease, border-color .15s ease;
}
.search-result:hover, .search-result.is-active { background: color-mix(in srgb, var(--gold-500) 14%, var(--surface-card, #fff)); border-color: color-mix(in srgb, var(--gold-500) 45%, transparent); }
.search-result:focus-visible, .search-card:focus-visible, .search-chip:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.search-result__thumb, .search-card__thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-muted, #f3eadc); }
.search-result__icon {
  flex: none; width: 52px; height: 52px; border-radius: 10px; background-color: var(--walnut-800); color: var(--gold-400);
  display: block; position: relative;
}
.search-result__body, .search-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-result__title, .search-card__title { font-size: .98rem; line-height: 1.5; font-weight: 700; }
.search-result__snippet, .search-card__snippet {
  font-size: .86rem; line-height: 1.65; color: color-mix(in srgb, currentColor 72%, transparent);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.search-result__meta, .search-card__meta { font-size: .76rem; color: color-mix(in srgb, currentColor 55%, transparent); display: flex; gap: 10px; }
.search-modal mark, .search-card mark {
  background: color-mix(in srgb, var(--gold-500) 38%, transparent); color: inherit; border-radius: 3px; padding: 0 2px;
}
.search-none { margin: 0; padding: 28px 12px; text-align: center; color: color-mix(in srgb, currentColor 65%, transparent); }
.search-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 10px 12px; }
.search-quick--center { justify-content: center; }
.search-quick a, .search-chip {
  font: inherit; font-size: .86rem; cursor: pointer; text-decoration: none; color: inherit; padding: 6px 14px; border-radius: 999px;
  background: var(--surface-muted, #f3eadc); border: 1px solid var(--border-soft, #e6dccb);
  transition: background .15s ease, border-color .15s ease;
}
.search-quick a:hover, .search-chip:hover { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-500) 16%, var(--surface-muted, #f3eadc)); }
.search-modal__foot {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px; font-size: .76rem;
  border-top: 1px solid var(--border-soft, #e6dccb); color: color-mix(in srgb, currentColor 60%, transparent);
}
.search-modal__foot kbd {
  font: inherit; font-size: .7rem; padding: 1px 6px; margin-inline-end: 3px; border-radius: 5px;
  background: var(--surface-muted, #f3eadc); border: 1px solid var(--border-soft, #e6dccb);
}
.search-modal__all { margin-inline-start: auto; color: var(--primary-600, #6f3f1b); font-weight: 700; text-decoration: none; }
html[data-theme="dark"] .search-modal__all { color: var(--gold-400); }
.search-modal__all:hover { text-decoration: underline; }

/* results page */
.search-hero .page-hero__intro { max-width: 760px; }
.search-page-form { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.search-page-form input[type="search"] {
  flex: 1 1 280px; min-width: 0; padding: 13px 18px; border-radius: 12px; font: inherit; font-size: 1.02rem;
  background: rgba(255, 255, 255, .96); color: #2a1409; border: 2px solid transparent; outline: 0;
}
.search-page-form input[type="search"]:focus { border-color: var(--gold-500); }
.search-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.search-type {
  display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 999px; text-decoration: none; color: inherit;
  background: var(--surface-card, #fff); border: 1px solid var(--border-soft, #e6dccb); font-weight: 600; font-size: .92rem;
}
.search-type span { font-size: .76rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-muted, #f3eadc); }
.search-type:hover { border-color: var(--gold-500); }
.search-type.is-active { background: var(--walnut-800); border-color: var(--walnut-800); color: var(--gold-400); }
.search-type.is-active span { background: color-mix(in srgb, var(--gold-500) 22%, transparent); color: var(--gold-400); }
.search-results-section .search-group { margin-bottom: 34px; }
.search-group__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.search-group__header h2 { margin: 0; font-size: 1.3rem; }
.search-group__count { font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-muted, #f3eadc); margin-inline-start: 6px; }
.search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.search-card {
  display: flex; gap: 14px; align-items: flex-start; height: 100%; padding: 14px; border-radius: 14px; text-decoration: none; color: inherit;
  background: var(--surface-card, #fff); border: 1px solid var(--border-soft, #e6dccb);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.search-card:hover { border-color: var(--gold-500); transform: translateY(-2px); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--walnut-900) 60%, transparent); }
.search-card .search-card__thumb, .search-card .search-result__icon { width: 72px; height: 72px; }

@media (max-width: 560px) {
  .search-modal { padding-top: 4vh; }
  .search-modal__dialog { max-height: 88vh; border-radius: 14px; }
  .search-modal__foot span { display: none; }
  .search-trigger { width: 36px; height: 36px; }
  .search-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .search-card, .search-result { transition: none; } .search-card:hover { transform: none; } }

/* search: neutralise global input styling + dark-mode text colours */
.search-modal .search-modal__input {
  border: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 0; height: auto; width: auto;
  color: #2a1409 !important;
}
.search-modal__dialog { color: #2a1409; }
html[data-theme="dark"] .search-modal__dialog { color: #f3eadc; background: var(--surface-card, #1d1610); }
html[data-theme="dark"] .search-modal .search-modal__input { color: #f3eadc !important; }
html[data-theme="dark"] .search-modal mark, html[data-theme="dark"] .search-card mark { color: #fff; background: color-mix(in srgb, var(--gold-500) 32%, transparent); }
html[data-theme="dark"] .search-card, html[data-theme="dark"] .search-type { color: #f3eadc; }
html[data-theme="dark"] .search-result__icon { background-color: var(--walnut-700); }
.search-more { font-size: .88rem; font-weight: 700; text-decoration: none; color: var(--primary-600, #6f3f1b); padding: 6px 4px; }
.search-more:hover { text-decoration: underline; }
html[data-theme="dark"] .search-more { color: var(--gold-400); }
.pager__gap { padding: 0 6px; color: color-mix(in srgb, currentColor 55%, transparent); align-self: center; }
/* Phones: keep the copyright line clear of the floating scroll-top / share buttons */
@media (max-width: 768px) {
  body .site-footer .footer__bottom { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
}
