/* ============================================================
   Preview Gallery — /preview  (standalone, not connected to home)
   ============================================================ */

.pg-page {
    min-height: 100svh;
    background: #FAF6F1; /* ← light background */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* ── Desktop — 75% centered ──────────────────────────────── */
    width: 100%;
    max-width: 75%;
    margin: 0 auto;
}



/* ── Top nav ─────────────────────────────────────────────────── */
.pg-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #E8DDD4; /* ← was rgba white */
    background: #FAF6F1;
    flex-shrink: 0;
}
.pg-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.pg-nav-logo {
    width: 28px; height: 28px;
    object-fit: contain;
    border-radius: 3px;
}
.pg-nav-name {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 18px;
    color: #1A0F0C;
    font-weight: 300;
}
.pg-nav-hint {
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    letter-spacing: .1em;
    color: #9E8C87;
    margin: 0;
}

/* ── Instruction ─────────────────────────────────────────────── */
.pg-instruction {
    text-align: center;
    padding: 12px 24px 4px;
}

.pg-instruction-text {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    color: #9E8C87;
    letter-spacing: .04em;
    margin: 0;
    line-height: 1.6;
}

    .pg-instruction-text strong {
        color: #C48B9F;
        font-weight: 600;
    }

/* ── Carousel wrap ───────────────────────────────────────────── */
.pg-carousel-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 24px 0;
    background: #FAF6F1;
}
.pg-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 calc(50vw - 100px);  /* center the active card */
    align-items: center;
}
.pg-carousel::-webkit-scrollbar { display: none; }

/* ── Slide ───────────────────────────────────────────────────── */
.pg-slide {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    scroll-snap-align: center;
    cursor: pointer;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
    position: relative;
}
/*.pg-slide:hover    { transform: translateY(-4px); }
.pg-slide--active  { transform: translateY(-10px); }*/

/* ── Hero frame ──────────────────────────────────────────────── */
.pg-hero-frame {
    width: 200px;
    aspect-ratio: 5 / 7;
    border-radius: 3px;
    position: relative;
}
/*.pg-slide--active .pg-hero-frame {
    box-shadow:
        0 20px 60px rgba(0,0,0,.65),
        0 4px 16px rgba(196,139,159,.35);
}*/

.pg-hero-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,.04) 0%,
        rgba(255,255,255,.08) 50%,
        rgba(255,255,255,.04) 100%
    );
    animation: pgSkeletonPulse 1.6s ease-in-out infinite;
}
@keyframes pgSkeletonPulse {
    0%, 100% { opacity: .5; }
    50%       { opacity: 1; }
}

/* ── Selected ring ───────────────────────────────────────────── */
.pg-slide-selected-ring {
    position: absolute;
    top: 0; left: 0;
    width: 200px;
    aspect-ratio: 5 / 7;
    border: 5px solid #f4e90e;
    pointer-events: none;
    animation: pgRingIn .2s ease;
}
@keyframes pgRingIn {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Slide meta ──────────────────────────────────────────────── */
.pg-slide-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}
.pg-slide-category {
    font-family: 'Jost', sans-serif;
    font-size: 9px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #9E8C87;
    transition: color .2s;
}
.pg-slide-name {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: #3A3230;
    line-height: 1.3;
    transition: color .2s;
}
.pg-slide--active .pg-slide-category {
    color: #C48B9F;
}
.pg-slide--active .pg-slide-name {
    color: #1A0F0C;
}

/* ── Scroll arrows ───────────────────────────────────────────── */
.pg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 5;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #D4C4B0;
    background: rgba(255,255,255,.8);
    color: #6B5B54;
}
    .pg-arrow:hover {
        background: rgba(196,139,159,.1);
        border-color: #C48B9F;
        color: #C48B9F;
    }
.pg-arrow-left     { left: 12px; }
.pg-arrow-right    { right: 12px; }

/* ── Bottom panel ────────────────────────────────────────────── */
.pg-bottom {
    flex-shrink: 0;
    background: #FFFFFF;
    backdrop-filter: blur(16px);
    border-top: 1px solid #E8DDD4;
    padding: 16px 20px 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 128px;
}

.pg-bottom-hint {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    color: #C4B4A8;
    text-align: center;
    margin: auto;
    letter-spacing: .06em;
}

.pg-bottom-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: pgBottomIn .25s ease;
}
@keyframes pgBottomIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pg-bottom-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pg-bottom-color {
    width: 24px; height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.pg-bottom-name {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 18px;
    font-weight: 300;
    color: #1A0F0C;
    margin: 0;
}
.pg-bottom-mood {
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    letter-spacing: .06em;
    color: #9E8C87;
    margin: 2px 0 0;
}
.pg-bottom-badges  { display: flex; gap: 6px; flex-shrink: 0; }

.pg-badge {
    padding: 3px 8px;
    border-radius: 2px;
    font-family: 'Jost', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.pg-badge-new     { background: rgba(143,175,138,.18); color: #8FAF8A; }
.pg-badge-popular { background: rgba(196,139,159,.18); color: #C48B9F; }

/* ── Buttons ─────────────────────────────────────────────────── */
.pg-bottom-actions { display: flex; gap: 10px; }

.pg-btn-preview {
    flex: 1;
    padding: 12px;
    background: transparent;
    border-radius: 3px;
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    letter-spacing: .04em;
    cursor: pointer;
    transition: all .2s;
    border: 1px solid #D4C4B0;
    color: #6B5B54;
}
    .pg-btn-preview:hover {
        border-color: #C48B9F;
        color: #C48B9F;
    }

.pg-btn-use {
    flex: 2;
    padding: 12px;
    background: #C48B9F;
    border: none;
    border-radius: 3px;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .04em;
    color: #fff;
    cursor: pointer;
    transition: background .2s;
}
.pg-btn-use:hover { background: #A06070; }


/* ── Generating overlay ──────────────────────────────────────── */
.pg-generating-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250,246,241,.92);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: pgFadeIn .2s ease;
}

@keyframes pgFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pg-gen-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.pg-gen-envelope {
    font-size: 52px;
    animation: pgEnvFloat 1.5s ease-in-out infinite;
}

@keyframes pgEnvFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.pg-gen-label {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 20px;
    font-weight: 300;
    color: #1A0F0C;
    margin: 0;
}

/* ── Dots ────────────────────────────────────────────────────── */
.pg-gen-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .pg-gen-dots span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #C48B9F;
        animation: pgDot .8s ease-in-out infinite;
    }

        .pg-gen-dots span:nth-child(2) {
            animation-delay: .15s;
        }

        .pg-gen-dots span:nth-child(3) {
            animation-delay: .30s;
        }

@keyframes pgDot {
    0%, 100% {
        opacity: .3;
        transform: scale(.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ── Button spinner ──────────────────────────────────────────── */
.pg-btn-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pgSpin .7s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes pgSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Error ───────────────────────────────────────────────────── */
.pg-gen-error {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    color: #C0392B;
    text-align: center;
    margin: 0;
    padding: 0 20px;
}

/* ── Button disabled ─────────────────────────────────────────── */
.pg-btn-preview:disabled,
.pg-btn-use:disabled {
    opacity: .5;
    cursor: not-allowed;
}


/* ── Desktop adjustments ─────────────────────────────────────── */
@media (min-width: 768px) {
    .pg-carousel      { padding: 0 80px; gap: 28px; }
    .pg-slide         { width: 240px; }
    .pg-hero-frame    { width: 240px; }
    .pg-slide-selected-ring { width: 240px; }
    .pg-bottom        { padding: 20px 48px 40px; }
    .pg-bottom-name   { font-size: 22px; }


}

/* ── Mobile — full width ─────────────────────────────────────── */
@media (max-width: 768px) {
    .pg-page {
        max-width: 100%;
    }
}
