:root {
    --primary-blue: #3A6B8C;
    --secondary-green: #4A7C2D;
    --secondary-gold: #D4AF37;
    --bg-dark: #12181F;
    --bg-card: #1E252D;
    --text-light: #E0E6ED;
    --text-muted: #9BA3AF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    /* Muted wrench/construction tool SVG pattern in the background */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" opacity="0.03"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>');
    color: var(--text-light);
    display: flex;
    min-height: 100vh;
    font-size: 16px;
}

/* Sticky Sidebar Menu */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border-right: 2px solid var(--primary-blue);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    z-index: 1000;
}

.brand-title {
    color: var(--secondary-gold);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background-color: rgba(58, 107, 140, 0.2);
    border-left: 3px solid var(--secondary-green);
    color: var(--secondary-gold);
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    width: calc(100% - 260px);
    display: flex;
    flex-direction: column;
}

.banner-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--primary-blue);
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.profile-container img {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    border: 2px solid var(--secondary-gold);
    margin-bottom: 1.5rem;
}

h1, h2, h3 {
    color: var(--secondary-gold);
    margin-bottom: 1rem;
}

p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border-top: 3px solid var(--primary-blue);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.card h3 {
    color: var(--secondary-green);
}

/* Forms */
form {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--primary-blue);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input, textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--primary-blue);
    color: var(--text-light);
    border-radius: 4px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary-gold);
}

button {
    background: var(--primary-blue);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.3s ease;
}

button:hover {
    background: var(--secondary-green);
}

footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Consolidated Gallery Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-4px);
    border-color: var(--secondary-gold);
}

/* Enforces uniform thumbnail aspect ratio without distorting images */
.thumb-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-dark);
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-card:hover .thumb-container img {
    transform: scale(1.05);
}

.gallery-caption {
    padding: 0.75rem 1rem;
    color: var(--secondary-gold);
    font-size: 0.9rem;
    background: var(--bg-card);
    border-top: 1px solid var(--primary-blue);
    flex-grow: 1; /* Ensures captions align evenly if text length varies */
}

/* Lightbox Modal Overlay */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(10, 14, 18, 0.92);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    border: 2px solid var(--secondary-gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    object-fit: contain;
}

.lightbox-caption {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--secondary-gold);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--secondary-green);
}

/* 📱 Responsive Web Design (Media Queries) */
@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
        font-size: 14px;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        flex-direction: row;
        align-items: center;
        padding: 0.5rem;
        border-right: none;
        border-bottom: 2px solid var(--primary-blue);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .brand-title {
        margin-bottom: 0;
        margin-right: 1.5rem;
        font-size: 1.2rem;
    }

    .sidebar nav {
        flex-direction: row;
        gap: 0.5rem;
    }

    .sidebar nav a {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 12px;
    }

    .sidebar nav a:hover, .sidebar nav a.active {
        border-left: none;
        border-bottom: 3px solid var(--secondary-green);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
