/*
============================================================
 SAGE SEVEN REALMS — RESPONSIVE INTERIOR SHELL
 DESKTOP + TABLET + PHONE
 2026-08-17
============================================================
*/

/*
 Landing has its own new responsive composition.
 Everything here deliberately targets NON-LANDING pages only.
*/


/* =========================================================
   1. RELEASE THE OLD FIXED VIEWPORT
   ========================================================= */

html {
    min-height: 100%;
    height: auto;
}

body:not(.landing-page) {
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    position: relative !important;
}


/* Background remains cinematic and fixed. */
body:not(.landing-page) .bg-layer {
    position: fixed !important;
}


/* =========================================================
   2. SHARED NAVIGATION
   ========================================================= */

body:not(.landing-page) .top-nav {
    position: sticky !important;

    top: 0 !important;
    left: auto !important;
    right: auto !important;

    width: 100% !important;
    height: 58px !important;

    z-index: 1000 !important;
}

body:not(.landing-page) .nav-inner {
    width: min(1400px, 100%) !important;
    height: 100% !important;

    margin: 0 auto !important;
    padding: 0 24px !important;
}


/*
 The old fixed SAGE back button duplicates the page return bar
 and is what created the large overlapping BACK block on phone.
*/
body:not(.landing-page) .sage-back-btn {
    display: none !important;
}


/* =========================================================
   3. CULTURAL BANNER — NORMAL FLOW
   ========================================================= */

body:not(.landing-page) .cultural-banner {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    transform: none !important;

    width: min(900px, calc(100% - 32px)) !important;
    max-width: 900px !important;

    margin: 16px auto 0 !important;
}


/* Old special clearance is no longer necessary. */
body:not(.landing-page) .portal-stage.has-cultural-banner,
body:not(.landing-page) .stage-story.has-cultural-banner {
    padding-top: 0 !important;
}


/* =========================================================
   4. SISTER-SITE BAR — NORMAL FLOW
   ========================================================= */

body:not(.landing-page) .sisters-stage {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    width: 100% !important;

    margin: 0 !important;
}

body:not(.landing-page) .gateway-stage.has-sisters-bar {
    padding-top: 0 !important;
}


/* =========================================================
   5. SITE-WIDE ADS — REAL PAGE POSITIONS
   ========================================================= */

body:not(.landing-page) .ad-slot.ad-top-global,
body:not(.landing-page) .ad-slot.ad-bottom-global {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    transform: none !important;

    width: min(728px, calc(100% - 32px)) !important;
    height: 60px !important;

    margin-right: auto !important;
    margin-left: auto !important;

    z-index: 20 !important;
}

body:not(.landing-page) .ad-slot.ad-top-global {
    margin-top: 16px !important;
    margin-bottom: 18px !important;
}

body:not(.landing-page) .ad-slot.ad-bottom-global {
    margin-top: 28px !important;
    margin-bottom: 20px !important;
}


/* =========================================================
   6. MAIN PAGE — NORMAL DOCUMENT SCROLL
   ========================================================= */

body:not(.landing-page) .main-stage {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    width: min(1180px, calc(100% - 40px)) !important;
    max-width: 1180px !important;

    height: auto !important;
    min-height: 0 !important;

    margin: 0 auto !important;
    padding: 12px 0 34px !important;

    overflow: visible !important;

    display: block !important;

    z-index: 10 !important;
}


/* =========================================================
   7. RETURN / BREADCRUMB BAR — NO FLOATING OVERLAP
   ========================================================= */

body:not(.landing-page) .return-bar {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    width: 100% !important;
    max-width: 1100px !important;

    margin: 0 auto 22px !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;

    gap: 10px 18px !important;

    z-index: 20 !important;
}

body:not(.landing-page) .return-link {
    display: inline-flex !important;
    align-items: center !important;

    min-height: 34px;

    padding: 6px 12px !important;

    border: 1px solid rgba(201,162,74,.24);
    border-radius: 999px;

    background: rgba(5,5,13,.54);
}


/* =========================================================
   8. RELEASE OLD 100% HEIGHT CONTENT STAGES
   ========================================================= */

body:not(.landing-page) .portal-stage,
body:not(.landing-page) .sections-stage,
body:not(.landing-page) .gallery-stage,
body:not(.landing-page) .signs-stage,
body:not(.landing-page) .oracle-stage,
body:not(.landing-page) .stories-stage,
body:not(.landing-page) .stage-story,
body:not(.landing-page) .museum-stage,
body:not(.landing-page) .about-stage,
body:not(.landing-page) .search-stage {
    width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    overflow: visible !important;

    align-items: flex-start !important;
}


/* =========================================================
   9. TRADITION HUB
   ========================================================= */

body:not(.landing-page) .portal-stage {
    justify-content: center !important;
}

body:not(.landing-page) .portal-inner {
    width: 100% !important;
    max-width: 1050px !important;

    margin: 0 auto !important;
    padding: 10px 0 22px !important;

    gap: 24px !important;
}

body:not(.landing-page) .portal-header {
    width: 100%;
    max-width: 820px;

    margin: 0 auto;
}

body:not(.landing-page) .portal-doors {
    width: 100% !important;
    max-width: 960px !important;

    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

    gap: 18px !important;
}

body:not(.landing-page) .portal-door {
    min-height: 150px !important;

    padding: 24px 18px !important;

    justify-content: center !important;
}


/* =========================================================
   10. DEEP SECTIONS
   ========================================================= */

body:not(.landing-page) .sections-stage {
    justify-content: center !important;
}

body:not(.landing-page) .sections-inner {
    width: 100% !important;
    max-width: 900px !important;

    margin: 0 auto !important;
    padding: 8px 0 24px !important;
}

body:not(.landing-page) .sections-list-stage {
    width: 100% !important;
}

body:not(.landing-page) .section-card-stage {
    width: 100% !important;

    padding: 18px 20px !important;
}


/* =========================================================
   11. GALLERY
   ========================================================= */

body:not(.landing-page) .gallery-stage {
    justify-content: center !important;
}

body:not(.landing-page) .gallery-inner {
    width: 100% !important;
    max-width: 1050px !important;

    margin: 0 auto !important;
    padding: 10px 0 30px !important;
}

body:not(.landing-page) .gallery-framed-grid {
    width: 100% !important;

    grid-template-columns:
        repeat(auto-fit, minmax(210px, 1fr)) !important;
}


/* =========================================================
   12. FOOTER — BELOW CONTENT, NEVER OVER IT
   ========================================================= */

body:not(.landing-page) .empire-footer {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    width: 100% !important;

    margin: 0 !important;

    z-index: 20 !important;

    background: rgba(3,3,10,.88) !important;
    border-top: 1px solid rgba(201,162,74,.16) !important;
}

body:not(.landing-page) .footer-inner {
    width: min(1200px, calc(100% - 40px)) !important;

    margin: 0 auto !important;
    padding: 18px 0 !important;
}


/* =========================================================
   13. TABLET
   ========================================================= */

@media (max-width: 1024px) {

    body:not(.landing-page) .main-stage {
        width: calc(100% - 32px) !important;
    }

    body:not(.landing-page) .portal-doors {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    body:not(.landing-page) .medallion-cluster {
        display: none !important;
    }
}


/* =========================================================
   14. PHONE
   ========================================================= */

@media (max-width: 768px) {

    body:not(.landing-page) .top-nav {
        height: 58px !important;
    }

    body:not(.landing-page) .nav-inner {
        padding: 0 18px !important;
    }

    body:not(.landing-page) .nav-logo {
        font-size: 1rem !important;
        letter-spacing: .08em !important;
    }

    body:not(.landing-page) .nav-toggle {
        font-size: 1.55rem !important;
    }


    /* Top/bottom banner ads */
    body:not(.landing-page) .ad-slot.ad-top-global,
    body:not(.landing-page) .ad-slot.ad-bottom-global {
        width: calc(100% - 20px) !important;
        max-width: 420px !important;

        height: 50px !important;
    }

    body:not(.landing-page) .ad-slot.ad-top-global {
        margin-top: 12px !important;
        margin-bottom: 16px !important;
    }

    body:not(.landing-page) .ad-slot.ad-bottom-global {
        margin-top: 22px !important;
        margin-bottom: 14px !important;
    }


    /* Main content */
    body:not(.landing-page) .main-stage {
        width: calc(100% - 22px) !important;

        margin: 0 auto !important;

        padding: 6px 0 26px !important;
    }


    /* Breadcrumbs / return */
    body:not(.landing-page) .return-bar {
        margin-bottom: 14px !important;

        gap: 7px !important;
    }

    body:not(.landing-page) .return-link {
        min-height: 32px !important;

        padding: 5px 10px !important;

        font-size: .68rem !important;
        letter-spacing: .08em !important;
    }


    /* Cultural message */
    body:not(.landing-page) .cultural-banner {
        width: calc(100% - 22px) !important;

        margin-top: 12px !important;

        padding: 10px 12px !important;
    }


    /* Tradition hub */
    body:not(.landing-page) .portal-inner {
        gap: 18px !important;

        padding-top: 2px !important;
    }

    body:not(.landing-page) .portal-title {
        font-size: clamp(1.65rem, 8vw, 2.25rem) !important;

        line-height: 1.1 !important;
    }

    body:not(.landing-page) .portal-tagline {
        font-size: .72rem !important;

        line-height: 1.5 !important;
        letter-spacing: .11em !important;
    }

    body:not(.landing-page) .portal-doors {
        grid-template-columns: 1fr !important;

        gap: 12px !important;
    }

    body:not(.landing-page) .portal-door {
        min-height: 132px !important;

        padding: 18px 14px !important;

        border-radius: 14px !important;
    }


    /* Deep Sections */
    body:not(.landing-page) .sections-inner {
        gap: 12px !important;
    }

    body:not(.landing-page) .sections-title {
        font-size: clamp(1.65rem, 8vw, 2rem) !important;

        text-align: center !important;
    }

    body:not(.landing-page) .sections-subtitle {
        font-size: .9rem !important;

        text-align: center !important;
    }

    body:not(.landing-page) .sections-list-stage {
        gap: 9px !important;
    }

    body:not(.landing-page) .section-card-stage {
        gap: 10px !important;

        padding: 14px 12px !important;
    }

    body:not(.landing-page) .section-number-stage {
        min-width: 26px !important;

        font-size: 1.2rem !important;
    }

    body:not(.landing-page) .section-info-stage h3 {
        font-size: 1rem !important;
    }

    body:not(.landing-page) .section-info-stage p {
        font-size: .82rem !important;

        line-height: 1.45 !important;
    }


    /* Gallery */
    body:not(.landing-page) .gallery-framed-grid {
        grid-template-columns: 1fr !important;
    }


    /* Footer */
    body:not(.landing-page) .footer-inner {
        width: calc(100% - 28px) !important;

        padding: 16px 0 18px !important;

        flex-direction: column !important;

        gap: 10px !important;

        text-align: center !important;
    }

    body:not(.landing-page) .footer-right {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
}


/* =========================================================
   15. SMALL PHONE
   ========================================================= */

@media (max-width: 430px) {

    body:not(.landing-page) .main-stage {
        width: calc(100% - 18px) !important;
    }

    body:not(.landing-page) .portal-door {
        min-height: 120px !important;
    }

    body:not(.landing-page) .section-card-stage {
        border-radius: 10px !important;
    }
}


/*
============================================================
 SAGE SEVEN REALMS — ARTWORK HUB DOORS
 2026-08-17
============================================================
*/

body:not(.landing-page) .portal-doors.portal-art-doors {
    width: 100% !important;
    max-width: 1120px !important;

    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

    gap: 22px !important;

    margin: 4px auto 0 !important;
}

body:not(.landing-page) .portal-art-door {
    position: relative;

    display: block;

    width: 100%;

    overflow: hidden;

    border: 1px solid rgba(224,169,79,.40);
    border-radius: 15px;

    background: rgba(3,3,10,.88);

    text-decoration: none;

    box-shadow:
        0 14px 36px rgba(0,0,0,.55),
        0 0 24px rgba(224,169,79,.08);

    transition:
        transform .22s ease,
        border-color .22s ease,
        box-shadow .22s ease;
}

body:not(.landing-page) .portal-art-door:hover {
    transform: translateY(-4px);

    border-color: rgba(244,202,104,.78);

    box-shadow:
        0 18px 42px rgba(0,0,0,.68),
        0 0 30px rgba(224,169,79,.18);
}

body:not(.landing-page) .portal-art-image {
    display: block;

    width: 100%;
    aspect-ratio: 16 / 9;

    object-fit: cover;
    object-position: center;

    background: #05050c;
}

body:not(.landing-page) .portal-art-meta {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    padding: 7px 12px;

    border-top: 1px solid rgba(224,169,79,.18);

    background:
        linear-gradient(
            180deg,
            rgba(12,10,24,.96),
            rgba(4,4,11,.98)
        );

    color: rgba(239,224,190,.70);

    font-family: var(--font-ui);
    font-size: .66rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}


/* Tablet */
@media (max-width: 900px) {

    body:not(.landing-page) .portal-doors.portal-art-doors {
        gap: 15px !important;
    }
}


/* Phone */
@media (max-width: 680px) {

    body:not(.landing-page) .portal-doors.portal-art-doors {
        grid-template-columns: 1fr !important;

        gap: 14px !important;
    }

    body:not(.landing-page) .portal-art-door {
        border-radius: 12px;
    }

    body:not(.landing-page) .portal-art-meta {
        min-height: 30px;

        padding: 5px 10px;

        font-size: .59rem;
    }
}


/*
============================================================
 SAGE SEVEN REALMS — UNIFIED HUB DOOR GEOMETRY
 2026-08-17
============================================================
*/

/*
 Every doorway gets the exact same outer proportion.
 The lower 34px is reserved for the information strip.
*/
body:not(.landing-page) .portal-art-door {
    width: 100% !important;

    aspect-ratio: 16 / 10 !important;

    display: grid !important;
    grid-template-rows: minmax(0, 1fr) 34px !important;

    padding: 0 !important;

    overflow: hidden !important;
}


/*
 Force every source image — including the taller Sacred Signs
 artwork — into the exact same visual viewport.
*/
body:not(.landing-page) .portal-art-image {
    display: block !important;

    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;

    aspect-ratio: auto !important;

    object-fit: cover !important;
    object-position: center center !important;

    margin: 0 !important;
}


/* Identical information strip on every card. */
body:not(.landing-page) .portal-art-meta {
    width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;

    margin: 0 !important;
    padding: 0 12px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}


/* Phone keeps the same proportions, only smaller. */
@media (max-width: 680px) {

    body:not(.landing-page) .portal-art-door {
        aspect-ratio: 16 / 10 !important;
        grid-template-rows: minmax(0, 1fr) 30px !important;
    }

    body:not(.landing-page) .portal-art-meta {
        height: 30px !important;
        min-height: 30px !important;
    }
}
