/* Main Stylesheet */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-body);
    line-height: var(--line-height-body);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-heading);
    color: var(--color-heading);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

p {
    margin-bottom: var(--spacing-element);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Add top padding for fixed header when there's no hero */
body:not(.has-hero) .main-content {
    padding-top: 80px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-body);
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: #fff;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border);
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-nav-bg);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.has-hero .site-header {
    background: transparent;
}

.has-hero .site-header.scrolled {
    background: var(--color-nav-bg);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.site-logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.site-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-site-title);
    font-weight: var(--font-weight-site-title);
    color: var(--color-nav-text);
    transition: opacity 0.3s ease;
    line-height: 1.1;
}

.site-subtitle {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-site-subtitle);
    transition: opacity 0.3s ease;
    letter-spacing: 0.02em;
}

.has-hero .site-title,
.has-hero .site-subtitle {
    opacity: 0;
}

.has-hero .site-header.scrolled .site-title,
.has-hero .site-header.scrolled .site-subtitle {
    opacity: 1;
}

.has-hero .site-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.has-hero .site-header.scrolled .site-subtitle {
    color: var(--color-site-subtitle);
}

/* Navigation */
.main-nav {
    font-family: var(--font-nav);
    font-size: var(--font-size-nav);
    font-weight: var(--font-weight-nav);
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-list a {
    color: var(--color-nav-text);
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
}

.has-hero .nav-list a {
    color: #fff;
}

.has-hero .scrolled .nav-list a {
    color: var(--color-nav-text);
}

.nav-list a {
    transition: color 0.3s ease;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--color-nav-hover, var(--color-primary));
}

.has-hero .nav-list a:hover,
.has-hero .nav-list a.active {
    color: var(--color-nav-hover, var(--color-primary));
}

.has-hero .scrolled .nav-list a:hover,
.has-hero .scrolled .nav-list a.active {
    color: var(--color-nav-hover, var(--color-primary));
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-top: 5px solid currentColor;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--color-dropdown-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 0.5rem 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    color: var(--color-dropdown-text, var(--color-text)) !important;
    transition: color 0.2s ease;
}

.dropdown-menu a:hover {
    color: var(--color-dropdown-hover, var(--color-primary)) !important;
    background: rgba(0, 0, 0, 0.03);
}

.dropdown-menu a.active {
    color: var(--color-dropdown-hover, var(--color-primary)) !important;
}

.lock-icon {
    font-size: 0.75rem;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-nav-text);
    transition: all 0.3s ease;
}

.has-hero .mobile-menu-toggle span {
    background: #fff;
}

.has-hero .scrolled .mobile-menu-toggle span {
    background: var(--color-nav-text);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay-color);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--hero-text-color);
    padding: 2rem;
}

.hero-title {
    font-size: var(--hero-title-size);
    color: var(--hero-text-color);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: var(--font-size-h3);
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-scroll {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--hero-text-color);
    text-decoration: none;
    animation: bounce 2s infinite;
}

.hero-scroll svg {
    width: 24px;
    height: 24px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-section);
}

.section-header h1 {
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--color-text-muted);
    font-size: var(--font-size-h4);
}

/* Collections Grid */
.collections-section {
    padding: var(--spacing-section) 0;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.collection-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--color-background);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.collection-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.collection-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.collection-card:hover .collection-image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.collection-info {
    padding: 1.5rem;
}

.collection-name {
    font-size: var(--font-size-h3);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collection-description {
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.collection-count {
    font-size: 0.85rem;
    color: var(--color-secondary);
}

/* Galleries Grid */
.galleries-section {
    padding: var(--spacing-element) 0 var(--spacing-section);
}

.galleries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--color-background);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gallery-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-info {
    padding: 1.25rem;
}

.gallery-name {
    font-size: var(--font-size-h4);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-description {
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.gallery-count {
    font-size: 0.8rem;
    color: var(--color-secondary);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb span {
    color: var(--color-text-muted);
}

/* Gallery/Collection Header */
.collection-header,
.gallery-header {
    padding: calc(var(--spacing-section) + 80px) 0 var(--spacing-element);
    background: linear-gradient(180deg, var(--color-border) 0%, var(--color-background) 100%);
}

.collection-header h1,
.gallery-header h1 {
    margin-bottom: 0.5rem;
}

.collection-header .collection-description,
.gallery-header .gallery-description {
    color: var(--color-text-muted);
    max-width: 600px;
}

.gallery-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.download-enabled {
    color: var(--color-primary);
}

/* Related Links */
.related-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.related-links-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-right: 0.15rem;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--color-primary);
    border-radius: 1rem;
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.06);
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.related-link:hover {
    color: #fff;
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.related-link svg {
    flex-shrink: 0;
}

/* Gallery Content */
.gallery-content {
    padding: var(--spacing-section) 0;
}

/* EXIF Flags - Shared styles for all gallery layouts */
.exif-flags {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .exif-flags {
    opacity: 1;
}

.exif-flag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* EXIF flag colors by type */
.exif-focal {
    background: rgba(59, 130, 246, 0.8);
}

.exif-aperture {
    background: rgba(16, 185, 129, 0.8);
}

.exif-shutter {
    background: rgba(245, 158, 11, 0.8);
}

.exif-iso {
    background: rgba(239, 68, 68, 0.8);
}

.exif-mode {
    background: rgba(139, 92, 246, 0.8);
}

/* Empty Message */
.empty-message {
    text-align: center;
    padding: var(--spacing-section);
    color: var(--color-text-muted);
}

/* Footer */
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: var(--spacing-section) 0;
    margin-top: var(--spacing-section);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-content {
    text-align: center;
}

.footer-copyright {
    font-size: var(--font-size-footer);
    margin-bottom: 0.25rem;
}

.footer-tagline {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--color-nav-bg);
        padding: 5rem 1.5rem 2rem;
        transition: right 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .main-nav.open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .nav-list li {
        width: 100%;
    }

    .nav-list a {
        display: block;
        padding: 1rem 0;
        border-bottom: 1px solid var(--color-border);
        color: var(--color-nav-text) !important;
    }

    .nav-list a:hover,
    .nav-list a.active {
        color: var(--color-nav-hover, var(--color-primary)) !important;
    }

    .has-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
        background: transparent;
        backdrop-filter: none;
        border-radius: 0;
    }

    .dropdown-menu a {
        color: var(--color-nav-text) !important;
        border-bottom: 1px solid var(--color-border);
    }

    .dropdown-menu a:hover,
    .dropdown-menu a.active {
        color: var(--color-nav-hover, var(--color-primary)) !important;
    }

    .collections-grid {
        grid-template-columns: 1fr;
    }

    .galleries-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: calc(var(--hero-title-size) * 0.6);
    }

    .hero-subtitle {
        font-size: var(--font-size-h4);
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .collection-info,
    .gallery-info {
        padding: 1rem;
    }
}
