/* =========================================================
   مكوّنات واجهة المستخدم: بطاقات، أزرار، فلاتر، نوافذ
   ========================================================= */

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px; border-radius: 11px; border: 2px solid transparent; font-weight: 700; font-size: 16px; transition: .2s; line-height: 1.4; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-gold { background: var(--gold); color: #2f2404; }
.btn-gold:hover { background: #dbe98a; color: #000; transform: translateY(-2px); }
.btn-outline { border-color: var(--blue); color: var(--blue-dark); background: transparent; }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-light:hover { background: var(--surface); color: var(--navy); }
.btn-sm { padding: 7px 16px; font-size: 14px; border-radius: 9px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sky); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-img img { transform: scale(1.06); }
.card-img .badge { position: absolute; top: 12px; right: 12px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 12px; border-radius: 99px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 18px; margin: 0; line-height: 1.65; }
.card-body h3 a { color: var(--navy); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-body h3 a:hover { color: var(--blue); }
.card-body p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 6px; align-items: center; }
.card-meta svg { width: 14px; height: 14px; vertical-align: -2px; margin-inline-end: 4px; fill: none; stroke: currentColor; stroke-width: 2; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #eaf6ef, #def2e6); }
.placeholder img { width: 56%; height: auto; object-fit: contain; opacity: .85; }

/* featured news layout */
.news-feature { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.feature-main { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 440px; box-shadow: var(--shadow); background: var(--navy); }
.feature-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.feature-main:hover img { transform: scale(1.05); }
.feature-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13,38,27,.92), rgba(13,38,27,.1) 70%); }
.feature-main .cap { position: absolute; z-index: 2; bottom: 0; padding: 26px; color: #fff; }
.feature-main .cap h3 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.feature-main .cap a { color: #fff; }
.feature-main .cap small { opacity: .8; }
.feature-list { display: grid; gap: 16px; }
.h-card { display: flex; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); color: var(--ink); transition: .25s; align-items: stretch; }
.h-card:hover { transform: translateX(-4px); box-shadow: var(--shadow-lg); }
.h-card .thumb { width: 150px; flex: none; border-radius: 10px; overflow: hidden; background: var(--sky); min-height: 96px; }
.h-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.h-card h3 { font-size: 16px; margin: 0 0 4px; line-height: 1.6; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.h-card:hover h3 { color: var(--blue); }
.h-card small { color: var(--muted); }

/* video cards */
.video-card .card-img::after { content: ""; position: absolute; inset: 0; background: rgba(13,38,27,.25); transition: .25s; }
.video-card:hover .card-img::after { background: rgba(13,38,27,.45); }
.play { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 62px; height: 62px; border-radius: 50%; background: rgba(51,153,103,.92); display: grid; place-items: center; transition: .25s; }
.video-card:hover .play { transform: translate(-50%, -50%) scale(1.12); background: var(--gold); }
.play svg { width: 24px; height: 24px; fill: #fff; margin-right: -3px; transform: scaleX(-1); }
.video-card:hover .play svg { fill: #000; }

/* ---------- Filters ---------- */
.filters { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 28px; display: grid; grid-template-columns: 2fr 1.3fr 1.5fr .9fr 1fr auto; gap: 14px; align-items: end; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; background: #fbfdfc; color: var(--ink); transition: .2s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(51,153,103,.12); background: var(--surface); }
.result-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: var(--muted); font-size: 15px; }
.empty { text-align: center; padding: 60px 20px; background: var(--surface); border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--navy); font-size: 20px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 16px; border-radius: 99px; font-weight: 700; font-size: 14px; transition: .2s; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 36px 0 6px; flex-wrap: wrap; }
.pagination button { min-width: 44px; height: 44px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 16px; color: var(--ink); transition: .2s; }
.pagination button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pagination button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: default; }

/* ---------- Article details ---------- */
.details-layout { display: grid; grid-template-columns: 1fr 340px; gap: 36px; align-items: start; }
.article { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 38px 44px 40px; }
.article h1 { font-size: 32px; line-height: 1.6; margin-bottom: 14px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 15px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.article-meta .cat { background: var(--sky); color: var(--blue-dark); padding: 0 14px; border-radius: 99px; font-weight: 700; }
.article-cover { border-radius: 12px; overflow: hidden; margin-bottom: 26px; background: var(--sky); }
.article-cover img { width: 100%; max-height: 560px; object-fit: cover; cursor: zoom-in; }
.article-body p { font-size: 19px; line-height: 2.15; color: #232323; text-align: justify; }
.article-body p:first-child { font-weight: 500; }
.article-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0; }
.article-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.article-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); align-items: center; }
.article-tools strong { color: var(--navy); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.post-nav a { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); color: var(--ink); display: block; transition: .2s; }
.post-nav a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-nav small { color: var(--blue); font-weight: 800; display: block; }
.post-nav span { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; }
.post-nav a:last-child { text-align: left; }
.sidebar-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 24px; }
.sidebar-box h3 { font-size: 18px; border-bottom: 3px solid var(--blue); display: inline-block; padding-bottom: 6px; margin-bottom: 8px; }
.sticky { position: sticky; top: 108px; }

/* ---------- Library ---------- */
.book-card { display: grid; grid-template-columns: 240px 1fr; gap: 34px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; align-items: center; }
.book-cover { border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--sky); }
.book-cover img { width: 100%; }
.book-info h2 { font-size: 28px; }
.book-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin: 18px 0 22px; }
.book-facts div { background: var(--bg); border-radius: 10px; padding: 8px 14px; }
.book-facts small { color: var(--muted); display: block; font-size: 13px; line-height: 1.5; }
.book-facts b { color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.notice { background: #fff8e6; border: 1px solid #f0dca4; border-radius: 12px; padding: 14px 18px; color: #6b5214; font-size: 15px; margin-top: 24px; }
.notice.info { background: #e9f6ef; border-color: #c3e3d1; color: #14452f; }
.notice.ok { background: #eaf7ee; border-color: #b9e2c5; color: #1c5c33; }
.notice.err { background: #fdecec; border-color: #f2bcbc; color: #8a1f1f; }

/* ---------- Gallery ---------- */
.album-card .card-img { aspect-ratio: 4 / 3; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; background: var(--surface); }
.album-card .card-img img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.album-card .card-img img:first-child { grid-row: 1 / 3; }
.album-card.single .card-img { display: block; }
.album-card .card-img::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, rgba(13,38,27,.65)); pointer-events: none; }
.album-card .count { position: absolute; bottom: 12px; left: 12px; background: var(--brand-lime, #CBDD67); color: #1b2a12; font-weight: 800; font-size: 13px; padding: 2px 12px; border-radius: 99px; z-index: 2; }
.album-card .card-body h3 { font-size: 18px; margin-bottom: 4px; }
.album-card .card-body small { color: var(--muted); }
.album-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
.album-head h2 { margin: 0; font-size: 26px; }
.album-head small { color: var(--muted); font-size: 15px; font-weight: 500; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.photo-grid button { display: block; width: 100%; padding: 0; border: 0; margin: 0; border-radius: 12px; overflow: hidden; background: var(--sky); position: relative; aspect-ratio: 4 / 3; cursor: zoom-in; }
.photo-grid button:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.photo-grid button:hover img { transform: scale(1.06); }
.photo-grid button::after { content: "⤢"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 32px; background: rgba(13,38,27,.45); opacity: 0; transition: .25s; }
.photo-grid button:hover::after, .photo-grid button:focus-visible::after { opacity: 1; }
.lb-strip { display: flex; gap: 8px; margin-top: 12px; max-width: min(900px, 92vw); overflow-x: auto; padding: 4px; scrollbar-width: thin; }
.lightbox .lb-strip button { position: static; flex: none; width: 64px; height: 48px; border-radius: 8px; padding: 0; border: 2px solid transparent; background: #000; opacity: .55; overflow: hidden; transition: .2s; }
.lightbox .lb-strip button img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border-radius: 0; box-shadow: none; }
.lightbox .lb-strip button:hover { background: #000; opacity: 1; }
.lightbox .lb-strip button.on { border-color: var(--brand-lime, #CBDD67); opacity: 1; }
.lightbox > img { transition: opacity .25s; }
.lightbox > img.loading { opacity: .25; }
.lb-dl { position: absolute; top: 20px; left: 86px; display: inline-flex; align-items: center; height: 52px; padding: 0 18px; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; font-size: 15px; font-weight: 700; }
.lb-dl:hover { background: var(--brand-lime, #CBDD67); color: #000; }.home-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.home-strip button { border: 0; padding: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--sky); position: relative; }
.home-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.home-strip button:hover img { transform: scale(1.1); }

/* ---------- Lightbox / modal ---------- */
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(7,24,17,.94); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1300px, 94vw); max-height: 66vh; border-radius: 8px; box-shadow: 0 10px 60px rgba(0,0,0,.6); }
.lightbox .lb-cap { color: #d8eadf; margin-top: 14px; text-align: center; font-size: 15px; max-width: 900px; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 52px; height: 52px; border-radius: 50%; font-size: 26px; transition: .2s; }
.lightbox button:hover { background: var(--gold); color: #000; }
.lb-close { top: 20px; left: 20px; }
.lb-prev { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 28px; right: 28px; color: #fff; font-weight: 700; }
.video-modal .video-wrap { width: min(1100px, 94vw); aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 60px rgba(0,0,0,.6); }
.video-modal iframe { width: 100%; height: 100%; border: 0; }
.video-modal .lb-cap { font-size: 17px; font-weight: 700; }

/* ---------- Video page feature ---------- */
.video-player { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 34px; }
.video-player .frame { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.video-player iframe { width: 100%; height: 100%; border: 0; }
.video-player h2 { font-size: 22px; margin: 16px 0 4px; }
.video-player p { color: var(--muted); margin: 0 0 6px; }

/* ---------- About / content blocks ---------- */
.prose-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 40px; }
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.about-layout .full { grid-column: 1 / -1; }
.about-box h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.about-box h2::before { content: ""; width: 6px; height: 28px; background: var(--blue); border-radius: 4px; }
.check-list li { padding: 7px 34px 7px 0; position: relative; font-size: 17px; }
.check-list li::before { content: "✓"; position: absolute; right: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--sky); color: var(--blue-dark); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 12px; }
.pill { background: var(--sky); color: var(--navy); padding: 10px 26px; border-radius: 99px; font-weight: 800; }
.pill.green { background: #eef4d6; }

/* ---------- Friendly sites ---------- */
.site-card { display: flex; gap: 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; align-items: center; color: var(--ink); transition: .25s; }
.site-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.site-card .ico { width: 62px; height: 62px; flex: none; border-radius: 16px; background: var(--sky); display: grid; place-items: center; color: var(--blue-dark); }
.site-card .ico svg { width: 30px; height: 30px; fill: currentColor; }
.site-card h3 { font-size: 19px; margin: 0 0 2px; }
.site-card p { margin: 0; color: var(--muted); font-size: 14px; direction: ltr; text-align: right; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 28px; align-items: start; }
.info-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.info-item:last-child { border-bottom: 0; }
.info-item .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--sky); display: grid; place-items: center; flex: none; color: var(--blue-dark); }
.info-item .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.info-item small { display: block; color: var(--muted); line-height: 1.5; }
.info-item b { font-size: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: #d64545; background: #fff7f7; }
.field .error { color: #c03030; font-size: 13px; min-height: 0; display: none; margin-top: 3px; }
.field.invalid .error { display: block; }

/* أدوات المقال */
.tools-sep { flex: 1 1 24px; }
.article-tools a.btn { text-decoration: none; }
/* وضع داكن */
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

.section-head .section-desc { flex: 1; margin: 0 14px; color: var(--muted, #667); font-size: 14px; }
@media (max-width: 700px) { .section-head { flex-wrap: wrap; } .section-head .section-desc { order: 3; flex-basis: 100%; margin: 6px 0 0; } }
