/* Сторінка «Майстерня» (костюми).
   Спільні стилі (шапка, перша секція, фон секції зі сніжинками, футер) — у layout.css */

.costumes {
    padding-bottom: 32px;
}

.costumes__title {
    margin: 0 0 32px;
    font-size: clamp(24px, 2.6vw, 38px);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-align: center;
}

/* ---------- Сітка карток ---------- */

.costume-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* Фото на всю картку, назва і стрілка — поверх фото внизу */
.costume-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    aspect-ratio: 6 / 5;
    padding: 20px 22px;
    border: 1.5px solid #218bd2;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 15px #0b94fe80;
    color: var(--white);
    text-decoration: none;
    isolation: isolate;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.costume-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 24px #0b94feb3;
}

/* Без фото видно заглушку із зірочкою */
.costume-card__thumb {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        url("../images/sparkle-sm.png") center 40% / 48px no-repeat,
        linear-gradient(135deg, #10399f 0%, #06235d 100%);
}

.costume-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.costume-card:hover .costume-card__thumb img {
    transform: scale(1.04);
}

/* затемнення знизу, щоб назва читалася на будь-якому фото */
.costume-card__thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(3, 19, 51, 0) 50%,
        rgba(3, 19, 51, 0.55) 72%,
        rgba(3, 19, 51, 0.9) 100%
    );
}

.costume-card__title {
    margin: 0;
    font-size: clamp(15px, 1.4vw, 20px);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 6px rgba(2, 12, 43, 0.8);
}

.costume-card__go {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--white);
    border-radius: 50%;
    background: rgba(3, 19, 51, 0.3);
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.costume-card__go svg {
    width: 22px;
    height: 22px;
}

.costume-card:hover .costume-card__go {
    background: var(--white);
    color: #06235d;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
    .costume-grid {
        gap: 18px;
    }

    .costume-card {
        padding: 14px 16px;
        border-radius: 16px;
    }

    .costume-card__go {
        width: 36px;
        height: 36px;
    }

    .costume-card__go svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 767px) {
    .costumes__title {
        margin-bottom: 20px;
    }

    .costume-grid {
        --gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--gap);
    }

    /* непарна остання картка — по центру, а не сама зліва */
    .costume-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - var(--gap) / 2);
    }
}

@media (max-width: 480px) {
    .costume-grid {
        --gap: 10px;
    }

    .costume-card {
        gap: 6px;
        padding: 10px;
        border-radius: 14px;
    }

    .costume-card__title {
        font-size: 13px;
        letter-spacing: 0.02em;
    }

    .costume-card__go {
        width: 28px;
        height: 28px;
        border-width: 1.5px;
    }

    .costume-card__go svg {
        width: 15px;
        height: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .costume-card,
    .costume-card__thumb img,
    .costume-card__go {
        transition: none;
    }

    .costume-card:hover,
    .costume-card:hover .costume-card__thumb img {
        transform: none;
    }
}
