
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: #222;
    background: #fff;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

header h1 { font-size: 1.8rem; font-weight: 600; }
header p.subtitle { color: #666; font-size: 0.95rem; margin-top: 0.25rem; }
.site-logo { max-height: 80px; margin-bottom: 0.5rem; }

nav {
    margin-top: 0.75rem;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: #0366d6;
    text-decoration: none;
    font-size: 0.95rem;
}
nav a:hover { text-decoration: underline; }

/* Filters */
.filter-help {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.filters label { font-weight: 500; font-size: 0.9rem; }
.filters select {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}
#copy-link, #reset-filters {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f8f8;
    cursor: pointer;
}
#copy-link:hover, #reset-filters:hover { background: #e8e8e8; }

.result-count {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Gallery grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.gallery-item {
    text-align: center;
}

.gallery-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-item img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    transition: box-shadow 0.15s;
}

.gallery-item img:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gallery-item .caption {
    font-size: 0.75rem;
    color: #555;
    margin-top: 0.35rem;
    line-height: 1.3;
}

/* Detail page */
.detail-images {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.detail-images figure {
    margin: 0;
    text-align: center;
}
.detail-images img {
    max-height: 500px;
    width: auto;
    border: 1px solid #ddd;
}
.detail-images figcaption {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
}

.metadata {
    list-style: none;
    margin-bottom: 2rem;
}
.metadata li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.metadata .label {
    font-weight: 600;
    display: inline-block;
    min-width: 160px;
}

.back-link {
    margin-top: 1.5rem;
}
.back-link a {
    color: #0366d6;
    text-decoration: none;
}
.back-link a:hover { text-decoration: underline; }

/* Index page */
.index-list {
    list-style: none;
    columns: 2;
    column-gap: 2rem;
}
.index-list li {
    padding: 0.25rem 0;
    break-inside: avoid;
}
.index-list a { color: #0366d6; text-decoration: none; }
.index-list a:hover { text-decoration: underline; }

/* About */
.about-content { max-width: 700px; }
.about-content p { margin-bottom: 1rem; }

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-size: 0.8rem;
    color: #999;
}
.generated-on {
    margin-top: 0.3rem;
    font-size: 0.75rem;
}

@media (max-width: 600px) {
    .index-list { columns: 1; }
    .gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .filters { flex-direction: column; align-items: stretch; }
    .filters select { width: 100%; font-size: 1rem; padding: 0.5rem; }
    .filters label { margin-bottom: 0.1rem; }
    #copy-link, #reset-filters {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        width: 100%;
        text-align: center;
    }
    .detail-images { flex-direction: column; align-items: center; }
    .detail-images img { max-height: none; max-width: 100%; height: auto; }
    .metadata .label { display: block; min-width: 0; margin-bottom: 0.1rem; }
    .metadata li { padding: 0.5rem 0; }
    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.1rem; }
    nav { gap: 0.5rem; }
    nav a { font-size: 0.85rem; }
    .about-content { padding: 0 0.5rem; }
}
