/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* Header */
header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-lg);
    z-index: 1000;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

nav ul {
    display: flex;
    gap: var(--spacing-lg);
}

nav a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

nav a:hover,
nav a.active {
    color: var(--text-color);
}

/* Footer */
footer {
    background-color: #111;
    color: #fff;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
    text-align: center;
}

footer p {
    color: #666;
    font-size: 0.875rem;
}

/* Hero Section */
.hero {
    height: 80vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('../photos/home_photo.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
    color: #fff;
}

.hero-content {
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -0.05em;
    margin-bottom: var(--spacing-sm);
}

.hero p {
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.filter-btn {
    background: none;
    border: 1px solid transparent;
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.filter-btn:hover {
    color: var(--text-color);
    border-color: var(--border-color);
}

.filter-btn.active {
    background-color: #111;
    color: #fff;
}

/* Download Button */
.btn-download {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-download:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

/* Hike Grid */
.hike-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.hike-card {
    display: block;
    transition: transform 0.3s ease, opacity 0.4s ease;
}

.hike-card:hover {
    transform: translateY(-5px);
    opacity: 1 !important;
}

.card-image-wrapper {
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    aspect-ratio: 4/3;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hike-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-info h3 {
    font-weight: 400;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hike-grid {
        grid-template-columns: 1fr;
    }

    header {
        padding: 0 var(--spacing-sm);
    }

    .logo {
        font-size: 1rem;
    }

    nav ul {
        gap: var(--spacing-sm);
    }

    nav a {
        font-size: 0.75rem;
    }
}

/* Detail Page */
.hike-detail-container {
    max-width: 1000px;
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
}

.hike-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.detail-subtitle {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: var(--spacing-sm);
}

.hike-header h1 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: var(--spacing-md);
}

.detail-meta {
    font-family: inherit;
    color: var(--text-muted);
}

.hike-notes {
    width: 100%;
    margin-bottom: var(--spacing-md);
}

.hike-notes p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

.hike-notes a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    color: var(--text-color);
}

.hike-notes a:hover {
    color: var(--text-muted);
}

/* Vertical Gallery */
.gallery-masonry {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.gallery-item {
    width: 100%;
}

.gallery-item img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 2px;
    /* Optional: slight refinement */
}

.back-link {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.back-link a {
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 2px;
}

@media (max-width: 768px) {
    .hike-header h1 {
        font-size: 2rem;
    }

    .gallery-masonry {
        column-count: 1;
    }
}

/* Mosaic Grid */
.mosaic-container {
    max-width: 100vw;
    height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    height: 100%;
    gap: 1rem;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoom 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: #f1f1f1;
    font-size: 3rem;
    font-weight: 100;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoom {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.mosaic-tile {
    position: relative;
    overflow: hidden;
    display: block;
}

.mosaic-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.mosaic-tile:hover img {
    transform: scale(1.05);
}

.mosaic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.mosaic-tile:hover .mosaic-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.mosaic-overlay h2 {
    color: #fff;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 0.2em;
    font-size: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 900px) {
    .mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    .mosaic-overlay h2 {
        font-size: 0.9rem;
        letter-spacing: 0.1em;
    }
}