/* Album page styles - Hero Redesign */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #1a1a1a;
    padding-top: 0;
    margin-top: 0;
}

/* Premium slim scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.32);
}

/* Album pages – same wide glass pill as the rest of the site: fixed over the
   photo, logo inside on the left, text-only links on the right (DESKTOP ONLY) */
@media (min-width: 768px) {
    .album-page .header {
        position: fixed !important;
        top: 16px !important;
        left: 0 !important;
        right: 0 !important;
        width: calc(100% - 2 * var(--grid-gutter, 15px)) !important;
        max-width: calc(var(--grid-max-width, 1200px) - 2 * var(--grid-gutter, 15px)) !important;
        transform: none !important;
        margin: 0 auto !important;
        z-index: 100;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 24px !important;
        padding: 8px 12px 8px 28px !important;
        /* Glass over a photo: hairline + inner highlight so the edge holds on
           bright regions; saturate keeps blurred color alive */
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(24px) saturate(140%);
        -webkit-backdrop-filter: blur(24px) saturate(140%);
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 50px !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
            0 8px 32px rgba(0, 0, 0, 0.25) !important;
    }

    .album-page .header>.logo {
        color: #fff !important;
        font-weight: 800 !important;
        letter-spacing: -0.02em !important;
        margin-right: auto !important;
    }

    /* Nav is transparent — the header itself is the pill */
    .album-page .header>.nav-bar {
        margin-left: 0 !important;
        margin-right: 0 !important;
        background: transparent !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none !important;
        border-radius: 50px !important;
        padding: 0 !important;
    }

    .album-page .header .nav-item:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .album-page .header .nav-item:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.8);
        outline-offset: 2px;
    }

    .album-page .header .nav-item-label {
        color: #fff !important;
        font-weight: 500 !important;
    }

    .album-page .header .nav-item-icon img,
    .album-page .header .mobile-menu-icon {
        filter: brightness(0) invert(1);
    }

    .album-page .header .nav-bar .user-dropdown .user-avatar {
        background: rgba(255, 255, 255, 0.25) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.35) !important;
        color: #fff !important;
    }

    .album-page .header .signin-container .btn-google-login {
        background: rgba(255, 255, 255, 0.2) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.35) !important;
        color: #fff !important;
        border-radius: 999px !important;
        padding: 6px 18px !important;
        font-weight: 500 !important;
    }

    .album-page .header .signin-container .btn-google-login::before {
        filter: brightness(0) invert(1);
    }

    .album-page .header .mobile-menu-btn {
        justify-self: start !important;
    }
}

/* Hero Section */
.hero-section {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    /* Ensure it covers full viewport width */
    height: 100vh !important;
    margin: 0 !important;
    /* Override index.css margin */
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    gap: 0 !important;
    /* Visible from first paint: a dark backdrop with the loader. The photo is
       painted onto ::before and fades in when .ready lands, so the guest never
       stares at a black viewport while matching runs. */
    background-color: #0d0d0f;
}

/* Cover photo layers (thumbnail, then original on top). Each fades in
   independently; the original crossfades over the thumbnail so the photo
   sharpens instead of blinking. Both sit below .hero-overlay (z 1). */
.hero-photo {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.9s ease-in-out;
    pointer-events: none;
}

.hero-photo.is-visible {
    opacity: 1;
}

.hero-photo__blur,
.hero-photo__img {
    position: absolute;
    inset: 0;
    background-image: var(--photo, none);
    background-position: center;
    background-repeat: no-repeat;
}

/* Blurred, zoomed copy fills the frame behind the contained photo */
.hero-photo__blur {
    background-size: cover;
    filter: blur(30px) brightness(0.5);
    transform: scale(1.15);
}

/* The whole photo, never cropped — portrait or landscape both look intended */
.hero-photo__img {
    background-size: contain;
}

/* Loading state: centered spinner + text, above the overlay, below the content */
.hero-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: rgba(255, 255, 255, 0.85);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hero-section.ready .hero-loading,
.hero-section.load-failed .hero-loading {
    opacity: 0;
}

.hero-loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.95);
    animation: spin 0.9s linear infinite;
}

.hero-loading-text {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.02em;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .hero-loading-spinner {
        animation-duration: 2s;
    }
}

.hero-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: filter 0.6s ease-out, transform 0.6s ease-out;
}

.hero-bg-layer.loading {
    filter: blur(10px);
    transform: scale(1.1);
    /* Prevent white edges from blur */
}


.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.hero-content {
    position: relative !important;
    z-index: 2 !important;
    text-align: center !important;
    color: white !important;
    padding: 0 !important;
    /* Override index.css padding */
    margin: 0 auto !important;
    background: transparent !important;
    /* Override index.css background */
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    max-width: 900px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.hero-event-name {
    font-size: clamp(48px, 10vw, 120px);
    font-weight: 900;
    letter-spacing: -3px;
    margin-bottom: 24px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(40px);
}

.hero-section.ready .hero-event-name {
    animation: fadeInUp 1.2s cubic-bezier(0.19, 1, 0.22, 1) 0.5s forwards;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    opacity: 0;
    position: relative;
    z-index: 10;
}

.hero-section.ready .hero-actions {
    animation: fadeInUp 1.2s cubic-bezier(0.19, 1, 0.22, 1) 0.8s forwards;
}

.view-gallery-btn,
.hero-share-btn {
    display: inline-block;
    padding: 16px 36px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.view-gallery-btn {
    background: white;
    color: #000;
    border: none;
}

.hero-share-btn {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.view-gallery-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: #f0f0f0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Loading shimmer for Find Best button */
.view-gallery-btn.finding {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.view-gallery-btn.finding::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: btnShimmer 1.5s ease-in-out infinite;
}

@keyframes btnShimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Download Best Photos — bar below gallery */
.best-download-bar {
    text-align: center;
    padding: 48px 20px;
}

.best-download-btn {
    display: inline-block;
    padding: 16px 48px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.best-download-btn:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.best-download-btn.downloading {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.best-download-btn.downloading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.25) 50%,
            transparent 100%);
    animation: btnShimmer 1.5s ease-in-out infinite;
}

.hero-share-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        /* Increased from 12px for better spacing */
        width: 100%;
        padding: 0 20px;
        margin-top: 24px;
    }

    .view-gallery-btn,
    .hero-share-btn {
        width: 100%;
        max-width: 280px;
        padding: 14px 24px;
    }
}

.hero-branding {
    position: relative;
    margin-top: 60px;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    opacity: 0;
}

.hero-section.ready .hero-branding {
    animation: fadeIn 2s ease-out 1.3s both;
}

@media (max-width: 767px) {
    .hero-section {
        align-items: flex-end !important;
        padding-bottom: 60px !important;
    }

    .hero-event-name {
        font-size: 42px !important;
        margin-bottom: 16px !important;
    }

    .hero-branding {
        margin-top: 30px;
        letter-spacing: 4px;
    }
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Gallery Section — dark premium */
.gallery-section {
    background: #0a0a0a;
    position: relative;
    z-index: 10;
    border-radius: 40px 40px 0 0;
    margin-top: -40px;
    padding: 100px 40px;
    box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.4);
}

.gallery-header {
    margin-bottom: 60px;
    text-align: center;
}

.gallery-event-name {
    font-size: 48px;
    font-weight: 200;
    letter-spacing: -1px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
}

.photo-count {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
}

#photo-count {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
}

#loading {
    text-align: center;
    font-size: 18px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.4);
}

#error {
    background: rgba(244, 67, 54, 0.9);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: 12px;
    background: #1a1a1a;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Cover photo button — star icon on gallery items (owner only) */
.cover-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .cover-btn,
.cover-btn--active {
    opacity: 1 !important;
}

.cover-btn:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: scale(1.15);
}

.cover-btn--active {
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

/* Delete photo button — trash icon next to the cover star (owner only) */
.delete-btn {
    position: absolute;
    top: 10px;
    right: 54px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(220, 38, 38, 0.75);
    transform: scale(1.15);
}

/* Mobile: always show cover + delete buttons */
@media (max-width: 768px) {
    .cover-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
    }

    .cover-btn svg {
        width: 16px;
        height: 16px;
    }

    .delete-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
        right: 50px;
    }

    .delete-btn svg {
        width: 16px;
        height: 16px;
    }
}
/* Promotional CTA at end of album – dark premium glass card */
.album-promo {
    text-align: center;
    margin: 64px auto 56px;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9) 0%, rgba(30, 20, 50, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    max-width: 800px;
    color: #fff;
}

.best-slider-wrapper {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.4s ease-out;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 20;
}

.best-slider-wrapper input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.best-toggle-label {
    display: inline-block;
    padding: 8px 20px;
    min-width: 50px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 18px;
    transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.best-toggle-label:hover {
    color: #fff;
}

.best-toggle-label.active {
    background: #fff;
    color: #111;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.album-page .album-promo {
    /* Override any fallback styles – dark card is universal */
    color: #fff !important;
}

.host-message-container {
    margin-bottom: 40px;
}

.host-message {
    font-size: 20px;
    line-height: 1.6;
    font-weight: 500;
    color: inherit;
    margin-bottom: 32px;
    font-style: italic;
}

.host-message-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    width: 100%;
    margin: 0 auto;
}

.album-page:not(.index-page) .host-message-divider {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.album-promo-text {
    font-size: 16px;
    line-height: 1.5;
    color: inherit;
    max-width: 500px;
    margin: 0 auto 24px;
    opacity: 0.8;
}

.album-promo-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.album-promo-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.album-promo-cta.cta-stacked {
    flex-direction: column;
    gap: 2px;
}

.cta-subtext {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.7;
}

.btn-feedback {
    background: linear-gradient(135deg, #7C42F5, #b06aff) !important;
    border-color: rgba(180, 120, 255, 0.3) !important;
}

.btn-feedback:hover {
    background: linear-gradient(135deg, #6a30e0, #9a58f0) !important;
}

.promo-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .promo-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 0 20px;
    }

    .album-promo-cta {
        width: 100%;
    }
}

/* Highlights strip — the album's best frames, from scores computed at upload */
.highlights {
    margin: -30px 0 56px;
}

.highlights-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 18px;
}

.highlights-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.highlights-count {
    font-size: 12px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
}

.highlights-share,
.highlights-view-all {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.highlights-share:hover,
.highlights-view-all:hover {
    background: rgba(255, 255, 255, 0.2);
}

.highlights-view-all + .highlights-share,
.highlights-share + .highlights-view-all {
    margin-left: 8px;
}

.highlights-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.highlights-strip .gallery-item {
    aspect-ratio: 1;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .highlights {
        margin: -10px 0 40px;
    }

    .highlights-strip {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .highlights-strip .gallery-item {
        flex: 0 0 62vw;
        scroll-snap-align: start;
    }
}

/* /highlights page: hero keeps only the title and VIEW HIGHLIGHTS */
.highlights-page #hero-highlights-btn,
.highlights-page #hero-share-btn,
.highlights-page #hero-download-btn,
.highlights-page #hero-selfie-btn,
.highlights-page #hero-upload-btn,
.highlights-page #admin-embed-btn {
    display: none !important;
}

/* Great-shot marker on a highlight tile — same short pill as the upload preview */
.great-shot-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #111;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 2;
}

/* Responsive */
@media (max-width: 992px) {
    /* (header padding is owned by the shared pill styles above; nothing to override here) */

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hero-event-name {
        font-size: 64px;
        letter-spacing: -2px;
    }

    .gallery-section {
        padding: 60px 20px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .view-gallery-btn {
        padding: 12px 32px;
        font-size: 14px;
    }

    .hero-branding {
        font-size: 10px;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    /* Increased to cover site header */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* All touch gestures are handled in JS (swipe/pinch/pan) */
    touch-action: none;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: grab;
    -webkit-user-drag: none;
    user-select: none;
}

/* Thumbnail shown while the full-resolution original downloads */
.lightbox-img.loading-original {
    filter: blur(10px);
}

/* Spinner over the blurred thumbnail so the wait reads as loading, not a bad photo */
.lightbox-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.lightbox.loading .lightbox-spinner {
    display: block;
}

.lightbox-img.zoomed {
    cursor: move;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next,
.lightbox-zoom-btn,
.lightbox-share-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 2001;
    /* Ensured on top of image */
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-zoom-btn:hover,
.lightbox-share-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-close:active,
.lightbox-prev:active,
.lightbox-next:active,
.lightbox-zoom-btn:active,
.lightbox-share-btn:active {
    transform: scale(0.95);
}

.lightbox-prev img,
.lightbox-next img,
.lightbox-zoom-btn img,
.lightbox-share-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 30px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Lightbox Toolbar - Positioned at Bottom Center */
.lightbox-toolbar {
    position: absolute;
    bottom: 40px;
    /* Moved to bottom */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 2001;
}

.lightbox-toolbar .lightbox-zoom-btn {
    position: relative;
}

.lightbox-counter {
    position: absolute;
    bottom: 110px;
    /* Moved above toolbar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 2001;
}

/* Hero blur while its image loads (was in index.css, which is now deferred) */
.hero-section.hero-loading {
    filter: blur(10px);
    transform: scale(1.1);
}

/* Infinite Scroll Loader */
.infinite-scroll-loader {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Lightbox Share Menu (Desktop Fallback) - Opens Upwards */
.share-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    /* Open upwards from toolbar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 25, 27, 0.98);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2002;
    min-width: 180px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.share-menu.hidden {
    display: none;
}

.share-menu-item {
    background: transparent;
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.share-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.share-menu-item svg {
    flex-shrink: 0;
}

/* Share Button Specific */
#shareBtn svg {
    stroke: white;
}

#downloadBtn svg {
    stroke: white;
}

/* Mobile Adjustments for Lightbox */
@media (max-width: 480px) {
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .lightbox-toolbar {
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        gap: 10px;
    }

    .lightbox-zoom-btn {
        width: 44px;
        height: 44px;
    }

    .lightbox-zoom-btn img,
    .lightbox-zoom-btn svg {
        width: 18px;
        height: 18px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        bottom: 95px;
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* (Personal-album cover photo layers — .hero-photo — are defined with the
   hero section above; the former ::before/::after pseudo-element approach
   was replaced so the thumbnail→original crossfade can use real layers.) */
/* All / Highlights tabs on the personal album (my-photos). A pill segmented
   control in the same quiet register as .photo-count above it. */
.gallery-tabs {
    display: inline-flex;
    gap: 4px;
    margin-top: 18px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.gallery-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s cubic-bezier(0.19, 1, 0.22, 1), color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.gallery-tab:hover { color: rgba(255, 255, 255, 0.95); }
.gallery-tab.is-active { background: rgba(255, 255, 255, 0.95); color: #111; }
.gallery-tab:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 2px; }
.gallery-tab-count {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.gallery-tab.is-active .gallery-tab-count { background: rgba(0, 0, 0, 0.1); }

/* Personal album: "Download all" email form (inside the download modal) */
.zip-email-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.zip-email-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font: inherit;
    font-size: 16px; /* 16px stops iOS zooming into the field */
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    outline: none;
}

.zip-email-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.14);
}

.zip-email-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.zip-email-error {
    min-height: 1.2em;
    margin: 8px 0 0;
    font-size: 13px;
    color: #ffb4ab;
}

.hero-share-btn.is-busy {
    pointer-events: none;
    opacity: 0.8;
}

/* ── Select and save (album.js) ── */
.gallery-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.select-toggle {
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: #fff;
    font: 500 14px Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
}
.is-selecting .select-toggle { background: #f4f2f8; color: #111014; border-color: #f4f2f8; }
.is-selecting .gallery .gallery-item::after,
.is-selecting .highlights-strip .gallery-item::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.25);
    z-index: 2;
}
.is-selecting .gallery .gallery-item.is-picked,
.is-selecting .highlights-strip .gallery-item.is-picked { box-shadow: 0 0 0 3px #f4f2f8; }
.is-selecting .gallery .gallery-item.is-picked::after,
.is-selecting .highlights-strip .gallery-item.is-picked::after {
    background: #f4f2f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
    border-color: #f4f2f8;
}
.is-selecting .gallery .gallery-item:hover,
.is-selecting .highlights-strip .gallery-item:hover { transform: none; }
.select-bar {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 20px;
    border-radius: 999px;
    background: #1b1a20;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    color: #fff;
    font: 14px Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.select-bar[hidden] { display: none; }
.select-bar__count { font-weight: 600; white-space: nowrap; }
.select-bar__save,
.select-bar__cancel {
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    font: 600 14px Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}
.select-bar__save { border: 0; background: #f4f2f8; color: #111014; }
.select-bar__save:disabled { opacity: 0.45; cursor: default; }
.select-bar__cancel { border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: #fff; }
.select-toggle:focus-visible,
.select-bar button:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }
@media (max-width: 600px) {
    .select-bar { left: 12px; right: 12px; transform: none; bottom: 20px; border-radius: 20px; }
    .select-bar__count { flex: 1; }
}
.is-selecting #kb-launcher { display: none !important; } /* the help bubble would cover Cancel */

/* ── Album header, simplified (Sep 2026) ──────────────────────────────────
   Guests: Find photos of me (primary), Download all, Share album — sentence
   case at a readable size. "View gallery" and "Highlights" only scrolled to
   what's below, so they're hidden (album.js still references them). The
   host's controls live in the host bar above the grid. */
.hero-actions #view-gallery-btn,
.hero-actions #hero-highlights-btn { display: none !important; }
.hero-actions { flex-wrap: wrap; gap: 12px; }
.hero-actions .hero-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 0 26px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.hero-actions #hero-selfie-btn { order: 1; }
.hero-actions #hero-download-btn { order: 2; }
.hero-actions #hero-share-btn { order: 3; }
.hero-actions .hero-primary {
    background: #f4f2f8;
    color: #111014;
    border: 0;
}
.hero-actions .hero-primary:hover { background: #fff; color: #000; }
@media (max-width: 600px) {
    .hero-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; margin: 0 auto; }
    .hero-actions .hero-share-btn { width: 100%; }
}

.host-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding: 10px 12px 10px 18px;
    border-radius: 16px;
    background: #1b1a20;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    font: 14px Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.host-bar[hidden] { display: none; }
.host-bar__label { margin-right: auto; }
.host-bar__btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    color: #fff;
    font: 600 14px Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
}
.host-bar__btn.hidden { display: none; }
.host-bar__btn:hover { background: rgba(255, 255, 255, 0.08); }
.host-bar__btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }

/* Sort control, beside Select */
.gallery-tools { display: flex; align-items: center; gap: 10px; }
.sort-control { display: flex; align-items: center; gap: 8px; font: 13px Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: rgba(255, 255, 255, 0.55); }
.sort-control select {
    height: 34px;
    padding: 0 30px 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #141416 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center / 14px no-repeat;
    color: #fff;
    font: 500 14px Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.sort-control select:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }
@media (max-width: 480px) { .sort-control > span { display: none; } }
.album-promo[hidden] { display: none !important; }
