/**
 * AliGali — premium refinement layer (depth, rhythm, micro-motion).
 * Revert: remove premium_refinement_head.php includes + restore backups/premium-refinement-pre-20260329/
 */

/* -------------------------------------------------------------------------- */
/* 1) Signature depth: static grain on html (no animation → mobile-safe)     */
/* -------------------------------------------------------------------------- */
html.aligali-ambient::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.032;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    mix-blend-mode: multiply;
}

html[data-theme="dark"].aligali-ambient::after,
html.aligali-ambient:has(body.dark-mode)::after {
    opacity: 0.038;
    mix-blend-mode: soft-light;
    filter: invert(1) contrast(1.04);
}

@media (max-width: 1024px) {
    html.aligali-ambient::after {
        opacity: 0.016;
        background-size: 180px 180px;
    }

    html[data-theme="dark"].aligali-ambient::after,
    html.aligali-ambient:has(body.dark-mode)::after {
        opacity: 0.026;
    }
}

/* -------------------------------------------------------------------------- */
/* 2) Soft brand wash — sits under page content, above html gradient          */
/* -------------------------------------------------------------------------- */
html.aligali-ambient body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 58% 44% at 6% 14%, rgba(184, 90, 58, 0.038), transparent 66%),
        radial-gradient(ellipse 52% 40% at 94% 86%, rgba(255, 255, 255, 0.32), transparent 72%);
}

html[data-theme="dark"].aligali-ambient body::before,
html.aligali-ambient:has(body.dark-mode) body::before {
    background:
        radial-gradient(ellipse 58% 44% at 8% 12%, rgba(212, 107, 74, 0.065), transparent 68%),
        radial-gradient(ellipse 50% 38% at 90% 90%, rgba(255, 255, 255, 0.028), transparent 74%);
}

@media (max-width: 1024px) {
    html.aligali-ambient body::before {
        opacity: 0.72;
    }
}

/* Page load fade: aligali-polish-layer.css (aligali-polish-page-in) */

/* -------------------------------------------------------------------------- */
/* 4) Home index — section rhythm, soft dividers, gentle band variation        */
/* -------------------------------------------------------------------------- */
body.home-index main.container > section + section {
    margin-top: clamp(2.05rem, 4.8vw, 3.05rem) !important;
}

body.home-index main.container > section + .content-wrapper.home-latest-wrap {
    margin-top: clamp(2.2rem, 5vw, 3.25rem) !important;
}

@media (max-width: 768px) {
    body.home-index main.container > section + section {
        margin-top: clamp(1.45rem, 4.2vw, 2.15rem) !important;
    }

    body.home-index main.container > section + .content-wrapper.home-latest-wrap {
        margin-top: clamp(1.55rem, 4.4vw, 2.25rem) !important;
    }
}

body.home-index .premium-picks {
    padding-top: clamp(0.2rem, 1vw, 0.55rem);
    padding-bottom: clamp(0.1rem, 0.6vw, 0.35rem);
}

body.home-index #home-deals::before,
body.home-index #home-hot::before {
    content: "";
    display: block;
    width: min(400px, 76vw);
    height: 1px;
    margin: 0 auto clamp(0.85rem, 2.6vw, 1.35rem);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(61, 53, 46, 0.09) 18%,
        rgba(61, 53, 46, 0.09) 82%,
        transparent
    );
}

body.dark-mode.home-index #home-deals::before,
html[data-theme="dark"] body.home-index #home-deals::before,
body.dark-mode.home-index #home-hot::before,
html[data-theme="dark"] body.home-index #home-hot::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.075) 22%,
        rgba(255, 255, 255, 0.075) 78%,
        transparent
    );
}

body.home-index #home-hot {
    padding-block: clamp(0.35rem, 1.4vw, 0.75rem);
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(250, 247, 243, 0.42) 0%,
        rgba(255, 255, 255, 0.12) 50%,
        transparent 100%
    );
}

body.dark-mode.home-index #home-hot,
html[data-theme="dark"] body.home-index #home-hot {
    background: linear-gradient(
        180deg,
        rgba(42, 38, 36, 0.35) 0%,
        rgba(28, 26, 24, 0.18) 55%,
        transparent 100%
    );
}

/* -------------------------------------------------------------------------- */
/* 5) Discover bar — עדין בלבד (לא כרטיסי מוצר)                              */
/* -------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
    body.home-index .home-discover-panel {
        transition:
            box-shadow 0.38s ease,
            border-color 0.32s ease;
    }

    body.home-index .home-discover-panel:hover {
        box-shadow: 0 12px 32px rgba(61, 53, 46, 0.07);
    }

    body.dark-mode.home-index .home-discover-panel:hover,
    html[data-theme="dark"] body.home-index .home-discover-panel:hover {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    }
}

/* -------------------------------------------------------------------------- */
/* 6) כותרות סקשן בדף הבית — היררכיה עדינה (לא תוכן כרטיסים)                  */
/* -------------------------------------------------------------------------- */
body.home-index #home-deals > .section-title,
body.home-index #home-hot > .section-title {
    font-weight: 400 !important;
    letter-spacing: 0.038em !important;
}

body.home-index .home-latest-wrap .section-title {
    font-weight: 300 !important;
    letter-spacing: 0.028em !important;
}

/* -------------------------------------------------------------------------- */
/* 7) Hero (דף הבית בלבד): עומק עדין מתחת לתוכן כשאין וידאו full-bleed        */
/* -------------------------------------------------------------------------- */
body.home-index .home-hero-refined:not(.home-hero-refined--bg-video) {
    position: relative;
    isolation: isolate;
}

body.home-index .home-hero-refined:not(.home-hero-refined--bg-video)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(
            circle at center,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.05) 40%,
            transparent 70%
        ),
        linear-gradient(
            180deg,
            transparent 38%,
            rgba(250, 247, 245, 0.22) 88%,
            rgba(250, 247, 245, 0.38) 100%
        );
    opacity: 0.55;
}

body.dark-mode.home-index .home-hero-refined:not(.home-hero-refined--bg-video)::before,
html[data-theme="dark"] body.home-index .home-hero-refined:not(.home-hero-refined--bg-video)::before {
    background:
        radial-gradient(
            circle at center,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.05) 40%,
            transparent 70%
        ),
        linear-gradient(
            180deg,
            transparent 42%,
            rgba(22, 22, 22, 0.14) 90%,
            rgba(22, 22, 22, 0.22) 100%
        );
    opacity: 0.65;
}

body.home-index .home-hero-refined:not(.home-hero-refined--bg-video) .home-hero-refined__shell {
    position: relative;
    z-index: 1;
}
