/* ============================================================
   === ✦ Hero Compass — رحلات المكتبة الستّ ✦ ===
   ============================================================
   ستّ نقاط حول بوصلة، كل نقطة رحلة قرائيّة:
   الرّيادي · الأديب · الفكر · الذات · العالِم · المؤرّخ
*/
.hero-compass {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 60px 20px;
    background: var(--parchment-100, #F5EFE0);
}

.hero-compass-bg {
    position: absolute; inset: 0; z-index: 0;
}
.hero-compass-bg img {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0.28;
    filter: sepia(0.3);
}
/* Parchment scrim — dark top + bottom, bright middle (from 95c3c42) */
.hero-compass-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg,
        rgba(26,15,8,.78) 0%,
        rgba(26,15,8,.30) 35%,
        rgba(26,15,8,.20) 60%,
        rgba(26,15,8,.78) 100%);
    pointer-events: none;
}

.hero-compass-inner {
    position: relative; z-index: 1;
    width: 100%; max-width: 880px;
    text-align: center;
    display: flex; flex-direction: column; gap: 32px;
    align-items: center;
}

.library-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(48px, 9vw, 110px) !important;
    color: var(--ink-900);
    margin: 0;
    text-shadow:
        0 1px 0 rgba(255,247,214,.85),
        0 2px 4px rgba(245,230,200,.55),
        0 0 18px rgba(255,228,150,.35),
        0 0 38px rgba(184,148,31,.20);
}

[data-theme="dark"] .library-name {
    color: var(--gold-glow, #D4AF37);
    text-shadow:
        0 0 26px rgba(8, 5, 2, 0.9),
        0 0 52px rgba(8, 5, 2, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.55);
}

.library-tagline {
    font-family: var(--font-quote);
    font-style: italic;
    font-size: clamp(1.05rem, 2.3vw, 1.4rem) !important;
    color: #2C2418;
    background: rgba(251,243,220,.55);
    padding: .35rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(184,148,31,.25);
    margin: 0 auto !important;
    max-width: 90%;
    line-height: 1.7;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ===== COMPASS ===== */
.compass {
    position: relative;
    width: min(620px, 88vw);
    aspect-ratio: 1 / 1;
    margin: 20px auto;
}

.compass-point {
    position: absolute;
    width: 155px;
    display: flex; flex-direction: column; gap: 8px;
    align-items: center;
    padding: 18px 16px;
    background: rgba(245, 239, 224, 0.92);
    border: 2px solid rgba(184, 153, 104, 0.55);
    border-radius: 18px;
    text-decoration: none;
    color: #2C2418;
    box-shadow: 0 6px 18px rgba(44,36,24,0.10);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background .35s ease;
    z-index: 2;
}
.compass-point:hover, .compass-point:focus-visible {
    transform: scale(1.05);
    border-color: #B89968;
    background: #FFF8E8;
    box-shadow: 0 10px 28px rgba(184,153,104,0.35), 0 0 30px rgba(184,153,104,0.20);
    outline: none;
}

.cp-icon { font-size: 1.8em; line-height: 1; }
.cp-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    color: #0F1B2D !important;
}
.cp-quote {
    font-family: var(--font-quote);
    font-style: italic;
    font-size: 0.92rem;
    color: #1B2C45 !important;
    opacity: 0.92;
    line-height: 1.6;
}

/* Position 6 points around the centre */
.cp-ne { top: 8%;      right: 6%;  }
.cp-e  { top: 50%;     right: -4%; transform: translateY(-50%); }
.cp-se { bottom: 8%;   right: 6%;  }
.cp-sw { bottom: 8%;   left: 6%;   }
.cp-w  { top: 50%;     left: -4%;  transform: translateY(-50%); }
.cp-nw { top: 8%;      left: 6%;   }

/* Compass centre */
.compass-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 200px;
    display: grid; place-items: center;
    pointer-events: none;
    z-index: 1;
}

.compass-rose {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(184,153,104,0.45);
    background: radial-gradient(circle, rgba(255,248,232,0.85) 0%, rgba(245,239,224,0.3) 70%, transparent 100%);
    animation: rose-rotate 40s linear infinite;
}
.rose-needle {
    position: absolute;
    top: 50%; left: 50%;
    width: 4px; height: 110px;
    background: linear-gradient(180deg, #B89968 0%, #B89968 50%, #2C2418 50%, #2C2418 100%);
    transform-origin: center bottom;
    transform: translate(-50%, -100%) rotate(45deg);
    border-radius: 2px;
    animation: needle-sway 7s ease-in-out infinite alternate;
}
.compass-question {
    position: relative;
    font-family: 'Aref Ruqaa', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #2C2418;
    margin: 0;
    text-align: center;
    line-height: 1.4;
    z-index: 2;
}

@keyframes rose-rotate { to { transform: rotate(360deg); } }
@keyframes needle-sway {
    from { transform: translate(-50%, -100%) rotate(40deg); }
    to   { transform: translate(-50%, -100%) rotate(50deg); }
}
@media (prefers-reduced-motion: reduce) {
    .compass-rose, .rose-needle { animation: none !important; }
}

/* Search box */
.hero-search {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.92);
    border: 2px solid rgba(184,153,104,0.55);
    border-radius: 60px;
    padding: 12px 22px;
    box-shadow: 0 6px 22px rgba(44,36,24,0.12);
    width: min(540px, 90vw);
}
.hero-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-family: 'Aref Ruqaa', serif;
    font-size: 1.15rem !important;
    color: #2C2418;
    padding: 12px 6px !important;
}
.hero-search button {
    border: none; background: #B89968; color: #FFF;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    font-size: 1.3rem !important;
    cursor: pointer;
    transition: background .25s, transform .25s;
}
.hero-search button:hover { background: #9D7B4E; transform: scale(1.08); }

/* ============================================================
   === Mobile: stack the compass as a 2-column grid (≤720px) ===
   ============================================================ */
@media (max-width: 720px) {
    .compass {
        width: 100%;
        aspect-ratio: auto;
        height: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .compass-point {
        position: static !important;
        transform: none !important;
        width: 100%;
        min-height: 130px;
        padding: 20px 16px !important;
    }
    .cp-icon { font-size: 2.2em !important; }
    .cp-label { font-size: 1.2rem !important; }
    .cp-quote { font-size: 0.95rem !important; line-height: 1.7; }
    .compass-center {
        grid-column: 1 / -1;
        order: -1;
        position: static;
        transform: none;
        width: 100%;
        height: 160px;
        margin: 0 0 8px;
    }
    .compass-rose {
        width: 150px;
        height: 150px;
        inset: auto;
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    .rose-needle {
        height: 80px;
    }
    .compass-question { font-size: 1.6rem !important; }
}

/* ============================================================
   === Very small phones (≤440px) — single column stack ===
   ============================================================ */
@media (max-width: 440px) {
    .compass {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .compass-point {
        padding: 24px 18px !important;
    }
    .cp-icon { font-size: 2.5em !important; }
    .cp-label { font-size: 1.3rem !important; }
    .cp-quote { font-size: 1rem !important; }
}
