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

/* Accessibility - Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-family: "IBM Plex Mono", monospace;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-family: "IBM Plex Mono", monospace;
    color: #333;
    font-size: 1rem;
}

/* Body styles */
body {
    font-family: "IBM Plex Mono", monospace;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Header styles */
header {
    background-color: #ffffff;
    color: #000000;
    padding: 1rem 0;
}

nav {
    max-width: 1720px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.title-group {
    display: flex;
    flex-direction: column;
}

.subtitle {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    font-family: "IBM Plex Mono", monospace;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-btn:hover {
    background-color: #555;
}

.dropdown-btn:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

.arrow {
    font-size: 24px;
    transform: rotate(270deg);
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover,
.dropdown-content a:focus {
    background-color: #f1f1f1;
    outline: none;
}

.dropdown-content a:focus {
    background-color: #e0e0e0;
}

.dropdown.active .dropdown-content {
    display: block;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: #000000;
    text-decoration: none;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #833b5c;
}

/* Main content styles */
main {
    max-width: 1720px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Gallery styles */
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.image-placeholder {
    width: 100%;
    background-color: #e0e0e0;
    transition: opacity 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.image-placeholder:hover {
    transform: scale(1.02);
}

.image-placeholder:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
    transform: scale(1.02);
}

.image-placeholder.hidden {
    display: none;
}

/* Enlarged view styles */
.enlarged-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.back-button {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    font-family: "IBM Plex Mono", monospace;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    align-self: flex-start;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #555;
}

.back-button:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

.enlarged-image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.enlarged-image {
    max-width: 1600px;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 4px;
    margin-bottom: 48px;
    transition: opacity 0.2s ease-in-out;
}

.nav-button {
    background-color: #333;
    color: white;
    padding: 11px 16px;
    font-size: 32px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    line-height: 1;
}

.nav-button:hover:not(:disabled) {
    background-color: #555;
}

.nav-button:focus:not(:disabled) {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

.nav-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Responsive design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }
    
    /* Mobile enlarged view adjustments */
    .enlarged-view {
        gap: 24px;
    }
    
    .enlarged-image-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .enlarged-image {
        max-width: 100%;
        max-height: 60vh;
        margin-bottom: 24px;
    }
    
    .nav-button {
        width: 100%;
        padding: 12px;
        font-size: 28px;
    }
    
    .back-button {
        width: 100%;
        text-align: center;
    }
    
    main {
        padding: 0 1rem;
    }
}
