/* 
    Author Page V11 - Ambient Cover Engine & GSAP Flow
    A completely out-of-the-box Fihris experience.
*/

:root {
    --bg-page: #F4F1ED; 
    --text-main: #1C1C19;
    --text-muted: #6B6862;
    
    /* Variables filled by Blade */
    --author-theme-solid: #D97706;
    --author-theme-glow: rgba(217, 119, 6, 0.4);
    --author-theme-light: rgba(217, 119, 6, 0.1);
    
    --font-serif: 'Aref Ruqaa', serif;
    --font-sans: 'Noto Kufi Arabic', sans-serif;
}

*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── 1. The Welcome Curtain (Loading) ── */
.v9-loading {
    position: fixed; inset: 0;
    background: var(--author-theme-solid);
    z-index: 999999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: transform 1.2s cubic-bezier(0.85, 0, 0.15, 1);
    transform-origin: top;
}

.v9-loading.loaded {
    transform: translateY(-100%);
}

.v9-loading-brand {
    font-family: var(--font-serif);
    font-size: 5rem;
    color: #fff;
    margin-bottom: 2rem;
}

.v9-loading-pulse {
    width: 60px; height: 2px;
    background: rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}
.v9-loading-pulse::after {
    content: ''; position: absolute; top:0; left:0; width: 50%; height: 100%; background: #fff;
    animation: loading-line 1.5s infinite ease-in-out;
}
@keyframes loading-line {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ── Ambient Underlayer ── */
.v9-noise-overlay {
    position: fixed; inset: 0; z-index: -10; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

.v9-ambient-words {
    position: fixed; top: 50%; left: 10%; transform: translateY(-50%) rotate(-90deg);
    font-family: var(--font-serif); font-size: 25vw;
    color: var(--text-main); opacity: 0.02;
    z-index: -5; pointer-events: none; user-select: none;
}

/* ── Floating Island Navigation (Creative Design) ── */
.v10-floating-island {
    position: fixed;
    top: 30px; 
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.6rem 1.5rem;
    border-radius: 100px;
    z-index: 9999;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 300px;
    /* Opacity is handled by GSAP, but top animation is CSS for scrolling hide */
    transition: top 0.4s ease;
}

.v10-floating-island.nav-hidden {
    top: -100px;
}

.v10-island-links {
    display: flex;
    justify-content: space-around;
    gap: 1.5rem;
    width: 100%;
}

.v10-island-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.2rem 0;
    transition: all 0.3s;
}

.v10-island-links a:hover,
.v10-island-links a.active {
    color: var(--author-theme-solid);
}

.v10-island-progress-wrap {
    width: 100%; height: 3px; background: rgba(0,0,0,0.06); border-radius: 4px; overflow: hidden;
}
.v10-island-progress-bar {
    height: 100%; width: 0%; background: var(--author-theme-solid); transition: width 0.1s; border-radius: 4px;
}

/* ── Main Wrapper ── */
.v9-main-wrapper {
    overflow-x: hidden;
    position: relative;
    padding-top: 40px; 
}

/* ── 2. The Literary Arch Hero ── */
.v9-arch-header {
    position: relative;
    height: auto !important; 
    min-height: auto;
    display: flex;
    align-items: center;
    padding: 12vh 5vw 8vh 5vw;
    overflow: visible !important; 
}

.v9-abstract-smoke {
    position: absolute;
    top: -10%; left: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle at center, var(--author-theme-glow) 0%, transparent 70%);
    opacity: 0.8;
    filter: blur(80px);
    z-index: -1;
    animation: float-smoke 15s infinite alternate ease-in-out;
}
@keyframes float-smoke {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 5vh) scale(1.1); }
}

.v9-arch-container {
    max-width: 1200px; margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.v9-arch-content {
    flex: 1;
    max-width: 700px; 
    z-index: 5;
    overflow: visible !important;
}

.v9-arch-name {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    line-height: 1.1;
    color: var(--text-main);
    margin-bottom: 2rem;
    position: relative;
}

.v9-arch-name::after {
    content: ''; position: absolute; right: 0; bottom: -10px;
    width: 80px; height: 4px; background: var(--author-theme-solid);
}

.v9-arch-bio {
    font-size: 1.1rem; line-height: 2; color: var(--text-muted);
    margin-bottom: 3.5rem; margin-top: 2rem;
    overflow: visible !important; 
    white-space: normal; 
}

/* Social & CTA Elements */
.v9-arch-actions {
    display: flex; flex-direction: column; gap: 1.5rem;
}

.v9-btn-master {
    display: inline-flex; align-items: center; justify-content: space-between;
    padding: 1.2rem 2.5rem;
    background: #252422;
    color: #ede9e1;
    border-radius: 12px;
    text-decoration: none; font-weight: 700; font-size: 1.05rem;
    position: relative; overflow: hidden;
    max-width: 380px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
}
.v9-btn-master:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    background: #111;
}
.v9-goodreads-btn {
    border-right: 4px solid var(--author-theme-solid);
}

.v9-stamps-dock {
    display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.5rem;
}

.v9-stamp {
    width: 44px; height: 44px; border-radius: 10px;
    background: transparent; border: 1px solid rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all 0.3s;
}
.v9-stamp:hover {
    background: var(--author-theme-light);
    color: var(--author-theme-solid);
    border-color: var(--author-theme-solid);
    transform: translateY(-3px);
}

/* The Arch Visual Frame */
.v9-arch-visual {
    flex: 0 0 450px;
    display: flex; justify-content: center;
    position: relative; z-index: 5;
}

.v9-arch-frame {
    width: 100%; aspect-ratio: 0.75;
    border-radius: 180px 180px 30px 30px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0,0,0,0.15);
    border: 8px solid var(--bg-page);
    position: relative;
    background: var(--author-theme-light);
}

.v9-arch-img {
    width: 100%; height: 100%; object-fit: cover;
}

.v9-arch-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-serif); font-size: 10rem; color: var(--author-theme-solid);
}


/* ── 3. The Cinematic Stage (Novels) - V11 ── */
.v9-cinematic-stage {
    position: relative;
    padding: 15vh 0;
    margin-top: 5vh;
}

/* V11: Ambient background container */
.v11-bg-cover-wrap {
    position: absolute; inset: 0; z-index: -2;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 95%);
    background: #1a1a1a; /* fallback */
}

/* The actual image that will be heavily blurred by CSS */
.v11-bg-cover-image {
    position: absolute; inset: -10%; /* extend past edges so blur doesn't show sharp borders */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(80px);
    transform: scale(1.2);
    /* Transition crossfade duration when JS updates background-image */
    transition: background-image 1.5s ease-in-out; 
}

/* V11: Dark overlay to guarantee typography is highly contrasted */
.v11-bg-cover-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65); /* Rich dark cinematic tone */
}

.v9-stage-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4rem;
}

/* Swiper Tuning */
.swiper-v9 {
    width: 100%; padding-top: 1rem; padding-bottom: 5rem;
}

.v9-slide-item {
    width: 280px; height: auto;
    filter: drop-shadow(0 25px 40px rgba(0,0,0,0.5));
    transition: filter 0.5s ease;
}

.v9-book-object {
    width: 100%; aspect-ratio: 2/3;
    border-radius: 4px 12px 12px 4px;
    overflow: hidden;
    position: relative;
}

.v9-book-cover {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.v9-book-reflection {
    position: absolute; top:0; left:0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 5%, rgba(0,0,0,0.1) 8%, transparent 100%);
    pointer-events: none;
}

/* The Clean Pure Typography Info Block (No Glass!) */
.v9-pure-info-block {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.v9-pure-info-block.info-visible {
    opacity: 1; transform: translateY(0);
}

.v9-pure-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.v9-pure-tags {
    display: flex; gap: 0.8rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap;
}

.v9-pure-tags span {
    font-size: 0.85rem; font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.v9-pure-tags span::after {
    content: '•'; margin-right: 0.8rem; opacity: 0.3;
}
.v9-pure-tags span:last-child::after { content: ''; }

.v9-pure-desc {
    font-size: 1.05rem; line-height: 2;
    color: rgba(255,255,255,0.75);
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.v9-pure-actions {
    display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap;
}

.v9-pure-actions .v8-btn {
    padding: 0.8rem 2.2rem; border-radius: 100px; font-weight: 700; text-decoration: none; transition: all 0.3s;
    font-size: 0.95rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

/* Beautiful Action Buttons for the stage */
.v10-btn-jarir {
    background: #fff; color: #111;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.v10-btn-jarir:hover { transform: translateY(-3px); }

.v10-btn-publisher {
    background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(5px);
}
.v10-btn-publisher:hover { background: rgba(255,255,255,0.25); transform: translateY(-3px); }

/* V11: Explicit styling for Goodreads inside the pure actions block */
.v8-btn-goodreads {
    background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
}
.v8-btn-goodreads:hover { background: rgba(0,0,0,0.8); transform: translateY(-3px); border-color: rgba(255,255,255,0.3); }


/* ── 4. Stores Section ── */
.v9-stores {
    padding: 8vh 5vw 12vh 5vw; text-align: center;
}
.v9-tiny-title {
    font-size: 1.2rem; color: var(--text-muted); font-weight: 700; margin-bottom: 2rem;
}
.v9-store-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
}
.v9-store-pill {
    padding: 0.9rem 2.5rem; border-radius: 10px;
    background: #fff; border: 1px solid rgba(0,0,0,0.06);
    color: var(--text-main); font-weight: 600; text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}
.v9-store-pill:hover { background: var(--author-theme-solid); color: #fff; border-color: var(--author-theme-solid); transform: translateY(-3px); }

/* ── 5. Minimal Footer ── */
.v9-footer {
    padding: 6vh 5vw; display: flex; flex-direction: column; align-items: center; border-top: 1px solid rgba(0,0,0,0.05); background: #fff;
}
.v9-footer-mark { font-family: var(--font-serif); font-size: 2rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.v9-footer-nav { display: flex; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; justify-content: center;}
.v9-footer-nav a { color: var(--text-main); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.v9-footer-copy { color: rgba(0,0,0,0.3); font-size: 0.85rem; }


/* ── Mobile Layout Master adjustments ── */
@media (max-width: 992px) {
    .v10-floating-island {
        min-width: 90%; border-radius: 50px; top: 15px; padding: 0.5rem 1rem;
    }
    .v10-island-links a { font-size: 0.85rem; }

    .v9-arch-header { padding: 15vh 6vw 5vh 6vw; display: block; height: auto !important; min-height: auto; overflow: visible !important; }
    
    .v9-arch-container {
        flex-direction: column; text-align: center; gap: 2rem; overflow: visible !important;
    }
    
    .v9-arch-bio {
        margin: 2rem auto;
        height: auto !important; max-height: none !important;
        overflow: visible !important;
    }

    .v9-arch-visual { flex: auto; order: -1; width: 100%; margin-bottom: 1rem; }
    .v9-arch-frame { 
        max-width: 300px;
        margin: 0 auto;
        border-radius: 150px 150px 15px 15px;
    }
    
    .v9-arch-name { font-size: clamp(3rem, 12vw, 4rem); }
    .v9-arch-name::after { left: 50%; transform: translateX(-50%); right: auto; bottom: -15px; } /* Center the underline */
    
    .v9-btn-master { margin: 0 auto; width: 100%; max-width: none; justify-content: center; gap: 1rem;}
    .v9-stamps-dock { justify-content: center; margin-top: 1.5rem; }
    
    .v11-bg-cover-wrap { clip-path: polygon(0 0, 100% 2%, 100% 100%, 0 98%); }
    .swiper-slide { width: 230px; }
    .v9-pure-title { font-size: 2.2rem; }
}

@media (min-width: 1024px) {
    .swiper-slide { width: 340px; } 
}