/* ═══════════════════════════════════════════════════════════
 *  Gallery UI — Fixed UI, flip structure, gallery composition, runtime gate
 *  @module wp-gallery-ui.css
 * ═══════════════════════════════════════════════════════════ */

.wedding-portal__gallery-fixed-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 78;
}

.wedding-portal__gallery-fixed-ui .wedding-portal__gallery-heading,
.wedding-portal__gallery-fixed-ui .wedding-portal__gallery-copy-shell {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.wedding-portal__gallery-fixed-ui .wedding-portal__gallery-heading {
    top: clamp(44px, 7vh, 78px);
}

.wedding-portal__gallery-fixed-ui .wedding-portal__gallery-copy-shell {
    bottom: clamp(150px, 18vh, 220px);
}

.wedding-portal__gallery-fixed-ui .wedding-portal__controls {
    position: absolute;
    left: 50%;
    bottom: clamp(24px, 5vh, 44px);
    transform: translateX(-50%);
    pointer-events: none;
}

.wedding-portal__gallery-fixed-ui .wedding-portal__controls .wedding-portal__inquiry-button {
    pointer-events: auto;
}

.wedding-portal__card-shell {
    transform-style: preserve-3d;
}

.wedding-portal__card-face--front,
.wedding-portal__card-face--back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.wedding-portal__card-face--back {
    transform: rotateY(180deg) translateZ(1px);
}

.wedding-portal__card-form {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    opacity: 0;
    pointer-events: none;
    z-index: 8;
}

.wedding-portal__card-form .wedding-portal__form-shell {
    position: relative;
    z-index: 2;
    height: 100%;
}

.wedding-portal__thumb-visual {
    overflow: hidden;
}

.wedding-portal__thumb-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.64;
}

.wedding-portal__thumb-image.is-empty {
    opacity: 0;
}

.wedding-portal__thumb-visual.is-thumb-empty {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 20%),
        linear-gradient(140deg, color-mix(in srgb, var(--portal-tone-c) 56%, white 44%), color-mix(in srgb, var(--portal-tone-c) 74%, black 26%));
}

.wedding-portal__brand-lockup {
    margin-top: 10px;
}

.wedding-portal__title {
    font-size: 35px;
    max-width: none;
    width: auto;
    line-height: 1.08;
    letter-spacing: 0.04em;
    margin-top: 18px;
    text-align: center;
}

.wedding-portal__script {
    margin-top: -5px;
    font-size: 20px;
    line-height: 1.05;
}

.wedding-portal__seal {
    width: 100px;
    margin-top: 0;
}

.wedding-portal__copy {
    margin-top: 0;
    max-width: none;
    width: auto;
    font-size: 12px;
    line-height: 1.6;
    letter-spacing: 0.22em;
    text-align: center;
}

.wedding-portal__keyhole-lockup {
    margin-top: 30px;
}

.wedding-portal__keyhole {
    width: 28px;
}

.wedding-portal__brand {
    font-size: 17px;
}

.wedding-portal__subbrand {
    font-size: 12px;
}

.wedding-portal__keyhole-text {
    font-size: 12px;
}

.wedding-portal__intro-top {
    gap: 20px;
}

.wedding-portal__intro-mid {
    margin-top: 15px;
}

.wedding-portal__intro-bottom {
    margin-top: 20px;
}

.wedding-portal__title span,
.wedding-portal__copy span {
    display: block;
    white-space: nowrap;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.wedding-portal__invitation-inner {
    padding-top: 50px;
}

@media (max-width: 900px) {
    .wedding-portal__gallery-fixed-ui .wedding-portal__gallery-copy-shell {
        bottom: 178px;
    }
}

@media (max-width: 640px) {
    .wedding-portal__gallery-fixed-ui .wedding-portal__gallery-heading {
        top: 22px;
    }

    .wedding-portal__gallery-fixed-ui .wedding-portal__gallery-copy-shell {
        bottom: 190px;
    }

    .wedding-portal__gallery-fixed-ui .wedding-portal__controls {
        width: min(92vw, 420px);
        bottom: 24px;
    }
}

/* Phase 52: Gallery composition tuned to reference mockup */

.wedding-portal__gallery-fixed-ui .wedding-portal__gallery-heading {
    top: clamp(18px, 3.6vh, 44px);
    width: min(92vw, 1220px);
}

.wedding-portal__gallery-heading-kicker {
    padding: 0 0 8px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.58rem, 0.72vw, 0.76rem);
    letter-spacing: 0.44em;
    color: rgba(66, 58, 47, 0.62);
}

.wedding-portal__gallery-heading-title {
    font-size: clamp(2.1rem, 3vw, 3.5rem);
    font-weight: 500;
    letter-spacing: 0.14em;
    color: rgba(54, 46, 35, 0.9);
}

.wedding-portal__gallery-heading-script {
    margin-top: 2px;
    font-size: clamp(1.3rem, 1.5vw, 1.85rem);
    line-height: 0.95;
    color: rgba(72, 62, 50, 0.72);
}

.wedding-portal__seo-support--portfolio,
.wedding-portal__gallery-copy-shell {
    display: none !important;
}

.wedding-portal__gallery-card {
    border-radius: 6px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        linear-gradient(160deg, rgba(21, 24, 30, 0.95), rgba(14, 16, 21, 0.98));
    box-shadow:
        0 26px 56px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wedding-portal__gallery-card::before,
.wedding-portal__player-frame::before {
    inset: 10px;
    border-radius: 2px;
    background: rgba(5, 6, 9, 0.36);
    opacity: 0.9;
}

.wedding-portal__gallery-card::after,
.wedding-portal__player-frame::after {
    opacity: 0.98;
    mix-blend-mode: normal;
    background-size: 96% 92%;
}

.wedding-portal__thumb-visual {
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(145deg, rgba(18, 21, 27, 0.94), rgba(11, 13, 19, 0.98));
}

.wedding-portal__thumb-image {
    opacity: 0.34;
}

.wedding-portal__thumb-grid,
.wedding-portal__thumb-glow,
.wedding-portal__thumb-orb {
    opacity: 0.1;
}

.wedding-portal__thumb-meta,
.wedding-portal__thumb-duration {
    display: none;
}

.wedding-portal__thumb-play {
    width: clamp(24px, 2.5vw, 34px);
    border-color: rgba(255, 238, 201, 0.24);
    background: rgba(255, 255, 255, 0.05);
}

.wedding-portal__thumb-triangle {
    margin-left: 1px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid rgba(255, 247, 228, 0.72);
}

.wedding-portal__player-frame {
    border-radius: 8px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 247, 232, 0.05), transparent 22%),
        linear-gradient(150deg, rgba(24, 26, 33, 0.98), rgba(10, 12, 18, 0.98));
    box-shadow:
        0 34px 74px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.wedding-portal__player-frame--turn-concealed {
    background: transparent !important;
}

.wedding-portal__player-frame--turn-stretched {
    grid-template-columns: minmax(0, 1fr) !important;
}

.wedding-portal__player-frame--turn-stretched .wedding-portal__player-visual {
    grid-column: 1 / -1;
    height: 100%;
    min-height: 100%;
    min-width: 100%;
    aspect-ratio: auto;
    align-self: stretch;
}

.wedding-portal__player-frame--turn-concealed::before,
.wedding-portal__player-frame--turn-concealed::after,
.wedding-portal__player-frame--turn-concealed .wedding-portal__player-visual,
.wedding-portal__player-frame--turn-concealed .wedding-portal__player-meta {
    opacity: 0 !important;
}

.wedding-portal__player-visual {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(145deg, rgba(20, 23, 30, 0.96), rgba(9, 10, 14, 0.98));
}

.wedding-portal__player-grid,
.wedding-portal__player-glow,
.wedding-portal__player-orb,
.wedding-portal__player-scrim {
    opacity: 0.08;
}

.wedding-portal__player-play {
    width: clamp(84px, 7.8vw, 112px);
    border-color: rgba(255, 240, 210, 0.5);
    background: rgba(255, 255, 255, 0.09);
}

.wedding-portal__player-triangle {
    border-left-color: rgba(255, 250, 240, 0.92);
}

.wedding-portal__controls {
    width: min(90vw, 1140px);
    gap: 14px;
    bottom: clamp(14px, 2.8vh, 26px);
}

.wedding-portal__gallery-note {
    max-width: 92ch;
    font-size: clamp(0.72rem, 0.92vw, 0.86rem);
    line-height: 1.25;
    font-style: italic;
    color: rgba(88, 78, 62, 0.6);
}

.wedding-portal__inquiry-button {
    padding: 13px 44px;
    border-radius: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    letter-spacing: 0.16em;
    color: rgba(63, 50, 33, 0.92);
    background:
        linear-gradient(90deg, rgba(178, 154, 116, 0.7), rgba(255, 255, 255, 0.64) 50%, rgba(178, 154, 116, 0.7)),
        rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(177, 146, 98, 0.62);
    box-shadow:
        0 10px 18px rgba(60, 49, 34, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.wedding-portal__gallery-footer {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.88rem, 1.1vw, 1.06rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(95, 81, 56, 0.66);
}

@media (max-width: 900px) {
    .wedding-portal__gallery-fixed-ui .wedding-portal__gallery-heading {
        top: clamp(14px, 2.6vh, 28px);
    }

    .wedding-portal__gallery-heading-title {
        font-size: clamp(1.56rem, 6.2vw, 2.6rem);
        letter-spacing: 0.09em;
    }

    .wedding-portal__gallery-heading-script {
        font-size: clamp(1.1rem, 3.8vw, 1.5rem);
    }

    .wedding-portal__controls {
        width: min(94vw, 760px);
        bottom: clamp(10px, 2.4vh, 18px);
    }
}

@media (max-width: 640px) {
    .wedding-portal__gallery-note {
        max-width: 40ch;
        font-size: 0.7rem;
    }

    .wedding-portal__inquiry-button {
        padding: 12px 30px;
        font-size: 0.95rem;
    }

    .wedding-portal__gallery-footer {
        font-size: 0.72rem;
        letter-spacing: 0.12em;
    }
}

/* Temporary runtime gate: keep gallery markup in DOM, but fully disable legacy gallery visuals/motion. */
.wedding-portal [data-stage-root][hidden] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.wedding-portal.wedding-portal--gallery-runtime-disabled .wedding-portal__gallery,
.wedding-portal.wedding-portal--gallery-runtime-disabled .wedding-portal__gallery-fixed-ui,
.wedding-portal.wedding-portal--gallery-runtime-disabled .wedding-portal__controls,
.wedding-portal.wedding-portal--gallery-runtime-disabled .wedding-portal__player-frame {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.wedding-portal.wedding-portal--gallery-runtime-disabled .wedding-portal__gallery-card {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translate3d(-50%, -50%, -160px) scale(0.6) !important;
}

