/* ============================================================
   COLLECTIONS.CSS — OMEGA CINEMATIC ULTRA
   Phase W10+ — CURATED AUTHORITY PASS (LOCK AFTER APPLY)
   ------------------------------------------------------------
   • Collections index ONLY
   • CSS-only
   • Calm, curated, boxed-set presence
   • ZERO impact on cards elsewhere
============================================================ */

/* ============================================================
   HERO — CURATED AUTHORITY
============================================================ */

html[data-ccg-page="collections-index"],
html[data-ccg-page="collections-index"] body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: auto;
}

html[data-ccg-page="collections-index"] .ccg-page,
html[data-ccg-page="collections-index"] .ccg-main,
html[data-ccg-page="collections-index"] main,
html[data-ccg-page="collections-index"] .ccg-section {
    height: auto;
    max-height: none;
    overflow-y: visible;
}

.ccg-page--collections-index .ccg-main {
    padding-top: 0;
}

.ccg-page--collections-index .ccg-main > .ccg-section.ccg-collections-hero {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.ccg-page--collections-index .ccg-collections-hero .ccg-hero {
    margin-top: 0 !important;
}

.ccg-page--collections-index .ccg-collections-hero .ccg-hero-inner > :first-child {
    margin-top: 0 !important;
}

.ccg-page--collections-index .ccg-hero--collections {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(26px, 3.2vw, 40px) clamp(20px, 3.2vw + 10px, 48px);
    min-height: clamp(220px, 30vw, 330px);
    margin-bottom: 32px;

    background:
        radial-gradient(ellipse at 18% 12%, rgba(var(--accent-rgb), 0.28), transparent 56%),
        radial-gradient(ellipse at 82% 8%, rgba(255,255,255,0.1), transparent 62%),
        linear-gradient(145deg, rgba(4,6,16,0.98), rgba(12,12,34,0.86), rgba(0,0,0,0.95));

    box-shadow:
        0 36px 96px rgba(0,0,0,0.90),
        0 0 44px rgba(var(--accent-rgb),0.16),
        inset 0 0 0 1px rgba(255,255,255,0.06);
}

.ccg-page--collections-index .ccg-hero--collections::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 16%, rgba(255,255,255,0.1), transparent 58%),
        radial-gradient(circle at 50% 120%, rgba(0,0,0,0.7), transparent 48%),
        linear-gradient(to bottom, rgba(0,0,0,0.28), rgba(0,0,0,0.74));
    opacity: 0.88;
    animation: ccg-omega-collections-halo 38s ease-in-out infinite;
}

.ccg-page--collections-index .ccg-hero--collections .ccg-hero-image {
    position: absolute;
    inset: -12%;
    z-index: 0;
    background:
        linear-gradient(120deg, rgba(var(--accent-rgb),0.18), transparent 44%),
        radial-gradient(circle at 78% 38%, rgba(var(--accent-rgb),0.24), transparent 52%),
        radial-gradient(circle at 22% 82%, rgba(255,255,255,0.08), transparent 50%);
    opacity: 0.6;
    transform: translate3d(0, 0, 0) scale(1.08);
    filter: saturate(1.08);
    animation: ccg-omega-collections-drift 72s ease-in-out infinite;
}

/* Scanline + vignette parity */
.ccg-page--collections-index .ccg-hero--collections::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;

    background:
        radial-gradient(
            ellipse at center,
            transparent 50%,
            rgba(0,0,0,0.64) 100%
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.024),
            rgba(255,255,255,0.024) 1px,
            transparent 1px,
            transparent 4px
        );

    opacity: 0.26;
}

/* Hero inner spacing */
.ccg-page--collections-index .ccg-hero-inner--collections {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 860px;
    margin: 0 auto;
    padding: 30px 28px 30px;
    text-align: center;
    text-shadow: 0 16px 40px rgba(0,0,0,0.78);
    pointer-events: none;
}

.ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-kicker {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.74);
}

.ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-title {
    margin: 0;
    letter-spacing: 0.12em;
    line-height: 1.08;
    font-weight: 700;
    -webkit-text-stroke: 1px rgba(0,0,0,0.45);
    text-shadow:
        0 14px 36px rgba(0,0,0,0.88),
        0 0 28px rgba(var(--accent-rgb),0.32);
}

.ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-tagline {
    margin: 0;
    max-width: 60ch;
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.86);
    -webkit-text-stroke: 0.6px rgba(0,0,0,0.4);
    text-shadow: 0 2px 18px rgba(0,0,0,0.82);
}

.ccg-page--collections-index .ccg-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.ccg-page--collections-index .ccg-hero-actions .ccg-btn {
    padding: 10px 14px;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

@media (max-width: 768px) {
    .ccg-page--collections-index .ccg-hero-inner--collections {
        padding: 22px 14px 20px;
    }
}

/* ============================================================
   OMEGA VISUAL CLARITY UPGRADE
   • Collections hero clarity
   • Title readability boost (mode-aware)
============================================================ */

.ccg-page--collections-index {
    /* OMEGA VISUAL CLARITY UPGRADE */
    --ccg-hero-title-glow: 0.46;
    --ccg-hero-title-glow-soft: 0.22;
}

body[data-ccg-mode="c64"] .ccg-page--collections-index,
body.c64-mode .ccg-page--collections-index {
    /* OMEGA VISUAL CLARITY UPGRADE */
    --ccg-hero-title-glow: 0.52;
    --ccg-hero-title-glow-soft: 0.26;
}

body[data-ccg-mode="amiga"] .ccg-page--collections-index,
body.amiga-mode .ccg-page--collections-index {
    /* OMEGA VISUAL CLARITY UPGRADE */
    --ccg-hero-title-glow: 0.48;
    --ccg-hero-title-glow-soft: 0.24;
}

.ccg-page--collections-index .ccg-hero--collections::before {
    /* OMEGA VISUAL CLARITY UPGRADE */
    background:
        radial-gradient(circle at 50% 16%, rgba(255,255,255,0.12), transparent 58%),
        radial-gradient(circle at 50% 120%, rgba(0,0,0,0.6), transparent 48%),
        linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.64));
    opacity: 0.8;
}

.ccg-page--collections-index .ccg-hero--collections .ccg-hero-image {
    /* OMEGA VISUAL CLARITY UPGRADE */
    opacity: 0.66;
    filter: saturate(1.12) contrast(1.04);
}

.ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-title {
    /* OMEGA VISUAL CLARITY UPGRADE */
    text-shadow:
        0 20px 44px rgba(0,0,0,0.92),
        0 0 26px rgba(var(--accent-rgb), var(--ccg-hero-title-glow)),
        0 0 52px rgba(var(--accent-rgb), var(--ccg-hero-title-glow-soft));
}

@keyframes ccg-omega-collections-drift {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1.08);
        opacity: 0.56;
    }
    50% {
        transform: translate3d(0, -2%, 0) scale(1.12);
        opacity: 0.7;
    }
}

@keyframes ccg-omega-collections-halo {
    0%, 100% { opacity: 0.82; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ccg-page--collections-index .ccg-hero--collections::before,
    .ccg-page--collections-index .ccg-hero--collections .ccg-hero-image {
        animation: none;
    }
}

@media (max-width: 768px) {
    .ccg-page--collections-index .ccg-hero--collections {
        padding: 22px 16px 26px;
        min-height: 200px;
    }

    .ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-title {
        letter-spacing: 0.08em;
    }

    .ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-tagline {
        font-size: 1rem;
    }
}


.ccg-page--collections-index .ccg-genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    align-items: stretch;

    margin-top: 12px;
}

@media (min-width: 1024px) {
    .ccg-page--collections-index .ccg-genre-grid {
        gap: 30px;
    }
}


/* ============================================================
   COLLECTION CARDS — BOXED SET PRESENCE
============================================================ */

.ccg-page--collections-index .ccg-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.06),
            rgba(255,255,255,0.02)
        );

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.09),
        0 20px 52px rgba(0,0,0,0.72);

    transition:
        transform 0.32s ease,
        box-shadow 0.32s ease,
        filter 0.32s ease;
}

/* Media framing — obeys global thumbnail contracts */
.ccg-page--collections-index .ccg-card img {
    display: block;
    width: 100%;
    height: auto;
}

/* Title — curated authority */
.ccg-page--collections-index .ccg-card span {
    display: block;
    padding: 14px 16px 16px;

    font-family: var(--ccg-font-main);
    font-size: 0.9rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--ccg-text-light);

    text-shadow:
        0 0 14px rgba(var(--accent-rgb),0.30),
        0 14px 32px rgba(0,0,0,0.88);
}


/* ============================================================
   HOVER / FOCUS — PREMIUM, RESTRAINED
============================================================ */

@media (hover: hover) {

    .ccg-page--collections-index .ccg-card:hover,
    .ccg-page--collections-index .ccg-card:focus-within {
        transform: translateY(-3px);
        filter: brightness(1.04);

        box-shadow:
            0 0 0 1px rgba(var(--accent-rgb), 0.40),
            0 0 26px rgba(var(--accent-rgb), 0.32),
            0 26px 58px rgba(0,0,0,0.82);
    }

    .ccg-page--collections-index .ccg-card:hover img,
    .ccg-page--collections-index .ccg-card:focus-within img {
        filter: saturate(1.05) brightness(1.04);
    }
}

/* Touch devices — no fake hover */
@media (hover: none) {
    .ccg-page--collections-index .ccg-card:hover {
        transform: none;
        filter: none;
        box-shadow: none;
    }
}


/* ============================================================
   SECTION RHYTHM & PAGE FLOW
============================================================ */

.ccg-page--collections-index .ccg-section {
    margin-top: 34px;
    position: relative;
}

/* Soft divider glow between hero and grid */
.ccg-page--collections-index .ccg-section::before {
    content: none;
}

@media (max-width: 768px) {
    .ccg-page--collections-index .ccg-section {
        margin-top: 30px;
    }

    .ccg-page--collections-index .ccg-section::before {
        top: -20px;
    }
}

/* ============================================================
   SCROLL STABILITY FIX — COLLECTIONS INDEX ONLY
   Prevent transform-based scroll suppression
============================================================ */

.ccg-page--collections-index main > section {
    transform: none !important;
    animation: none !important;
    opacity: 1 !important;
}

/* =========================================================
   OMEGA HEADER SYSTEM
   Applies to ALL Collection & Genre headers
========================================================= */

.ccg-page--collections-index .ccg-hero-inner--collections {
    position: relative;
    padding: 28px 32px;
    border-radius: 14px;
    background: var(--omega-panel-bg, linear-gradient(135deg, rgba(10, 30, 45, 0.85), rgba(20, 55, 75, 0.85)));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--omega-panel-border, rgba(120, 220, 255, 0.25));
    box-shadow: 0 0 24px var(--omega-panel-glow, rgba(0, 180, 255, 0.15)), inset 0 0 0.5px rgba(255,255,255,0.15);
    overflow: hidden;
}

.ccg-page--collections-index .ccg-hero-inner--collections::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255,255,255,0.06), transparent 60%);
    pointer-events: none;
}

.ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-title {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: none;
    font-size: clamp(2.2rem, 3.5vw, 3.2rem);
    color: var(--omega-header-text, #e9fbff);
    text-shadow: 0 0 6px var(--omega-glow-inner, rgba(64, 220, 255, 0.9)), 0 0 18px var(--omega-glow-mid, rgba(32, 180, 255, 0.6)), 0 0 42px var(--omega-glow-outer, rgba(0, 120, 255, 0.35));
    animation: omegaHeaderEnter 600ms ease-out both, omegaGlowPulse 10s ease-in-out infinite;
}

.ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-tagline {
    margin-top: 10px;
    max-width: 900px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--omega-subtext, rgba(200, 235, 245, 0.85));
    letter-spacing: 0.03em;
    text-shadow: none;
}

@media (max-width: 768px) {
    .ccg-page--collections-index .ccg-hero-inner--collections {
        padding: 22px 20px;
    }

    .ccg-page--collections-index .ccg-hero-inner--collections .ccg-hero-title {
        font-size: 2rem;
    }
}
