/* ===== انتقال الصفحات — View Transitions API ===== */
@view-transition {
  navigation: auto;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateY(4deg) translateX(-18px);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) rotateY(0deg) translateX(0);
  }
}

@keyframes page-exit {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slide-out-left {
  from { transform: translateX(0);     opacity: 1;   }
  to   { transform: translateX(-100%); opacity: 0.6; }
}

@keyframes slide-in-from-right {
  from { transform: translateX(22%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

::view-transition-new(root) {
  animation: page-enter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root) {
  animation: page-exit 0.4s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root),
  ::view-transition-old(root) { animation: none; }
}

/* ===== إعادة التهيئة والقاعدة ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-family: 'Cairo', 'Amiri', sans-serif;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #FAFAF8;
  color: #2C1810;
  min-height: 100vh;
  overflow-x: hidden;
}

body.is-home {
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

/* ===== الصفحة الرئيسية — البطل ===== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* صورة الخلفية — بركة اللوتس عند الفجر */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: 0;
}

/* طبقة التدرج الدافئ فوق الصورة */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: background 0.4s ease;
  background: linear-gradient(
    to bottom,
    rgba(255, 245, 210, 0.68) 0%,
    rgba(255, 225, 160, 0.45) 25%,
    rgba(255, 200, 100, 0.28) 45%,
    rgba(180, 130,  60, 0.18) 65%,
    rgba( 60,  40,  10, 0.30) 100%
  );
}

/* كانفاس المؤثرات البصرية */
#lotus-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.hero-top {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(2.5rem, 5vh, 4rem);
  padding-bottom: 2.5rem;
  gap: 0.5rem;
}

.hero-brand {
  display: inline-block;
  position: relative;
  font-family: 'Cairo', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: #5a2800;
  text-decoration: none;
  margin-top: 0.4rem;
  transition: color 0.2s;
  animation: fade-up 0.7s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}

.hero-brand:hover {
  color: #3a1800;
}

/* الفاصل الذهبي */
.hero-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(200, 168, 75, 0.75);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  animation: fade-up 0.7s cubic-bezier(0.22,1,0.36,1) 0.7s both;
}

.hero-divider::before,
.hero-divider::after {
  content: '';
  width: clamp(28px, 3.5vw, 56px);
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(200, 168, 75, 0.65), transparent);
}


@keyframes title-shimmer {
  0%, 25%  { background-position: 250% center; }
  75%, 100% { background-position: -250% center; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(3.2rem, 7.5vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  margin-top: 0.25rem;
  background: linear-gradient(
    105deg,
    #8B3800 30%,
    #C86010 44%,
    #FF9820 50%,
    #C86010 56%,
    #8B3800 70%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-shimmer 10s ease-in-out 1.0s infinite, fade-up 0.7s cubic-bezier(0.22,1,0.36,1) 0.3s both;
}

.hero-subtitle {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700;
  color: rgba(80, 55, 5, 1);
  text-shadow: 0 1px 4px rgba(255, 240, 190, 0.5);
  text-align: center;
  animation: fade-up 0.7s cubic-bezier(0.22,1,0.36,1) 0.5s both;
}

.hero-subtitle-rule {
  width: clamp(140px, 35vw, 260px);
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(to right, transparent, rgba(120, 80, 10, 0.6), transparent);
  animation: fade-up 0.7s cubic-bezier(0.22,1,0.36,1) 0.6s both;
}

/* ===== اللوتس ===== */
.hero-lotus {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0;
}

@keyframes lotus-pulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(255, 170, 70, 0.30)); }
  50%       { filter: drop-shadow(0 0 55px rgba(255, 215, 120, 0.75)); }
}

.hero-lotus img {
  width: clamp(180px, 30vw, 300px);
  height: auto;
  animation: lotus-pulse 5s ease-in-out infinite;
  will-change: filter;
  mix-blend-mode: multiply;
}

/* ===== روابط الصفحة الرئيسية ===== */
.splash-links {
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(200px, 40vh, 360px);
  bottom: clamp(3rem, 6vh, 5rem);
  z-index: 11;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.splash-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cairo', sans-serif;
  font-size: clamp(0.9rem, 1.8vw, 1.25rem);
  font-weight: 600;
  color: rgba(255, 248, 228, 0.95);
  text-decoration: none;
  text-shadow:
    0 1px 4px rgba(15, 6, 0, 0.92),
    0 0 22px rgba(15, 6, 0, 0.72),
    0 2px 10px rgba(15, 6, 0, 0.55);
  background: transparent;
  padding: 0.65rem 1.4rem;
  width: min(22rem, 90vw);
  text-align: center;
  transition: color 0.2s, transform 0.2s, text-shadow 0.2s;
  white-space: normal;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}


.splash-link::before,
.splash-link::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 24px;
  height: 2px;
  background: rgba(255, 248, 228, 0.85);
  transform: translateY(-50%) scaleX(0);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.splash-link::before {
  right: calc(100% + 3px);
  transform-origin: right center;
}

.splash-link::after {
  left: calc(100% + 3px);
  transform-origin: left center;
}

@media (hover: hover) {
  .splash-link:hover::before,
  .splash-link:hover::after {
    transform: translateY(-50%) scaleX(1);
  }
}

.splash-link.is-tapped::before,
.splash-link.is-tapped::after {
  transform: translateY(-50%) scaleX(1);
}

.splash-link:hover {
  color: #fff;
  transform: translateY(-3px);
  text-shadow:
    0 0 18px rgba(255, 210, 100, 0.75),
    0 1px 4px rgba(15, 6, 0, 0.8);
}

/* تأخير الظهور لكل رابط */
.splash-pos-0 { animation: fade-up 0.6s cubic-bezier(0.22,1,0.36,1) 0.85s both; }
.splash-pos-1 { animation: fade-up 0.6s cubic-bezier(0.22,1,0.36,1) 1.00s both; }
.splash-pos-2 { animation: fade-up 0.6s cubic-bezier(0.22,1,0.36,1) 1.15s both; }
.splash-pos-3 { animation: fade-up 0.6s cubic-bezier(0.22,1,0.36,1) 1.30s both; }
.splash-pos-4 { animation: fade-up 0.6s cubic-bezier(0.22,1,0.36,1) 1.45s both; }
.splash-pos-5 { animation: fade-up 0.6s cubic-bezier(0.22,1,0.36,1) 1.60s both; }

/* الشاشات الكبيرة: عمودان عائمان */
@media (min-width: 1024px) {
  .splash-links {
    top: 0;
    bottom: 0;
    justify-content: unset;
    gap: 0;
  }
  .splash-link {
    position: absolute;
    width: 20rem;
    white-space: nowrap;
  }
  .splash-link:nth-child(1) { right: 18%; top: 50%; }
  .splash-link:nth-child(2) { right: 18%; top: 63%; }
  .splash-link:nth-child(3) { right: 18%; top: 76%; }
  .splash-link:nth-child(4) { left: 18%; top: 50%; }
  .splash-link:nth-child(5) { left: 18%; top: 63%; }
  .splash-link:nth-child(6) { left: 18%; top: 76%; }
}

/* ===== تذييل الصفحة الرئيسية ===== */
/* Homepage dark mode toggle */
.home-dark-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  width: 38px;
  height: 38px;
  background: rgba(255, 248, 228, 0.14);
  border: 1px solid rgba(255, 248, 228, 0.35);
  border-radius: 50%;
  color: rgba(255, 248, 228, 0.92);
  cursor: pointer;
  z-index: 50;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.home-dark-btn svg {
  width: 16px;
  height: 16px;
  position: absolute;
  transition: opacity 0.2s;
}
@media (hover: hover) {
  .home-dark-btn:hover {
    background: rgba(255, 248, 228, 0.16);
    color: rgba(255, 248, 228, 1);
  }
}

.hero-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  font-family: 'Cairo', sans-serif;
  font-size: 0.72rem;
  color: rgba(255, 235, 190, 0.75);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
  z-index: 20;
  letter-spacing: 0.02em;
}

/* الهاتف والتابلت */
@media (max-width: 900px) {
  .hero-top {
    padding-bottom: 0.75rem;
  }
  .hero-bg {
    object-position: center 45%;
  }
  .splash-links {
    top: clamp(220px, 40vh, 320px);
  }
}

/* ===== شريط تقدم القراءة ===== */
#reading-progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  width: 0%;
  height: 1px;
  background: linear-gradient(to left, #C8A84B, #E8C86A);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ===== صفحة المقال ===== */
.article-page {
  background: rgba(252, 248, 238, 0.94);
  min-height: 100vh;
  position: relative;
}

.article-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/images/hero-bg.jpg') center 20% / cover no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
@media (pointer: coarse) {
  .article-page::before { display: none; }
}

.article-page > * {
  position: relative;
  z-index: 1;
}

.article-header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0);
  transform: translateY(0);
  transition: box-shadow 0.3s ease, transform 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-header-bar.is-hidden {
  transform: translateY(-110%);
}
.article-header-bar.is-scrolled {
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.07), 0 1px 0 rgba(200, 168, 75, 0.15);
}
.a11y-dark .article-header-bar {
  background: rgba(21, 14, 8, 0.9);
}
.a11y-dark .article-header-bar.is-scrolled {
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(200, 168, 75, 0.1);
}

.gold-bar {
  height: 3px;
  background: linear-gradient(to left, #C8A84B, #E8C86A, #C8A84B);
  width: 100%;
}

.article-nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.back-link {
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  color: #8B5E3C;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
  min-height: 44px;
  padding: 0.5rem 0;
  flex-shrink: 0;
}

.article-header {
  max-width: 680px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
}

.article-title {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  color: #2C1810;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-subtitle {
  font-family: 'Amiri', serif;
  font-size: 1.35rem;
  color: #8B6014;
  margin-top: 0.6rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.article-meta {
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  color: #888;
  margin-bottom: 2rem;
}

.meta-author-link {
  color: inherit;
  text-decoration: none;
}

/* ===== صفحة دارشمس ===== */
.darshams-page {
  background: #FAFAF8;
  position: relative;
}

.darshams-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/images/hero-bg.jpg') center 20% / cover no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.darshams-page > * {
  position: relative;
  z-index: 1;
}

.darshams-header {
  padding-top: 2rem;
}

.darshams-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #C8A84B;
  margin-bottom: 1.25rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.darshams-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem) !important;
}

.darshams-tagline {
  font-family: 'Amiri', serif;
  font-size: 1rem;
  font-style: italic;
  color: #C8A84B;
  margin-top: 0.4rem;
  margin-bottom: 1rem;
}

@media (hover: hover) {
  .meta-author-link:hover { color: #C8A84B; }
}

.article-divider {
  max-width: 680px;
  margin: 0 auto;
  border: none;
  border-top: 1px solid #E8E0D8;
}

.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  font-family: 'Amiri', serif;
  font-size: 1.45rem;
  line-height: 2.1;
  color: #2C1810;
  overflow-x: hidden;
}

.article-body p {
  margin-bottom: 1.6em;
  text-align: justify;
}

.article-body figure {
  float: left;
  width: 38%;
  max-width: 240px;
  margin: 0.25em 1.75em 1em 0;
}

.article-body figure img {
  float: none;
  width: 100%;
  max-width: none;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0;
}

.article-body figcaption {
  font-family: 'Amiri', serif;
  font-size: 0.82rem;
  color: #8a7560;
  text-align: center;
  margin-top: 0.35em;
  font-style: italic;
  line-height: 1.4;
}

/* fallback for any img not inside a figure */
.article-body img {
  float: left;
  width: 38%;
  max-width: 240px;
  height: auto;
  border-radius: 8px;
  margin: 0.25em 1.75em 1em 0;
}

@media (max-width: 600px) {
  .article-body figure,
  .article-body img {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0.5em 0 1em;
  }
}

.article-body h2 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #2C1810;
  margin: 2em 0 0.75em;
}

.article-body strong {
  font-weight: 700;
  color: #1a0e08;
}

.article-body h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2C1810;
  margin: 1.75em 0 0.6em;
}

.article-body h4 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #4a2c10;
  margin: 1.5em 0 0.5em;
}

.article-body blockquote {
  margin: 2em 0;
  padding: 0.75em 1.25em;
  border-right: 3px solid #C8A84B;
  background: rgba(200, 168, 75, 0.06);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #5a3a18;
}

.article-body blockquote p {
  margin-bottom: 0;
}

.article-body ul,
.article-body ol {
  padding-right: 1.75em;
  padding-left: 0;
  margin-bottom: 1.6em;
}

.article-body ul {
  list-style: none;
  padding-right: 1.5em;
}

.article-body ul li {
  position: relative;
  padding-right: 1.25em;
}

.article-body ul li::before {
  content: '◆';
  position: absolute;
  right: 0;
  top: 0.55em;
  font-size: 0.45em;
  color: #C8A84B;
  line-height: 1;
}

.article-body ol {
  list-style-type: decimal;
}

.article-body li {
  margin-bottom: 0.3em;
  line-height: 1.6;
}

.article-body a {
  color: #a07830;
  text-decoration: underline;
  text-decoration-color: rgba(200, 168, 75, 0.4);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.article-body a:visited {
  color: #8a6828;
  text-decoration-color: rgba(200, 168, 75, 0.3);
}

.article-body a:hover {
  color: #C8A84B;
  text-decoration-color: #C8A84B;
}

.article-body code {
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  background: rgba(200, 168, 75, 0.1);
  border: 1px solid rgba(200, 168, 75, 0.2);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: #7a4a10;
}

.article-body pre {
  background: #1e1208;
  border-radius: 10px;
  padding: 1.25em 1.5em;
  overflow-x: auto;
  margin-bottom: 1.6em;
  border: 1px solid rgba(200, 168, 75, 0.15);
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e8d4a0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.article-body hr {
  border: none;
  border-top: 1px solid #E8E0D8;
  margin: 2.5em auto;
  width: 60%;
}

.article-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.6em;
  font-size: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body th,
.article-body td {
  padding: 0.65em 0.9em;
  border: 1px solid #E8E0D8;
  text-align: right;
}

.article-body th {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  background: rgba(200, 168, 75, 0.08);
  color: #2C1810;
}

/* ===== التنقل بين المقالات ===== */
.article-pagination {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.pagination-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #E8E0D8;
  background: #fafaf8;
  transition: border-color 0.2s, background 0.2s;
  max-width: 48%;
}

.pagination-link:hover {
  border-color: #C8A84B;
  background: #fffdf7;
}

.pagination-label {
  font-family: 'Cairo', sans-serif;
  font-size: 0.72rem;
  color: #C8A84B;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pagination-title {
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  color: #2C1810;
  font-weight: 600;
  line-height: 1.4;
}

.pagination-prev { text-align: left; }
.pagination-next { text-align: right; }

/* ===== زر المشاركة ===== */
.article-share {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #C8A84B;
  background: transparent;
  border: 1px solid rgba(200,168,75,0.35);
  border-radius: 50px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.share-btn svg {
  width: 15px;
  height: 15px;
}

@media (hover: hover) {
  .share-btn:hover {
    background: rgba(200,168,75,0.08);
    border-color: #C8A84B;
  }
}

.share-copied {
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  color: #C8A84B;
}

.article-footer {
  text-align: center;
  padding: 2rem;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  color: #ccc;
  border-top: 1px solid #E8E0D8;
}

.article-footer a {
  color: #C8A84B;
  text-decoration: none;
}

/* ===== زر العودة للأعلى ===== */
.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(200, 168, 75, 0.45);
  background: rgba(20, 10, 5, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 235, 190, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s, background 0.2s, border-color 0.2s;
  z-index: 200;
}

.scroll-top-btn--visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: rgba(200, 168, 75, 0.2);
  border-color: rgba(200, 168, 75, 0.7);
  color: #fff;
}

.scroll-top-tooltip {
  position: fixed;
  bottom: calc(1.5rem + 44px + 8px);
  left: 1.5rem;
  background: rgba(20, 10, 5, 0.82);
  color: rgba(255, 235, 190, 0.95);
  font-family: 'Cairo', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  letter-spacing: 0.02em;
  z-index: 201;
}

@media (hover: hover) {
  .scroll-top-btn:hover .scroll-top-tooltip {
    opacity: 1;
  }
}

.scroll-top-btn svg {
  width: 20px;
  height: 20px;
}

.a11y-dark .scroll-top-btn {
  background: rgba(10, 5, 0, 0.75);
  border-color: rgba(200, 168, 75, 0.35);
}

/* ===== صفحة القائمة ===== */
.list-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.list-title {
  font-family: 'Cairo', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #2C1810;
  margin-bottom: 2rem;
  text-align: center;
}

.post-list {
  list-style: none;
}

.post-item {
  border-bottom: 1px solid #E8E0D8;
  padding: 1.5rem 0;
}

.post-item:last-child {
  border-bottom: none;
}

.post-link {
  font-family: 'Cairo', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2C1810;
  text-decoration: none;
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0.25rem;
}

.post-date {
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  color: #bbb;
}

/* ===== استجابة الشاشة ===== */

/* تأثيرات التمرير للأجهزة التي تدعم المؤشر فقط */
@media (hover: hover) {
  .back-link:hover     { color: #C8A84B; }
  .post-link:hover     { color: #C8A84B; }
  .article-footer a:hover { text-decoration: underline; }
}

/* الأجهزة اللوحية والهواتف الكبيرة */
@media (max-width: 768px) {
  .hero-top {
    padding-top: 2rem;
  }
  .article-body {
    font-size: 1.15rem;
    padding: 2rem 1.25rem 4rem;
  }
  .article-subtitle {
    font-size: 1.15rem;
  }
  .article-header {
    margin-top: 2rem;
    padding: 0 1.25rem;
  }
  .article-nav {
    padding: 1rem 1.25rem 0;
  }
}

/* الهواتف — أزرار التحكم أصغر */
@media (max-width: 768px) {
  .article-nav { max-width: 100%; }
  .a11y-font-btns button { width: 26px; height: 26px; font-size: 1rem; }
  .a11y-dark-track { width: 26px; height: 26px; }
  .a11y-dark-track svg { width: 14px; height: 14px; }
  .a11y-dark-toggle { padding-right: 0.3rem; margin-right: 0.2rem; }
  .hl-nav-btn { display: none; }
  .article-nav-end { gap: 0; }
}

/* الهواتف المتوسطة */
@media (max-width: 480px) {
  .a11y-font-btns { display: none; }
  .a11y-dark-toggle { border-right: none; padding-right: 0; margin-right: 0; }
  .hero-top {
    padding-top: 1.25rem;
    gap: 0.2rem;
  }
  .hero-lotus {
    padding: 0.75rem 0;
  }
  .hero-lotus img {
    width: clamp(130px, 42vw, 180px);
  }
  .article-nav {
    padding: 0.75rem 1rem 0;
  }
  .article-header {
    margin-top: 1.25rem;
    padding: 0 1rem;
  }
  .article-title {
    font-size: clamp(1.45rem, 6vw, 2rem);
    line-height: 1.35;
    margin-bottom: 0.75rem;
  }
  .article-subtitle {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
  .article-meta {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  .article-body {
    font-size: 1.05rem;
    line-height: 1.95;
    padding: 1.5rem 1rem 3rem;
  }
  .article-body h2 {
    font-size: 1.25rem;
    margin: 1.75em 0 0.6em;
  }
  .article-body h3 {
    font-size: 1.1rem;
    margin: 1.5em 0 0.5em;
  }
  .article-body h4 {
    font-size: 1rem;
  }
  .article-body p {
    margin-bottom: 1.3em;
  }
  .article-divider {
    margin: 0 1rem;
    max-width: none;
  }
  .list-page {
    padding: 2rem 1rem;
  }
  .list-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .post-link {
    font-size: 1.05rem;
  }
  .hero-footer {
    font-size: 0.7rem;
    padding: 1rem 0.75rem;
  }
}

/* الهواتف الصغيرة */
@media (max-width: 360px) {
  .hero-top {
    padding-top: 1rem;
    gap: 0.15rem;
  }
  .hero-lotus {
    padding: 0.5rem 0;
  }
  .hero-lotus img {
    width: clamp(110px, 36vw, 150px);
  }
  .article-body {
    font-size: 0.95rem;
    line-height: 1.9;
    padding: 1.25rem 0.875rem 2.5rem;
  }
  .article-title {
    font-size: clamp(1.3rem, 7vw, 1.75rem);
  }
  .article-subtitle {
    font-size: 0.95rem;
  }
}

/* إيقاف الحركة لمن يفضلها محدودة */
@media (prefers-reduced-motion: reduce) {
  .hero-lotus img  { animation: none; }
  .hero-title      { animation: none; background: none; -webkit-text-fill-color: #8B3800; color: #8B3800; }
  .hero-subtitle, .hero-subtitle-rule, .hero-brand, .hero-divider,
  .splash-pos-0, .splash-pos-1, .splash-pos-2,
  .splash-pos-3, .splash-pos-4, .splash-pos-5 { animation: none; }
}

/* ===== شريط إمكانية الوصول ===== */
.a11y-bar {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: 'Cairo', sans-serif;
}

.a11y-font-btns {
  display: flex;
  align-items: center;
  gap: 0;
}

.a11y-font-label {
  display: none;
}

.a11y-font-btns button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #999;
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.a11y-size-icon { font-family: 'Amiri', serif; font-weight: 700; line-height: 1; display: block; }
.a11y-size-sm   { font-size: 0.78rem; }
.a11y-size-lg   { font-size: 1.2rem; }

#a11y-font-reset {
  font-size: 1.05rem;
  font-weight: 500;
  font-family: serif;
  color: #aaa;
}

@media (hover: hover) {
  .a11y-font-btns button:hover { color: #C8A84B; background: rgba(200,168,75,0.08); }
}

/* زر الوضع الداكن */
.a11y-dark-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  border-right: 1px solid #E8E0D8;
  padding-right: 0.45rem;
  margin-right: 0.3rem;
}

.a11y-dark-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.a11y-dark-track {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  color: #bbb;
  position: relative;
}

.a11y-dark-track svg {
  width: 17px;
  height: 17px;
  position: absolute;
  transition: opacity 0.2s;
}

.icon-sunrise { opacity: 0; }
.icon-sunset  { opacity: 1; }

.a11y-dark-toggle input:checked + .a11y-dark-track {
  color: #C8A84B;
  background: rgba(200,168,75,0.08);
}

.a11y-dark-toggle input:checked + .a11y-dark-track .icon-sunset  { opacity: 0; }
.a11y-dark-toggle input:checked + .a11y-dark-track .icon-sunrise { opacity: 1; }

@media (hover: hover) {
  .a11y-dark-track:hover { color: #C8A84B; background: rgba(200,168,75,0.08); }
}

/* الوضع الداكن — الصفحة الرئيسية */
.a11y-dark .hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(2, 1, 0, 0.78) 0%,
    rgba(8, 4, 1, 0.65) 40%,
    rgba(20, 10, 2, 0.55) 70%,
    rgba(5, 2, 0, 0.75) 100%
  );
  transition: background 0.5s ease;
}
.a11y-dark .hero-brand    { color: rgba(200, 168, 75, 0.85); }
.a11y-dark .hero-title    { color: rgba(255, 230, 170, 0.95); -webkit-text-fill-color: rgba(255, 230, 170, 0.95); }
.a11y-dark .hero-subtitle { color: rgba(180, 148, 65, 0.85); }
.a11y-dark .hero-divider  { color: rgba(180, 148, 65, 0.65); }
.a11y-dark .hero-footer   { color: rgba(130, 100, 55, 0.65); }

/* الوضع الداكن */
.a11y-dark .article-page      { background: #150e08; }
.a11y-dark .article-page::before { opacity: 0.05; }
.a11y-dark .article-body      { color: #EDE0C4; }
.a11y-dark .article-body h2   { color: #E8C86A; }
.a11y-dark .article-body h3   { color: #D4B870; }
.a11y-dark .article-body h4   { color: #B89850; }
.a11y-dark .article-body strong { color: #F2E4C0; }
.a11y-dark .article-body blockquote { background: rgba(200,168,75,0.08); color: #c4a870; }
.a11y-dark .article-body ul li::before { color: #D4A84B; }
.a11y-dark .article-body a         { color: #D4A84B; text-decoration-color: rgba(212,168,75,0.4); }
.a11y-dark .article-body a:visited { color: #b89040; text-decoration-color: rgba(184,144,64,0.35); }
.a11y-dark .article-body a:hover   { color: #E8C86A; text-decoration-color: #E8C86A; }
.a11y-dark .article-body code { background: rgba(200,168,75,0.12); border-color: rgba(200,168,75,0.2); color: #D4A860; }
.a11y-dark .article-body hr   { border-color: rgba(200,168,75,0.15); }
.a11y-dark .article-body th   { background: rgba(200,168,75,0.1); color: #EDE0C4; }
.a11y-dark .article-body td   { border-color: rgba(200,168,75,0.15); }
.a11y-dark .article-body th   { border-color: rgba(200,168,75,0.2); }
.a11y-dark .article-title     { color: #E8D4A0; }
.a11y-dark .article-subtitle  { color: #C8A84B; }
.a11y-dark .article-meta      { color: #6a6a6a; }
.a11y-dark .back-link         { color: #7a6050; }
.a11y-dark .article-divider   { border-color: rgba(200,168,75,0.18); }
.a11y-dark .article-footer    { color: #505050; border-color: rgba(200,168,75,0.12); }
.a11y-dark .gold-bar          { opacity: 0.6; }
.a11y-dark .a11y-font-btns button { color: #666; }
.a11y-dark #a11y-font-reset       { color: #555; }
.a11y-dark .a11y-dark-toggle      { border-right-color: rgba(255,255,255,0.1); }

/* Dark mode: white on hover for all links and icons */
@media (hover: hover) {
  .a11y-dark .back-link:hover                    { color: #fff; }
  .a11y-dark .post-link:hover                    { color: #fff; }
  .a11y-dark .article-body a:hover               { color: #E8C86A; text-decoration-color: #E8C86A; }
  .a11y-dark .article-footer a:hover             { color: #fff; }
  .a11y-dark .meta-author-link:hover             { color: #fff; }
  .a11y-dark .a11y-font-btns button:hover        { color: #fff; background: rgba(255,255,255,0.07); }
  .a11y-dark .a11y-dark-track:hover              { color: #fff; background: rgba(255,255,255,0.07); }
  .a11y-dark .share-btn:hover                    { color: #fff; border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.05); }
  .a11y-dark .scroll-top-btn:hover               { color: #fff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); }
}

/* Next article link */
.next-article {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  border-top: 1px solid rgba(200,168,75,0.15);
  text-align: left;
}
.next-article-link {
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #8B5E3C;
  text-decoration: none;
}
.next-article-link:hover { color: #5a3a1a; }
.a11y-dark .next-article { border-top-color: rgba(200,168,75,0.1); }
.a11y-dark .next-article-link { color: #7a6050; }
.a11y-dark .next-article-link:hover { color: #E8C86A; }

/* Article closing mark */
.article-end {
  text-align: center;
  color: #C8A84B;
  font-size: 1.1rem;
  letter-spacing: 0.6rem;
  margin-top: 3rem;
  opacity: 0.55;
  user-select: none;
}
.a11y-dark .article-end { color: #D4A84B; opacity: 0.4; }

/* Pull-quote copy tooltip */
.pull-quote-tooltip {
  position: absolute;
  transform: translateX(-50%);
  background: rgba(42, 28, 12, 0.93);
  color: rgba(255, 248, 228, 0.95);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  z-index: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.pull-quote-tooltip.pq-visible {
  opacity: 1;
  pointer-events: auto;
}
.pull-quote-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(42, 28, 12, 0.93);
}
.pull-quote-copy {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.pull-quote-copy:hover { color: #E8C86A; }
.a11y-dark .pull-quote-tooltip { background: rgba(20, 12, 4, 0.96); }

.a11y-contrast .article-body  { color: #0a0604 !important; }
.a11y-contrast .article-page  { background: #fdfaf5 !important; }
.a11y-contrast .article-title    { color: #0a0604 !important; }
.a11y-contrast .article-subtitle { color: #5a3a00 !important; }
.a11y-contrast .article-meta     { color: #555 !important; }

/* ===== Heading anchor links ===== */
.heading-anchor {
  opacity: 0;
  margin-inline-start: 0.45rem;
  color: #C8A84B;
  text-decoration: none;
  font-size: 0.6em;
  transition: opacity 0.15s;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}
.article-body h2:hover .heading-anchor,
.article-body h3:hover .heading-anchor { opacity: 0.55; }
.heading-anchor:hover { opacity: 1 !important; color: #E8C86A; }
.a11y-dark .heading-anchor { color: #C8A84B; }

/* ===== Pull-quote tooltip — two icon buttons ===== */
.pull-quote-tooltip { display: flex; align-items: center; gap: 0.05rem; padding: 0.28rem 0.5rem; }
.pq-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 248, 228, 0.2);
  margin: 0 0.1rem;
  flex-shrink: 0;
}
.pull-quote-copy { gap: 0; padding: 0.18rem 0.22rem; }
.pull-quote-save {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.18rem 0.22rem;
  border-radius: 3px;
  -webkit-tap-highlight-color: transparent;
}
.pull-quote-save:hover { color: #E8C86A; }
.pull-quote-copy.pq-copied svg { stroke: #7dd67d; }

/* ===== Saved highlight mark ===== */
.saved-highlight {
  background: rgba(255, 236, 59, 0.52);
  border-radius: 2px;
  padding: 0 1px;
}
.a11y-dark .saved-highlight { background: rgba(255, 220, 30, 0.25); }
@keyframes hl-flash-anim {
  0%   { background: rgba(255, 236, 59, 0.35); }
  35%  { background: rgba(255, 236, 59, 0.78); }
  100% { background: rgba(255, 236, 59, 0.52); }
}
.saved-highlight.hl-flash { animation: hl-flash-anim 1.4s ease-out forwards; }

/* ===== Bookmark nav button ===== */
.article-nav-end { display: flex; align-items: center; gap: 0.1rem; }
.hl-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #bbb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, color 0.15s, background 0.15s;
}
.hl-nav-btn.hl-has-marks {
  opacity: 1;
  pointer-events: auto;
  color: #C8A84B;
}
@media (hover: hover) {
  .hl-nav-btn:hover { color: #E8C86A; background: rgba(200, 168, 75, 0.08); }
}
.a11y-dark .hl-nav-btn.hl-has-marks { color: #D4A84B; }

/* ===== Highlights overlay ===== */
.hl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 800;
  pointer-events: none;
  transition: background 0.3s;
}
.hl-overlay.hl-open { background: rgba(0, 0, 0, 0.35); pointer-events: auto; }

/* ===== Highlights drawer ===== */
.hl-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 320px;
  max-width: 90vw;
  background: #fdf8f0;
  border-left: 1px solid rgba(200, 168, 75, 0.22);
  box-shadow: -4px 0 28px rgba(0, 0, 0, 0.1);
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hl-drawer.hl-open { transform: translateX(0); }
.a11y-dark .hl-drawer {
  background: #1a1008;
  border-left-color: rgba(200, 168, 75, 0.18);
  box-shadow: -4px 0 28px rgba(0, 0, 0, 0.5);
}
.hl-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(200, 168, 75, 0.18);
  flex-shrink: 0;
  direction: rtl;
}
.hl-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Cairo', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #3a2a0a;
}
.a11y-dark .hl-drawer-title { color: #e8d5a3; }
.hl-drawer-title svg { color: #C8A84B; flex-shrink: 0; }
.hl-head-actions { display: flex; align-items: center; gap: 0.3rem; }
.hl-clear-btn {
  background: none;
  border: 1px solid rgba(200, 168, 75, 0.35);
  color: #999;
  font-family: 'Cairo', sans-serif;
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hl-clear-btn:hover { border-color: #C8A84B; color: #C8A84B; }
.hl-close-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  padding: 0;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hl-close-btn:hover { color: #3a2a0a; background: rgba(0, 0, 0, 0.06); }
.a11y-dark .hl-close-btn { color: #888; }
.a11y-dark .hl-close-btn:hover { color: #e8d5a3; background: rgba(255, 255, 255, 0.07); }
.hl-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  direction: rtl;
}
.hl-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(200, 168, 75, 0.07);
  border: 1px solid rgba(200, 168, 75, 0.16);
  border-right: 3px solid rgba(200, 168, 75, 0.45);
  border-radius: 5px;
  padding: 0.55rem 0.55rem 0.55rem 0.4rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: right;
}
.hl-item:hover {
  background: rgba(200, 168, 75, 0.13);
  border-right-color: #C8A84B;
}
.a11y-dark .hl-item { background: rgba(200, 168, 75, 0.05); border-color: rgba(200, 168, 75, 0.12); border-right-color: rgba(200, 168, 75, 0.4); }
.a11y-dark .hl-item:hover { background: rgba(200, 168, 75, 0.1); }
.hl-item-text {
  font-family: 'Amiri', serif;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #3a2a0a;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.a11y-dark .hl-item-text { color: #d4b97a; }
.hl-item-content { display: flex; flex-direction: column; gap: 0.18rem; flex: 1; min-width: 0; }
.hl-item-meta {
  font-family: 'Cairo', sans-serif;
  font-size: 0.68rem;
  color: #C8A84B;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.a11y-dark .hl-item-meta { opacity: 0.6; }
.hl-remove-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  margin-top: 2px;
  -webkit-tap-highlight-color: transparent;
}
.hl-remove-btn:hover { color: #c0392b; background: rgba(192, 57, 43, 0.08); }
.hl-empty {
  display: none;
  text-align: center;
  color: #bbb;
  font-family: 'Cairo', sans-serif;
  font-size: 0.84rem;
  padding: 2.5rem 1rem;
  direction: rtl;
}
.hl-empty.hl-visible { display: block; }
.a11y-dark .hl-empty { color: #555; }

/* ===== Mobile: slightly larger base font for readability ===== */
@media (max-width: 600px) {
  .article-body {
    font-size: 1.08rem;
    line-height: 1.88;
  }
  .article-body h2 { font-size: 1.25rem; }
  .article-body h3 { font-size: 1.05rem; }
  .article-body blockquote { font-size: 1.1rem; }
}

/* ===== Search overlay ===== */
.hero-search-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hero-search-btn:hover { opacity: 1; }
.hero-footer-sep { margin: 0 0.3em; }

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(60px, 13vh, 150px);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
@media (pointer: coarse) {
  .search-overlay {
    padding-top: 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    align-items: flex-start;
  }
  .search-box {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 14px;
  }
  .search-results {
    max-height: 52vh;
  }
  .search-hint {
    display: none;
  }
  .search-esc-hint {
    display: none;
  }
  .search-input {
    font-size: 1rem;
  }
  .srch-title {
    font-size: 0.9rem;
  }
  .srch-snip {
    font-size: 0.82rem;
  }
}
.search-overlay.search-open {
  opacity: 1;
  pointer-events: auto;
}
.search-box {
  width: 100%;
  max-width: 580px;
  margin: 0 1rem;
  background: #1c1812;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0,0,0,0.55), 0 4px 18px rgba(0,0,0,0.3);
  border: 1px solid rgba(200,168,75,0.14);
  transform: scale(0.96) translateY(-6px);
  transition: transform 0.18s cubic-bezier(0.22,1,0.36,1);
}
.search-overlay.search-open .search-box {
  transform: scale(1) translateY(0);
}
.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.search-input-wrap > svg { flex-shrink: 0; color: rgba(245,230,192,0.3); }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  color: #f5e6c0;
  padding: 1rem 0;
  caret-color: #C8A84B;
  direction: rtl;
}
.search-input::placeholder { color: rgba(245,230,192,0.28); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-esc-hint {
  background: rgba(255,255,255,0.07);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.7rem;
  color: rgba(245,230,192,0.3);
  font-family: monospace;
  flex-shrink: 0;
}
.search-results {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.srch-item {
  display: block;
  padding: 0.8rem 1.2rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
  cursor: pointer;
}
.srch-item:last-child { border-bottom: none; }
.srch-item:hover,
.srch-item.srch-active { background: rgba(200,168,75,0.1); }
.srch-title {
  font-family: 'Cairo', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #f5e6c0;
  margin-bottom: 0.22rem;
}
.srch-snip {
  font-family: 'Amiri', serif;
  font-size: 0.87rem;
  color: rgba(245,230,192,0.45);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.srch-hl {
  background: rgba(200,168,75,0.3);
  color: #E8C86A;
  border-radius: 2px;
  padding: 0 1px;
}
.srch-empty {
  padding: 1.6rem;
  text-align: center;
  font-family: 'Cairo', sans-serif;
  color: rgba(245,230,192,0.35);
  font-size: 0.92rem;
}
.search-hint {
  padding: 0.55rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Cairo', sans-serif;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.18);
  direction: rtl;
}
.search-hint kbd {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
}
