/**
 * الصفحة الرئيسيّة الفاخرة — أسلوب "المخطوطة"
 */

/* === Hero === */
.hero-luxury {
    position: relative;
    background: var(--grad-page);
    padding: 6rem 0 4rem;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

.hero-luxury::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(ellipse at top, rgba(184,153,104,.08), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(177,55,63,.04), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.hero-greeting {
    font-family: 'Aref Ruqaa', serif;
    color: var(--text-muted);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fade-up 380ms var(--ease-paper) 80ms both;
}

.hero-title {
    font-family: 'Reem Kufi', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 1rem;
    color: var(--text);
    letter-spacing: -0.02em;
    opacity: 0;
    animation: fade-up 380ms var(--ease-paper) 160ms both;
}

.hero-title-accent {
    color: var(--indian-red);
    font-style: italic;
    font-family: 'Amiri', serif;
}

.hero-tagline {
    font-family: 'Amiri', serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    color: var(--text-muted);
    margin: 0 0 2.5rem;
    line-height: 1.6;
    opacity: 0;
    animation: fade-up 380ms var(--ease-paper) 240ms both;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fade-up 380ms var(--ease-paper) 320ms both;
}

/* فاصل ذهبي بعد البطل */
.hero-luxury::after {
    content: '· ❆ ·';
    display: block;
    text-align: center;
    color: var(--gold-line);
    font-size: 1.2rem;
    letter-spacing: 1rem;
    padding-top: 3rem;
    opacity: .6;
}

/* === إحصائيّات أنيقة === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
    text-align: center;
}
.stat-item b {
    display: block;
    font-family: 'Reem Kufi', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text);
    line-height: 1;
    margin-bottom: .35rem;
}
.stat-item span {
    font-family: 'Aref Ruqaa', serif;
    color: var(--text-muted);
    font-size: .95rem;
}

/* === بطاقة حكمة اليوم === */
#dailyQuote .daily-quote-card {
    max-width: 720px;
    margin: 3rem auto;
}

/* === جريدة الكتب === */
.featured-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.book-spine {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-slow);
    position: relative;
}
.book-spine:hover {
    transform: translateY(-4px);
    border-color: var(--gold-line);
    box-shadow: var(--shadow-lg);
}
.book-spine-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    background: var(--bg-subtle);
    overflow: hidden;
}
.book-spine-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--transition-deliberate);
}
.book-spine:hover .book-spine-cover img { transform: scale(1.05); }
.book-spine-fallback {
    position: absolute; inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--parchment-300), var(--parchment-400));
    color: var(--ink-900);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    z-index: 0;
}
.book-spine-cover img + .book-spine-fallback { display: none; }
.book-spine-info {
    padding: 1rem;
}
.book-spine-title {
    font-family: 'Reem Kufi', sans-serif;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.4;
    margin-bottom: .25rem;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-spine-author {
    font-size: .82rem;
    color: var(--text-muted);
}

/* === الرحلات القرائيّة === */
.journeys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.journey-card {
    display: block;
    width: 100%;
    text-align: right;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
}
.journey-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-gold-line);
    transform: scaleX(0);
    transition: transform var(--transition-slow);
    transform-origin: right;
}
.journey-card:hover::before { transform: scaleX(1); }
.journey-card:hover {
    border-color: var(--gold-line);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.journey-card:focus-visible {
    outline: 2px solid var(--gold-line);
    outline-offset: 3px;
}
.journey-icon {
    font-size: 2.5rem;
    margin-bottom: .75rem;
    display: inline-block;
}
.journey-title {
    font-family: 'Reem Kufi', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 .5rem;
    color: var(--text);
}
.journey-desc {
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.6;
    margin: 0 0 1rem;
}
.journey-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* === الأقسام === */
.categories-luxury-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}
.category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    cursor: pointer;
    font-family: inherit;
}
.category-tile:hover {
    border-color: var(--gold-line);
    background: var(--bg-subtle);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.category-tile:focus-visible {
    outline: 2px solid var(--gold-line);
    outline-offset: 3px;
}
.category-tile-icon {
    font-size: 2rem;
    margin-bottom: .5rem;
}
.category-tile-name {
    font-family: 'Reem Kufi', sans-serif;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    margin-bottom: .25rem;
}
.category-tile-count {
    font-size: .78rem;
    color: var(--text-muted);
}

/* === الأقسام === */
.section-luxury {
    padding: 4rem 0;
}
.section-luxury.alt {
    background: var(--bg-subtle);
    background-image: var(--pattern-mosque);
}

/* ============================================================
   نافذة فاخرة (Modal) — تُفتح عند نقر بطاقة رحلة أو قسم
   ============================================================ */
.taybaa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 45, .72);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    opacity: 0;
    transition: opacity 280ms cubic-bezier(.4, 0, .2, 1);
}
.taybaa-modal-overlay.is-open {
    display: flex;
    opacity: 1;
}

.taybaa-modal {
    position: relative;
    background: var(--bg-elevated, #FAF6EE);
    border: 1px solid rgba(184, 153, 104, .55);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(184, 153, 104, .15) inset,
        0 0 0 8px rgba(250, 246, 238, .35),
        0 0 0 9px rgba(184, 153, 104, .35),
        0 30px 80px -20px rgba(0, 0, 0, .6);
    width: 100%;
    max-width: 1080px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(.97);
    transition: transform 380ms cubic-bezier(.25, .8, .25, 1);
}
.taybaa-modal-overlay.is-open .taybaa-modal {
    transform: none;
}

.taybaa-modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(184, 153, 104, .4);
    background: rgba(250, 246, 238, .9);
    color: #0F1B2D;
    font-size: 1.1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 280ms cubic-bezier(.4, 0, .2, 1);
    z-index: 2;
    font-family: inherit;
}
.taybaa-modal-close:hover {
    background: #9c1f2d;
    color: #FAF6EE;
    border-color: #9c1f2d;
    transform: rotate(90deg);
}

.taybaa-modal-header {
    padding: 1.75rem 4rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(184, 153, 104, .25);
    background: linear-gradient(180deg,
        rgba(255, 250, 238, .95),
        rgba(248, 240, 222, .92));
}
.taybaa-modal-title {
    font-family: 'Reem Kufi', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #0F1B2D;
    margin: 0 0 .35rem;
    line-height: 1.2;
}
.taybaa-modal-subtitle {
    font-family: 'Amiri', serif;
    font-style: italic;
    color: #5b4636;
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
}

.taybaa-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.taybaa-modal-body::-webkit-scrollbar {
    width: 8px;
}
.taybaa-modal-body::-webkit-scrollbar-track {
    background: rgba(184, 153, 104, .08);
}
.taybaa-modal-body::-webkit-scrollbar-thumb {
    background: rgba(184, 153, 104, .45);
    border-radius: 4px;
}

.taybaa-modal-books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}
@media (max-width: 640px) {
    .taybaa-modal-books {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }
}

.taybaa-modal-loading {
    text-align: center;
    padding: 3rem 1rem;
    font-family: 'Aref Ruqaa', serif;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.taybaa-modal-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.taybaa-modal-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .6;
}
.taybaa-modal-empty p {
    margin: 0 0 .5rem;
    font-family: 'Reem Kufi', sans-serif;
    font-size: 1.1rem;
    color: var(--text);
}
.taybaa-modal-empty-hint {
    font-family: 'Amiri', serif !important;
    font-style: italic;
    font-size: .95rem !important;
    color: var(--text-muted) !important;
}

@media (prefers-reduced-motion: reduce) {
    .taybaa-modal-overlay,
    .taybaa-modal,
    .taybaa-modal-close {
        transition: none !important;
    }
}
