/* ========================================
   ANIMATIONS
   ======================================== */
   @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Source Sans 3", sans-serif;
    background-color: #3E2723;
    color: #3E2723;
    line-height: 1.5;
}
img { display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; padding: 0; margin: 0; }

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    background-color: #3E2723;
    padding: 1rem 2rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}
.navbar-brand {
    font-family: "Xanh Mono", monospace;
    font-size: clamp(20px, 2.5vw, 28px);
    color: #eccaca;
    transition: color 0.3s ease;
    white-space: nowrap;
}
.navbar-brand:hover { color: #ECEAE2; }

.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    margin-left: auto;
}
.nav-menu a {
    font-family: "Source Sans 3", sans-serif;
    font-size: 16px;
    color: #eccaca;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.25s ease;
}
.nav-menu a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 2px;
    background-color: #eccaca;
    transform: scaleX(0);
    transition: transform 280ms ease;
}
.nav-menu a:hover        { color: #ECEAE2; }
.nav-menu a:hover::after { transform: scaleX(1); }
.nav-active              { color: #ECEAE2 !important; }
.nav-active::after       { transform: scaleX(1) !important; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    background-color: #eccaca;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ========================================
   MAIN LAYOUT
   ======================================== */
main {
    margin-top: 72px;
    background-color: #eceae2;
}
.main-container {
    padding: 10px 30px;
}
.content-wrapper {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 10px;
}

/* ========================================
   PAGE TITLE
   ======================================== */
.gallery-title {
    font-family: "Xanh Mono", monospace;
    font-size: clamp(32px, 5vw, 56px);
    color: #3E2723;
    padding: 10px 0;
    line-height: 1.1;
}

/* ========================================
   FILTER BUTTONS
   ======================================== */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 10px 0;
}
.filter-btn {
    font-family: "Source Sans 3", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(62,39,35,0.45);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 6px 14px 5px;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease;
}
.filter-btn:hover  { color: #3E2723; }
.filter-btn.active { color: #3E2723; border-bottom-color: #3E2723; }

/* ========================================
   GALLERY GRID — square tiles
   ======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 12px;
    padding: 10px 0 40px;
}

.gallery-item {
    position: relative;
    opacity: 1;
    transition: opacity 0.4s ease;
}
.gallery-item.hidden { display: none; }

.image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #e0d8ce;
}
.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.35s ease;
}
.gallery-item:hover .image-wrapper img { transform: scale(1.05); }

/* View button overlay */
.btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}
.gallery-item:hover .btn-overlay {
    opacity: 1;
    pointer-events: auto;
}
.view-btn {
    background-color: rgba(62,39,35,0.7);
    border: 2px solid #eceae2;
    color: #eceae2;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Source Sans 3", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.2s ease;
}
.view-btn:hover { background-color: #3E2723; }

/* ========================================
   LIGHTBOX
   ======================================== */
.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.9);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}
.overlay.active { display: flex; }

.overlay-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: fadeInUp 0.25s ease;
}

.close-btn {
    position: absolute;
    top: -38px; right: 0;
    background: transparent;
    color: #eccaca;
    border: none;
    font-family: "Source Sans 3", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 10px;
    transition: color 0.25s ease;
}
.close-btn:hover { color: #fff; }

.nav-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.22);
    width: 48px; height: 48px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 26px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease;
}
.nav-btn:hover { background: rgba(255,255,255,0.18); }
.prev-btn { left: -64px; }
.next-btn { right: -64px; }

.image-container { display: flex; align-items: center; justify-content: center; }

.overlay-image {
    max-height: 90vh;
    max-width: 88vw;
    width: auto; height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6);
    transition: opacity 0.2s ease;
}
.overlay-image.transitioning { opacity: 0; }

/* ========================================
   FOOTER
   ======================================== */
footer {
    background-color: #3E2723;
    padding: 40px 20px 24px;
    color: #eceae2;
    text-align: center;
}
.footer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
#socials-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 10px 0;
}
#socials-links li a {
    color: #eceae2;
    font-size: 17px;
    position: relative;
    transition: color 0.25s ease;
}
#socials-links li a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -1px;
    width: 100%; height: 2px;
    background-color: #eceae2;
    transform: scaleX(0);
    transition: transform 280ms ease;
}
#socials-links li a:hover::after { transform: scaleX(1); }
#footer-message {
    font-family: "Xanh Mono", monospace;
    font-size: clamp(36px, 7vw, 88px);
    line-height: 1;
    color: #eceae2;
}
.footer-copy {
    font-size: 13px;
    color: rgba(236,234,226,0.45);
}

/* ========================================
   RESPONSIVE — TABLET
   ======================================== */
@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ========================================
   RESPONSIVE — MOBILE
   ======================================== */
@media (max-width: 680px) {
    .navbar { padding: 1rem; }
    .nav-toggle { display: flex; }
    .nav-menu {
        position: fixed;
        top: 72px; left: -100%;
        width: 70%; max-width: 280px;
        height: 100vh;
        background-color: #3E2723;
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 2rem;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 4px 0 16px rgba(0,0,0,0.25);
        margin-left: 0;
    }
    .nav-menu.active { left: 0; }
    .nav-menu a      { font-size: 18px; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    .prev-btn { left: 8px; }
    .next-btn { right: 8px; }
    .close-btn { position: fixed; top: 12px; right: 12px; }

    #socials-links  { gap: 20px; }
    #footer-message { font-size: 40px; }
    .main-container { padding: 10px 15px; }
}