* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #2b2b2b;
    color: #f0f0f0;
    font-family: "Yu Gothic", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ====================
   HERO
==================== */

header {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* モデル一覧ページ専用ヘッダー */

header.models-header {
    position: relative;
    min-height: 48vh;
    height: auto;

    background:
        linear-gradient(
            rgba(0,0,0,.32),
            rgba(0,0,0,.72)
        ),
        url("../img/models-header.jpg")
        center 35% / cover no-repeat;

    text-align: center;
    padding: 40px 20px;
    overflow: hidden;
}

header.models-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 120px;

    background:
        linear-gradient(
            to bottom,
            rgba(43,43,43,0),
            #2b2b2b
        );

    pointer-events: none;
}

/* モデルページ共通ヘッダー */

header.model-header {
    background:
        linear-gradient(
            rgba(0,0,0,.45),
            rgba(0,0,0,.45)
        ),
        url("../img/default-header.jpg")
        center / cover no-repeat;
}

/* ギャラリーページ共通ヘッダー */

header.gallery-header {
    background:
        linear-gradient(
            rgba(0,0,0,.45),
            rgba(0,0,0,.45)
        ),
        url("../img/default-header.jpg")
        center / cover no-repeat;
}

.hero {
    position: relative;
    z-index: 1;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 300;
    letter-spacing: 0.08em;
}

.subtitle {
    margin-top: 14px;
    font-size: 0.85rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #ddd;
    opacity: 0.75;
}

/* ====================
   MAIN
==================== */

main {
    max-width: 1600px;
    margin: auto;
    padding: 20px;
}

/* TOPへ戻るリンク */

.back-link {
    max-width: 1120px;
    margin: 0 auto 40px;
    padding: 50px 20px 0;
    font-size: 0.82rem;
    color: #aaa;
    letter-spacing: 0.04em;
}

.back-link a {
    border-bottom: 1px solid rgba(255,255,255,0.25);
    transition: 0.3s ease;
}

.back-link a:hover {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.7);
}

/* ====================
   FILTER TOGGLE
==================== */

.toggle-btn {
    padding: 8px 14px;
    margin-bottom: 15px;
    background: #3a3a3a;
    color: #eee;
    border: 1px solid #555;
    cursor: pointer;
    transition: .2s;
}

.toggle-btn:hover {
    background: #555;
}

/* ====================
   FILTER AREA
==================== */

.filters {
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
    transition:
        max-height .35s ease,
        opacity .25s ease;
    margin-bottom: 25px;
}

.filters.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

#searchBox {
    width: 100%;
    max-width: 320px;
    padding: 10px;
    margin-bottom: 15px;
    background: #3a3a3a;
    border: 1px solid #555;
    color: white;
}

#searchBox:focus {
    outline: none;
    border-color: #888;
}

.filter-group {
    margin-bottom: 10px;
}

.filter-label {
    display: inline-block;
    width: 45px;
    color: #bbb;
    font-size: 13px;
}

.filter-group button {
    padding: 6px 10px;
    margin: 2px;
    background: #3a3a3a;
    color: #ddd;
    border: 1px solid #555;
    cursor: pointer;
    transition: .2s;
}

.filter-group button:hover {
    background: #555;
    border-color: #777;
}

.filter-group button.active {
    background: #888;
    color: white;
    border-color: #ccc;
}

/* ====================
   GRID
==================== */

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 220px);
    justify-content: center;
    gap: 20px;
}

/* ====================
   CARD
==================== */

.model-card {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: white;
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,0,0,.5);
}

.model-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

/* ====================
   CARD OVERLAY
==================== */

.model-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 10px;
    background:
        linear-gradient(
            rgba(0,0,0,0),
            rgba(0,0,0,.85)
        );
    text-align: center;
}

.model-name {
    font-size: 19px;
    font-weight: 600;
}

.model-grade {
    margin-top: 4px;
    color: #ddd;
    font-size: 13px;
}

/* ====================
   SOCIAL LINKS
==================== */

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 10px 18px;
    background: #3a3a3a;
    border: 1px solid #555;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    transition: .2s;
}

.social-link:hover {
    background: #555;
    border-color: #777;
    transform: translateY(-2px);
}

/* ====================
   FOOTER
==================== */

footer {
    margin-top: 60px;
    padding: 25px;
    text-align: center;
    font-size: 13px;
    color: #999;
    border-top: 1px solid #444;
}

/* ====================
   MOBILE
==================== */

@media (max-width: 768px) {
    header {
        height: 180px;
    }

    header.models-header {
        min-height: 42vh;
        height: auto;
    }

    .hero h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 12px;
    }

    .back-link {
        padding: 42px 18px 0;
        margin-bottom: 34px;
    }

    .model-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .model-name {
        font-size: 15px;
    }

    .model-grade {
        font-size: 12px;
    }

    .filter-label {
        display: block;
        margin-bottom: 5px;
    }
}