/* ==========================================================================
   pages.css — أنماط القوالب الفرعية (الخطوة 9). للضرورة فقط؛ الباقي من utilities.css.
   - .abugroon-pdf-frame: ارتفاع عارض PDF في صفحة الكتاب (لا يوجد class مكافئ في Tailwind المُجمَّع).
   ========================================================================== */
.abugroon-pdf-frame { height: 75vh; min-height: 480px; }

/* ==========================================================================
   مكوّنات عامة (الخطوة النهائية): واجهة "اضغط للتشغيل" للـ iframes، رابط التخطي، التركيز.
   ========================================================================== */
.abugroon-embed { position: relative; }
.abugroon-embed__btn {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  background: linear-gradient(to bottom, #173829, #0c1f17);
  color: #E0C172; font-size: 0.8125rem; font-weight: 700; border: 0; cursor: pointer;
  transition: filter 0.15s;
}
.abugroon-embed__btn:hover { filter: brightness(1.15); }
.abugroon-embed__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 9999px;
  border: 2px solid #C8A143; color: #C8A143; font-size: 1rem; padding-inline-start: 0.15rem;
}
.abugroon-embed noscript a { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #E0C172; background: #173829; }

.abugroon-skip {
  position: absolute; inset-inline-start: 0.5rem; top: -4rem; z-index: 100;
  background: #173829; color: #E0C172; padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 700;
  border: 1px solid #C8A143;
}
.abugroon-skip:focus { top: 0.5rem; }

a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid #C8A143; outline-offset: 2px; }

/* ==========================================================================
   روابط الفوتر: صف متوسّط، مسافات منتظمة، وفاصل ❖ ذهبي بين الروابط.
   ========================================================================== */
.abugroon-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.abugroon-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.25rem 0;
  color: #E5E7EB;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.abugroon-footer-link:hover { color: #D8B153; border-bottom-color: #C8A143; }
/* الفاصل بعد كل رابط عدا الأخير (جزء من الرابط لكنه غير قابل للضغط بصرياً) */
.abugroon-footer-nav > .abugroon-footer-link:not(:last-child)::after {
  content: "❖";
  color: #C8A143;
  font-size: 0.55rem;
  opacity: 0.85;
  pointer-events: none;
}
@media (max-width: 639px) {
  .abugroon-footer-nav { gap: 0.25rem 0.875rem; font-size: 0.75rem; }
  .abugroon-footer-link { gap: 0.875rem; }
}

/* ==========================================================================
   معرض الصور: فلتر السنوات + شبكة + نافذة العرض مع الوصف.
   ========================================================================== */
.abugroon-gallery-years { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.abugroon-gallery-year-btn {
  padding: 0.35rem 1rem; border-radius: 9999px; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
  background: #F8F5EE; color: #173829; border: 1px solid #E8DFC8; transition: background 0.15s, color 0.15s;
}
.abugroon-gallery-year-btn:hover { border-color: #C8A143; }
.abugroon-gallery-year-btn.is-active { background: #173829; color: #E0C172; border-color: #C8A143; }
.abugroon-gallery-section { margin-bottom: 2rem; }
.abugroon-gallery-section[hidden] { display: none; }
.abugroon-gallery-heading {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; padding-bottom: 0.5rem;
  font-family: 'Amiri', serif; font-size: 1.5rem; font-weight: 700; color: #173829; border-bottom: 1px solid #EBE4D5;
}
.abugroon-gallery-heading span {
  font-family: 'Cairo', sans-serif; font-size: 0.7rem; color: #8E6D24; background: #F8F5EE;
  border: 1px solid #E8DFC8; padding: 0.1rem 0.6rem; border-radius: 9999px;
}
.abugroon-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 640px) { .abugroon-gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 1024px) { .abugroon-gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.abugroon-gallery-item {
  position: relative; display: block; padding: 0; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3;
  border: 1px solid #E8DFC8; border-radius: 1rem; background: #F8F5EE; transition: transform 0.3s, box-shadow 0.3s;
}
.abugroon-gallery-item:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(23, 56, 41, 0.18); }
.abugroon-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.abugroon-gallery-caption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 1.5rem 0.75rem 0.5rem; text-align: start;
  font-size: 0.75rem; font-weight: 700; color: #fff; background: linear-gradient(to top, rgba(12, 31, 23, 0.85), transparent);
}

.abugroon-lightbox {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(12, 31, 23, 0.92);
}
.abugroon-lightbox[hidden] { display: none; }
.abugroon-lightbox__figure {
  display: flex; flex-direction: column; max-width: min(960px, 100%); max-height: 100%; margin: 0;
  background: #fff; border-radius: 1rem; overflow: hidden; border: 2px solid #C8A143;
}
.abugroon-lightbox__figure img { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto; object-fit: contain; background: #0c1f17; }
.abugroon-lightbox__figure figcaption { padding: 0.9rem 1.25rem 1.1rem; overflow-y: auto; color: #173829; }
.abugroon-lightbox__year { display: inline-block; margin-inline-end: 0.5rem; font-size: 0.75rem; font-weight: 700; color: #8E6D24; }
.abugroon-lightbox__title { font-family: 'Amiri', serif; font-size: 1.25rem; }
.abugroon-lightbox__desc { margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.9; color: #44403c; white-space: pre-line; }
.abugroon-lightbox__desc:empty, .abugroon-lightbox__year:empty, .abugroon-lightbox__title:empty { display: none; }
.abugroon-lightbox__close, .abugroon-lightbox__nav {
  position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
  width: 2.75rem; height: 2.75rem; border-radius: 9999px; font-size: 1.75rem; line-height: 1;
  color: #E0C172; background: rgba(23, 56, 41, 0.9); border: 1px solid #C8A143;
}
.abugroon-lightbox__close { top: 1rem; inset-inline-end: 1rem; }
.abugroon-lightbox__nav { top: 50%; transform: translateY(-50%); }
.abugroon-lightbox__nav--next { inset-inline-start: 1rem; }
.abugroon-lightbox__nav--prev { inset-inline-end: 1rem; }
@media (max-width: 639px) { .abugroon-lightbox__nav { top: auto; bottom: 1rem; transform: none; } }

/* ==========================================================================
   الهيرو (جوال/تابلت): النص فوق، والصورتان تحته جنباً إلى جنب (واحدة في كل جهة) بحجم أصغر.
   ========================================================================== */
@media (max-width: 1023px) {
  .abugroon-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .abugroon-hero-grid > :nth-child(2) { grid-column: 1 / -1; }
  .abugroon-hero-grid > div > .arch-frame { width: 9.5rem; height: 14rem; border-width: 3px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .abugroon-hero-grid > div > .arch-frame { width: 12rem; height: 17.5rem; }
}

/* ==========================================================================
   نافذة تشغيل الصوتيات (جوال): لوحة سفلية واسعة بمشغّل أكبر.
   ========================================================================== */
.abugroon-audio-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(12, 31, 23, 0.85);
}
.abugroon-audio-modal[hidden] { display: none; }
.abugroon-audio-modal__panel {
  position: relative; width: 100%; max-height: 92vh; overflow-y: auto; padding: 1.5rem 1rem 1.25rem;
  background: #FBF9F4; border: 2px solid #C8A143; border-bottom: 0; border-radius: 1.5rem 1.5rem 0 0;
}
.abugroon-audio-modal__close {
  position: absolute; top: 0.75rem; inset-inline-end: 0.75rem; width: 2.25rem; height: 2.25rem; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: #E0C172; background: #173829; font-weight: 700;
}
.abugroon-audio-modal__cat {
  display: inline-block; margin-bottom: 0.5rem; padding: 0.15rem 0.75rem; border-radius: 9999px;
  font-size: 0.6875rem; font-weight: 700; color: #E0C172; background: #173829; border: 1px solid rgba(200, 161, 67, 0.4);
}
.abugroon-audio-modal__cat:empty { display: none; }
.abugroon-audio-modal__title { margin: 0 0 0.4rem; padding-inline-end: 2.75rem; font-family: 'Amiri', serif; font-size: 1.35rem; font-weight: 700; line-height: 1.5; color: #173829; }
.abugroon-audio-modal__desc { margin-bottom: 0.9rem; font-size: 0.8125rem; line-height: 1.8; color: #57534e; }
.abugroon-audio-modal__desc:empty { display: none; }
.abugroon-audio-modal__player { height: min(56vh, 420px); min-height: 240px; border-radius: 0.75rem; overflow: hidden; background: #0c1f17; border: 1px solid #E8DFC8; }
.abugroon-audio-modal__player iframe { width: 100%; height: 100%; border: 0; }
.abugroon-audio-modal__download {
  display: block; margin-top: 0.9rem; padding: 0.65rem; text-align: center; border-radius: 0.75rem;
  font-size: 0.8125rem; font-weight: 700; color: #E0C172; background: #173829;
}
.abugroon-audio-modal__download[hidden] { display: none; }

/* ==========================================================================
   السلايدر (الصفحة الرئيسية): scroll-snap بدون مكتبات.
   ========================================================================== */
.abugroon-slider { position: relative; border-radius: 1.5rem; overflow: hidden; border: 2px solid #C8A143; background: #0c1f17; box-shadow: 0 10px 25px rgba(23, 56, 41, 0.18); }
.abugroon-slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.abugroon-slider__track::-webkit-scrollbar { display: none; }
.abugroon-slider__slide { position: relative; display: block; flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 16 / 7; }
.abugroon-slider__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.abugroon-slider__caption {
  position: absolute; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; gap: 0.15rem;
  padding: 2.5rem 1.25rem 2.25rem; color: #fff; background: linear-gradient(to top, rgba(12, 31, 23, 0.88), transparent);
}
.abugroon-slider__caption strong { font-family: 'Amiri', serif; font-size: 1.35rem; color: #E0C172; }
.abugroon-slider__caption span { font-size: 0.8125rem; line-height: 1.7; max-width: 42rem; }
.abugroon-slider__btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.6rem; line-height: 1;
  color: #E0C172; background: rgba(23, 56, 41, 0.85); border: 1px solid #C8A143;
}
.abugroon-slider__btn--next { inset-inline-start: 0.75rem; }
.abugroon-slider__btn--prev { inset-inline-end: 0.75rem; }
.abugroon-slider__dots { position: absolute; inset-inline: 0; bottom: 0.6rem; display: flex; justify-content: center; gap: 0.4rem; }
.abugroon-slider__dot { width: 0.55rem; height: 0.55rem; padding: 0; border-radius: 9999px; cursor: pointer; background: rgba(255, 255, 255, 0.5); border: 0; }
.abugroon-slider__dot.is-active { background: #C8A143; width: 1.4rem; }
@media (max-width: 767px) {
  .abugroon-slider { border-radius: 1rem; }
  .abugroon-slider__slide { aspect-ratio: 4 / 3; }
  .abugroon-slider__btn { display: none; }
  .abugroon-slider__caption { padding: 2rem 0.9rem 1.9rem; }
  .abugroon-slider__caption strong { font-size: 1.1rem; }
}

/* ==========================================================================
   المقالات: صورة البطاقة والصورة داخل المقال.
   ========================================================================== */
.abugroon-article-thumb { aspect-ratio: 16 / 9; background: rgba(23, 56, 41, 0.05); }
.abugroon-article-img { width: 100%; height: auto; display: block; }

/* القائمة (الهيدر والفوتر): تبدأ من اليمين (بداية السطر في RTL) على الشاشات المتوسطة فأكبر. */
@media (min-width: 768px) {
  #navbar-links { flex: 1 1 auto; justify-content: flex-start; }
  .abugroon-footer-nav { justify-content: flex-start; }
}
