/* Turn.js Flipbook Styles */

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

/* Las Vegas sample turn.js enhancements */
.turn-magazine {
    overflow: visible; /* Allow page peel/fold overlay to render outside container */
    will-change: transform;
}

.flipbook-viewport {
    overflow: hidden; /* Ensure viewport also hides overflow */
}

.turn-magazine .gradient {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    pointer-events: none; /* Don't block corner hover/peel */
}

.turn-magazine.double .even .gradient {
    background: -webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0)), color-stop(1, rgba(0,0,0,0.2)));
    background-image: -webkit-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: -moz-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: -ms-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: -o-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
}

.turn-magazine.double .odd .gradient,
.turn-magazine.single .even .gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    border-left: 1px solid rgba(0,0,0,0.30);
    background: -webkit-gradient(linear, right top, left top, color-stop(0, rgba(0,0,0,0)), color-stop(1, rgba(0,0,0,0.2)));
    background-image: -webkit-linear-gradient(right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: -moz-linear-gradient(right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: -ms-linear-gradient(right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: -o-linear-gradient(right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
    background-image: linear-gradient(right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
}

body {
    font-family: 'Georgia', serif;
    background: #b8aee6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(184, 174, 230, 0.92);
    backdrop-filter: blur(2px);
    z-index: 9999;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 6px solid rgba(255,255,255,0.6);
    border-top-color: rgba(34,34,34,0.8);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 14px;
}

.loading-text {
    color: #222;
    font-weight: 700;
    letter-spacing: .3px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.6);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.flipbook-viewport {
    overflow: hidden;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.flipbook-viewport .container {
    position: relative;
    margin: auto;
}

/* Flipbook container (turn.js will set the exact size via JS) */
.flipbook {
    margin: 0 auto;
    background: transparent;
    overflow: visible; /* Allow peel overlay */
    opacity: 0; /* Fade in after init to avoid flicker */
    transition: opacity .25s ease;
}

/* Force white only on the temporary single-page slot so peel/back appears white */
.single-peel-white .p-temporal { background: #fff !important; }

/* Ensure page wrappers don't show overflow */
.flipbook .page-wrapper {
    overflow: hidden;
    position: absolute;
    background: transparent;
}

/* Hide any page content that might peek through */
.flipbook .page-content {
    overflow: hidden;
    position: relative;
}

/* Each page content wrapper */
.page-content {
    width: 100%;
    height: 100%;
    position: relative;
    background: #111; /* subtle bg behind images to avoid white gaps */
}

/* Transparent page variant (for page 23 overlay) */
.page-content.transparent-page { background: transparent; }
.page-content.transparent-page img { background: transparent !important; }

.page-content[data-blank="1"] {
    background: #fff; /* clean blank page for cover/back padding */
}

.page-content img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* keep original aspect ratio, no stretch */
    display: block;
    background: #111;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Clickable areas */
.clickable-area {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.gazebo-hotspot {
    border-radius: 0;
    background: transparent;
    border: none;
}

.gazebo-hotspot::after {
    content: '';
}

.gazebo-hotspot:hover {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.75), 0 0 26px rgba(255,255,255,0.65);
}

/* RSVP overlay image that sits atop page 23 */
.gazebo-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none; /* click passes to hotspot */
}

/* Clickable mask matching the overlay alpha, so only gazebo is clickable */
.gazebo-mask {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.001); /* gives element a hit area */
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    cursor: pointer;
}
.gazebo-mask:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.75), 0 0 26px rgba(255,255,255,0.65); }

/* Mobile indicator: subtle pulsing ring */
@media (pointer: coarse), (max-width: 768px) {
    .gazebo-mask { animation: pulse-ring 1.8s ease-in-out infinite; }
    @keyframes pulse-ring {
        0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); }
        70% { box-shadow: 0 0 0 16px rgba(255,255,255,0); }
        100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
    }
}

/* Navigation and UI Elements */
.nav-buttons { display:none; }

.container {
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.nav-arrow {
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.35);
    color: #222;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.nav-arrow:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.12); background: rgba(255,255,255,0.55); }
.nav-arrow:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }

.nav-arrow-left { justify-self: end; }
.nav-arrow-right { justify-self: start; }

.page-counter {
    position: fixed;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.35);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    z-index: 10001; /* ensure above any accidental overlays */
}

button {
    padding: 10px 20px;
    font-size: 16px;
    font-family: 'Georgia', serif;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #333;
    font-weight: 600;
}

button:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.15); transform: translateY(-1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

/* Mobile responsiveness */
@media (max-width: 768px) {
    .flipbook-viewport { height: 100svh; padding: 10px; }
    button { padding: 8px 14px; font-size: 14px; }
    .page-counter { font-size: 14px; padding: 6px 12px; }
    /* Center the flipbook when arrows are hidden */
    .container { grid-template-columns: 1fr; justify-items: center; }
}

/* Phone landscape: force centering with flex to avoid any grid offset */
@media (pointer: coarse) and (orientation: landscape) {
    .flipbook-viewport .container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0;
        width: 100%;
    }
}

/* Hide arrows on phones / coarse pointer devices */
@media (pointer: coarse), (max-width: 768px) {
    .nav-arrow { display: none !important; }
}

/* Invitation page styles (for invitation.html) */
body.invitation-page { background: #b8aee6; }

/* Hard-center the flipbook element in any layout */
.flipbook { margin-left: auto !important; margin-right: auto !important; }
.invitation-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.invitation-container img { max-width: 100%; max-height: 90vh; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.back-button { position: fixed; top: 20px; left: 20px; padding: 10px 20px; background: rgba(255,255,255,.95); border: 2px solid rgba(255,255,255,.3); border-radius: 24px; color: #333; font-weight: 700; text-decoration: none; transition: all .25s; }
.back-button:hover { box-shadow: 0 5px 15px rgba(0,0,0,.15); transform: translateY(-1px); } 