/*
 * PersonligPlast Gallery Page Styles
 * Bento grid layout — dark theme, warm editorial design system
 */

/* ==========================================================================
   GALLERY PAGE — Dark Theme Override
   ========================================================================== */

.pp-gallery-page {
    background: #0d0f0d;
    color: #f4f4f0;
    min-height: 100vh;
}

/* Override body background for dark theme */
body.pp-gallery-body {
    background: #0d0f0d !important;
}

/* Hide Kadence page header/title for gallery page */
body.pp-gallery-body .entry-hero-container-inner,
body.pp-gallery-body .page-hero-section,
body.pp-gallery-body .entry-header,
body.pp-gallery-body .wp-block-kadence-rowlayout.hero-section {
    display: none !important;
}

/* ==========================================================================
   GALLERY HEADER — Editorial Style
   ========================================================================== */

.pp-gallery-header {
    padding: 5rem 2rem 3rem;
    max-width: 1280px;
    margin: 0 auto;
}

.pp-gallery-header__inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .pp-gallery-header__inner {
        flex-direction: row;
        align-items: baseline;
        gap: 3rem;
    }
}

.pp-gallery-header__title {
    font-family: var(--pp-font-primary);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    color: #faf9f6;
    margin: 0;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
}

.pp-gallery-header__title em {
    color: #f79877;
    font-style: italic;
    font-weight: 400;
}

.pp-gallery-header__desc {
    max-width: 28rem;
}

.pp-gallery-header__desc p {
    font-family: var(--pp-font-secondary);
    font-size: 1.125rem;
    color: rgba(157, 157, 154, 0.9);
    line-height: 1.7;
    margin: 0;
}

/* ==========================================================================
   BENTO GALLERY GRID
   ========================================================================== */

.pp-bento-gallery {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

/* ---------- Shared item styles ---------- */

.pp-bento__item {
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    background: rgba(244, 244, 240, 0.03);
}

.pp-bento__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(1) opacity(0.8);
    transition: filter 0.7s ease, transform 0.7s ease, opacity 0.7s ease;
}

.pp-bento__item:hover .pp-bento__image {
    filter: grayscale(0) opacity(1);
    transform: scale(1.03);
}

/* Placeholder for empty state */
.pp-bento__placeholder {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: linear-gradient(135deg, #1a1c1a 0%, #2a2c2a 100%);
}

/* ---------- Hero Piece: 8 of 12 columns ---------- */

.pp-bento__item--hero {
    grid-column: span 8;
}

.pp-bento__image-wrap {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.pp-bento__overlay--hero {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.pp-bento__label {
    display: block;
    font-family: var(--pp-font-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #e78b6b;
    margin-bottom: 0.75rem;
}

.pp-bento__title--hero {
    font-family: var(--pp-font-primary);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}

.pp-bento__cta {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #954a2e;
    color: #fff7f5 !important;
    text-decoration: none;
    font-family: var(--pp-font-primary);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 9999px;
    transition: opacity 0.2s ease;
}

.pp-bento__cta:hover {
    opacity: 0.9;
    color: #fff7f5 !important;
}

/* ---------- Side Piece: 4 of 12 columns ---------- */

.pp-bento__item--side {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pp-bento__side-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.pp-bento__series {
    font-family: var(--pp-font-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    color: #f79877;
    margin: 0 0 0.5rem;
}

.pp-bento__side-title {
    font-family: var(--pp-font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: #faf9f6;
    margin: 0;
}

/* ---------- Tall Vertical Piece: 4 columns ---------- */

.pp-bento__item--tall {
    grid-column: span 4;
}

.pp-bento__image--tall {
    height: 600px;
    width: 100%;
    object-fit: cover;
}

.pp-bento__overlay--tall {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    background: linear-gradient(to top, #0d0f0d 0%, transparent 50%);
}

.pp-bento__title {
    font-family: var(--pp-font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: #faf9f6;
    margin: 0;
}

.pp-bento__subtitle {
    font-family: var(--pp-font-secondary);
    font-size: 0.875rem;
    color: rgba(157, 157, 154, 0.9);
    margin: 0.5rem 0 0;
}

/* ---------- 2x2 Grid Section: 8 columns ---------- */

.pp-bento__item--grid {
    grid-column: span 8;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    background: transparent;
}

.pp-bento__grid-card {
    overflow: hidden;
    border-radius: 0.75rem;
    background: rgba(244, 244, 240, 0.05);
    padding: 1rem;
    transition: background 0.3s ease;
}

.pp-bento__grid-card:hover {
    background: rgba(244, 244, 240, 0.08);
}

.pp-bento__grid-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.pp-bento__grid-image .pp-bento__image {
    filter: brightness(0.75);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.pp-bento__grid-card:hover .pp-bento__grid-image .pp-bento__image {
    filter: brightness(1) grayscale(0);
    transform: scale(1.03);
}

.pp-bento__grid-title {
    font-family: var(--pp-font-primary);
    font-size: 1rem;
    font-weight: 700;
    color: #faf9f6;
    margin: 0 0 0.25rem;
    padding: 0 0.5rem;
}

.pp-bento__grid-series {
    font-family: var(--pp-font-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(157, 157, 154, 0.7);
    margin: 0;
    padding: 0 0.5rem;
}

/* ---------- Extra items beyond bento layout ---------- */

.pp-bento__item--extra {
    grid-column: span 4;
    min-height: 300px;
}

.pp-bento__extra-image {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.pp-bento__overlay--extra {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.25rem 1.25rem;
    background: linear-gradient(to top, rgba(13, 15, 13, 0.85), transparent);
}

/* ==========================================================================
   FULL-WIDTH STATEMENT BLOCK
   ========================================================================== */

.pp-gallery-statement {
    max-width: 1280px;
    margin: 1.5rem auto 5rem;
    padding: 0 2rem;
}

.pp-gallery-statement__bg {
    display: none;
}

.pp-gallery-statement__content {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1c1a 0%, #0d0f0d 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 2rem;
    min-height: 400px;
}

.pp-gallery-statement__title {
    font-family: var(--pp-font-primary);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    max-width: 36rem;
}

.pp-gallery-statement__desc {
    font-family: var(--pp-font-secondary);
    font-size: 1.125rem;
    color: rgba(225, 227, 222, 0.7);
    margin: 0 0 2rem;
    max-width: 32rem;
    line-height: 1.7;
}

.pp-gallery-statement__cta {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: #faf9f6;
    color: #0d0f0d !important;
    text-decoration: none;
    font-family: var(--pp-font-primary);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 9999px;
    transition: background 0.3s ease, color 0.3s ease;
}

.pp-gallery-statement__cta:hover {
    background: #f79877;
    color: #0d0f0d !important;
}

/* ==========================================================================
   RESPONSIVE — Mobile
   ========================================================================== */

@media (max-width: 767px) {
    .pp-gallery-header {
        padding: 3rem 1.5rem 2rem;
    }

    .pp-gallery-header__title {
        white-space: normal;
    }

    .pp-bento-gallery {
        grid-template-columns: 1fr;
        padding: 0 1.5rem 1.5rem;
        gap: 1rem;
    }

    .pp-bento__item--hero,
    .pp-bento__item--side,
    .pp-bento__item--tall,
    .pp-bento__item--grid,
    .pp-bento__item--extra {
        grid-column: span 1;
    }

    .pp-bento__image--tall {
        height: 400px;
    }

    .pp-bento__item--grid {
        grid-template-columns: 1fr;
    }

    .pp-gallery-statement {
        padding: 0 1.5rem;
    }

    .pp-gallery-statement__content {
        padding: 3rem 1.5rem;
        min-height: 300px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .pp-bento-gallery {
        grid-template-columns: repeat(8, 1fr);
    }

    .pp-bento__item--hero {
        grid-column: span 5;
    }

    .pp-bento__item--side {
        grid-column: span 3;
    }

    .pp-bento__item--tall {
        grid-column: span 3;
    }

    .pp-bento__item--grid {
        grid-column: span 5;
    }

    .pp-bento__item--extra {
        grid-column: span 4;
    }

    .pp-bento__image--tall {
        height: 450px;
    }
}

/* ==========================================================================
   LIGHTBOX — fullscreen image viewer with original colors (no overlay)
   ========================================================================== */

body.pp-lightbox-active {
    overflow: hidden;
}

.pp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 200ms ease;
    padding: 24px;
}

.pp-lightbox[hidden] {
    display: none;
}

.pp-lightbox--open {
    opacity: 1;
}

.pp-lightbox__content {
    position: relative;
    max-width: min(100%, 1400px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.pp-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    /* Ensure original colors — no filters, no overlays */
    filter: none;
    opacity: 0;
    transition: opacity 200ms ease;
}

.pp-lightbox__image--loaded {
    opacity: 1;
}

.pp-lightbox__caption {
    color: #faf9f6;
    font-size: 14px;
    letter-spacing: 0.04em;
    margin-top: 16px;
    text-align: center;
    max-width: 600px;
    font-family: var(--font-sans, 'Be Vietnam Pro', system-ui, sans-serif);
}

.pp-lightbox__close,
.pp-lightbox__nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #faf9f6;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
    padding: 0;
    z-index: 2;
}

.pp-lightbox__close:hover,
.pp-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

.pp-lightbox__close:focus-visible,
.pp-lightbox__nav:focus-visible {
    outline: 2px solid #faf9f6;
    outline-offset: 2px;
}

.pp-lightbox__close {
    top: 16px;
    right: 16px;
}

.pp-lightbox__nav--prev { left: 16px; top: 50%; transform: translateY(-50%); }
.pp-lightbox__nav--next { right: 16px; top: 50%; transform: translateY(-50%); }

.pp-lightbox__nav--prev:hover { transform: translateY(-50%) scale(1.05); }
.pp-lightbox__nav--next:hover { transform: translateY(-50%) scale(1.05); }

.pp-lightbox__nav--hidden {
    display: none !important;
}

/* Bento images become pointer-obvious */
.pp-bento__image {
    cursor: zoom-in;
}

@media (max-width: 600px) {
    .pp-lightbox { padding: 12px; }
    .pp-lightbox__image { max-height: calc(100vh - 140px); }
    .pp-lightbox__close,
    .pp-lightbox__nav { width: 40px; height: 40px; }
    .pp-lightbox__nav--prev { left: 8px; }
    .pp-lightbox__nav--next { right: 8px; }
    .pp-lightbox__close { top: 8px; right: 8px; }
}
