@font-face {
    font-family: "metropolis-semibold";
    src: url("/fonts/metropolis.semi-bold.otf");
}

.harlow {
    font-family: "metropolis-semibold";
}

:root {
    --primary-color: #FF8000;
    --bg-primary: #060d18;
    --bg-secondary: #0a1628;
    --text-color: #ffffff;
    --text-muted: #8ba3c1;
}

body {
    box-sizing: inherit;
    -webkit-tap-highlight-color: transparent;
    word-wrap: break-word;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: none;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-color);
    text-decoration: none;
    font-family: "metropolis-regular", sans-serif;
    font-style: normal;
    font-weight: normal;
}

/* ── Header ── */
.main-header {
    text-align: center;
    margin-top: 90px;
    margin-bottom: 50px;
    padding: 0 20px;
    animation: fadeInDown 0.8s ease;
    border-bottom: 3px solid #FF8000;
}

.main-header h1 {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
    font-family: "metropolis-semibold", sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-intro {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.7rem;
    line-height: 1.6;
}

.gallery-empty {
    text-align: center;
    color: #8ba3c1;
    font-size: 16px;
    padding: 48px 0;
}

/* ── Shared ── */
.gallery-container {
    margin: 0 auto;
    padding: 0 30px 80px;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 30px;
}

.gallery-item {
    break-inside: avoid;
    overflow: hidden;
}

.gallery-image-wrapper {
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.gallery-image-wrapper img {
    width: 100%;
    display: block;
    border-radius: 12px;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-image-wrapper:hover img {
    transform: scale(1.03);
    filter: brightness(0.85);
}

.gallery-description {
    padding: 12px 4px 0;
}

.gallery-description p {
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    margin: 0;
}

/* ══════════════════════════════════
   LAYOUT: Grid (uniform cells)
   ══════════════════════════════════ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: 24px;
}

.gallery-grid .gallery-image-wrapper img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* ══════════════════════════════════
   LAYOUT: Vertical masonry (columns)
   ══════════════════════════════════ */
.gallery-vertical {
    columns: 350px;
    column-gap: 24px;
}

.gallery-vertical .gallery-item {
    margin-bottom: 24px;
}

.gallery-vertical .gallery-image-wrapper img {
    object-fit: cover;
}

/* ══════════════════════════════════
   LAYOUT: Horizontal masonry (rows)
   ══════════════════════════════════ */
.gallery-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.gallery-horizontal .gallery-item {
    flex: 1 1 auto;
    min-width: 250px;
    max-width: 50%;
}

.gallery-horizontal .gallery-image-wrapper img {
    height: 300px;
    object-fit: cover;
}

/* ══════════════════════════════════
   Lightbox
   ══════════════════════════════════ */
.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.gallery-lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    scrollbar-width: none;
}

.lightbox-content::-webkit-scrollbar {
    display: none;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-description {
    color: #fff;
    font-size: 1.6rem;
    margin-top: 16px;
    text-align: center;
    max-width: 700px;
    line-height: 1.5;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 3.6rem;
    line-height: 1;
    padding: 10px;
    transition: color 0.2s ease;
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--primary-color);
}

.lightbox-close {
    top: 20px;
    right: 30px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* ══════════════════════════════════
   Responsive
   ══════════════════════════════════ */
@media screen and (max-width: 1024px) {
    body .main-header {
        margin-top: 10px;
    }

    .main-header h1 {
        padding-top: 90px;
    }

    .gallery-vertical {
        columns: 2;
    }
}

@media screen and (max-width: 640px) {
    .gallery-container {
        padding: 0 16px 40px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-vertical {
        columns: 1;
    }

    .gallery-horizontal .gallery-item {
        min-width: 100%;
        max-width: 100%;
    }

    .gallery-horizontal .gallery-image-wrapper img {
        height: auto;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }
}
