/*
 * home.css — الصفحة الرئيسية v2 (نظام تصميم فِهرس)
 * ورقٌ دافئ · حبرٌ داكن · نحاسٌ للتأكيد — حواف حادّة وظلال صلبة.
 * الألوان مأخوذة حرفياً من رموز colors.css (--fh-*).
 */

.fh-home { min-width: 320px; overflow-x: clip; direction: rtl; }
.fh-home *, .fh-home *::before, .fh-home *::after { box-sizing: border-box; }
.fh-home a { text-decoration: none; }

/* الهيدر والفوتر: مكوّنات مشتركة SiteHeader.jsx / SiteFooter.jsx (أنماطها داخلها) */

/* ══════════ الهيرو ══════════ */
.fh-hero { position: relative; border-bottom: 2px solid var(--fh-ink); overflow: hidden; }
.fh-hero-water {
    position: absolute; top: -6%; right: -3%; font-family: var(--font-heading); font-weight: 700;
    font-size: clamp(180px, 34vw, 460px); line-height: 1; color: transparent;
    -webkit-text-stroke: 1px var(--fh-border); pointer-events: none; user-select: none;
}
.fh-seal {
    position: absolute; bottom: 34px; right: 26px; width: 92px; height: 92px;
    animation: fhrsSpin 24s linear infinite; opacity: .9; pointer-events: none;
}
.fh-hero-in {
    max-width: 1240px; margin: 0 auto; padding: clamp(56px,9vw,110px) 20px clamp(64px,9vw,110px);
    position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 64px 56px;
}
.fh-hero-copy { flex: 1 1 460px; min-width: 280px; }
.fh-hero-badge {
    display: inline-flex; align-items: center; gap: 10px; background: var(--fh-ink);
    color: var(--fh-paper); padding: 6px 16px; margin-bottom: 30px; box-shadow: 3px 3px 0 var(--fh-copper);
}
.fh-hero-badge span.d { width: 7px; height: 7px; background: var(--fh-copper); transform: rotate(45deg); }
.fh-hero-badge span.t { font-size: 12px; font-weight: 600; }
.fh-hero h1 {
    font-family: var(--font-heading); font-weight: 700; font-size: clamp(42px,7vw,82px);
    line-height: 1.28; margin: 0 0 22px;
}
.fh-hero h1 .stroke { color: transparent; -webkit-text-stroke: 2px var(--fh-copper); }
.fh-hero-sub { font-size: clamp(15px,2vw,18px); line-height: 2; color: var(--fh-ink-500); margin: 0 0 30px; max-width: 500px; }
.fh-hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.fh-btn-primary {
    background: var(--fh-ink); color: var(--fh-paper); border: 1px solid var(--fh-ink);
    box-shadow: 4px 4px 0 var(--fh-copper); padding: 15px 32px; font-size: 15px; font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease;
}
.fh-btn-primary:hover { transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--fh-copper); color: var(--fh-paper); }
.fh-btn-secondary {
    background: var(--fh-surface); color: var(--fh-ink); border: 1px solid var(--fh-ink);
    box-shadow: 4px 4px 0 var(--fh-ink); padding: 15px 32px; font-size: 15px; font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease;
}
.fh-btn-secondary:hover { transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--fh-ink); color: var(--fh-ink); }
.fh-url-chip { display: inline-flex; align-items: center; border: 1px solid var(--fh-border-strong); background: var(--fh-surface); }
.fh-url-chip .proto { background: var(--fh-sand-100); border-right: 1px solid var(--fh-border-strong); font-family: var(--font-latin); font-size: 12px; color: var(--fh-ink-500); padding: 8px 12px; }
.fh-url-chip .path { font-family: var(--font-latin); font-size: 13px; font-weight: 500; color: var(--fh-ink); padding: 8px 14px; }
.fh-url-chip .path b { color: var(--fh-copper); font-weight: 500; }

/* بطاقة صفحة كاتبة مائلة */
.fh-hero-card-wrap { flex: 1 1 340px; min-width: 280px; max-width: 440px; position: relative; padding: 10px 6px 26px 26px; }
.fh-hero-card-back { position: absolute; inset: 40px -10px 0 46px; background: var(--fh-copper-100); border: 1px solid var(--fh-copper); transform: rotate(2deg); }
.fh-hero-card { position: relative; background: var(--fh-surface); border: 1.5px solid var(--fh-ink); box-shadow: 9px 9px 0 var(--fh-ink); transform: rotate(-1.5deg); }
.fh-hc-head { background: var(--fh-ink); padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fh-hc-ava { width: 50px; height: 50px; background: var(--fh-paper); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 26px; font-weight: 700; color: var(--fh-copper); flex: none; }
.fh-hc-name { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--fh-paper); }
.fh-hc-slug { font-family: var(--font-latin); font-size: 11px; color: var(--fh-copper-200); text-align: right; }
.fh-badge-copper { background: var(--fh-copper); color: var(--fh-paper); font-size: 10px; font-weight: 600; padding: 3px 10px; flex: none; }
.fh-hc-body { padding: 18px 20px 20px; }
.fh-hc-bio { font-size: 12.5px; line-height: 1.9; color: var(--fh-ink-500); margin: 0 0 14px; }
.fh-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fh-divider .line { flex: 1; height: 1px; background: var(--fh-border); }
.fh-divider .dot { width: 6px; height: 6px; background: var(--fh-copper); transform: rotate(45deg); flex: none; }
.fh-hc-novels { display: flex; flex-direction: column; gap: 9px; }
.fh-hc-novel { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--fh-border); padding: 9px 13px; background: var(--fh-paper); }
.fh-hc-novel .l { display: flex; align-items: center; gap: 11px; min-width: 0; }
.fh-hc-novel .cover { width: 24px; height: 34px; border: 1px solid var(--fh-ink); flex: none; }
.fh-hc-novel .title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-hc-novel .year { font-family: var(--font-latin); font-size: 11px; color: var(--fh-ink-500); flex: none; }

/* ══════════ شريط الأنواع المتحرك ══════════ */
.fh-ticker { background: var(--fh-ink); border-bottom: 2px solid var(--fh-ink); padding: 13px 0; overflow: hidden; }
.fh-ticker-track { display: flex; gap: 28px; width: max-content; animation: fhrsTicker 32s linear infinite; }
.fh-ticker-item { display: flex; align-items: center; gap: 28px; flex: none; }
.fh-ticker-item .g { font-family: var(--font-heading); font-size: 17px; color: var(--fh-paper); white-space: nowrap; }
.fh-ticker-item .d { width: 7px; height: 7px; background: var(--fh-copper); transform: rotate(45deg); flex: none; }

/* ══════════ رأس قسم عام ══════════ */
.fh-section { border-bottom: 2px solid var(--fh-ink); }
.fh-section-in { max-width: 1240px; margin: 0 auto; padding: clamp(60px,9vw,104px) 20px; }
.fh-chapter { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.fh-chapter .no { font-family: var(--font-latin); font-weight: 700; font-size: 13px; letter-spacing: 0.2em; color: var(--fh-copper); }
.fh-chapter h2 { font-family: var(--font-heading); font-weight: 700; font-size: clamp(30px,5vw,46px); margin: 0; }
.fh-lead { font-size: 15px; line-height: 1.9; color: var(--fh-ink-500); margin: 0 0 52px; max-width: 520px; }

/* ══════════ كيف يعمل ══════════ */
.fh-how { background: var(--fh-surface); }
.fh-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); border: 1.5px solid var(--fh-ink); box-shadow: 7px 7px 0 var(--fh-copper-100); }
.fh-step { padding: 34px 28px 38px; border-left: 1.5px solid var(--fh-ink); transition: transform .15s ease; }
.fh-step:last-child { border-left: none; }
.fh-step:hover { transform: translateY(-3px); }
.fh-step-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 44px; }
.fh-step-num { font-family: var(--font-heading); font-size: 58px; font-weight: 700; line-height: 1; }
.fh-step-top .d { width: 9px; height: 9px; background: var(--fh-copper); transform: rotate(45deg); margin-top: 10px; }
.fh-step h3 { font-family: var(--font-heading); font-size: 23px; font-weight: 700; margin: 0 0 10px; }
.fh-step p { font-size: 13px; line-height: 1.95; margin: 0; }

/* ══════════ الرفوف (كتب ثلاثية الأبعاد) ══════════ */
.fh-shelf { background: var(--fh-ink); position: relative; overflow: hidden; }
.fh-shelf-water { position: absolute; bottom: -8%; left: -2%; font-family: var(--font-heading); font-weight: 700; font-size: clamp(140px,26vw,340px); line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--fh-ink-700); pointer-events: none; user-select: none; }
.fh-shelf .fh-section-in { position: relative; padding-bottom: clamp(80px,10vw,130px); }
.fh-shelf .fh-chapter .no { color: var(--fh-copper-200); }
.fh-shelf .fh-chapter h2 { color: var(--fh-paper); }
.fh-shelf .fh-lead { color: #C9C1B2; margin-bottom: 70px; }
.fh-books { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 72px 56px; }
.fh-book-col { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.fh-book-persp { perspective: 1400px; }
.fh-book {
    width: 196px; height: 292px; position: relative; transform-style: preserve-3d;
    transform: rotateY(-28deg); transition: transform .5s ease; cursor: pointer;
    animation: fhrsFloat 7s ease-in-out infinite;
}
.fh-book:hover { transform: rotateY(-9deg) translateY(-12px); }
.fh-book-front { position: absolute; inset: 0; transform: translateZ(19px); display: flex; flex-direction: column; justify-content: space-between; padding: 20px 18px; overflow: hidden; }
.fh-book-front.has-cover { padding: 0; }
.fh-book-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.fh-book-front .top { display: flex; align-items: center; justify-content: space-between; }
.fh-book-front .top .lbl { font-family: var(--font-latin); font-size: 8.5px; letter-spacing: 0.22em; }
.fh-book-front .top .d { width: 8px; height: 8px; transform: rotate(45deg); }
.fh-book-front .mid { text-align: center; }
.fh-book-front .mid .rule { width: 40px; height: 1.5px; margin: 0 auto; }
.fh-book-front .mid .t { font-family: var(--font-heading); font-size: 27px; font-weight: 700; line-height: 1.5; }
.fh-book-front .bot { text-align: center; }
.fh-book-front .bot .a { font-size: 11.5px; font-weight: 600; margin-bottom: 6px; }
.fh-book-front .bot .press { padding-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.fh-book-front .bot .press span { font-family: var(--font-latin); font-size: 8px; letter-spacing: 0.2em; }
.fh-book-spine { position: absolute; top: 0; right: 0; width: 38px; height: 100%; transform: translateZ(-19px) rotateY(-90deg); transform-origin: right center; display: flex; align-items: center; justify-content: center; }
.fh-book-spine span { writing-mode: vertical-rl; font-family: var(--font-heading); font-size: 13px; font-weight: 700; letter-spacing: 2px; }
.fh-book-back { position: absolute; inset: 0; transform: translateZ(-19px); }
.fh-book-pages { position: absolute; top: 4px; bottom: 4px; left: 0; width: 34px; background: var(--fh-sand-100); transform: translateZ(-17px) rotateY(90deg); transform-origin: left center; }
.fh-book-base { text-align: center; }
.fh-book-base .rule { width: 150px; height: 3px; background: var(--fh-copper); margin: 0 auto 16px; }
.fh-book-base .t { font-family: var(--font-heading); font-size: 19px; font-weight: 700; color: var(--fh-paper); }
.fh-book-base .m { font-size: 12px; color: var(--fh-ink-300); margin-top: 4px; }

/* ══════════ فهرسُ الكتّاب ══════════ */
.fh-writers-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.fh-link-more { font-size: 13px; font-weight: 600; color: var(--fh-ink); border-bottom: 2px solid var(--fh-copper); padding-bottom: 2px; }
.fh-index { border: 1.5px solid var(--fh-ink); background: var(--fh-surface); box-shadow: 7px 7px 0 var(--fh-border); }
.fh-index-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--fh-sand-100); border-bottom: 1.5px solid var(--fh-ink); padding: 10px 22px; }
.fh-index-top .l { font-size: 11px; font-weight: 700; color: var(--fh-ink-500); }
.fh-index-top .r { font-family: var(--font-latin); font-size: 10px; letter-spacing: 0.2em; color: var(--fh-ink-500); }
.fh-index-row { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--fh-border); color: var(--fh-ink); transition: background .15s ease; }
.fh-index-row:hover { background: var(--fh-copper-100); }
.fh-index-row .no { font-family: var(--font-latin); font-size: 13px; font-weight: 700; color: var(--fh-copper); width: 30px; flex: none; text-align: right; }
.fh-index-row .ava { width: 44px; height: 44px; background: var(--fh-sand-100); border: 1px solid var(--fh-ink); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--fh-copper); flex: none; overflow: hidden; }
.fh-index-row .ava img { width: 100%; height: 100%; object-fit: cover; }
.fh-index-row .meta { min-width: 0; flex: none; max-width: 40%; }
.fh-index-row .meta .n { font-family: var(--font-heading); font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-index-row .meta .b { font-size: 11.5px; color: var(--fh-ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-index-row .fill { flex: 1; border-bottom: 2px dotted var(--fh-border-strong); min-width: 24px; margin-top: 6px; }
.fh-index-row .genre { background: var(--fh-ink); color: var(--fh-paper); font-size: 10px; font-weight: 600; padding: 3px 10px; flex: none; }
.fh-index-row .slug { font-family: var(--font-latin); font-size: 12px; color: var(--fh-copper); flex: none; }
.fh-index-foot { padding: 12px 22px; display: flex; justify-content: center; font-size: 11.5px; color: var(--fh-ink-500); }

/* ══════════ دور النشر ══════════ */
.fh-pubs { background: var(--fh-copper); }
.fh-pubs .fh-chapter .no { color: var(--fh-copper-100); }
.fh-pubs .fh-chapter h2 { color: var(--fh-paper); }
.fh-pubs .fh-lead { color: var(--fh-copper-100); margin-bottom: 48px; max-width: 540px; }
.fh-pub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.fh-pub-card { background: var(--fh-paper); border: 1.5px solid var(--fh-ink); box-shadow: 6px 6px 0 var(--fh-copper-900); padding: 28px; transition: transform .15s ease, box-shadow .15s ease; }
.fh-pub-card:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 var(--fh-ink); }
.fh-pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.fh-pub-top .badge { background: var(--fh-ink); color: var(--fh-paper); font-size: 10px; font-weight: 600; padding: 4px 12px; }
.fh-pub-top .est { font-family: var(--font-latin); font-size: 11px; letter-spacing: 0.16em; color: var(--fh-ink-500); }
.fh-pub-card .name { font-family: var(--font-heading); font-size: 27px; font-weight: 700; margin-bottom: 8px; color: var(--fh-ink); }
.fh-pub-card .bio { font-size: 13px; color: var(--fh-ink-500); line-height: 1.9; }
.fh-pub-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; border-top: 1px solid var(--fh-border-strong); padding-top: 14px; }
.fh-pub-foot .slug { font-family: var(--font-latin); font-size: 12.5px; color: var(--fh-copper); font-weight: 500; }
.fh-pub-foot .count { font-size: 11.5px; color: var(--fh-ink-500); }

/* ══════════ CTA ══════════ */
.fh-cta { background: var(--fh-paper); }
.fh-cta-in { max-width: 860px; margin: 0 auto; padding: clamp(70px,10vw,120px) 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.fh-cta h2 { font-family: var(--font-heading); font-weight: 700; font-size: clamp(32px,6vw,58px); line-height: 1.4; margin: 26px 0 18px; }
.fh-cta p { font-size: 15px; line-height: 1.95; color: var(--fh-ink-500); margin: 0 0 40px; max-width: 460px; }
.fh-cta-form { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: stretch; width: min(560px, 100%); }
.fh-cta-input { flex: 1 1 250px; display: flex; align-items: center; background: var(--fh-surface); border: 1.5px solid var(--fh-ink); box-shadow: 4px 4px 0 var(--fh-border); direction: ltr; }
.fh-cta-input .p { font-family: var(--font-latin); font-size: 13px; color: var(--fh-ink-500); padding: 0 0 0 14px; flex: none; }
.fh-cta-input input { flex: 1; min-width: 60px; border: none; outline: none; background: transparent; padding: 14px 8px 14px 10px; font-size: 14px; color: var(--fh-ink); text-align: left; font-family: var(--font-body); }
.fh-cta-submit { background: var(--fh-copper); color: var(--fh-paper); border: 1.5px solid var(--fh-ink); box-shadow: 4px 4px 0 var(--fh-ink); padding: 14px 30px; font-size: 14px; font-weight: 600; transition: transform .15s ease, box-shadow .15s ease; flex: none; display: flex; align-items: center; cursor: pointer; }
.fh-cta-submit:hover { transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--fh-ink); color: var(--fh-paper); }

/* ══════════ حركات ══════════ */
@keyframes fhrsTicker { from { transform: translateX(0); } to { transform: translateX(33.333%); } }
@keyframes fhrsSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fhrsFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ظهور تدريجي عند التمرير */
.fh-reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.fh-reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .fh-book, .fh-seal, .fh-ticker-track { animation: none; }
    .fh-reveal { opacity: 1; transform: none; transition: none; }
}

/* ══════════ الاستجابة على الهواتف ══════════ */
@media (max-width: 768px) {
    .fh-hero-in { gap: 40px 32px; }
    .fh-hero-card-wrap { padding: 10px 8px 20px; margin: 0 auto; }
    .fh-seal { width: 68px; height: 68px; bottom: 18px; right: 14px; }
    .fh-steps { grid-template-columns: 1fr; }
    .fh-step { border-left: none; border-bottom: 1.5px solid var(--fh-ink); }
    .fh-step:last-child { border-bottom: none; }
    .fh-books { gap: 52px 40px; }
    .fh-writers-head { gap: 12px; }
    .fh-index-row { gap: 12px; padding: 16px; flex-wrap: wrap; }
    .fh-index-row .meta { max-width: none; flex: 1 1 60%; }
    .fh-index-row .fill, .fh-index-row .slug { display: none; }
    .fh-pub-grid { grid-template-columns: 1fr; }
    .fh-cta-input { flex-basis: 100%; }
    .fh-cta-submit { flex: 1; justify-content: center; }
}
@media (max-width: 420px) {
    .fh-hero h1 { font-size: 38px; }
    .fh-book { transform: rotateY(-16deg); }
    .fh-index-row .no { width: 22px; }
}
