﻿/* ==========================================================================
   موقع أ.د. ندى الموسوي — التصميم الجديد
   المقاسات (Mobile first):
     موبايل صغير      : حتى 375px   (الأساس)
     موبايل كبير      : 376px  - 575px
     تابلت            : 576px  - 991px
     لابتوب صغير      : 992px  - 1199px
     لابتوب كبير      : 1200px - 1439px
     شاشات كبيرة      : 1440px فأكثر
   ========================================================================== */

/* الألوان مسحوبة من صورة التصميم (اللون الغالب في كل منطقة) */
:root {
    --navy-900: #0c1c28;   /* الفوتر */
    --navy-800: #10202f;   /* الهيدر */
    --navy-700: #1a2c3c;   /* شريط الاقتباس */
    --navy-600: #243b4d;
    --gold-600: #b08040;   /* دهبي غامق: نصوص وأيقونات على الخلفية الفاتحة + زر الإرسال */
    --gold-500: #e0b068;   /* دهبي أساسي: الزر النشط في المنيو */
    --gold-400: #e8b86c;   /* زر "تعرّف على الدكتورة" */
    --gold-300: #ecd2a8;
    --gold-100: #f6ead6;
    --cream: #f8f0e8;      /* خلفية الصفحة */
    --cream-2: #fbf6f0;
    --paper: #fdf8f2;      /* الكروت */
    --chip: #f4e8e0;       /* التابات غير النشطة */
    --ink: #1c2530;
    --ink-2: #4f5866;
    --ink-3: #8a8f99;
    --line: #ecdfd2;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 6px 24px rgba(20, 35, 56, .08);
    --shadow-lg: 0 14px 40px rgba(20, 35, 56, .14);
    --container: 1180px;
    --gutter: 16px;
    --font-body: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --font-head: 'Amiri', 'Tajawal', serif;
}

/* ---------- أساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.8;
    color: var(--ink);
    background: var(--cream);
    direction: rtl;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-600); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.35; margin: 0; color: var(--navy-800); }
p { margin: 0; }
button { font-family: inherit; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

/* ---------- أيقونات SVG ---------- */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: middle; flex: none; }

/* ---------- أزرار ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: 14px;
    border: 1.5px solid transparent; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.btn-gold { background: linear-gradient(180deg, #f0c078, var(--gold-400)); color: var(--navy-900); }
.btn-gold:hover { color: var(--navy-900); filter: brightness(1.05); box-shadow: 0 6px 18px rgba(224,176,104,.4); }
.btn-outline-light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline-light:hover { border-color: var(--gold-400); color: var(--gold-400); }
.btn-outline-gold { border-color: var(--gold-600); color: var(--gold-600); background: transparent; }
.btn-outline-gold:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }

/* ==========================================================================
   الهيدر
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--navy-800); box-shadow: 0 2px 14px rgba(0,0,0,.18); }
.site-header .container { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: none; }
.brand:hover { color: #fff; }
.brand__logo { width: 38px; height: 38px; color: var(--gold-500); }
.brand__name { font-family: var(--font-head); font-size: 19px; font-weight: 700; white-space: nowrap; }

.main-nav { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.main-nav a { display: block; padding: 6px 12px; border-radius: 999px; color: rgba(255,255,255,.88); font-size: 14px; font-weight: 500; }
.main-nav a:hover { color: var(--gold-400); }
.main-nav a.active { background: var(--gold-500); color: var(--navy-900); font-weight: 700; }

.header-actions { margin-right: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: transparent; border: 0; cursor: pointer; font-size: 20px; }
.icon-btn:hover { color: var(--gold-400); background: rgba(255,255,255,.06); }
.header-contact { display: none; }

/* شريط البحث */
.search-bar { display: none; background: var(--navy-700); padding: 12px 0; }
.search-bar.open { display: block; }
.search-bar form { display: flex; gap: 8px; }
.search-bar input { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; border-radius: 999px; padding: 10px 18px; font-family: inherit; font-size: 14px; }
.search-bar input::placeholder { color: rgba(255,255,255,.5); }

/* منيو الموبايل */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,18,30,.55); opacity: 0; visibility: hidden; transition: .25s; z-index: 150; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 320px); background: var(--navy-800); z-index: 160; transform: translateX(100%); transition: transform .3s ease; display: flex; flex-direction: column; padding: 18px; overflow-y: auto; }
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer ul { list-style: none; padding: 0; margin: 0; }
.drawer li a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); color: rgba(255,255,255,.9); font-size: 15px; }
.drawer li a .ic { color: var(--gold-500); font-size: 18px; }
.drawer li a.active, .drawer li a:hover { background: rgba(224,176,104,.14); color: var(--gold-400); }
.drawer .btn { margin-top: 18px; }

/* ==========================================================================
   الهيرو (الرئيسية)
   ========================================================================== */
.hero {
    position: relative; color: #fff; overflow: hidden;
    background: var(--navy-900) center/cover no-repeat;
    padding: 56px 0 90px;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(270deg, rgba(15,27,45,.96) 0%, rgba(15,27,45,.82) 45%, rgba(15,27,45,.35) 100%);
}
.hero .container { position: relative; z-index: 1; }
.hero__content { max-width: 560px; text-align: center; margin: 0 auto; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold-500); margin-bottom: 12px; }
.ornament::before, .ornament::after { content: ""; width: 48px; height: 1px; background: currentColor; opacity: .8; }
.ornament .ic { font-size: 34px; }
.hero h1 { color: #fff; font-size: 34px; font-weight: 700; }
.hero__sub { color: var(--gold-400); font-weight: 700; font-size: 16px; margin-top: 6px; }
.hero__text { color: rgba(255,255,255,.82); margin-top: 14px; font-size: 14.5px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }

/* موجة أسفل الهيرو والبانر */
.wave { position: absolute; left: 0; right: 0; bottom: -1px; line-height: 0; z-index: 2; }
.wave svg { width: 100%; height: 46px; display: block; }

/* ==========================================================================
   بانر الصفحات الداخلية
   ========================================================================== */
.page-banner { position: relative; color: #fff; background: var(--navy-900) center/cover no-repeat; padding: 34px 0 64px; overflow: hidden; }
.page-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg, rgba(15,27,45,.92) 0%, rgba(15,27,45,.6) 60%, rgba(15,27,45,.25) 100%); }
.page-banner .container { position: relative; z-index: 1; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: rgba(255,255,255,.7); }
.crumbs a { color: rgba(255,255,255,.85); }
.crumbs a:hover { color: var(--gold-400); }
.page-banner h1, .page-banner__title { font-family: var(--font-head); line-height: 1.35; margin-bottom: 0; color: #fff; font-size: 30px; margin-top: 6px; }

/* ==========================================================================
   الأقسام العامة
   ========================================================================== */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: 24px; }
.more-link { color: var(--gold-600); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.more-link:hover { color: var(--navy-700); }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); background: var(--paper); border-radius: var(--radius); }
.empty .ic { font-size: 40px; color: var(--gold-500); margin: 0 auto 10px; display: block; }

/* كروت الوصول السريع */
.quick { margin-top: -38px; position: relative; z-index: 3; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-item { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; color: var(--navy-800); border: 1px solid transparent; transition: .2s; }
.quick-item .ic { font-size: 34px; color: var(--gold-600); }
.quick-item:hover { transform: translateY(-3px); border-color: var(--gold-300); color: var(--navy-800); box-shadow: var(--shadow-lg); }

/* ---------- كتب (المؤلفات) ---------- */
.book-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.book-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; transition: .2s; }
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.book-cover { width: 100%; aspect-ratio: 3/4; border-radius: 6px; object-fit: cover; box-shadow: -6px 8px 18px rgba(0,0,0,.22); background: var(--navy-700); }
.book-card h3 { font-size: 15px; margin-top: 12px; color: var(--navy-800); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; }
.meta .ic { color: var(--gold-600); }
.book-card .meta { margin-top: 6px; }
.book-card .btn { margin-top: 10px; }

/* ---------- قائمة مقالات (صف أفقي) ---------- */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-row { display: flex; gap: 14px; align-items: center; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; transition: .2s; }
.post-row:hover { box-shadow: var(--shadow-lg); }
.post-row__img { width: 96px; height: 80px; border-radius: var(--radius-sm); object-fit: cover; flex: none; background: var(--gold-100); }
.post-row__body { min-width: 0; flex: 1; }
.post-row h3 { font-size: 15.5px; color: var(--navy-800); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row p { color: var(--ink-2); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row .meta { margin-top: 6px; }

/* ---------- قائمة مختصرة (الرئيسية) ---------- */
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-item:last-child { border-bottom: 0; }
.mini-item img { width: 76px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--gold-100); }
.mini-item h3 { font-size: 15px; font-family: var(--font-body); font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- كروت صور (الخواطر) ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.photo-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: .2s; }
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--gold-100); }
.photo-card__body { padding: 10px 12px 14px; text-align: center; }
.photo-card h3 { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-card .meta { margin-top: 4px; }

/* ---------- معرض الصور ---------- */

/* عارض الصور (Lightbox) */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(8,16,24,.94); display: none; align-items: center; justify-content: center; padding: 56px 12px; touch-action: pan-y; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); user-select: none; }
.lightbox__btn { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .2s; }
.lightbox__btn:hover { background: var(--gold-500); color: var(--navy-900); }
.lightbox__close { top: 10px; left: 10px; }
.lightbox__prev { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__next { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; top: 18px; right: 18px; color: rgba(255,255,255,.75); font-size: 13px; }
body.lightbox-open { overflow: hidden; }

/* ---------- محاضرات (فيديو) ---------- */
.lecture-row { display: flex; align-items: center; gap: 14px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.lecture-thumb { position: relative; width: 120px; aspect-ratio: 16/10; border-radius: var(--radius-sm); overflow: hidden; flex: none; background: var(--navy-700); }
.lecture-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lecture-thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,27,45,.35); color: #fff; font-size: 30px; }
.lecture-row h3 { font-size: 15.5px; }

/* ---------- تابات الفلترة ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 6px 16px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--gold-400); color: var(--navy-800); }
.chip.active { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); font-weight: 700; }
.count { margin-right: auto; color: var(--ink-3); font-size: 13px; }

/* ---------- ترقيم ---------- */
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 26px; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.pager .current { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- سلايدر ---------- */
.slider { position: relative; }
.slider__track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px 10px; }
.slider__track::-webkit-scrollbar { display: none; }
.slider__track > * { scroll-snap-align: start; flex: 0 0 72%; }
.slider__btn { position: absolute; top: 40%; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: var(--shadow); color: var(--navy-800); display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 2; font-size: 18px; }
.slider__btn:hover { background: var(--gold-500); }
.slider__btn--prev { right: -8px; }
.slider__btn--next { left: -8px; }
.slider__dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.slider__dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-300); }
.slider__dots span.active { background: var(--gold-500); width: 18px; border-radius: 6px; }

/* ---------- اقتباس ---------- */
.quote-band { background: var(--navy-700) linear-gradient(90deg, rgba(224,176,104,.10), transparent 30%, transparent 70%, rgba(224,176,104,.10)); color: #fff; border-radius: var(--radius); padding: 22px 18px; text-align: center; font-family: var(--font-head); font-size: 19px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.quote-band .ic { color: var(--gold-500); font-size: 22px; flex: none; }

/* ---------- عن الدكتورة (الرئيسية) ---------- */
.about-strip { display: grid; grid-template-columns: 1fr; gap: 0; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.about-strip__img { min-height: 200px; background: var(--navy-700) center/cover no-repeat; position: relative; }
.about-strip__img::after { display: none; }
.about-strip__body { padding: 22px; }
.about-strip__body h2 { font-size: 22px; }
.about-strip__body h3 { font-family: var(--font-body); font-size: 16px; color: var(--navy-700); margin-top: 6px; }
.about-strip__body p { color: var(--ink-2); margin-top: 10px; font-size: 14px; }
.about-strip__body .btn { margin-top: 16px; }

/* ---------- صفحة عن الدكتورة ---------- */
.profile { padding: 22px; }
.profile__top { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center; }
.profile__img { width: 100%; border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; }
.profile h2 { font-size: 24px; }
.profile p { color: var(--ink-2); margin-top: 10px; }
.facts { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
.fact { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--cream-2); }
.fact .ic { font-size: 26px; color: var(--gold-600); }
.fact b { display: block; color: var(--navy-800); font-size: 14px; }
.fact span { color: var(--ink-2); font-size: 13px; }

/* ---------- المقالة ---------- */
.article { padding: 18px; }
.article__cover { width: 100%; border-radius: var(--radius); max-height: 460px; object-fit: cover; }
.article__meta { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0 6px; }
.article h1 { font-size: 26px; }
.article__body { margin-top: 16px; font-size: 16.5px; line-height: 2.05; color: var(--ink); overflow-wrap: anywhere; }
.article__body img { border-radius: var(--radius-sm); margin: 12px auto; height: auto !important; }
.article__body iframe, .article__body table { max-width: 100%; }
.article__body table { display: block; overflow-x: auto; }
.article__body h2, .article__body h3 { margin: 18px 0 8px; }
.article__body p { margin: 0 0 12px; }
.article__body blockquote { margin: 16px 0; padding: 12px 16px; border-right: 4px solid var(--gold-600); background: var(--gold-100); border-radius: 8px; }
.video-box { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pdf-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; padding: 14px; border: 1px dashed var(--gold-600); border-radius: var(--radius-sm); background: var(--gold-100); }
.pdf-box .ic { font-size: 30px; color: #b42318; }
.pdf-box b { flex: 1; min-width: 160px; }
.pdf-frame { width: 100%; height: 70vh; border: 0; border-radius: var(--radius-sm); margin-top: 14px; display: none; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.share a, .share button { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--cream); color: var(--navy-800); border: 0; cursor: pointer; font-size: 17px; }
.share a:hover, .share button:hover { background: var(--gold-500); color: var(--navy-900); }
.layout { display: grid; grid-template-columns: 1fr; gap: 22px; }
.aside-card { padding: 18px; }
.aside-card h3 { font-size: 18px; margin-bottom: 8px; }

/* ---------- تواصل معنا ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.contact-info { padding: 22px; }
.contact-info h3 { font-size: 19px; margin-bottom: 12px; }
.info-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--ink-2); overflow-wrap: anywhere; }
.info-line .ic { font-size: 20px; color: var(--gold-600); }
.socials { display: flex; gap: 10px; margin-top: 14px; }
.socials a { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--cream); color: var(--navy-800); font-size: 17px; }
.socials a:hover { background: var(--gold-500); color: var(--navy-900); }
.form-card { padding: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; color: var(--navy-800); }
.field label i { color: #b42318; font-style: normal; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--cream-2); border-radius: var(--radius-sm); padding: 11px 14px; font-family: inherit; font-size: 14.5px; color: var(--ink); transition: .2s; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--gold-500); background: #fff; box-shadow: 0 0 0 3px rgba(224,176,104,.22); }
.field textarea { min-height: 130px; resize: vertical; }
.field .err { color: #b42318; font-size: 12px; margin-top: 4px; display: none; }
.field.invalid input, .field.invalid textarea { border-color: #e5484d; }
.field.invalid .err { display: block; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-msg { display: none; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; }
.form-msg.ok { display: block; background: #e8f6ee; color: #18794e; }
.form-msg.bad { display: block; background: #fdecec; color: #b42318; }

/* ==========================================================================
   الفوتر
   ========================================================================== */
.site-footer { background: var(--navy-900); color: rgba(255,255,255,.78); margin-top: 40px; }
.footer-top { padding: 28px 0 18px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.footer-links a { color: rgba(255,255,255,.82); }
.footer-links a:hover { color: var(--gold-400); }
.site-footer .socials a { background: rgba(255,255,255,.07); color: #fff; }
.site-footer .socials a:hover { background: var(--gold-500); color: var(--navy-900); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 0; font-size: 12.5px; }
.footer-bottom .container { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.made-by { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); }
.made-by img { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: .85; }
.made-by:hover img { opacity: 1; }
.made-by { margin: 0; }
.footer-year { color: inherit; text-decoration: none; cursor: default; }

/* زر الرجوع لأعلى */
.to-top { position: fixed; left: 16px; bottom: 16px; width: 42px; height: 42px; border-radius: 50%; background: var(--gold-500); color: var(--navy-900); border: 0; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s; z-index: 90; font-size: 20px; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ==========================================================================
   موبايل كبير: 376px فأكثر
   ========================================================================== */
@media (min-width: 376px) {
    .hero h1 { font-size: 38px; }
    .post-row__img { width: 110px; height: 88px; }
    .slider__track > * { flex-basis: 58%; }
}

/* ==========================================================================
   تابلت: 576px فأكثر
   ========================================================================== */
@media (min-width: 576px) {
    :root { --gutter: 20px; }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
    .book-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .slider__track > * { flex-basis: 40%; }
    .facts { grid-template-columns: repeat(2, 1fr); }
    .lecture-thumb { width: 150px; }
    .header-contact { display: inline-flex; }
    .article { padding: 26px; }
    .article h1 { font-size: 30px; }
    .page-banner h1, .page-banner__title { font-size: 34px; }
    .footer-top { flex-direction: row; justify-content: space-between; text-align: right; }
    .footer-bottom .container { flex-direction: row; justify-content: space-between; }
}

/* ==========================================================================
   لابتوب صغير: 992px فأكثر
   ========================================================================== */
@media (min-width: 992px) {
    body { font-size: 15.5px; }
    .site-header .container { min-height: 72px; }
    .main-nav { display: block; flex: 1; }
    .main-nav ul { justify-content: center; }
    .header-actions { margin-right: 0; }
    .menu-toggle { display: none; }
    .hero { padding: 90px 0 120px; min-height: 520px; display: flex; align-items: center; }
    .hero__content { margin: 0; text-align: right; }
    .ornament { justify-content: flex-start; }
    .hero__actions { justify-content: flex-start; }
    .hero h1 { font-size: 46px; }
    .page-banner { padding: 150px 0 150px; }
    .page-banner h1, .page-banner__title { font-size: 40px; }
    .quick-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
    .quick-item { padding: 22px 10px; }
    .book-grid { grid-template-columns: repeat(4, 1fr); }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .lightbox { padding: 60px 80px; }
    .lightbox__prev { right: 20px; }
    .lightbox__next { left: 20px; }
    .home-split { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
    .slider__btn { display: inline-flex; }
    .slider__track > * { flex-basis: 46%; }
    .about-strip { grid-template-columns: 1fr 1.1fr; }
    .about-strip__img { min-height: 280px; }

    .about-strip__body { padding: 30px; align-self: center; }
    .profile { padding: 30px; }
    .profile__top { grid-template-columns: 1fr 1.2fr; gap: 28px; }
    .facts { grid-template-columns: repeat(3, 1fr); }
    .layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .layout aside { position: sticky; top: 92px; }
    .contact-grid { grid-template-columns: 1fr 1.5fr; }
    .lecture-thumb { width: 170px; }
    .post-row { padding: 14px; }
    .post-row__img { width: 150px; height: 110px; }
}

/* ==========================================================================
   لابتوب كبير: 1200px فأكثر
   ========================================================================== */
@media (min-width: 1200px) {
    .main-nav a { padding: 7px 15px; font-size: 14.5px; }
    .brand__name { font-size: 21px; }
    .hero h1 { font-size: 52px; }
    .book-grid { grid-template-columns: repeat(5, 1fr); }
    .photo-grid { grid-template-columns: repeat(4, 1fr); }
    .slider__track > * { flex-basis: 38%; }
    .section { padding: 54px 0; }
}

/* ==========================================================================
   شاشات كبيرة: 1440px فأكثر
   ========================================================================== */
@media (min-width: 1440px) {
    :root { --container: 1320px; }
    body { font-size: 16px; }
    .hero { min-height: 600px; }
    .hero h1 { font-size: 58px; }
    .hero__content { max-width: 620px; }
    .book-grid { grid-template-columns: repeat(6, 1fr); }
}

/* تقليل الحركة لمن يفضّل ذلك */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* الطباعة */
@media print {
    .site-header, .site-footer, .to-top, .share, .drawer, .drawer-backdrop { display: none !important; }
    body { background: #fff; }
}

/* ---------- معرض الصور (Bento بعرض الشاشة) ---------- */
.gallery-wrap { position: relative; width: 100vw; margin: 34px calc(50% - 50vw) 0; padding: 34px 12px 40px; background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); }
.gallery-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 80% 0%, rgba(224,176,104,.14), transparent 70%); pointer-events: none; }
.gallery-head { position: relative; max-width: 1680px; margin: 0 auto 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.gallery-head h2 { color: #fff; font-size: 22px; padding-bottom: 8px; border-bottom: 2px solid var(--gold-500); }
.gallery-head__count { color: var(--gold-300); font-size: 13px; background: rgba(255,255,255,.06); border: 1px solid rgba(224,176,104,.3); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.gallery-grid { position: relative; max-width: 1680px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; grid-auto-flow: dense; gap: 8px; }
.gallery-item { position: relative; display: block; overflow: hidden; border-radius: 10px; background: var(--navy-700); }
.gallery-item.is-big, .gallery-item.is-wide { grid-column: span 2; }
.gallery-item.is-big { grid-row: span 2; }
.gallery-item.is-hidden { display: none; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.02); transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.gallery-item img.loaded { opacity: 1; transform: scale(1); }
.gallery-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(12,28,40,.7), rgba(12,28,40,0) 55%); opacity: 0; transition: opacity .3s; }
.gallery-item__zoom { position: absolute; z-index: 1; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: var(--gold-500); color: var(--navy-900); display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(.7); transition: .3s; }
.gallery-item__zoom svg { width: 20px; height: 20px; }
.gallery-item:hover img.loaded, .gallery-item:focus-visible img.loaded { transform: scale(1.07); }
.gallery-item:hover::after, .gallery-item:focus-visible::after { opacity: 1; }
.gallery-item:hover .gallery-item__zoom, .gallery-item:focus-visible .gallery-item__zoom { opacity: 1; transform: scale(1); }
.gallery-item.reveal { animation: gIn .5s ease both; }
@keyframes gIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.gallery-more { position: relative; text-align: center; margin-top: 24px; }
.gallery-more .btn { color: var(--gold-300); border-color: var(--gold-500); background: transparent; }
.gallery-more .btn:hover { background: var(--gold-500); color: var(--navy-900); }
.lightbox__thumbs { display: none; }
@media (min-width: 376px) { .gallery-grid { grid-auto-rows: 170px; } }
@media (min-width: 576px) {
    .gallery-wrap { padding: 44px 20px 50px; }
    .gallery-head h2 { font-size: 26px; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 180px; gap: 10px; }
    .gallery-item.is-tall { grid-row: span 2; }
}
@media (min-width: 992px) {
    .gallery-wrap { padding: 56px 32px 64px; }
    .gallery-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 12px; }
    .lightbox { padding-bottom: 110px; }
    .lightbox__thumbs { display: flex; position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); max-width: 90vw; gap: 6px; overflow-x: auto; padding: 4px; scrollbar-width: none; }
    .lightbox__thumbs img { width: 64px; height: 64px; flex: none; object-fit: cover; border-radius: 6px; opacity: .45; cursor: pointer; transition: .2s; box-shadow: none; }
    .lightbox__thumbs img.active, .lightbox__thumbs img:hover { opacity: 1; outline: 2px solid var(--gold-500); }
}
@media (min-width: 1200px) { .gallery-grid { grid-template-columns: repeat(5, 1fr); grid-auto-rows: 210px; } }
@media (min-width: 1440px) { .gallery-grid { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 220px; } }
@media (prefers-reduced-motion: reduce) { .gallery-item img, .gallery-item.reveal { transition: none; animation: none; } }

/* صورة رئيسية طولية مخصوصة للموبايل */
@media (max-width: 575px) {
    .hero { background-image: url(../img/hero-mobile.webp) !important; background-position: center bottom !important; }
    .hero::before { background: linear-gradient(180deg, rgba(12,28,40,.92) 0%, rgba(12,28,40,.7) 55%, rgba(12,28,40,.35) 100%); }
}

/* صورة تملأ باقي كارت معلومات التواصل */
.contact-info { display: flex; flex-direction: column; overflow: hidden; }
.contact-info__img { margin: 18px -22px -22px; flex: 1 1 auto; min-height: 180px; background: var(--navy-700) center/cover no-repeat; border-top: 3px solid var(--gold-500); }

/* مقالة من غير صورة: هيدر كحلي ودهبي بالعنوان */
.article__nocover { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; min-height: 220px; padding: 34px 22px; margin-bottom: 22px; border-radius: var(--radius); overflow: hidden; color: #fff; background: url(../img/placeholder.webp) center/cover no-repeat, var(--navy-800); }
.article__nocover::before { content: ""; position: absolute; inset: 0; background: rgba(12,28,40,.55); }
.article__nocover > * { position: relative; }
.article__nocover svg { width: 42px; height: 42px; color: var(--gold-500); }
.article__nocover span { font-family: 'Amiri', serif; font-size: 26px; line-height: 1.6; max-width: 640px; }
.article__nocover::after { content: ""; position: relative; width: 70px; height: 2px; background: var(--gold-500); }
@media (min-width: 992px) { .article__nocover { min-height: 300px; } .article__nocover span { font-size: 34px; } }

/* الغلاف الافتراضي للكتاب وعليه العنوان */
.book-cover-wrap { position: relative; display: block; width: 100%; }
.book-cover-wrap .book-cover { display: block; }
.book-cover__text { position: absolute; inset: 10% 12%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #fff; pointer-events: none; }
.book-cover__text b { font-family: 'Amiri', serif; font-weight: 700; font-size: 20px; line-height: 1.5; color: var(--gold-300); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.book-cover__text i { width: 46px; height: 2px; background: var(--gold-500); }
.book-cover__text small { font-size: 12px; color: rgba(255,255,255,.8); }
.book-cover-wrap::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(224,176,104,.45); border-radius: 4px; pointer-events: none; }

/* فيديو طولي (ريلز / شورتس) */
.video-box--vertical { aspect-ratio: 9/16; max-width: 380px; margin-inline: auto; }
