/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #333333;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
}

/* Loading Percentage */
.loading-percentage {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.percentage-text { font-size: 5rem; }

/* Navbar */
.navbar {
    background-color: rgba(169, 169, 169, 0.3);
    padding: 0 1.2rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    transition: background-color 0.3s;
}
.navbar:hover {
    background-color: rgba(169, 169, 169, 1);
}

.brand-title {
    font-size: 1.5rem;
    color: #fff;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.navbar-expanded-links {
    display: flex;
    gap: 0.7rem;
}
.navbar-expanded-links a {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    opacity: 0.3;
    font-size: 0.9rem;
    transition: opacity 0.3s ease, color 0.3s ease;
}
.navbar-expanded-links a:hover {
    opacity: 1;
    color: purple;
}

/* Gallery */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-content: flex-start;
    width: 100%;
    margin: 0;
    padding: 0;
}
.gallery-item {
    flex: 0 0 11.1111%;
    max-width: 11.1111%;
    position: relative;
}
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}
.overlay img {
    max-width: 100%;
    max-height: 100%;
    transition: all 0.3s ease-in-out;
    object-fit: contain;
}

/* Before/After Buttons */
.button-container {
    position: absolute;
    bottom: 10px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}
.button-container button {
    background-color: gray;
    color: white;
    border: none;
    padding: 5px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.button-container button:hover {
    background-color: darkgray;
}

/* Responsive gallery breakpoints */
@media screen and (max-width: 1400px) {
    .gallery-item { flex: 0 0 20%; max-width: 20%; }
}
@media screen and (max-width: 1024px) {
    .gallery-item { flex: 0 0 25%; max-width: 25%; }
}
@media screen and (max-width: 768px) {
    .navbar-expanded-links a { font-size: 0.6rem; }
    .gallery-item { flex: 0 0 33.3333%; max-width: 33.3333%; }
}

/* ↓↓↓ MOBILE ONLY: tappable‐area hack + tap-highlight ↓↓↓ */
@media screen and (max-width: 768px) {
    /* shrink brand title */
    .brand-title {
        font-size: 0.75rem !important;
    }
    /* beef up nav opacity */
    .navbar {
        background-color: rgba(169, 169, 169, 0.45);
    }
    /* expand tappable area */
    .navbar-expanded-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        padding: 0 0.5rem;
        margin: 0 -0.5rem;
    }
    /* flash purple while you press */
    .navbar-expanded-links a:active {
        color: purple !important;
        opacity: 1 !important;
    }
}

/* Prevent blue tap flash on the Work tab */
.navbar-expanded-links a#work-link {
    -webkit-tap-highlight-color: transparent;
    /* (you can also add `touch-action: manipulation;` here if needed) */
}
