* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #666;
    color: #f0f0f0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #fff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

header {
    background-color: #444;
    padding: 1rem 2rem;
    border-bottom: 1px solid #555;
}

header nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

header nav .separator {
    color: #999;
}

header nav .current {
    color: #ccc;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

h1 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    color: #fff;
}

h2 {
    font-size: 1.25rem;
    font-weight: 400;
    color: #fff;
}

h2 a {
    color: inherit;
}

main > h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

main > h2:first-of-type {
    margin-top: 0;
}

/* Grid layouts */
.years-grid,
.months-grid,
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 400px);
    gap: 1.5rem;
}

.year-card,
.month-card,
.photo-card {
    background-color: #555;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.year-card:hover,
.month-card:hover,
.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.year-card .thumbnail,
.month-card .thumbnail,
.photo-card .thumbnail {
    aspect-ratio: 1/1;
    overflow: hidden;
    background-color: #444;
    position: relative;
}

.year-card .thumbnail img,
.month-card .thumbnail img,
.photo-card .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1rem 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
}

.thumbnail .overlay h2 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.thumbnail .overlay p {
    font-size: 0.85rem;
    color: #ccc;
}

/* Day sections in month view */
.day-section {
    margin-bottom: 2rem;
}

.day-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #777;
}

/* Photo detail page */
.photo-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.photo-detail figure {
    margin: 1.5rem 0;
    text-align: center;
}

.photo-detail figure img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.photo-detail .description {
    font-size: 1.1rem;
    color: #ddd;
    margin: 1.5rem 0;
    font-style: italic;
}

.exif-line {
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.photo-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #777;
}

.photo-nav a {
    padding: 0.5rem 1rem;
    background-color: #555;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.photo-nav a:hover {
    background-color: #666;
    text-decoration: none;
}

.photo-nav .prev {
    margin-right: auto;
}

.photo-nav .next {
    margin-left: auto;
}

footer {
    background-color: #444;
    padding: 1rem 2rem;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    border-top: 1px solid #555;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    main {
        padding: 1rem;
    }

    .years-grid,
    .months-grid,
    .photos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}
