/* ═══════════════════════════════════════════════
   gallery.css  —  Hannah Midha Photography
   Shared styles for portfolio preview (index.html)
   and full gallery page (gallery.html)
   Place at: css/gallery.css
═══════════════════════════════════════════════ */

/* ── PORTFOLIO PREVIEW SECTION (index.html) ── */
.portfolio-preview-section {
    padding: 6rem 6vw;
    background: var(--off-white, #f4f9fd);
}

.portfolio-preview-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.portfolio-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 240px 240px;
    gap: 0.75rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* First item spans 2 rows for editorial punch */
.portfolio-preview-grid .portfolio-item.tall {
    grid-row: span 2;
}

.portfolio-preview-cta {
    text-align: center;
    margin-top: 2.5rem;
}

/* ── SHARED PORTFOLIO ITEM ── */
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #dce8f0;
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(19, 41, 75, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

/* placeholder state when image is missing */
.portfolio-item.img-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dce8f0;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8ba5be;
}

.portfolio-item.img-missing::after {
    content: 'Add photo here';
}

.portfolio-item.img-missing img {
    display: none;
}

/* ── GALLERY PAGE HEADER ── */
.gallery-page-header {
    padding: 5rem 6vw 3rem;
    text-align: center;
}

.gallery-page-header .section-label {
    display: block;
    margin-bottom: 0.75rem;
}

/* ── FULL MASONRY GALLERY (gallery.html) ── */
.gallery-full-wrap {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem 6vw 5rem;
}

.masonry-grid {
    columns: 3;
    column-gap: 0.75rem;
}

.masonry-grid .portfolio-item {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    height: auto;
    cursor: pointer;
}

.masonry-grid .portfolio-item img {
    height: auto;           /* respect the photo's natural proportions */
    width: 100%;
    object-fit: unset;      /* override the shared cover rule — no cropping */
}

/* aspect-ratio rules removed — let real photo dimensions show through */

/* missing image state in masonry */
.masonry-grid .portfolio-item.img-missing {
    aspect-ratio: 3/4;
}

/* ── LIGHTBOX ── */
.lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: lbFadeIn 0.2s ease;
}

.lb-overlay.open {
    display: flex;
}

@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lb-inner {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
}

.lb-inner img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 3px;
    display: block;
    animation: lbScaleIn 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes lbScaleIn {
    from { transform: scale(0.93); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lb-close-btn {
    position: absolute;
    top: -2.8rem;
    right: 0;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.lb-close-btn:hover {
    background: rgba(75, 156, 211, 0.25);
    border-color: #4b9cd3;
}

/* ── GALLERY PAGE CTA ── */
.gallery-cta-strip {
    text-align: center;
    padding: 4rem 2rem 5rem;
    border-top: 1px solid #dce8f0;
}

.gallery-cta-strip p {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 300;
    margin-bottom: 2rem;
    color: var(--navy, #13294b);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .masonry-grid { columns: 2; }
    .portfolio-preview-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 200px);
    }
    .portfolio-preview-grid .portfolio-item.tall {
        grid-row: span 1;
    }
}

@media (max-width: 560px) {
    .masonry-grid { columns: 1; }
    .portfolio-preview-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
}
