/* blog.css — المدونة العامة (القائمة + المقال). هوية GazaPX: Midnight/Royal/Phoenix/Paper، حواف 4px، بلا ظلال ولا تدرجات ولا blur.
   يحل محل كتل <style> المضمّنة في blog_list.html وblog_detail.html. */
.blog-page { background: #F7F7F5; color: #0B0B38; }
.blog-page .container { max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 640px) { .blog-page .container { padding-inline: 2rem; } }

/* ── الهيرو (القائمة والمقال) ── */
.blog-hero, .detail-hero { position: relative; background: #0B0B38 url("../img/brand/bg-midnight-band.295641b7dc66.svg") center / 100% 100% no-repeat; color: #fff; padding-block: clamp(40px, 7vw, 80px) clamp(32px, 5vw, 56px); }
.blog-hero .inner { max-width: 44rem; margin-inline: auto; text-align: center; }
.detail-hero .inner { max-width: 52rem; margin-inline: auto; }
.crumbs { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: .95rem; color: #B8BBD6; }
.crumbs a { color: #B8BBD6; text-decoration: none; }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] { color: #fff; font-weight: 600; }
.hero-title { margin: 0 0 1rem; font-size: clamp(1.75rem, 4.5vw, 2.75rem); font-weight: 700; line-height: 1.3; color: #fff; overflow-wrap: anywhere; }
.hero-subtitle { max-width: 32rem; margin: 0 auto 1.5rem; font-size: 1.0625rem; line-height: 1.8; color: #B8BBD6; }
.blog-search { max-width: 32rem; margin: 0 auto 1.25rem; }
.blog-search input { width: 100%; height: 3rem; border: 1px solid #7C7F96; border-radius: 4px; background: #fff; padding-inline: 1rem; font: inherit; font-size: 1rem; color: #0B0B38; }
.blog-search input::placeholder { color: #5E617A; }
.blog-search input:focus-visible { outline: 2px solid #AEB4F0; outline-offset: 2px; }
.hero-stat { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid rgb(174 180 240 / .35); border-radius: 4px; padding: .5rem 1rem; font-size: .95rem; font-weight: 500; color: #fff; }
.hero-stat svg { color: #AEB4F0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.meta-pill { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid rgb(174 180 240 / .35); border-radius: 4px; padding: .4rem .85rem; font-size: .9rem; color: #fff; }
.meta-pill svg { color: #AEB4F0; }
.tag-status { display: inline-flex; align-items: center; margin-bottom: 1rem; border-radius: 4px; background: #012EB2; padding: .3rem .75rem; font-size: .85rem; font-weight: 600; color: #fff; }

/* ── شريط علوي لصفحة المقال ── */
.detail-top-bar { background: #fff; border-bottom: 1px solid #E1E2EA; padding-block: .5rem; }
.detail-top-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.share-top-btn { display: grid; width: 2.75rem; height: 2.75rem; place-items: center; border: 1px solid #7C7F96; border-radius: 4px; background: #fff; color: #0B0B38; cursor: pointer; }
.share-top-btn:hover { border-color: #0B0B38; }

/* ── الأزرار ── */
.btn-gpx { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; border: 1px solid transparent; border-radius: 4px; padding: .6rem 1.4rem; font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.4; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.btn-gpx svg { width: 1rem; height: 1rem; }
.btn-primary-gpx { flex: 1; background: #0B0B38; color: #fff; }
.btn-primary-gpx:hover { background: #012EB2; color: #fff; }
.btn-outline-gpx { flex: 1; border-color: #7C7F96; background: transparent; color: #0B0B38; }
.btn-outline-gpx:hover { border-color: #0B0B38; }
.btn-sm-gpx { min-height: 2.75rem; padding: .4rem 1rem; font-size: .95rem; }
:where(.btn-gpx, .share-top-btn, .strip-item, .thumb-item, .studio-arrow, .studio-overlay, .page-link, .file-item, .file-card, .lightbox-nav, .lightbox-close, .video-thumb):focus-visible { outline: 2px solid #012EB2; outline-offset: 2px; }

/* ── القائمة ── */
.blog-list-section { padding-block: clamp(32px, 5vw, 56px); }
.posts-list { display: flex; flex-direction: column; gap: 1.5rem; max-width: 56rem; margin-inline: auto; }
.post-card { overflow: hidden; border: 1px solid #E1E2EA; border-radius: 4px; background: #fff; }
.post-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.5rem; border-bottom: 1px solid #E1E2EA; background: #F7F7F5; }
.post-meta-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-size: .9rem; color: #4A4D66; }
.post-meta-inline svg { color: #012EB2; }
.badge-gpx { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid #E1E2EA; border-radius: 4px; padding: .2rem .65rem; font-size: .85rem; font-weight: 500; color: #4A4D66; }
.post-body { min-width: 0; padding: 1.5rem; }
.post-title { margin: 0 0 1.25rem; font-size: 1.5rem; font-weight: 600; line-height: 1.5; overflow-wrap: break-word; }
.post-title a { color: #0B0B38; text-decoration: none; }
.post-title a:hover { color: #012EB2; }
.post-text { margin: 1.25rem 0; min-width: 0; }
.excerpt { margin: 0; font-size: 1.0625rem; line-height: 1.85; color: #4A4D66; overflow-wrap: break-word; }
.post-actions, .actions-bar { display: flex; gap: .75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid #E1E2EA; }
@media (max-width: 640px) { .post-actions, .actions-bar { flex-direction: column; } .post-body { padding: 1.25rem; } .post-header { padding-inline: 1.25rem; } }

/* ── الوسائط: فيديو ── */
.post-media, .media-section { overflow: hidden; border-radius: 4px; }
.post-media { margin-bottom: 1.25rem; }
.video-thumb, .video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0B0B38; cursor: pointer; display: block; }
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb iframe.video-el, .video-frame .video-el { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame { cursor: default; }
.play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgb(11 11 56 / .4); }
.video-thumb:hover .play-overlay { background: rgb(11 11 56 / .55); }
.play-icon { display: grid; width: 4rem; height: 4rem; place-items: center; border-radius: 4px; background: #F16202; color: #0B0B38; }
.play-icon svg { width: 1.6rem; height: 1.6rem; }
.generic-video-thumb, .generic-thumb { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: #AEB4F0; }
.generic-thumb { position: static; height: 100%; width: 100%; }
.media-caption { margin: .75rem 0 0; font-size: .95rem; color: #4A4D66; }
.video-image-strip, .video-strip { display: flex; gap: .5rem; overflow-x: auto; padding: .75rem; background: #E9E9EF; }
.strip-item { flex: 0 0 4.5rem; height: 3.25rem; overflow: hidden; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
.strip-item:hover { border-color: #012EB2; }
.strip-item img, .thumb-item img { width: 100%; height: 100%; object-fit: cover; }

/* ── الوسائط: استوديو الصور ── */
.image-studio { display: flex; flex-direction: column; overflow: hidden; border-radius: 4px; background: #0B0B38; }
.studio-main { position: relative; width: 100%; height: 380px; overflow: hidden; }
.studio-main img { width: 100%; height: 100%; object-fit: contain; background: #0B0B38; }
.studio-counter { position: absolute; top: .75rem; inset-inline-start: .75rem; z-index: 2; border-radius: 4px; background: #0B0B38; padding: .25rem .65rem; font-size: .85rem; font-weight: 600; color: #fff; }
.studio-counter:empty { display: none; }
.studio-arrow { position: absolute; top: 50%; z-index: 3; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; transform: translateY(-50%); border: 1px solid #AEB4F0; border-radius: 4px; background: #0B0B38; font-size: 1.5rem; line-height: 1; color: #fff; cursor: pointer; }
.studio-arrow:hover { background: #012EB2; }
.studio-arrow.prev { inset-inline-start: .75rem; }
.studio-arrow.next { inset-inline-end: .75rem; }
.studio-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: zoom-in; opacity: 0; transition: opacity .15s; }
.studio-overlay:hover { opacity: 1; background: rgb(11 11 56 / .4); }
.zoom-hint { display: grid; width: 3rem; height: 3rem; place-items: center; border: 1px solid #fff; border-radius: 4px; color: #fff; }
@media (hover: none) { .studio-overlay { opacity: 1; align-items: flex-end; justify-content: flex-start; } .studio-overlay .zoom-hint { width: 2.75rem; height: 2.75rem; margin: .75rem; background: #0B0B38; } }
.studio-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .75rem; background: #0B0B38; border-top: 1px solid rgb(174 180 240 / .25); }
.thumb-item { flex: 0 0 4.5rem; height: 3.25rem; overflow: hidden; border: 2px solid transparent; border-radius: 4px; cursor: pointer; opacity: .7; }
.thumb-item:hover { opacity: 1; }
.thumb-item.active { border-color: #F16202; opacity: 1; }
@media (max-width: 991px) { .studio-main { height: 300px; } }
@media (max-width: 576px) { .studio-main { height: 230px; } }

/* ── الملفات المرفقة ── */
.post-files { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #E1E2EA; }
.files-title, .section-heading { display: flex; align-items: center; gap: .5rem; margin: 0 0 .85rem; font-size: 1.0625rem; font-weight: 600; color: #0B0B38; }
.files-title svg, .section-heading svg { color: #012EB2; }
.files-list, .files-grid { display: flex; flex-direction: column; gap: .5rem; max-height: 220px; overflow-y: auto; }
.files-grid { max-height: none; }
.file-item, .file-card { display: flex; align-items: center; gap: 1rem; border: 1px solid #E1E2EA; border-radius: 4px; background: #F7F7F5; padding: .75rem 1rem; text-decoration: none; color: inherit; }
.file-item:hover, .file-card:hover { border-color: #0B0B38; }
.file-icon, .file-icon-wrap { display: grid; width: 2.75rem; height: 2.75rem; flex-shrink: 0; place-items: center; border-radius: 4px; background: #0B0B38; color: #fff; }
.file-info, .file-details { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 600; color: #0B0B38; }
.file-size { font-size: .85rem; color: #4A4D66; }
.file-download-icon, .file-download { flex-shrink: 0; color: #012EB2; }

/* ── ترقيم الصفحات ── */
.pagination-nav { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #E1E2EA; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.page-link { display: flex; min-width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; border: 1px solid #7C7F96; border-radius: 4px; background: #fff; padding-inline: .5rem; font-weight: 600; color: #0B0B38; text-decoration: none; }
a.page-link:hover { border-color: #0B0B38; }
.page-item.active .page-link { border-color: #0B0B38; background: #0B0B38; color: #fff; }
.page-item.disabled .page-link { border-color: #E1E2EA; background: #F7F7F5; color: #7C7F96; cursor: not-allowed; }

/* ── حالة فارغة ── */
.empty-state { border: 1px solid #E1E2EA; border-radius: 4px; background: #fff; padding: 3.5rem 1.5rem; text-align: center; }
.empty-state h3 { margin: 0; font-size: 1.375rem; font-weight: 600; }
.empty-state p { margin: .5rem 0 1.5rem; font-size: 1.0625rem; color: #4A4D66; }
.empty-state .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.empty-state .btn-gpx { flex: 0 0 auto; }

/* ── صفحة المقال ── */
.detail-article { padding-block: clamp(28px, 5vw, 56px); }
.article-wrapper { display: flex; max-width: 52rem; margin-inline: auto; flex-direction: column; gap: 2rem; }
.post-content { min-width: 0; }

/* ── العارض المكبّر + التوست ── */
.lightbox { display: none; position: fixed; inset: 0; z-index: 9999; }
.lightbox-overlay { position: absolute; inset: 0; background: rgb(11 11 56 / .96); cursor: pointer; }
.lightbox-content { position: absolute; top: 50%; left: 50%; display: flex; max-width: 95%; max-height: 90vh; transform: translate(-50%, -50%); flex-direction: column; align-items: center; }
.lightbox-content img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 4px; }
.lightbox-close, .lightbox-nav { position: absolute; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; border: 1px solid #AEB4F0; border-radius: 4px; background: #0B0B38; font-size: 1.5rem; line-height: 1; color: #fff; cursor: pointer; }
.lightbox-close { top: 1rem; left: 1rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }
.lightbox-close:hover, .lightbox-nav:hover { background: #012EB2; }
.lightbox-info { position: absolute; bottom: 1rem; left: 50%; display: flex; transform: translateX(-50%); align-items: center; gap: 1.25rem; border-radius: 4px; background: #0B0B38; padding: .5rem 1rem; color: #fff; }
#lightbox-download { display: inline-flex; color: #fff; }
#toast-container { position: fixed; bottom: 1.5rem; left: 50%; z-index: 9999; transform: translateX(-50%); }
.share-toast { display: flex; align-items: center; gap: .5rem; border-radius: 4px; background: #0B0B38; padding: .75rem 1.25rem; font-weight: 500; color: #fff; }
.phx-skeleton { border: 1px solid #E1E2EA; border-radius: 4px; background: #fff; padding: 1.5rem; }
.phx-skeleton .sk { height: .9rem; margin-bottom: .6rem; border-radius: 4px; background: #E9E9EF; }
