/* ================================================================
   PORTFOLIO PAGE — Standalone category gallery pages
   ================================================================ */

body.portfolio-page {
    background: #0d0d0d;
    color: #fff;
}

/* Transparent header on dark pages */
.portfolio-page .main-header:not(.scrolled) .nav-links a,
.portfolio-page .main-header:not(.scrolled) .dropdown-trigger {
    color: rgba(255, 255, 255, 0.85);
}

.portfolio-page .main-header:not(.scrolled) .logo-img {
    filter: brightness(0) invert(1);
}

.portfolio-page .main-header:not(.scrolled) .hamburger span {
    background: #fff;
}

.portfolio-page .main-header.scrolled .dropdown-menu {
    background: #fff;
}

/* ── PORTFOLIO HERO ── */
.pf-page-hero {
    position: relative;
    height: 82vh;
    min-height: 580px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}


.pf-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
    transition: transform 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    filter: brightness(0.5) saturate(0.85);
}

.pf-hero-bg.loaded {
    transform: scale(1);
}

.pf-hero-grad {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(13, 13, 13, 1) 0%,
            rgba(13, 13, 13, 0.65) 25%,
            rgba(13, 13, 13, 0.15) 65%,
            transparent 100%);
    z-index: 1;
}

.pf-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 80px 72px;
    max-width: 1000px;
}

.pf-hero-eyebrow {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #d4c5a9;
    margin-bottom: 18px;
    font-family: 'Montserrat', sans-serif;
    opacity: 0;
    animation: pfFadeUp 0.9s ease 0.3s forwards;
}

.pf-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3.2rem, 7.5vw, 7rem);
    font-style: italic;
    font-weight: 400;
    color: #fff;
    line-height: 1;
    margin-bottom: 26px;
    opacity: 0;
    animation: pfFadeUp 1s ease 0.5s forwards;
}

.pf-hero-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    opacity: 0;
    animation: pfFadeUp 0.9s ease 0.75s forwards;
}

.pf-hero-count {
    font-size: 0.58rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    font-weight: 300;
}

.pf-hero-sep {
    width: 36px;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.pf-hero-back {
    text-decoration: none;
    font-size: 0.58rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
    font-family: 'Montserrat', sans-serif;
}

.pf-hero-back:hover {
    color: #d4c5a9;
}

.pf-hero-back::before {
    content: '←';
    font-style: normal;
}

@keyframes pfFadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── CATEGORY NAV STRIP ── */
.pf-cat-strip {
    background: rgba(10, 10, 10, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    position: sticky;
    top: 77px; /* Align exactly below scrolled desktop header */
    z-index: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow-x: auto;
    scrollbar-width: none;
}

.pf-cat-strip::-webkit-scrollbar {
    display: none;
}

.pf-cat-strip-inner {
    display: flex;
    align-items: center;
    max-width: 1640px;
    margin: 0 auto;
    padding: 0 48px;
}

.pf-cat-link {
    flex-shrink: 0;
    text-decoration: none;
    font-size: 0.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 18px 16px;
    position: relative;
    transition: color 0.25s;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.pf-cat-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #d4c5a9;
    transition: width 0.35s ease;
}

.pf-cat-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

.pf-cat-link.active {
    color: #d4c5a9;
}

.pf-cat-link.active::after {
    width: 60%;
}

/* ── GALLERY WRAPPER ── */
.pf-gallery-wrap {
    padding: 0;
    ;
    max-width: none;
}

/* ── FEATURED OPENING TRIO ── */
.pf-trio {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 360px 360px;
    gap: 5px;
    margin-bottom: 5px;
}

.pf-trio-main {
    grid-row: span 2;
}

.pf-trio-main,
.pf-trio-side {
    position: relative;
    overflow: hidden;
    background: #111;
    cursor: pointer;
}

.pf-trio-main img,
.pf-trio-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s ease;
}

.pf-trio-main:hover img,
.pf-trio-side:hover img {
    transform: scale(1.07);
    filter: brightness(0.65);
}

/* ── ZOOM HOVER ICON (shared) ── */
.pm-zoom-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.pm-zoom-icon::after {
    content: '';
    width: 56px;
    height: 56px;
    border: 1.5px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background:
        rgba(0, 0, 0, 0.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") center / 22px no-repeat;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.pf-trio-main:hover .pm-zoom-icon,
.pf-trio-side:hover .pm-zoom-icon {
    opacity: 1;
}

/* ── MAIN MOSAIC GRID ── */
.pf-mosaic {
    display: block !important;
    column-count: 3;
    column-gap: 20px;
    max-width: none;
    margin: 0 auto;
    padding: 0 20px;
    content-visibility: auto;        /* skip rendering of off-screen columns */
    contain-intrinsic-size: 0 2000px; /* reserve space to prevent layout shift */
}


.pf-mosaic-item {
    display: inline-block;
    /* Prevents photos from splitting across columns */
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    cursor: pointer;
    will-change: transform;
}

/* Every 7th item = wide accent */
.pf-mosaic-item:nth-child(7n + 1) {
    grid-column: span 2;
    aspect-ratio: 16 / 7;
}

/* Every 11th item = full width feature */
.pf-mosaic-item:nth-child(11n + 5) {
    grid-column: span 3;
    aspect-ratio: 21 / 8;
}

.pf-mosaic-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
    transition: transform 0.35s ease;
    backface-visibility: hidden;
    transform: translateZ(0);  /* GPU layer promotion */
}

.pf-mosaic-item:hover img {
    transform: scale(1.04) translateZ(0);
}

.pf-mosaic-item:hover .pm-zoom-icon {
    opacity: 1;
}

/* Thin bottom caption line */
.pf-mosaic-item .pm-num {
    position: absolute;
    bottom: 12px;
    left: 14px;
    font-size: 0.5rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.35);
    font-family: 'Montserrat', sans-serif;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pf-mosaic-item:hover .pm-num {
    opacity: 1;
}

/* ── SCROLL REVEAL ── */
.pf-reveal {
    opacity: 0;
    transform: translateY(28px);
}
/* Transition is only set ONCE visible, so hidden elements don't track transitions */
.pf-reveal.pf-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

/* ── PREV / NEXT CATEGORY NAVIGATION ── */
.pf-cat-nav-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 64px 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: #0d0d0d;
}

.pf-cat-nav-btn {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 16px 0;
    transition: opacity 0.3s;
}

.pf-cat-nav-btn:hover {
    opacity: 0.6;
}

.pf-nav-label {
    font-size: 0.52rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
}

.pf-nav-name {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.55rem;
    color: #fff;
    font-weight: 400;
}

.pf-cat-nav-btn.pf-nav-next {
    text-align: right;
}

.pf-cat-nav-btn.pf-nav-prev .pf-nav-name::before {
    content: '← ';
    font-style: normal;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
}

.pf-cat-nav-btn.pf-nav-next .pf-nav-name::after {
    content: ' →';
    font-style: normal;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
}

/* ── FOOTER on dark portfolio page ── */
.portfolio-page .main-footer {
    margin-top: 0;
}

/* ── LIGHTBOX (re-declared for portfolio pages) ── */
.lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lb-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lb-img-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-img-wrap img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0, 0.2, 1);
    box-shadow: 0 10px 80px rgba(0, 0, 0, 0.7);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

.lb-img-wrap img.is-zoomed {
    cursor: grab;
}

.lb-img-wrap img.is-dragging {
    cursor: grabbing;
    transition: opacity 0.25s ease;
    /* Remove transform transition while dragging for instant response */
}

/* Smooth 1s cross-fade during slideshow playback */
.lb-overlay.slideshow-active .lb-img-wrap img {
    transition: opacity 1s ease;
}

/* ── Top-right button group: Play, Fullscreen, Close ── */
/* Shared base so all three buttons sit on exactly the same horizontal line */
.lb-close,
.lb-icon-btn {
    position: absolute;
    top: 18px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 9010;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.2s, transform 0.2s;
}

.lb-close:hover,
.lb-icon-btn:hover {
    color: #fff;
    transform: scale(1.15);
}

/* Close button — uses a text × glyph, sized to match the 24 px SVG icons */
.lb-close {
    right: 22px;
    font-size: 1.7rem;
    line-height: 1;
}

/* SVG icons */
.lb-icon-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#lbFullscreen {
    left: 68px;
    right: auto;
}

#lbPlay {
    left: 22px;
    right: auto;
}

#lbShare {
    left: 114px;
    right: auto;
}

/* Playing state indicator on play button */
#lbPlay.is-playing {
    color: #d4c5a9;
}

/* ── Share Panel ── */
.lb-share-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 10px));
    background: rgba(18, 18, 18, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 28px 32px 22px;
    z-index: 9020;
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    min-width: 350px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.lb-share-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.lb-share-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
}

.lb-share-close:hover {
    color: #fff;
    transform: scale(1.1);
}

.lb-share-panel-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 20px;
    display: block;
    text-align: center;
}

.lb-share-icons {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 0 4px;
}

.lb-share-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.lb-share-icon-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.1);
}

.lb-share-icon-link svg {
    width: 22px;
    height: 22px;
}

.lb-share-url-row {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    overflow: hidden;
}

.lb-share-url {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 9px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    outline: none;
    min-width: 0;
}

.lb-share-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 9px 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.lb-share-copy:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.lb-share-copy.copied {
    background: #2d6e4e;
    color: #fff;
}

.lb-share-copy svg {
    width: 16px;
    height: 16px;
}

.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9010;
    transition: background 0.25s;
    backdrop-filter: blur(4px);
}

.lb-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lb-prev {
    left: 26px;
}

.lb-next {
    right: 26px;
}

.lb-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.62rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
    .pf-mosaic {
        column-count: 2;
    }

    .pf-mosaic-item:nth-child(7n + 1) {
        grid-column: span 2;
        aspect-ratio: 16/7;
    }

    .pf-mosaic-item:nth-child(11n + 5) {
        grid-column: span 2;
        aspect-ratio: 16/7;
    }

    .pf-trio {
        grid-template-rows: 280px 280px;
    }
}

@media (max-width: 768px) {
    .pf-page-hero {
        height: 50vh !important;
        min-height: 350px !important;
    }

    .pf-hero-content {
        padding: 0 32px 52px;
    }

    .pf-trio {
        grid-template-columns: 1fr;
        grid-template-rows: 300px 200px 200px;
    }

    .pf-trio-main {
        grid-row: span 1;
    }

    .pf-gallery-wrap {
        padding: 28px 12px 80px;
    }

    .pf-cat-strip-inner {
        padding: 0 16px;
    }

    .pf-cat-strip {
        top: 65px; /* Align exactly below scrolled mobile header */
    }

    .pf-mosaic-item:nth-child(7n + 1) {
        grid-column: span 2;
        aspect-ratio: 16/9;
    }

    .pf-mosaic-item:nth-child(11n + 5) {
        grid-column: span 2;
        aspect-ratio: 16/9;
    }

    .pf-cat-nav-bottom {
        flex-direction: column;
        gap: 32px;
        padding: 48px 24px;
    }

    .pf-cat-nav-btn.pf-nav-next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .pf-mosaic {
        column-count: 1;
    }

    .pf-mosaic-item:nth-child(7n + 1),
    .pf-mosaic-item:nth-child(11n + 5) {
        grid-column: span 1;
        aspect-ratio: 4/3;
    }

    .pf-cat-nav-bottom {
        padding: 36px 20px;
    }

    .lb-arrow {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .lb-prev {
        left: 8px;
    }

    .lb-next {
        right: 8px;
    }
}

/* ==========================================
   FIX VERTICAL IMAGES CROPPING (SHOW FULL IMAGE)
   ========================================== */

/* Safely target ONLY the images inside your photo grid and lightbox */
.pf-gallery-wrap img,
.pf-mosaic-item img,
.pf-trio-item img,
.lb-content img {
    object-fit: contain !important;
    /* Forces the entire image to be visible */
    height: auto !important;
    width: 100% !important;
    max-height: 90vh !important;
    /* Prevents vertical images from becoming insanely tall */
}