/* Anchor Core - Living Gallery Portfolio */

.anchor-gallery-section {
    position: relative;
    padding: 6rem 2rem;
    background-color: rgba(241, 236, 228, 0.6);
    margin: 4rem 0;
}

.anchor-gallery-header {
    max-width: 1400px;
    margin: 0 auto 4rem;
}

.anchor-gallery-chapter {
    font-family: var(--anchor-font-mono, "JetBrains Mono", monospace);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--anchor-moss, #6c746f);
}

.anchor-gallery-title {
    margin: 0.75rem 0;
    font-family: var(--anchor-font-editorial, "Cormorant Garamond", Georgia, serif);
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.02;
    font-weight: 300;
    color: var(--anchor-charcoal, #1d1e20);
}

.anchor-gallery-subtitle {
    max-width: 420px;
    font-family: var(--anchor-font-editorial, "Cormorant Garamond", Georgia, serif);
    font-size: 1.25rem;
    color: rgba(29, 30, 32, 0.7);
    margin: 0;
}

.anchor-gallery-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    perspective: 1400px;
}

@media (min-width: 992px) {
    .anchor-gallery-wall {
        grid-template-columns: repeat(3, 1fr);
    }
}

.anchor-gallery-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    border-radius: 0.2rem;
    border: 1px solid rgba(29, 30, 32, 0.12);
    overflow: hidden;
    cursor: pointer;
    will-change: transform, box-shadow;
    transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.9s ease;
}

.anchor-gallery-frame:hover {
    box-shadow: 0 40px 60px -30px rgba(29, 30, 32, 0.35), 0 12px 20px -12px rgba(29, 30, 32, 0.2);
}

/* Aspect Ratios */
.aspect-4-5 { aspect-ratio: 4 / 5; }
.aspect-3-4 { aspect-ratio: 3 / 4; }
.aspect-5-6 { aspect-ratio: 5 / 6; }

/* Tones (Light / Dark Card & Text Combinations) */
.tone-bone {
    background-color: var(--anchor-bone, #f1ece4) !important;
    color: var(--anchor-charcoal, #1d1e20) !important;
}

.tone-porcelain {
    background-color: var(--anchor-porcelain, #faf8f4) !important;
    color: var(--anchor-charcoal, #1d1e20) !important;
}

.tone-charcoal {
    background-color: var(--anchor-charcoal, #1d1e20) !important;
    color: var(--anchor-porcelain, #faf8f4) !important;
}

/* Photography viewport & light gradient overlay */
.anchor-photo-viewport {
    position: absolute;
    inset: 1rem;
    border-radius: 0.15rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.anchor-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.anchor-gallery-frame:hover .anchor-gallery-img {
    transform: scale(1.06);
}

.anchor-photo-light {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    transition: transform 300ms ease-out;
    pointer-events: none;
    z-index: 2;
}

.light-a {
    background: radial-gradient(120% 80% at 30% 20%, rgba(162, 123, 72, 0.35), transparent 60%),
                linear-gradient(180deg, rgba(29, 30, 32, 0.15), rgba(29, 30, 32, 0.6));
}

.light-b {
    background: radial-gradient(120% 80% at 70% 30%, rgba(241, 236, 228, 0.9), transparent 60%),
                linear-gradient(180deg, rgba(29, 30, 32, 0.05), rgba(29, 30, 32, 0.25));
}

.anchor-frame-meta {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    font-family: var(--anchor-font-mono, "JetBrains Mono", monospace);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.85;
}

.anchor-frame-info {
    position: relative;
    z-index: 3;
}

.anchor-frame-name {
    margin: 0;
    font-family: var(--anchor-font-editorial, "Cormorant Garamond", Georgia, serif);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.1;
    font-weight: 300;
}

.anchor-frame-type {
    margin: 0.5rem 0 0;
    font-family: var(--anchor-font-mono, "JetBrains Mono", monospace);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.8;
}

/* ==========================================================================
   FULL-SCREEN VIEWPORT-CENTERED SCROLLABLE LIGHTBOX MODAL
   ========================================================================== */
.anchor-lightbox {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2vh 2vw !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 350ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.anchor-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.anchor-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(17, 18, 20, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.anchor-lightbox-container {
    position: relative;
    z-index: 2;
    width: 92vw;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background-color: var(--anchor-porcelain, #faf8f4);
    color: var(--anchor-charcoal, #1d1e20);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Fixed Header Bar above scroll viewport */
.anchor-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.75rem;
    background-color: rgba(241, 236, 228, 0.95);
    border-bottom: 1px solid rgba(29, 30, 32, 0.12);
    flex-shrink: 0;
}

.anchor-lightbox-plate {
    font-family: var(--anchor-font-mono, "JetBrains Mono", monospace);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--anchor-moss, #6c746f);
    display: block;
    margin-bottom: 0.2rem;
}

.anchor-lightbox-title {
    margin: 0;
    font-family: var(--anchor-font-editorial, "Cormorant Garamond", Georgia, serif);
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1.1;
}

.anchor-lightbox-type {
    margin: 0.2rem 0 0;
    font-family: var(--anchor-font-mono, "JetBrains Mono", monospace);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.7;
}

.anchor-lightbox-close {
    background: rgba(29, 30, 32, 0.08);
    border: 1px solid rgba(29, 30, 32, 0.18);
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--anchor-charcoal, #1d1e20);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.anchor-lightbox-close:hover {
    background-color: var(--anchor-charcoal, #1d1e20);
    color: var(--anchor-porcelain, #faf8f4);
}

/* Scrollable Viewport for High-Res Screencaptures */
.anchor-lightbox-scroll-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background-color: #121315;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    scroll-behavior: smooth;
}

.anchor-lightbox-img {
    width: 100%;
    max-width: 1280px;
    height: auto;
    display: block;
    border-radius: 0.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    margin: 0 auto;
    image-rendering: -webkit-optimize-contrast; /* High crispness rendering hint */
}

@media (max-width: 640px) {
    .anchor-lightbox {
        padding: 0 !important;
    }

    .anchor-lightbox-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .anchor-lightbox-header {
        padding: 0.85rem 1.15rem;
    }

    .anchor-lightbox-title {
        font-size: 1.25rem;
    }

    .anchor-lightbox-scroll-viewport {
        padding: 1rem 0.75rem;
    }
}