/**
 * Portal shell — global reset, header, nav drawer, footer, skip-link.
 * Loaded on every portal page (after portal-tokens.css). Page-specific
 * sections (hero, carousels, etc.) live in portal-home-page.css or the
 * per-page stylesheets pushed via @push('styles').
 *
 * Unified breakpoints: 1180 / 760 / 420 (see portal-tokens.css).
 */

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

html {
    scroll-behavior: auto;
    -webkit-text-size-adjust: 100%;
}

body.portal-body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink-soft);
    background: var(--paper);
    line-height: 1.75;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
select,
input {
    font: inherit;
}

.portal-container {
    width: min(1200px, calc(100% - 2.5rem));
    margin-inline: auto;
}

/* ========== Accessibility: skip link & focus visibility ========== */
.skip-link {
    position: absolute;
    top: -3rem;
    inset-inline-start: 1rem;
    z-index: 1000;
    background: var(--maroon);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.65rem 1.1rem;
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow-md);
    transition: top 0.2s ease;
}

.skip-link:focus-visible,
.skip-link:focus {
    top: 0;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--maroon);
    outline-offset: 2px;
    border-radius: 6px;
}

.btn:focus-visible,
.header-icon:focus-visible,
.menu-toggle:focus-visible,
.carousel__btn:focus-visible,
.carousel__dot:focus-visible {
    outline: 2px solid var(--maroon);
    outline-offset: 2px;
}

/* ========== Shared alert (x-portal.alert) ========== */
.portal-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.6;
    border: 1px solid transparent;
}

.portal-alert--success {
    background: rgba(47, 107, 79, 0.1);
    border-color: rgba(47, 107, 79, 0.25);
    color: #1f5b3f;
}

.portal-alert--error {
    background: rgba(122, 24, 36, 0.08);
    border-color: rgba(122, 24, 36, 0.22);
    color: var(--maroon);
}

.portal-alert--info {
    background: rgba(197, 160, 109, 0.12);
    border-color: rgba(197, 160, 109, 0.28);
    color: var(--ink-soft);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== Buttons (shared across shell + pages) ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease,
        color 0.25s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn--ticket {
    background: linear-gradient(180deg, var(--maroon-soft), var(--maroon));
    color: var(--white);
    padding: 0.72rem 1.15rem;
    box-shadow:
        0 10px 24px rgba(109, 14, 14, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn--ticket:hover {
    background: linear-gradient(180deg, var(--maroon), var(--maroon-deep));
}

.btn--header {
    padding: 0.68rem 1.1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    gap: 0.4rem;
    box-shadow: 0 8px 18px rgba(122, 24, 36, 0.2);
}

.btn--gold {
    background: linear-gradient(180deg, var(--gold-soft), var(--gold));
    color: var(--ink);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 24px rgba(169, 132, 79, 0.25);
}

.btn--gold:hover {
    background: linear-gradient(180deg, #ead4a8, var(--gold-deep));
    color: var(--white);
}

/* ========== Header ========== */
.site-header {
    --header-pad-y: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(10, 10, 10, 0.88);
    border-bottom: 1px solid rgba(197, 160, 89, 0.12);
    transition:
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

.site-header.is-scrolled {
    background: rgba(10, 10, 10, 0.96);
    border-bottom-color: rgba(197, 160, 89, 0.16);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.site-header__bar {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: var(--header-pad-y);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.88;
}

.brand__mark {
    width: 52px;
    height: auto;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(20, 30, 70, 0.18));
}

.brand__text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.brand__name {
    font-family: var(--display);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
    white-space: nowrap;
}

.brand__tag {
    font-size: 0.76rem;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.1rem 0.15rem;
    flex: 1;
    min-width: 0;
}

.site-nav__link {
    position: relative;
    padding: 0.45rem 0.62rem 0.7rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #cccccc;
    white-space: nowrap;
    transition: color 0.22s ease;
}

.site-nav__link::after {
    content: "";
    position: absolute;
    right: 0.55rem;
    left: 0.55rem;
    bottom: 0.2rem;
    height: 2.5px;
    border-radius: 999px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.28s ease;
}

.site-nav__link:hover {
    color: var(--gold-soft);
}

.site-nav__link.is-active {
    color: var(--gold-soft);
}

.site-nav__link.is-active::after {
    transform: scaleX(1);
}

/* Mobile drawer — hidden on desktop */
.nav-drawer {
    display: none;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.brand-partner {
    display: block;
    height: 48px;
    width: auto;
    max-width: min(260px, 30vw);
    object-fit: contain;
    object-position: center;
    flex-shrink: 1;
    background: transparent;
}

.header-icon {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    color: #cccccc;
    border-radius: 10px;
    transition: color 0.2s ease, background 0.2s ease;
}

.header-icon:hover {
    color: var(--gold-soft);
    background: rgba(197, 160, 89, 0.08);
}

.header-login {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #cccccc;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.35rem 0.15rem;
    transition: color 0.2s ease;
}

.header-login svg {
    flex-shrink: 0;
    color: #a0a0a0;
    transition: color 0.2s ease;
}

.header-login:hover,
.header-login:hover svg {
    color: var(--gold-soft);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    place-items: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.menu-toggle__lines,
.menu-toggle__lines::before,
.menu-toggle__lines::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    position: relative;
    transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.menu-toggle__lines::before,
.menu-toggle__lines::after {
    content: "";
    position: absolute;
    inset-inline: 0;
}

.menu-toggle__lines::before { top: -6px; }
.menu-toggle__lines::after { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__lines {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__lines::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__lines::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ========== Footer ========== */
.site-footer {
    --footer-ink: #120e10;
    --footer-panel: #1a1417;
    --footer-line: rgba(223, 199, 154, 0.14);
    --footer-muted: rgba(255, 255, 255, 0.58);
    position: relative;
    margin-top: 4rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.82);
    background:
        radial-gradient(ellipse 70% 55% at 100% 0%, rgba(122, 24, 36, 0.28), transparent 55%),
        radial-gradient(ellipse 55% 45% at 0% 100%, rgba(197, 160, 109, 0.1), transparent 50%),
        linear-gradient(180deg, #1c1417 0%, var(--footer-ink) 100%);
    border-top: 1px solid var(--footer-line);
}

.site-footer__glow {
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(197, 160, 109, 0.55) 35%,
        rgba(223, 199, 154, 0.85) 50%,
        rgba(197, 160, 109, 0.55) 65%,
        transparent 100%
    );
    pointer-events: none;
}

.site-footer__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.45fr repeat(3, minmax(0, 1fr));
    gap: 2.4rem 2rem;
    padding: 3.4rem 0 2.6rem;
}

.site-footer__brand-block {
    max-width: 34ch;
}

.site-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.site-footer__brand:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.site-footer__mark {
    width: 56px;
    height: auto;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.site-footer__brand strong {
    display: block;
    font-family: var(--display);
    font-size: 1.12rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.site-footer__brand em {
    display: block;
    margin-top: 0.15rem;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-soft);
    letter-spacing: 0.04em;
}

.site-footer__tagline {
    margin: 0 0 1.35rem;
    color: var(--footer-muted);
    line-height: 1.85;
    font-size: 0.95rem;
}

.site-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.site-footer__social-link {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition:
        color 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        transform 0.22s ease;
}

.site-footer__social-link:hover {
    color: var(--ink);
    background: var(--gold);
    border-color: var(--gold);
    transform: translateY(-2px);
}

.site-footer__title {
    margin: 0 0 1.05rem;
    font-family: var(--display);
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
}

.site-footer__title::after {
    content: "";
    display: block;
    width: 28px;
    height: 2px;
    margin-top: 0.55rem;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.site-footer__list,
.site-footer__contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.site-footer__list a {
    display: inline-block;
    font-weight: 600;
    font-size: 0.94rem;
    color: var(--footer-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.site-footer__list a:hover {
    color: var(--gold-soft);
    transform: translateX(-3px);
}

.site-footer__contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: var(--footer-muted);
    line-height: 1.55;
}

.site-footer__contact a {
    color: inherit;
    transition: color 0.2s ease;
}

.site-footer__contact a:hover {
    color: var(--gold-soft);
}

.site-footer__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    margin-top: 0.05rem;
    border-radius: 8px;
    color: var(--gold-soft);
    background: rgba(197, 160, 109, 0.1);
    border: 1px solid rgba(197, 160, 109, 0.16);
}

.site-footer__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1.35rem;
    padding: 0.72rem 1.15rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--ink);
    background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 55%, var(--gold-deep) 100%);
    box-shadow: 0 10px 24px rgba(169, 132, 79, 0.22);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.site-footer__cta:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 14px 28px rgba(169, 132, 79, 0.3);
}

.site-footer__bar {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.22);
}

.site-footer__bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 0 1.35rem;
}

.site-footer__copy,
.site-footer__credit {
    margin: 0;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.46);
}

.site-footer__credit {
    color: rgba(223, 199, 154, 0.55);
    font-weight: 600;
}

/* ========== Breakpoint: 1180 — nav collapses to drawer ========== */
@media (max-width: 1180px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .site-header__bar {
        gap: 1rem;
    }

    .site-nav--desktop {
        display: none;
    }

    .menu-toggle {
        display: inline-grid;
    }

    .nav-drawer {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 300;
        visibility: hidden;
        pointer-events: none;
    }

    .nav-drawer.is-open {
        visibility: visible;
        pointer-events: auto;
    }

    .nav-drawer__backdrop {
        position: absolute;
        inset: 0;
        border: 0;
        padding: 0;
        margin: 0;
        width: 100%;
        height: 100%;
        background: rgba(20, 10, 8, 0.55);
        opacity: 0;
        cursor: pointer;
        transition: opacity 0.28s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-drawer.is-open .nav-drawer__backdrop {
        opacity: 1;
    }

    .nav-drawer__panel {
        position: absolute;
        top: 0;
        bottom: 0;
        inset-inline-start: 0;
        width: min(86vw, 320px);
        max-width: 100%;
        display: flex;
        flex-direction: column;
        background: linear-gradient(180deg, #fffdf9 0%, #faf6f0 100%);
        border-inline-end: 1px solid rgba(122, 24, 36, 0.12);
        box-shadow: -12px 0 40px rgba(20, 10, 8, 0.22);
        transform: translate3d(110%, 0, 0);
        transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    [dir="ltr"] .nav-drawer__panel {
        box-shadow: 12px 0 40px rgba(20, 10, 8, 0.22);
        transform: translate3d(-110%, 0, 0);
    }

    .nav-drawer.is-open .nav-drawer__panel {
        transform: translate3d(0, 0, 0);
    }

    .nav-drawer__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 1.05rem 1rem 1rem;
        border-bottom: 1px solid rgba(90, 40, 40, 0.1);
        background: linear-gradient(135deg, rgba(122, 24, 36, 0.06), transparent 70%);
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .nav-drawer__brand {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        min-width: 0;
    }

    .nav-drawer__brand img {
        width: 40px;
        height: auto;
        flex-shrink: 0;
        object-fit: contain;
    }

    .nav-drawer__brand strong {
        display: block;
        font-family: var(--display);
        font-size: 0.95rem;
        font-weight: 800;
        color: var(--maroon);
        line-height: 1.3;
    }

    .nav-drawer__brand span {
        display: block;
        font-size: 0.78rem;
        color: var(--muted);
        font-weight: 600;
    }

    .nav-drawer__close {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        border: 1px solid rgba(90, 40, 40, 0.14);
        background: #fff;
        color: var(--maroon);
        display: inline-grid;
        place-items: center;
        cursor: pointer;
        flex-shrink: 0;
    }

    .nav-drawer__links {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.85rem;
        flex: 1;
    }

    .nav-drawer__link {
        display: block;
        padding: 0.95rem 1rem;
        border-radius: 12px;
        font-size: 1.02rem;
        font-weight: 700;
        color: #3f342f;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .nav-drawer__link:hover,
    .nav-drawer__link.is-active {
        background: rgba(122, 24, 36, 0.08);
        color: var(--maroon);
    }

    .nav-drawer__link.is-active {
        font-weight: 800;
        box-shadow: inset -3px 0 0 var(--maroon);
    }

    [dir="ltr"] .nav-drawer__link.is-active {
        box-shadow: inset 3px 0 0 var(--maroon);
    }

    .nav-drawer__foot {
        margin-top: auto;
        padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(90, 40, 40, 0.1);
        background: rgba(255, 252, 247, 0.98);
        position: sticky;
        bottom: 0;
    }

    .nav-drawer__cta {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    body.nav-drawer-open {
        overflow: hidden;
    }

    .site-footer__inner {
        grid-template-columns: 1.2fr 1fr 1fr;
        gap: 2.2rem 1.6rem;
    }

    .site-footer__col--contact {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: end;
        gap: 1rem 2rem;
    }

    .site-footer__col--contact .site-footer__title {
        grid-column: 1 / -1;
    }

    .site-footer__cta {
        margin-top: 0;
        align-self: center;
    }
}

/* ========== Breakpoint: 760 — phone shell ========== */
@media (max-width: 760px) {
    :root {
        --header-h: 64px;
    }

    body.portal-body {
        overscroll-behavior-y: none;
    }

    .portal-container {
        width: min(100%, calc(100% - 1.25rem));
    }

    .site-header {
        --header-pad-y: 0.55rem;
    }

    .site-header__bar {
        gap: 0.65rem;
        min-height: var(--header-h);
    }

    .brand__mark {
        width: 40px;
    }

    .brand-partner {
        height: 32px;
        max-width: min(148px, 42vw);
    }

    .brand__name {
        font-size: 0.88rem;
        max-width: 9.5rem;
        white-space: normal;
        line-height: 1.25;
    }

    .brand__tag,
    .header-login span,
    .btn__label {
        display: none;
    }

    .site-header__actions {
        gap: 0.35rem;
    }

    .btn--header,
    .menu-toggle {
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 12px;
    }

    body.nav-drawer-open {
        overflow: hidden;
    }

    .site-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        padding: 2rem 0 1.5rem;
    }

    .site-footer__col--contact {
        grid-template-columns: 1fr;
    }

    .site-footer__cta {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .site-footer__bar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    /* Chat widget (kept here since it is part of the persistent shell) */
    .portal-chat {
        inset-inline-end: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .portal-chat__fab {
        min-height: 48px;
        padding: 0.55rem 0.7rem;
        gap: 0;
    }

    .portal-chat__fab-label {
        display: none;
    }

    .portal-chat__fab-icon {
        width: 36px;
        height: 36px;
    }

    .portal-chat__panel {
        width: min(100vw - 1rem, 360px);
        max-height: min(72vh, 520px);
        inset-inline-end: 0;
    }
}

/* ========== Breakpoint: 420 — small phones ========== */
@media (max-width: 420px) {
    .brand__name {
        max-width: 7.8rem;
        font-size: 0.82rem;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 1.85rem;
        padding: 2.2rem 0 1.7rem;
    }

    .site-footer__col--contact {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .site-footer__cta {
        width: 100%;
        justify-content: center;
        margin-top: 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .btn,
    .site-footer__brand,
    .site-footer__social-link,
    .site-footer__list a,
    .site-footer__cta {
        transition: none !important;
    }

    .site-footer__brand:hover,
    .site-footer__social-link:hover,
    .site-footer__list a:hover,
    .site-footer__cta:hover {
        transform: none;
    }
}
