* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f7f7f5;
    color: #222;
    font-family: Georgia, "Times New Roman", serif;
}

body,
.gallery,
.gallery-item,
.gallery-item img,
.lightbox,
.lightbox img {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ---------- Header ---------- */

.site-header {
    text-align: center;
    padding: 55px 20px 45px;
    background: #f7f7f5;
}

.site-header h1 {
    margin: 0 0 25px 0;
    font-size: 54px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #666;
}

.site-header h2 {
    margin: 2px 0 8px;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-header p {
    margin: 0 0 10px;
    color: #666;
    font-size: 15px;
}

.site-header nav {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #777;
}

.site-header nav a {
    color: #666;
    text-decoration: none;
    margin: 0 8px;
}

.site-header nav a:hover {
    color: #111;
}

/* ---------- Filter buttons ---------- */

.gallery-filters {
    text-align: center;
    margin: 0 0 24px;
    font-family: Arial, Helvetica, sans-serif;
}

.filter-btn {
    padding: 7px 15px;
    margin: 0 5px 8px;
    border: 1px solid #ccc;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filter-btn:hover,
.filter-btn.active {
    background: #333;
    border-color: #333;
    color: white;
}

/* ---------- Isotope masonry gallery ---------- */

.gallery-wrap {
    max-width: 1500px;
    margin: 0 auto;
    padding: 8px 18px 60px;
}

/* Needed because Isotope positions children absolutely. */
.gallery {
    position: relative;
}

/* 7 columns on large screen:
   100 / 7 = 14.2857%
*/
.gallery-sizer,
.gallery-item {
    width: 14.2857%;
}

.gallery-item {
    padding: 0 5px 10px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    display: block;
    background: #ddd;
    transition: opacity 0.2s ease, transform 0.2s ease;

    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.gallery-item:hover img {
    opacity: 0.86;
    transform: translateY(-1px);
}

/* ---------- Lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
    background: rgba(247, 247, 245, 0.96);
}

.lightbox.open {
    display: flex;
}

.lightbox-image-area {
    flex: 1;
    height: 100vh;
    padding: 34px 30px 34px 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-area img {
    max-width: 100%;
    max-height: 92vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

.lightbox-info {
    width: 300px;
    max-width: 32vw;
    height: 100vh;
    background: rgba(255,255,255,0.88);
    border-left: 1px solid #ddd;
    padding: 150px 30px 30px;
    font-family: Arial, Helvetica, sans-serif;
    color: #666;
    position: relative;
}

.lightbox-info h3 {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.03em;
}

.lightbox-info .subtitle {
    margin: 0 0 26px;
    font-size: 13px;
    line-height: 1.6;
    color: #777;
}

.lightbox-info .description {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: #666;
}

.lightbox-close {
    border: 0;
    background: transparent;
    color: #777;
    cursor: pointer;
    font-size: 34px;
    line-height: 1;
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 10001;
}

.lightbox-close:hover {
    color: #111;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
    .gallery-sizer,
    .gallery-item {
        width: 20%; /* 5 columns */
    }
}

@media (max-width: 900px) {
    .gallery-sizer,
    .gallery-item {
        width: 33.3333%; /* 3 columns */
    }

    .lightbox.open {
        flex-direction: column;
        overflow-y: auto;
    }

    .lightbox-image-area {
        height: auto;
        min-height: 60vh;
        padding: 50px 18px 18px;
    }

    .lightbox-info {
        width: 100%;
        max-width: none;
        height: auto;
        border-left: 0;
        border-top: 1px solid #ddd;
        padding: 24px 24px 70px;
    }
}

@media (max-width: 600px) {
    .site-header h1 {
        font-size: 34px;
        letter-spacing: 0.05em;
    }

    .site-header h2 {
        font-size: 17px;
    }

    .gallery-sizer,
    .gallery-item {
        width: 50%; /* 2 columns */
    }

    .gallery-item {
        padding: 0 4px 8px;
    }
}
