/* ==========================================================================
   IMungro - Horizontal Scroll Styles
   Full-page slider based horizontal scroll
   ========================================================================== */

/* Horizontal scroll wrapper - only active on front page */
body.im-horizontal-scroll-active {
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100vh;
}

.im-horizontal-scroll-wrapper {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    position: relative;
}

body.im-horizontal-scroll-active .im-horizontal-scroll-wrapper {
    height: 100vh;
    width: max-content;
    max-width: none;
    will-change: transform;
}

/* Each section is a full viewport slide */
.im-hscroll-section {
    flex: 0 0 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

body.im-horizontal-scroll-active .im-hscroll-section {
    height: 100vh;
}

/* Section inner */
.im-section-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.im-section-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

/* Section title */
.im-section-title {
    font-family: var(--im-font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--im-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.im-section-desc {
    font-family: var(--im-font-body);
    font-size: 1.25rem;
    color: var(--im-on-surface-variant);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.im-label-caps {
    font-family: var(--im-font-nav);
    font-size: 12px;
    font-weight: 600;
    color: var(--im-secondary);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.im-hero-title {
    font-family: var(--im-font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--im-on-surface);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 1rem;
}

.im-hero-subtitle {
    font-family: var(--im-font-body);
    font-size: clamp(1.1rem, 2.5vw, 1.75rem);
    color: var(--im-on-surface-variant);
    font-style: italic;
    margin-bottom: 2.5rem;
}

.im-hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Books Section
   ========================================================================== */

.im-books-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Characters Section
   ========================================================================== */

.im-character-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.im-category-card {
    text-align: center;
    transition: all var(--im-transition-base);
}

.im-category-card:hover {
    border-color: var(--im-secondary-container);
    box-shadow: 0 0 24px rgba(0, 210, 255, 0.15);
}

.im-category-card h3 {
    font-family: var(--im-font-display);
    font-size: 1.5rem;
    color: var(--im-primary);
    margin-bottom: 0.75rem;
}

.im-category-card p {
    font-size: 0.95rem;
    color: var(--im-on-surface-variant);
    margin: 0;
}

/* ==========================================================================
   Coming Soon
   ========================================================================== */

.im-coming-soon {
    font-family: var(--im-font-display);
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--im-outline);
    font-style: italic;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ==========================================================================
   Progress Bar (Top)
   ========================================================================== */

.im-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    z-index: 9100;
}

.im-progress-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--im-primary), var(--im-secondary-container));
    transition: width 0.1s linear;
}

/* ==========================================================================
   Non-horizontal-scroll pages (regular vertical scroll)
   ========================================================================== */

body:not(.im-horizontal-scroll-active) .im-horizontal-scroll-wrapper {
    display: block;
    width: 100%;
}

body:not(.im-horizontal-scroll-active) .im-hscroll-section {
    width: 100%;
    min-height: auto;
    padding: 5rem 0;
}

body:not(.im-horizontal-scroll-active) .im-progress-bar {
    display: none;
}

/* Arrows are always visible on all pages — JS controls their behavior */

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
}

@media (max-width: 768px) {
    .im-character-categories {
        grid-template-columns: 1fr;
    }


    .im-hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .im-books-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================================================
   Arrow Navigation Buttons (left/right edges)
   ========================================================================== */

.im-scroll-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(242, 202, 80, 0.3);
    border-radius: 50%;
    color: var(--im-primary, #f2ca50);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.im-scroll-arrow:hover {
    opacity: 1;
    border-color: var(--im-primary, #f2ca50);
    background: rgba(242, 202, 80, 0.1);
    box-shadow: 0 0 20px rgba(242, 202, 80, 0.3);
}

.im-scroll-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.im-scroll-arrow.im-scroll-arrow-disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

.im-scroll-arrow-prev {
    left: 60px;
}

.im-scroll-arrow-next {
    right: 60px;
}

/* Mobile arrow buttons — smaller, positioned inside viewport edges */
@media (max-width: 1024px) {
    .im-scroll-arrow {
        width: 52px;
        height: 52px;
        opacity: 0.55;
    }

    .im-scroll-arrow:hover {
        opacity: 0.9;
    }

    .im-scroll-arrow svg {
        width: 28px;
        height: 28px;
    }

    .im-scroll-arrow-prev {
        left: 16px;
    }

    .im-scroll-arrow-next {
        right: 16px;
    }
}

@media (max-width: 480px) {
    .im-scroll-arrow {
        width: 44px;
        height: 44px;
        opacity: 0.5;
    }

    .im-scroll-arrow svg {
        width: 22px;
        height: 22px;
    }

    .im-scroll-arrow-prev {
        left: 10px;
    }

    .im-scroll-arrow-next {
        right: 10px;
    }
}


/* ==========================================================================
   Arrow-focused button highlight (non-front-page pages)
   When arrow nav cycles through buttons, the active one gets this glow
   ========================================================================== */

.im-arrow-focused {
    outline: 2px solid var(--im-primary) !important;
    outline-offset: 4px;
    box-shadow: 0 0 20px rgba(242, 202, 80, 0.4) !important;
    transition: all 0.3s ease;
}


/* ==========================================================================
   Mobile/Tablet Overflow Guards
   Prevent any horizontal scrolling from 100vw or element widths
   ========================================================================== */
@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        position: relative !important;
    }

    .im-horizontal-scroll-wrapper {
        max-width: 100% !important;
    }

    .im-hscroll-section {
        max-width: 100% !important;
    }

    /* Prevent any Elementor container from overflowing */
    .elementor-section,
    .elementor-container,
    .elementor-column {
        max-width: 100% !important;
    }
}
