/**
 * Photography Page Styles
 * Single CSS file for all photography page sections
 */

/* ========================================
   CSS Variables (inherit from base-sections.css)
   ======================================== */

/* ========================================
   Photo Page Intro with Gradient
   ======================================== */
.photo-intro-gradient {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: calc(60px + 2vw); /* Account for header height */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: linear-gradient(to bottom, var(--highlight-color) 0%, var(--highlight-color) 5%, var(--content-bg, white) 100%);
}

@media (prefers-color-scheme: dark) {
    .photo-intro-gradient {
        background: linear-gradient(to bottom, var(--highlight-color) 0%, var(--highlight-color) 5%, var(--content-bg, #050505) 100%);
    }
}

/* Tablet */
@media (max-width: 1200px) {
    .photo-intro-gradient {
        padding-top: 80px;
    }

    .photo-page-intro h3 {
        font-size: 3rem;
    }
}

/* Mobile */
@media (max-width: 768px), ((max-width: 1200px) and (max-height: 768px)) {
    .photo-intro-gradient {
        padding-top: 70px;
    }

    .photo-page-intro {
        padding: 40px 4vw;
    }

    .photo-page-intro h3 {
        font-size: 1.84375rem;
    }
}

.photo-page-intro {
    padding: 0;
    max-width: 900px;
    margin: 0 auto;
}

/* Match large-intro-text sizing */
.photo-page-intro h3 {
    font-size: min(3vw, 63px);
}

/* Override strategy-intro padding on photography page */
.photo-intro-gradient .strategy-intro {
    padding-top: 0;
    padding-bottom: 0;
}

/* Even text wrap for photography intro */
.strategy-intro-body h3 {
    text-wrap: balance;
}

/* ========================================
   Photo Type (Section Container)
   ======================================== */
.photo-type {
    position: relative;
    padding: 0 0 120px 0;
}

/* ========================================
   Photo Type Headline (Sticky Section Header)
   ======================================== */
.photo-type-headline {
    position: sticky;
    top: calc(2vw + 60px); /* Below site header */
    z-index: 80;
    padding: 24px 2vw;
    width: fit-content;
    text-align: left;
}

.photo-type-headline h2 {
    font-family: var(--compressed-font) !important;
    font-size: 8vw;
    font-weight: 400;
    line-height: 1.1;
    color: var(--link-hover-color); /* Highlight green #39e58f */
    margin: 0;
}

/* ========================================
   Photo Set (Individual Set Container)
   ======================================== */
.photo-set {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    padding: 0 2vw 120px 2vw;
    min-height: 60vh;
}

/* ========================================
   Photo Title (Sticky Title Column)
   ======================================== */
.photo-title {
    position: sticky;
    top: calc(2vw + 60px + 10vw + 48px); /* Header + headline height + padding */
    align-self: flex-start;
    flex: 0 0 300px;
    height: fit-content;
    z-index: 90;
}

.photo-title h3 {
    font-family: var(--serif-font) !important;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-color);
    margin: 0 0 12px 0;
}

.photo-title .story-meta {
    font-family: var(--primary-font);
    font-size: 14px;
    font-weight: 400;
    color: var(--text-color-muted);
    margin: 0;
}

/* Remove arrow from story-meta on photo page */
.photo-title .story-meta::after {
    content: "";
}

.photo-title .story-meta i {
    font-style: italic;
}

/* Read More Link (Photo Page) */
.photo-read-more-pill {
    display: inline-block;
    font-family: var(--serif-font);
    font-size: 1.5rem;
    font-weight: 400;
    font-style: italic;
    color: var(--highlight-color);
    text-decoration: none;
    margin: 0 0 12px 0;
    transition: opacity 0.12s ease;
}

.photo-read-more-pill:hover {
    opacity: 0.7;
}

/* ========================================
   Photo Scroll (Horizontal Scroller)
   ======================================== */
.photo-scroll {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px; /* Space for scrollbar */
    align-items: center;
}

/* Custom scrollbar styling */
.photo-scroll::-webkit-scrollbar {
    height: 8px;
}

.photo-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.photo-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.photo-scroll::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Dark mode scrollbar */
@media (prefers-color-scheme: dark) {
    .photo-scroll::-webkit-scrollbar-track {
        background: #333;
    }

    .photo-scroll::-webkit-scrollbar-thumb {
        background: #666;
    }

    .photo-scroll::-webkit-scrollbar-thumb:hover {
        background: #888;
    }
}

/* ========================================
   Photo Picture (Individual Images)
   ======================================== */
.photo-picture {
    flex: 0 0 auto;
    height: 75vh;
    scroll-snap-align: start;
    cursor: pointer;
}

.photo-picture img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}

/* ========================================
   Photo Description (Text at End)
   ======================================== */
.photo-description {
    flex: 0 0 300px;
    width: 300px;
    height: 75vh;
    display: flex;
    align-items: flex-end;
    scroll-snap-align: start;
}

.photo-description p {
    font-family: var(--serif-font);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-color);
    margin: 0;
}

/* ========================================
   Tablet Responsive (max-width: 1200px)
   ======================================== */
@media (max-width: 1200px) {
    .photo-type-headline {
        top: 80px; /* Adjusted for stacked header */
    }

    .photo-type-headline h2 {
        font-size: 10vw;
    }

    .photo-title {
        flex: 0 0 250px;
        top: calc(80px + 12vw + 48px);
    }

}

/* ========================================
   Mobile Responsive (max-width: 768px)
   ======================================== */
@media (max-width: 768px), ((max-width: 1200px) and (max-height: 768px)) {
    .photo-type {
        padding-bottom: 80px;
    }

    .photo-type-headline {
        position: sticky;
        top: 70px;
        padding: 16px 4vw;
    }

    .photo-type-headline h2 {
        font-size: 12vw;
    }

    /* Stack layout on mobile */
    .photo-set {
        flex-direction: column;
        gap: 24px;
        padding: 0 4vw 80px 4vw;
        min-height: auto;
    }

    /* Title loses sticky, moves below scroll */
    .photo-title {
        position: static;
        flex: none;
        width: 100%;
        order: 2; /* Move below photo-scroll */
    }

    /* Photo scroll takes full width */
    .photo-scroll {
        order: 1;
        width: 100%;
        gap: 16px;
        scroll-snap-type: x mandatory;
    }

    /* Images take 100% width on mobile */
    .photo-picture {
        flex: 0 0 100%;
        width: 100%;
        height: auto;
    }

    .photo-picture img {
        width: 100%;
        height: auto;
    }

    /* Description at 100% width */
    .photo-description {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        padding: 0;
        align-items: flex-start;
    }

    .photo-description p {
        font-size: 1.125rem;
    }
}

/* ========================================
   Small Mobile (max-width: 480px)
   ======================================== */
@media (max-width: 480px), ((max-width: 1200px) and (max-height: 480px)) {
    .photo-type-headline h2 {
        font-size: 14vw;
    }
}

/* ========================================
   Photo Lightbox
   ======================================== */
.photo-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.photo-lightbox.active {
    display: flex;
}

.photo-lightbox-image {
    max-height: 90vh;
    max-width: 90vw;
    object-fit: contain;
}

.photo-lightbox-close {
    position: absolute;
    top: 24px;
    left: 24px;
    background: none;
    border: none;
    color: #808080;
    font-family: var(--primary-font);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.photo-lightbox-close:hover {
    opacity: 1;
}

/* Dark mode lightbox */
@media (prefers-color-scheme: dark) {
    .photo-lightbox {
        background: rgba(0, 0, 0, 0.9);
    }
}
