/* Guest page infrastructure only. Visual gallery/hero/button styling comes from EventTemplate.CustomCss. */

.template-preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.55rem 1rem;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.9rem;
    font-weight: 700;
}

.template-preview-banner a {
    color: #bfdbfe;
}

.event-password-gate,
.gb-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.event-password-gate[hidden],
.gb-modal[hidden] {
    display: none;
}

.event-password-gate {
    background: rgba(13, 15, 23, 0.78);
    backdrop-filter: blur(8px);
}

.event-password-gate-card,
.gb-modal-dialog {
    width: min(100%, 420px);
    background: var(--page-2, #fff);
    color: var(--ink, #111827);
    border: 1px solid var(--line, rgba(17, 24, 39, 0.12));
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.event-password-gate-card {
    padding: 1.4rem;
}

.event-password-gate-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.3rem 0.7rem;
    margin-bottom: 0.85rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent, #0ea5e9) 12%, white);
    color: var(--accent, #0ea5e9);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.event-password-gate-card h2 {
    margin: 0 0 0.55rem;
    line-height: 1.15;
}

.gb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 15, 23, 0.72);
    backdrop-filter: blur(5px);
}

.gb-modal-dialog {
    position: relative;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.gb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--line, rgba(17, 24, 39, 0.12));
    flex-shrink: 0;
}

.gb-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.gb-modal-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted, #6b7280);
    cursor: pointer;
}

.gb-modal-close:hover,
.gb-modal-close:focus {
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink, #111827);
}

.gb-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.gb-modal-footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--line, rgba(17, 24, 39, 0.12));
}

.event-guest-name {
    margin-bottom: 1.25rem;
}

.event-guest-name .form-label {
    font-weight: 800;
    color: var(--ink, #111827);
}

.event-upload-dropzone {
    display: grid;
    place-items: center;
    min-height: 240px;
    padding: 2rem 1rem;
    border: 2px dashed color-mix(in srgb, var(--accent, #0ea5e9) 34%, #94a3b8);
    border-radius: 14px;
    background: color-mix(in srgb, var(--page, #f8fafc) 74%, white);
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.event-upload-dropzone.is-dragging {
    border-color: var(--accent, #0ea5e9);
    background: color-mix(in srgb, var(--accent, #0ea5e9) 10%, white);
}

.event-upload-dropzone.is-disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.event-upload-dropzone-icon {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent, #0ea5e9) 14%, white);
    color: var(--accent, #0ea5e9);
    font-size: 2rem;
    line-height: 1;
}

.event-upload-dropzone h3 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.event-upload-dropzone p {
    margin: 0 0 1rem;
    color: var(--muted, #667085);
}

.gb-file-list {
    max-height: 88px;
    overflow-y: auto;
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted, #667085);
    font-size: 0.82rem;
    line-height: 1.6;
}

.gb-status-text,
.event-upload-progress-text {
    margin: 0.5rem 0 0;
    min-height: 1.2em;
    color: var(--muted, #667085);
    font-size: 0.86rem;
    text-align: center;
}

.event-upload-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent, #0ea5e9) 14%, white);
}

.event-upload-progress[hidden],
.event-upload-progress-text[hidden] {
    display: none;
}

.event-upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent, #0ea5e9);
    transition: width 160ms ease;
}

.event-upload-progress.is-error .event-upload-progress-bar {
    background: #dc2626;
}

.event-upload-progress.is-complete .event-upload-progress-bar {
    background: #16a34a;
}

.gb-limit-reached-notice {
    margin: 0.6rem 0 0;
    padding: 0.45rem 0.75rem;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.84rem;
    text-align: center;
}

.gb-limit-reached-notice[hidden] {
    display: none;
}

/* Album density controls live on the guest page, while each event template owns
   its own gallery skin. Keep these structural grid modes here so the controls
   work consistently across all seeded templates. */
body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--normal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--large {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--compact .guest-album-meta {
    display: none;
}

@media (min-width: 576px) {
    body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--compact {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--normal {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.75rem;
    }

    body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--large {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 992px) {
    body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--normal {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body.event-guest-body .guest-album-section .guest-album-grid.guest-album-grid--large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.gb-success-state {
    padding: 1.5rem 0.5rem 0.5rem;
    text-align: center;
}

.gb-success-icon {
    display: block;
    margin-bottom: 0.75rem;
    color: #22c55e;
    font-size: 2.75rem;
}

.gb-success-state h3 {
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.gb-my-uploads-empty {
    padding: 2rem 0;
    color: var(--muted, #667085);
    text-align: center;
}

.event-my-uploads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.6rem;
}

.event-my-upload-item {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line, rgba(17, 24, 39, 0.12));
    border-radius: 10px;
    background: color-mix(in srgb, var(--page, #f8fafc) 78%, #eef2f7);
    aspect-ratio: 1;
}

.event-my-upload-item img,
.event-my-upload-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-my-upload-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.35rem 0.5rem;
    overflow: hidden;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
    color: #fff;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-my-upload-delete {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.88);
    color: #fff;
    cursor: pointer;
}

.guest-album-video video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.guest-album-item::before,
.guest-album-item::after,
.guest-album-meta {
    pointer-events: none;
}

.guest-album-thumb {
    position: relative;
    background:
        linear-gradient(135deg, rgba(166, 136, 216, 0.14), rgba(95, 198, 210, 0.16)),
        color-mix(in srgb, var(--page, #f8fafc) 84%, #d9c8f1);
    touch-action: manipulation;
}

body.event-guest-body .guest-album-section .guest-album-grid {
    overflow-anchor: none;
    touch-action: pan-y;
}

@media (max-width: 575.98px) {
    body.event-guest-body .guest-album-section {
        padding-top: 0 !important;
    }
}

body.event-guest-body .guest-album-section .album-pagination {
    overflow-anchor: none;
}

@media (hover: none), (pointer: coarse) {
    body.event-guest-body .guest-album-section .guest-album-grid {
        transition: none !important;
        transform: none !important;
    }

    body.event-guest-body .guest-album-section .guest-album-thumb img,
    body.event-guest-body .guest-album-section .guest-album-item:hover img {
        transition: none !important;
        transform: none !important;
        filter: none !important;
    }

    body.event-guest-body .guest-album-section .guest-album-item::before,
    body.event-guest-body .guest-album-section .guest-album-item::after,
    body.event-guest-body .guest-album-section .guest-album-meta {
        transition: none !important;
    }
}

html.guest-media-viewer-open,
body.guest-media-viewer-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.guest-media-viewer[hidden] {
    display: none;
}

.guest-media-viewer {
    position: fixed;
    inset: 0;
    z-index: 1095;
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) 3rem;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: #140b1c;
    color: #fff;
    contain: layout paint style;
    isolation: isolate;
    touch-action: none;
}

.guest-media-viewer__stage {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-media-viewer__image,
.guest-media-viewer__video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: #050208;
}

.guest-media-viewer__video {
    width: min(100%, 960px);
}

.guest-media-viewer__loader {
    position: absolute;
    inset: auto auto 1rem 50%;
    transform: translateX(-50%);
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}

.guest-media-viewer__caption {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 1.6rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.92rem;
}

.guest-media-viewer__close,
.guest-media-viewer__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.guest-media-viewer__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
}

.guest-media-viewer__nav {
    width: 2.75rem;
    height: 2.75rem;
}

.guest-media-viewer__nav--prev {
    grid-column: 1;
    grid-row: 1;
}

.guest-media-viewer__nav--next {
    grid-column: 3;
    grid-row: 1;
}

.guest-media-viewer__close:focus-visible,
.guest-media-viewer__nav:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .guest-media-viewer {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(0, 1fr) auto auto;
        padding: 0.5rem;
    }

    .guest-media-viewer__stage {
        grid-column: 1 / -1;
    }

    .guest-media-viewer__nav {
        grid-row: 2;
        width: 100%;
        height: 2.75rem;
    }

    .guest-media-viewer__nav--prev {
        grid-column: 1;
    }

    .guest-media-viewer__nav--next {
        grid-column: 2;
    }

    .guest-media-viewer__caption {
        grid-row: 3;
        font-size: 0.82rem;
    }
}

.guest-album-video {
    position: relative;
    background: #030303;
}

.guest-album-video video:not([src]) {
    opacity: 0;
}

.guest-album-video--tap-load {
    cursor: pointer;
}

.guest-album-video-lazy-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem;
    background: #030303;
    color: #fff;
    text-align: center;
}

.guest-album-video-lazy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.guest-album-video-lazy-text {
    max-width: 10.5rem;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
}

.guest-album-video.is-video-loading .guest-album-video-lazy-text::after {
    content: "...";
}

.guest-album-video.is-video-ready .guest-album-video-lazy-overlay {
    visibility: hidden;
    opacity: 0;
}

.guest-album-preview-date {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.85em;
    opacity: 0.78;
}

.guest-album-preview-separator {
    display: none;
}

body.event-guest-body .guest-private-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem 0;
}

body.event-guest-body .guest-private-actions .btn {
    min-width: min(100%, 220px);
}

body.event-guest-body .gb-no-album {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: min(calc(100% - 2rem), 620px);
    margin: 1.25rem auto 3rem;
    padding: 2.25rem 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.16);
    color: #111827 !important;
    text-align: center;
    backdrop-filter: blur(10px);
}

body.event-guest-body .gb-no-album-icon {
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
    color: #1f2937 !important;
    opacity: 0.8;
}

body.event-guest-body .gb-no-album-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827 !important;
}

body.event-guest-body .gb-no-album-sub {
    margin: 0;
    font-size: 0.85rem;
    color: #374151 !important;
    opacity: 1;
}

@media (max-width: 600px) {
    .gb-modal {
        padding: 0.75rem;
    }

    .gb-modal-dialog {
        max-height: 92vh;
    }

    .gb-modal-header,
    .gb-modal-body,
    .gb-modal-footer {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}
