/* VORTEX GROUP — HOME (v5) */

[data-page="home"] .section { margin-top: 70px; }

/* ---------- العمل المميز: صفحة مانجا ---------- */
.feature {
    position: relative; overflow: hidden; border: 1px solid var(--hair); border-radius: 2px;
    background: var(--ink-2); display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
}
.feature::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 2px; background: var(--cy); z-index: 3; }
.feature:empty { display: none; }
.feature-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(50px) saturate(1.2); opacity: 0.22; transform: scale(1.2); }
.feature::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(12, 16, 21, 0.2), rgba(12, 16, 21, 0.96) 60%); }
.feature-swirl { position: absolute; z-index: 1; left: -140px; bottom: -170px; width: 560px; height: 560px; opacity: 0.05; pointer-events: none; }

.feature-inner { position: relative; z-index: 2; display: contents; }
.feature-portal { position: relative; z-index: 2; padding: 38px; border-inline-end: 1px solid var(--hair); display: flex; align-items: center; }
.feature-poster { width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 2px; background: var(--ink-3); outline: 1px solid var(--hair-2); outline-offset: 6px; }
.feature-poster img { width: 100%; height: 100%; object-fit: cover; }
.ring { display: none; }

.feature-text { position: relative; z-index: 2; min-width: 0; padding: 48px 52px; display: flex; flex-direction: column; justify-content: center; }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; color: var(--mute); font-family: var(--mono); font-size: 12.5px; }
.feature-meta span { padding-inline-end: 12px; margin-inline-end: 12px; border-inline-end: 1px solid var(--hair-2); line-height: 1; }
.feature-meta span:last-child { border: 0; padding: 0; margin: 0; }
.feature-meta .st { color: var(--cy-2); }
.feature-text h1 { margin: 18px 0 16px; max-width: 18ch; font-size: clamp(34px, 4.4vw, 58px); font-weight: 800; line-height: 1.2; letter-spacing: 0; color: #fff; }
.feature-text p { max-width: 58ch; margin: 0; color: #b9c3cc; font-size: 15.5px; line-height: 1.95; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.feature-actions .btn { min-height: 48px; padding-inline: 24px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 10px; border: 1px solid var(--hair-2); border-radius: 2px; color: var(--mute); font-size: 12.5px; font-weight: 500; background: transparent; }

/* ---------- آخر الفصول: قائمة صفوف ---------- */
.latest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--hair); border-radius: 2px; background: var(--ink-2); overflow: hidden; }
.latest-card {
    position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; min-width: 0;
    border-inline-end: 1px solid var(--hair); border-bottom: 1px solid var(--hair); transition: background 160ms;
}
.latest-card:nth-child(3n) { border-inline-end: 0; }
.latest-card:nth-last-child(-n+3) { border-bottom: 0; }
.latest-card:hover { background: var(--ink-3); }
.latest-cover { width: 60px; height: 84px; flex-shrink: 0; overflow: hidden; border-radius: 2px; background: var(--ink-3); outline: 1px solid var(--hair-2); outline-offset: 2px; }
.latest-cover img { width: 100%; height: 100%; object-fit: cover; }
.latest-info { flex: 1; min-width: 0; }
.latest-info h3 { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-chapter { margin-top: 4px; color: var(--cy-2); font-family: var(--mono); font-size: 13px; }
.latest-time { margin-top: 2px; color: var(--mute); font-size: 12px; }
.new-badge { display: inline-block; margin-bottom: 6px; padding: 0 8px; border-radius: 2px; background: var(--cy); color: #04151c; font-size: 11px; font-weight: 700; line-height: 1.7; }
.new-badge i { display: none; }
.latest-go { color: var(--mute-2); transition: color 160ms; }
.latest-card:hover .latest-go { color: var(--cy-2); }

/* ---------- أضيفت حديثًا: رف الأغلفة ---------- */
.head-tools, .section-head > .head-tools { display: flex; flex-direction: row; align-items: center; gap: 16px; }
.shelf-nav { display: flex; gap: 6px; }
.shelf-nav button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--hair-2); border-radius: 2px; background: transparent; color: var(--paper); cursor: pointer; }
.shelf-nav button:hover { border-color: var(--cy); color: var(--cy-2); }
.shelf-nav .flip .icon { transform: scaleX(-1); }

.shelf { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x proximity; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf-card { flex: 0 0 150px; display: block; scroll-snap-align: start; }
.shelf-cover { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 2px; background: var(--ink-3); outline: 1px solid var(--hair); outline-offset: -1px; }
.shelf-cover::before, .shelf-cover::after { content: ""; position: absolute; z-index: 2; width: 14px; height: 14px; border-color: var(--cy-2); border-style: solid; opacity: 0; transition: opacity 160ms; }
.shelf-cover::before { top: 6px; inset-inline-start: 6px; border-width: 2px 0 0 2px; }
.shelf-cover::after { bottom: 6px; inset-inline-end: 6px; border-width: 0 2px 2px 0; }
.shelf-card:hover .shelf-cover::before, .shelf-card:hover .shelf-cover::after { opacity: 1; }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; transition: opacity 160ms; }
.shelf-card:hover .shelf-cover img { opacity: 0.82; }
.shelf-rank { display: none; }
.shelf-new { position: absolute; z-index: 2; top: 8px; inset-inline-end: 8px; padding: 0 7px; border-radius: 2px; background: var(--cy); color: #04151c; font-size: 11px; font-weight: 700; line-height: 1.7; }
.shelf-card h3 { margin: 12px 0 0; font-size: 14px; font-weight: 700; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-card small { display: block; margin-top: 2px; color: var(--mute); font-size: 12px; }

/* ---------- استكشف الأقسام ---------- */
.genre-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.genre-tile {
    position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 20px;
    border: 1px solid var(--hair); border-radius: 2px; background: var(--ink-2); font-size: 16.5px; font-weight: 700;
    transition: border-color 160ms, background 160ms;
}
.genre-tile::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 2px; background: transparent; transition: background 160ms; }
.genre-tile:hover { border-color: rgba(118, 229, 253, 0.4); background: var(--ink-3); }
.genre-tile:hover::before { background: var(--cy); }
.genre-tile span { position: relative; }
.genre-tile .icon { color: var(--mute); transition: color 160ms; }
.genre-tile:hover .icon { color: var(--cy-2); }

@media (max-width: 1000px) {
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-card:nth-child(3n) { border-inline-end: 1px solid var(--hair); }
    .latest-card:nth-child(2n) { border-inline-end: 0; }
    .latest-card:nth-last-child(-n+3) { border-bottom: 1px solid var(--hair); }
    .latest-card:nth-last-child(-n+2) { border-bottom: 0; }
    .genre-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feature { grid-template-columns: 1fr; }
    .feature-portal { border-inline-end: 0; border-bottom: 1px solid var(--hair); padding: 32px 0; justify-content: center; }
    .feature-poster { width: 200px; }
    .feature-text { padding: 32px 30px 36px; }
}

@media (max-width: 720px) {
    [data-page="home"] .section { margin-top: 52px; }
    .feature-text { padding: 26px 22px 28px; }
    .feature-text h1 { max-width: none; }
    .feature-text p { font-size: 14.5px; }
    .feature-actions { width: 100%; margin-top: 24px; }
    .feature-actions .btn { flex: 1; padding-inline: 12px; }
    .latest-grid { grid-template-columns: 1fr; }
    .latest-card { border-inline-end: 0 !important; border-bottom: 1px solid var(--hair) !important; }
    .latest-card:last-child { border-bottom: 0 !important; }
    .shelf-nav { display: none; }
    .shelf-card { flex-basis: 128px; }
    .genre-tile { min-height: 64px; font-size: 15px; }
}

/* ===== الصفحة الرئيسية: أقسام مرتبة ===== */
.hidden { display: none !important; }

/* قسم الداتا بوك المميز */
.db-spotlight { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 28px; align-items: center; padding: 30px; margin-bottom: 40px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: radial-gradient(ellipse at 0% 0%, rgba(19,171,210,.18), transparent 55%), linear-gradient(145deg, rgba(15,24,33,.98), rgba(5,8,12,.96)); }
.db-spot-eyebrow { font-family: monospace; font-size: 11px; letter-spacing: .18em; color: var(--vortex-cyan-light); }
.db-spotlight h2 { margin: 8px 0 10px; font-size: 28px; font-weight: 800; }
.db-spot-copy p { margin: 0 0 20px; color: var(--vortex-gray); line-height: 1.9; }
.db-spot-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: var(--radius-sm); background: var(--vortex-cyan); color: #031116; font-weight: 700; text-decoration: none; transition: filter var(--transition); }
.db-spot-btn:hover { filter: brightness(1.08); }
.db-spotlight .db-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dbt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: inherit; text-align: center; text-decoration: none; transition: transform var(--transition), border-color var(--transition); }
.dbt:hover { transform: translateY(-3px); border-color: var(--vortex-cyan); }
.dbt-img { position: relative; display: grid; place-items: center; width: 84px; height: 100px; margin-bottom: 8px; border-radius: 10px; overflow: hidden; background: linear-gradient(145deg, rgba(19,171,210,.24), rgba(19,171,210,.05)); }
.dbt-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dbt-ini { font-size: 30px; font-weight: 900; color: var(--vortex-cyan-light); }
.dbt-name { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.dbt-en { font-size: 12px; color: var(--vortex-gray); direction: ltr; overflow-wrap: anywhere; }
.dbt-role { margin-top: 6px; padding: 3px 9px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 11px; color: var(--vortex-cyan-light); }

/* مفضلتي */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.fav-empty { display: grid; justify-items: start; gap: 14px; padding: 22px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--vortex-gray); }
.fav-empty p { margin: 0; line-height: 1.9; }

/* تصفح */
.browse-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.browse-tile { display: grid; gap: 4px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color var(--transition), transform var(--transition); }
.browse-tile:hover { border-color: var(--vortex-cyan); transform: translateY(-2px); }
.browse-tile b { font-size: 17px; font-weight: 700; }
.browse-tile small { color: var(--vortex-gray); font-size: 13px; }
.browse-sub { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--vortex-cyan-light); }

@media (max-width: 900px) {
    .db-spotlight { grid-template-columns: 1fr; padding: 22px; gap: 22px; }
    .db-spotlight .db-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .db-spotlight h2 { font-size: 24px; }
}
@media (max-width: 560px) {
    .browse-tiles { grid-template-columns: 1fr; }
    .db-spotlight .db-home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .dbt { padding: 12px 6px 10px; }
    .dbt-img { width: 64px; height: 78px; }
    .dbt-name { font-size: 13px; }
    .dbt-en { font-size: 11px; }
}

/* ===== بطاقة الأنمي في الصفحة الرئيسية ===== */
.ah { display: grid; grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); gap: 26px; align-items: center; padding: 26px; margin-bottom: 40px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--anime-primary, #13abd2) 22%, transparent), transparent 60%), linear-gradient(145deg, rgba(15,24,33,.98), rgba(5,8,12,.96)); }
.ah.hidden { display: none !important; }
.ah-poster { aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); background: rgba(0,0,0,.3); }
.ah-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ah-eyebrow { font: 700 11px/1.4 monospace; letter-spacing: .18em; color: var(--vortex-cyan-light); }
.ah-copy h2 { margin: 8px 0 4px; font-size: 28px; font-weight: 900; line-height: 1.3; }
.ah-en { margin: 0 0 12px; color: var(--vortex-gray); font-size: 14px; }
.ah-tag { margin: 0 0 14px; color: var(--vortex-white-soft); line-height: 1.9; max-width: 560px; }
.ah-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ah-chips span { padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12px; color: var(--vortex-white-soft); }
.ah-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ah-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); background: var(--vortex-cyan); color: #031116; font-weight: 800; text-decoration: none; border: 1px solid var(--vortex-cyan); }
.ah-btn.ghost { background: transparent; color: inherit; border-color: var(--border-strong); }

/* ===== قسم المانغا المتأخر (لا يكشف الأحداث الحديثة) ===== */
.spoiler-zone details { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.spoiler-zone summary { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; padding: 16px 18px; cursor: pointer; }
.spoiler-zone summary::-webkit-details-marker { display: none; }
.sz-title { font-size: 18px; font-weight: 800; }
.sz-warn { font-size: 12.5px; color: #f6d58e; }
.spoiler-zone details[open] summary { border-bottom: 1px solid var(--border); }
.spoiler-zone .latest-grid { padding: 16px; }

@media (max-width: 700px) {
    .ah { grid-template-columns: 1fr; padding: 20px; }
    .ah-poster { width: min(180px, 60%); }
    .ah-copy h2 { font-size: 23px; }
}

/* بطاقات الأقسام المميزة في الرئيسية */
.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 52px; }
.gc-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.gc-card:hover, .gc-card:focus-visible { border-color: rgba(120,220,255,.45); transform: translateY(-2px); }
.gc-tag { font-size: 12px; letter-spacing: .04em; opacity: .75; }
.gc-card h3 { margin: 0; font-size: 18px; line-height: 1.5; }
.gc-card p { margin: 0; font-size: 14px; line-height: 1.8; opacity: .8; }
.gc-go { margin-top: auto; font-size: 14px; font-weight: 700; padding-top: 6px; }
@media (max-width: 760px) { .guide-cards { grid-template-columns: 1fr; } }
