.private-gallery-access {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0px;
    /* we colour mix to ensure bg still visible regardless of user choice */
    background: color-mix(in oklab, var(--color-login-bg) 80%, transparent);
}

.private-gallery-access[hidden] {
    display: none;
}

.private-gallery-popup {
    width: min(100%, 440px);
    padding: 42px 40px 40px;
    border: 1px solid color-mix(in srgb, var(--color-login-text, var(--color-foreground, #000000)) 15%, transparent);
    border-radius: var(--border-radius-card, 24px);
    background: var(--color-login-card-bg, rgba(255, 250, 250, 1.0));
    box-shadow: 0 24px 80px rgba(37, 16, 25, 0.28);
    box-sizing: border-box;
    margin-top: 20px;
}

.private-gallery-eyebrow {
    display: block;
    margin-bottom: 14px;
    color: var(--color-action, #ba5e75);
    font-family: var(--font-bold);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.private-gallery-access h1,
.private-gallery-popup h1 {
    color: var(--color-login-text, var(--color-foreground, var(--color-text, #24191d)));
    font-size: clamp(30px, 5vw, 42px);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 14px;
}

.private-gallery-intro {
    max-width: 32ch;
    color: var(--color-login-text, var(--color-foreground, var(--color-text, #6b575d)));
    opacity: 0.85;
    line-height: 1.55;
    margin-top: 0;
    margin-bottom: 28px;
}

.private-gallery-access form,
.private-gallery-popup form {
    gap: 8px;
}

.private-gallery-access label,
.private-gallery-popup label {
    color: var(--color-login-text, var(--color-foreground, var(--color-text, #49383e)));
    font-family: var(--font-bold);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.private-gallery-access form input,
.private-gallery-popup form input {
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--color-login-text, var(--color-foreground, #000000)) 18%, transparent);
    border-radius: var(--border-radius, 10px);
    background: var(--color-login-input-bg, #fff);
    color: var(--color-login-input-text, var(--color-login-text, var(--color-foreground, #24191d)));
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.private-gallery-access form input:focus,
.private-gallery-popup form input:focus {
    border-color: var(--color-login-btn-bg, var(--color-accent, var(--color-cta, #FF8FAB)));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-login-btn-bg, var(--color-accent, var(--color-cta, #FF8FAB))) 18%, transparent);
}

.private-gallery-access form .button,
.private-gallery-popup form .button {
    width: auto;
    min-height: 46px;
    margin: 10px 0 0;
    padding: 12px 19px;
    border: 0;
    border-radius: var(--border-radius, 10px);
    color: var(--color-login-btn-text, var(--color-cta-text, #fff));
    background: var(--color-login-btn-bg, var(--color-accent, var(--color-cta, #FF8FAB)));
    letter-spacing: 0.07em;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.private-gallery-access form .button:hover,
.private-gallery-popup form .button:hover {
    border: 0;
    color: var(--color-action-text, var(--color-login-btn-text, #fff));
    background: var(--color-action, var(--color-login-btn-bg, var(--color-accent, #ba5e75)));
    transform: translateY(-1px);
}

/* Log in / sign up modes of the login widget (data-mode, switched by components/login_popup.html). The switch is a
   quiet underlined text link, like the age verification form's, so "Book a session" stays the main button. */
.private-gallery-popup form .inline-signup-only,
.private-gallery-popup form[data-mode="signup"] .inline-login-only {
    display: none;
}

.private-gallery-popup form[data-mode="signup"] .inline-signup-only {
    display: revert;
}

.private-gallery-popup form[data-mode="signup"] input.inline-signup-only {
    display: block;
}

.private-gallery-popup .inline-signup-age-note {
    margin: 4px 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.private-gallery-popup .inline-login-switch {
    margin: 6px 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-login-text, var(--color-foreground, var(--color-text, #49383e)));
}

.private-gallery-popup .inline-login-link {
    padding: 4px 2px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-family: var(--font-bold);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.login-block-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 20px;
    width: 100%;
    box-sizing: border-box;
}

.login-block-wrapper[data-block-width] {
    max-width: calc(var(--block-width) + 40px);
    margin: 0 auto;
}

.login-block-wrapper .private-gallery-popup {
    margin-top: 0;
}

.private-gallery-error {
    margin-bottom: 0;
    color: #a32929;
    font-size: 13px;
}

.private-gallery-images img {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover;
    filter: none;
    transform: none;
    transition: opacity 0.3s ease;
}

/* Keep the (blurred) preview visible under the spinner while loading,
   instead of hiding it like the public gallery does. */
.private-gallery-images a.is-loading .gallery-preview-img,
.private-gallery-images a.is-loading-full .gallery-preview-img {
    opacity: 1;
}

/* Spinner shows for both preview loads and queued full-image loads. */
.private-gallery-images a.is-loading-full .gallery-spinner {
    display: block;
}

/* Full image stacks on top of the preview and fades in once loaded. */
.private-gallery-images .gallery-full-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.private-gallery-images a.is-loaded .gallery-full-img {
    opacity: 1;
}

.private-gallery-content {
    position: relative;
    min-height: 50vh;
}

.private-gallery-content.is-unlocked {
    min-height: unset;
}

.private-gallery-content.is-unlocked .private-gallery-images img {
    filter: none;
    transform: none;
}

.private-gallery-content:not(.is-unlocked) .private-gallery-images a {
    cursor: not-allowed;
    pointer-events: none;
}

/* Locked photo cards for timed releases */
.gallery-locked-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 300px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-image, 12px);
    box-sizing: border-box;
    color: #fff;
    text-align: center;
    overflow: hidden;
    user-select: none;
    cursor: default;
    transition: transform 0.2s var(--easing), border-color 0.2s var(--easing);
}

.gallery-locked-card:hover {
    border-color: rgba(214, 129, 151, 0.4);
}

.gallery-locked-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.gallery-locked-bg.is-loaded {
    opacity: 1;
}

.locked-card-backdrop {
    position: absolute;
    inset: 0;
    backdrop-filter: brightness(80%);
    -webkit-backdrop-filter: brightness(80%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.locked-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.locked-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    /* Fixed white on the black card: the theme accent can be too dark to read here. */
    color: #fff;
    margin-bottom: 2px;
}

.locked-card-timer {
    font-size: 0.78rem;
    /* Fixed white on the black card: the theme accent can be too dark to read here. */
    color: #fff;
    padding: 3px 10px;
    font-weight: 500;
}

.private-gallery-userbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
}

.private-gallery-signed-in {
    font-size: 0.85rem;
    opacity: 0.6;
}

.private-gallery-username-link {
    color: var(--color-links);
    text-decoration: none;
    transition: color 0.25s var(--easing);
}

.private-gallery-username-link:hover {
    text-decoration: underline;
}

.private-gallery-username-link strong {
    font-weight: inherit;
}

.private-gallery-userbar form {
    width: auto;
}

.private-gallery-logout {
    padding: 0 0 2px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 0;
    background: none;
    color: var(--color-text);
    font-family: var(--font-bold);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.25s var(--easing), border-color 0.25s var(--easing);
}

.private-gallery-logout:hover {
    color: var(--color-cta);
    border-color: var(--color-cta);
}

.private-gallery-tabs {
    display: flex;
    gap: 4px;
    max-width: 1200px;
    margin: 24px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
}

.private-gallery-tab {
    padding: 12px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: var(--color-text);
    opacity: 0.5;
    font-family: var(--font-bold);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.25s var(--easing), opacity 0.25s var(--easing), border-color 0.25s var(--easing);
}

@media (hover: hover) {
    .private-gallery-tab:hover {
        color: var(--color-links);
        opacity: 1;
    }
}

.private-gallery-tab.is-active {
    color: var(--color-links);
    opacity: 1;
    border-bottom-color: var(--color-links);
}

.private-gallery-panel:not([hidden]) {
    animation: private-gallery-panel-in 0.35s var(--easing) both;
}

@keyframes private-gallery-panel-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.private-gallery-panel .image-gallery {
    margin-top: 28px;
}

.private-gallery-collection-header {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
    color: var(--color-text);
    font-family: var(--font-bold);
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.private-gallery-collection-header + .image-gallery {
    margin-top: 12px;
}

/* "This is just for clients" note between a locked collection's name and its greyed-out photos. */
.private-gallery-clients-only {
    max-width: 1200px;
    margin: 6px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
    color: var(--color-text);
    font-size: 0.95rem;
    opacity: 0.85;
}

.private-gallery-clients-only a {
    color: inherit;
    font-family: var(--font-bold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.private-gallery-clients-only + .image-gallery,
.private-gallery-panel .private-gallery-clients-only + .image-gallery {
    margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .private-gallery-panel:not([hidden]) {
        animation: none;
    }
}

.private-gallery-empty {
    max-width: 1200px;
    margin: 48px auto;
    padding: 0 20px;
    text-align: center;
    opacity: 0.6;
}

.favourite-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #b9aeb2;
    cursor: pointer;
    transition: transform 0.2s var(--easing), color 0.2s var(--easing), background 0.2s var(--easing);
}

.favourite-toggle:hover {
    transform: scale(1.1);
    color: var(--color-cta);
}

.favourite-toggle.is-favourited {
    color: var(--color-cta);
}

.favourite-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.favourite-toggle:not(.is-favourited):hover svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Lightbox heart: sits at the top-left, styled to match the X — transparent
   button, white icon, and a 32px square hit area. Outline heart until
   favourited, then filled white. */
.lightbox .lightbox-favourite {
    top: 40px;
    left: 25px;
    right: auto;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #fff;
    font-size: 0;
    line-height: 1;
    opacity: 1;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.4s ease;
}

.lightbox .lightbox-favourite svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.lightbox .lightbox-favourite.is-favourited {
    color: #fff;
}

.lightbox .lightbox-favourite.is-favourited svg {
    fill: currentColor;
    stroke: none;
}

.lightbox .lightbox-favourite[hidden] {
    display: none;
}

.lightbox .lightbox-favourite:hover {
    color: #ccc;
    transform: none;
}

@media (max-width: 600px) {
    .lightbox .lightbox-favourite {
        width: 32px;
        height: 32px;
        left: 25px;
        right: auto;
    }

    .lightbox .lightbox-favourite svg {
        width: 100%;
        height: 100%;
    }

    .private-gallery-popup {
        padding: 32px 24px 28px;
        border-radius: var(--border-radius-card, 18px);
    }

    /* Keep the sign-in box off the screen edges, in line with the page's own gutter. */
    .private-gallery-access {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.private-gallery-access .button.secondary,
.private-gallery-booking-btn {
    display: block;
    text-align: center;
    background-color: var(--color-login-secondary-btn-bg, var(--color-secondary, transparent));
    color: var(--color-login-secondary-btn-text, var(--color-secondary-text, white));
    border: 1px solid var(--color-login-secondary-btn-border, var(--color-secondary-border, rgba(255, 255, 255, 0.4)));
    border-radius: var(--border-radius, 10px);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.private-gallery-access .button.secondary:hover,
.private-gallery-booking-btn:hover {
    background-color: var(--color-login-secondary-hover-bg, var(--color-secondary-hover-bg, rgba(255, 255, 255, 0.1)));
    color: var(--color-login-secondary-hover-text, var(--color-secondary-hover-text, var(--color-login-secondary-btn-text, var(--color-secondary-text, white))));
    border: 1px solid var(--color-login-secondary-hover-border, var(--color-secondary-hover-border, white));
    transform: translateY(-1px);
}
