/* Core Layout and Typography for a Brighter Palette */
:root {
    --text-color: #333;
    --background-color: #f0f0f0;
    --accent-color: #007bff;
    --font-family: 'Roboto Mono', monospace;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

body.fade-in {
    opacity: 1;
}

/* Header and Navigation */
.site-header {
    width: 100%;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(240, 240, 240, 0.9);
    backdrop-filter: blur(5px);
    margin-bottom: 50px;
    position: relative; /* Ensure z-index works */
    z-index: 10;      /* Place header above other content */
}

.site-title-link {
    text-decoration: none;
    color: inherit;
}

.title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    width: 300px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 4px; /* Widen spacing to align with title */
    text-transform: uppercase;
    margin-top: -5px;
    padding-left: 4px; /* Nudge to align optically with spaced-out letters */
}

.site-title span {
    display: inline-block;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    padding: 0 10px;
    transition: color 0.3s ease-in-out;
}

.main-nav a:hover {
    text-decoration: underline;
}

/* Minimalist & Creative Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    padding: 0 10px;
}

.dropdown-btn:hover {
    text-decoration: underline;
}

.dropdown-content {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 8px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-content a:hover {
    text-decoration: underline;
}

.dropdown:hover .dropdown-content a {
    opacity: 1;
    transform: translateY(0);
}

.dropdown-content a:nth-child(1) { transition-delay: 0.05s; }
.dropdown-content a:nth-child(2) { transition-delay: 0.1s; }
.dropdown-content a:nth-child(3) { transition-delay: 0.15s; }
.dropdown-content a:nth-child(4) { transition-delay: 0.2s; }


/* Main Content & Section Titles */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-section {
    width: 100%;
    margin-bottom: 80px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
}

/* **NEW**: Styles for "Browse All" page category subheadings */
#browse-all-content .section-title {
    font-size: 2rem;
    margin-top: 40px;
    margin-bottom: 25px;
}

#browse-all-content .category-grid-view {
    margin-bottom: 40px;
}

/* Homepage Single Image Styles */
#homepage-gallery-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Place it below the header */
    transition: opacity 0.3s ease, filter 0.3s ease; /* Smooth transition for effect */
}

/* **NEW** Creative fix: Fade and blur the image when a dropdown is active */
body:has(.dropdown:hover) #homepage-gallery-container {
    opacity: 0.4;
    filter: blur(4px);
}

#homepage-gallery-container img {
    max-width: 80vw;
    max-height: 75vh; /* Keep it from touching header/footer */
    width: auto;
    height: auto;
    display: block;
    cursor: default; /* Ensure no pointer cursor */
}

#homepage-text {
    font-size: 1rem;
    color: #000;
    font-weight: 400;
    white-space: nowrap;
}

/* Styles for Footer on Browse page */
.site-footer-text {
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    margin-top: auto;
    cursor: default;
}


/* Loader Styles */
.loader {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 300px;
    font-size: 1.5rem;
    color: var(--text-color);
    letter-spacing: 2px;
}

.loader.visible {
    display: flex;
}

.cursor {
    animation: blink 1s step-end infinite;
    margin-left: 5px;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Gallery Styles (Justified) */
.gallery {
    width: 100%;
}

.gallery-row {
    display: flex;
    margin-bottom: 10px;
}

.gallery-row .photo-item-link {
    margin-right: 10px;
}

.gallery-row .photo-item-link:last-child {
    margin-right: 0;
}

.photo-item-link {
    display: block;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

.photo-item-link img {
    display: block;
    transition: transform 0.3s ease-in-out;
}

/* Hover Effects */
.photo-item-link:hover {
    transform: scale(1.02);
    cursor: pointer;
}

.photo-item-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1;
}

.photo-item-link:hover::before {
    opacity: 1;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
    animation: fadeIn 0.3s ease-in-out;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid white;
    animation: zoomIn 0.3s ease-in-out;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

/* Styles for Category/Collection Cards */
.gallery.category-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.collection-card {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.collection-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.collection-card:hover img {
    transform: scale(1.05);
}

.collection-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 30px 15px 15px 15px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    transition: background 0.3s ease;
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        padding: 15px;
    }
    .site-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
        width: 100%;
        height: 40px;
    }
    .main-nav {
        flex-direction: column;
        align-items: center;
    }
    .main-nav a {
        padding: 5px 0;
    }
    .main-content {
        padding: 0 10px;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .gallery.category-grid-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-header {
        flex-direction: column;
        align-items: center;
    }
    .site-title {
        text-align: center;
    }
    .main-nav {
        flex-direction: column;
        text-align: center;
    }
    .main-nav a {
        padding: 5px 0;
    }
}