/* ===== PHOTOBOOK STYLES ===== */

/* Page Setup */
.photobook-page {
    background: #1a1a1a;
    overflow: hidden;
}

.photobook-page .nav {
    background: rgba(10, 10, 10, 0.95);
}

/* Main Container */
.photobook-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Photobook (The Book Itself) */
.photobook {
    position: relative;
    width: 100%;
    height: 100vh;
    max-height: none;
    perspective: 2000px;
}

/* Two-Page Spread */
.photobook-spread {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.photobook-spread.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    opacity: 1;
    transform: scale(1);
}

/* Individual Page */
.page {
    background: #0a0a0a;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    transition: none;
    height: 100vh;
}

.page:hover {
    transform: none;
}

/* Left and right pages - no shadows in fullscreen */
.left-page,
.right-page {
    box-shadow: none;
}

/* Photo Wrapper */
.photo-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;  /* Changed from cover to contain - shows full image */
    display: block;
}

/* Photo Caption - Overlay at bottom */
.photo-caption-l {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: calc(var(--spacing-unit) * 4);
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: 10;
    transition: opacity 0.3s ease;
}

.photo-caption-r {
    position: absolute;
    bottom: 0;
    left: 200;
    right: 0;
    padding: calc(var(--spacing-unit) * 4);
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: 10;
    transition: opacity 0.3s ease;
}

.page:hover .photo-caption {
    opacity: 1;
}

/* Photo Placeholder (for missing images) */
.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.caption-location {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: calc(var(--spacing-unit) * 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.caption-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--color-text);
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-btn:hover:not(:disabled) {
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

.prev-btn {
    left: calc(var(--spacing-unit) * 4);
}

.next-btn {
    right: calc(var(--spacing-unit) * 4);
}

/* Page Counter */
.page-counter {
    position: absolute;
    bottom: calc(var(--spacing-unit) * 4);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    z-index: 10;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
}

.current-page {
    color: var(--color-accent);
    font-weight: 600;
}

/* Close Button */
.photobook-close {
    position: absolute;
    top: calc(var(--spacing-unit) * 4);
    right: calc(var(--spacing-unit) * 4);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: all 0.3s ease;
    z-index: 100;
}

.photobook-close:hover {
    background: var(--color-accent);
    transform: rotate(90deg);
}

/* Title Overlay */
.photobook-title {
    position: absolute;
    top: calc(var(--spacing-unit) * 15);
    left: calc(var(--spacing-unit) * 4);
    z-index: 5;
    animation: fadeIn 1s ease 0.5s both;
    pointer-events: none;
}

.photobook-title h1 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.9;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--color-text);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.photobook-title p {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-top: calc(var(--spacing-unit) * 2);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keyboard Navigation Hint */
.keyboard-hint {
    position: absolute;
    bottom: calc(var(--spacing-unit) * 10);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    opacity: 0.5;
    animation: fadeIn 1s ease 2s both;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1024px) {
    .photobook-container {
        padding: 0;
    }
    
    .photobook {
        height: 100vh;
    }
    
    .photobook-spread.active {
        gap: 0;
    }
    
    .photo-caption {
        padding: calc(var(--spacing-unit) * 3);
    }
    
    .caption-text {
        font-size: 1rem;
    }
    
    .nav-btn {
        width: 50px;
        height: 50px;
    }
    
    .prev-btn {
        left: calc(var(--spacing-unit) * 2);
    }
    
    .next-btn {
        right: calc(var(--spacing-unit) * 2);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .photobook-container {
        padding: 0;
    }
    
    .photobook {
        height: 100vh;
    }
    
    /* Keep pages side by side on mobile */
    .photobook-spread.active {
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }
    
    .left-page,
    .right-page {
        box-shadow: none;
    }
    
    .photo-caption {
        padding: calc(var(--spacing-unit) * 2);
    }
    
    .caption-location {
        font-size: 0.7rem;
    }
    
    .caption-text {
        font-size: 0.85rem;
    }
    
    .nav-btn {
        width: 45px;
        height: 45px;
    }
    
    .prev-btn {
        left: calc(var(--spacing-unit) * 1);
    }
    
    .next-btn {
        right: calc(var(--spacing-unit) * 1);
    }
    
    .photobook-close {
        top: calc(var(--spacing-unit) * 2);
        right: calc(var(--spacing-unit) * 2);
        width: 40px;
        height: 40px;
    }
    
    .photobook-title {
        top: calc(var(--spacing-unit) * 10);
        left: calc(var(--spacing-unit) * 2);
    }
    
    .photobook-title h1 {
        font-size: clamp(2rem, 10vw, 4rem);
    }
    
    .photobook-title p {
        font-size: clamp(0.75rem, 3vw, 1rem);
    }
    
    .page-counter {
        bottom: calc(var(--spacing-unit) * 2);
        font-size: 0.8rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .photobook {
        height: 100vh;
    }
    
    /* Show only one photo per slide on small screens */
    .photobook-spread.active {
        grid-template-columns: 1fr;  /* Single column */
        grid-template-rows: 1fr;     /* Single row */
        gap: 0;
    }
    
    /* Hide right page on small screens */
    .right-page {
        display: none;
    }
    
    /* Left page takes full width */
    .left-page {
        width: 100%;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .nav-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Make captions very compact on tiny screens */
    .photo-caption {
        padding: calc(var(--spacing-unit) * 1.5);
    }
    
    .caption-location {
        font-size: 0.65rem;
        margin-bottom: calc(var(--spacing-unit) * 0.5);
    }
    
    .caption-text {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Landscape Mobile */
@media (max-width: 900px) and (orientation: landscape) {
    .photobook-container {
        padding: 0;
    }
    
    .photobook {
        height: 100vh;
    }
    
    /* Keep side by side in landscape */
    .photobook-spread.active {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
        gap: 0;
    }
}

/* Print Styles */
@media print {
    .nav,
    .nav-btn,
    .photobook-close,
    .page-counter,
    .photobook-title {
        display: none;
    }
    
    .photobook-spread.active {
        page-break-after: always;
    }
}

/* Dark Theme Override */
.photobook-page {
    --color-bg: #0a0a0a;
    --color-surface: #151515;
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Loading State */
.photo-wrapper img[src=""] {
    display: none;
}

/* Focus States for Accessibility */
.nav-btn:focus,
.photobook-close:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Selection Colors */
::selection {
    background: var(--color-accent);
    color: var(--color-text);
}