/* ========================= */
/* Base Styles               */
/* ========================= */
body, html {
    margin: 0;
    padding: 0;
    color: white;
    overflow-x: hidden; /* prevent horizontal overflow */
    font-family: 'Arial', sans-serif;
    background: linear-gradient(180deg, #0a0a0a, #111);
}

/* ========================= */
/* Gallery Section           */
/* ========================= */
.work-gallery-section {
    min-height: 100vh;
    padding: 30px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.work-gallery-container {
    width: 100%;
    max-width: 95%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========================= */
/* Title                     */
/* ========================= */
.work-gallery-title {
    font-size: clamp(28px, 8vw, 72px); /* scales with viewport */
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
    line-height: 1.2;
    word-break: break-word; /* prevent overflow */
}

.work-gallery-title .highlight {
    background: linear-gradient(90deg, #888, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========================= */
/* Gallery Buttons           */
/* ========================= */
.gallery-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
}

.gallery-buttons button {
    flex: 1 1 auto;
    min-width: 100px;
    max-width: 200px;
    padding: 8px 12px;
    font-size: clamp(0.7rem, 3vw, 0.95rem);
    outline: 1px solid #a8a8a8;
    background: #222;
    color: #eee;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-buttons .return-home {
    outline: 1px solid rgba(175, 149, 0, 0.747);
}

.gallery-buttons .return-home:hover {
    outline: 1px solid rgb(255, 217, 0);
    background: rgb(255, 221, 71);
    color: black;
}

.gallery-buttons button:hover {
    background: #444;
    transform: translateY(-2px);
}

.gallery-buttons button:active {
    background: #666;
    transform: translateY(0);
}

/* ========================= */
/* Input Hint / Badges       */
/* ========================= */
.input-hint {
    font-size: clamp(0.75rem, 3vw, 1rem);
    margin-top: 0.5rem;
    line-height: 1.4;
    text-align: center;
}

.input-hint .hint-or {
    margin: 0 6px;
    opacity: 0.7;
    font-size: 0.9em;
}

.kbd {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: clamp(2px, 1vw, 6px) clamp(4px, 2vw, 8px);
    font-size: clamp(0.6rem, 2.5vw, 0.9rem);
    color: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.6), 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kbd:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.7), 0 4px 6px rgba(0,0,0,0.3);
}

.kbd .icon {
    width: clamp(10px, 3vw, 18px);
    height: clamp(10px, 3vw, 18px);
    background-size: contain;
    background-repeat: no-repeat;
    filter: invert(1) brightness(1.8);
}

.kbd .leftmousebutton {
    background-image: url("https://www.svgrepo.com/show/69012/mouse-left-button.svg");
}

.kbd .touchtap {
    background-image: url("https://cdn-icons-png.flaticon.com/512/121/121426.png");
}

/* ========================= */
/* Gallery Grid / Cards      */
/* ========================= */
.work-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    justify-items: center;
}

.work-card {
    width: 100%;
    max-width: 280px;
    height: auto;
    background: #181818;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 3px 8px rgba(0,0,0,0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .work-card:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 6px 15px rgba(255,255,255,0.15);
    }
}

.work-card img,
.work-card video {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

/* ========================= */
/* Viewer Overlay            */
/* ========================= */
.viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.viewer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.viewer-content {
    max-width: 95%;
    max-height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-content img,
.viewer-content video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

.viewer-close {
    margin-top: 20px;
    padding: clamp(6px, 2vw, 12px) clamp(12px, 3vw, 18px);
    background: #222;
    color: #fff;
    font-size: clamp(0.75rem, 3vw, 1rem);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.viewer-close:hover {
    background: #444;
}

/* ========================= */
/* Single-column mobile layout (<400px) */
/* ========================= */
@media (max-width: 400px) {
    .work-items {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding-bottom: 20px;
    }

    .work-card {
        width: 100%;
        max-width: 280px;
    }

    .gallery-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .gallery-buttons button {
        width: 100%;
        max-width: 200px;
    }

    .input-hint {
        font-size: 0.7rem;
        margin-top: 0.5rem;
    }

    .kbd {
        font-size: 0.65rem;
        padding: 2px 4px;
        gap: 2px;
    }

    .kbd .icon {
        width: 10px;
        height: 10px;
    }

    .viewer-content {
        max-width: 95%;
        max-height: 70%;
    }
}
