:root {
    --bg: #111;
    --text: #eee;
    --accent: #e67e22;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

header {
    padding: 1rem 2rem;
    background: #000;
    text-align: center;
}

h1 a {
    color: white;
    text-decoration: none;
}

.album-grid, .photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

.album-card, .photo-item {
    display: block;             /* Allows aspect-ratio on img to control height */
    text-decoration: none;
    color: inherit;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.album-card:hover, .photo-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.album-card img,
.photo-item img {
    width: 100%;
    aspect-ratio: 1 / 1;        /* Ensures square display */
    height: auto;
    object-fit: cover;          /* Fills the square cleanly */
    display: block;
    border-radius: 4px 4px 0 0;
}

.album-card img {
    aspect-ratio: 4 / 3;        /* Change to 16/9 or keep 1/1 for albums if preferred */
}

.album-info, .filename {
    padding: 0.8rem;
    text-align: center;
}

.back {
    text-align: center;
    margin: 1rem;
    font-size: 1.1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 0.9rem;
}

#searchInput {
    width: 100%;
    max-width: 600px;
    padding: 0.8rem;
    margin: 1rem auto;
    display: block;
    font-size: 1rem;
    border: 1px solid #444;
    border-radius: 4px;
    background: #222;
    color: #eee;
}

.pagination {
    text-align: center;
    margin: 2rem 0;
}

.pagination a {
    margin: 0 0.5rem;
    color: var(--accent);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #444;
    border-radius: 4px;
    transition: background 0.2s;
}

.pagination a:hover {
    background: #333;
}

.pagination a.active {
    background: var(--accent);
    color: #111;
    font-weight: bold;
}

@media (max-width: 600px) {
    .album-grid, .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    header {
        padding: 0.5rem 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .pagination a {
        padding: 0.3rem 0.7rem;
        font-size: 0.9rem;
    }
}

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