/* Сторінка окремого костюма (<x-costume-page>).
   Спільні стилі (шапка, сніжинки секції .page-section, футер) — у layout.css */

/* Зимовий банер угорі (1440×480 → висота 33.33vw), під ним плавний перехід
   від кольору низу банера до звичайного синього фону */
.costume-page {
    --banner-height: 33.34vw;

    padding: max(70px, 22.5vw) 0 40px;
    background:
        url("../images/masternya/masternya-main.webp") center top / 100% auto no-repeat,
        linear-gradient(
            180deg,
            var(--navy-800) 0,
            var(--navy-800) var(--banner-height),
            rgba(0, 28, 91, 0) calc(var(--banner-height) + 260px)
        ),
        radial-gradient(ellipse at 50% 45%, #073575 0%, #031e5b 55%, #001c5b 100%);
}

/* сніжинки — тільки під банером */
.costume-page::before {
    inset: var(--banner-height) 0 0;
}

/* ---------- Фото + опис ---------- */

.costume-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 48px;
    margin-bottom: 64px;
}

.costume-intro__media {
    margin: 0;
    filter: drop-shadow(0 10px 24px rgba(1, 10, 40, 0.45));
}

.costume-intro__media img {
    width: 100%;
    height: auto;
    border-radius: 24px;
}

.costume-intro__placeholder {
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    background:
        url("../images/sparkle-sm.png") center / 48px no-repeat,
        linear-gradient(135deg, #10399f 0%, #06235d 100%);
}

.costume-intro__head {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.costume-intro__title {
    margin: 0;
    font-size: clamp(30px, 3.6vw, 52px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.costume-intro__ornament {
    flex: none;
    width: clamp(90px, 12vw, 170px);
    height: auto;
}

/* «Завантажити шаблон маски» тощо */
.costume-intro__download {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: -6px 0 18px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 16px rgba(255, 212, 0, 0.35);
    color: var(--navy-900);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.costume-intro__download:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(255, 212, 0, 0.55);
}

/* поки файлу шаблону немає */
.costume-intro__download.is-disabled {
    opacity: 0.55;
    box-shadow: none;
    cursor: default;
    transform: none;
}

.costume-intro__text,
.costume-howto p {
    margin: 0 0 1em;
    font-size: clamp(16px, 1.6vw, 22px);
    line-height: 1.45;
    letter-spacing: 0.03em;
}

.costume-howto p:last-child {
    margin-bottom: 0;
}

/* ---------- «Що знадобиться?» ---------- */

.materials {
    margin-top: 28px;
    padding: 22px 26px 26px;
    border: 1px solid #218bd2;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(16, 57, 159, 0.5), rgba(6, 35, 93, 0.5));
    box-shadow: 0 0 15px #0b94fe40;
}

.materials__title {
    margin: 0 0 18px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* --cols колонок; неповний останній ряд стає по центру (як у макеті «Кози з дзвіночком») */
.materials__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px 0;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
}

.materials__item {
    flex: 0 0 calc(100% / var(--cols, 3));
    min-width: 0;
    padding: 0 6px;
}

.materials__item img,
.materials__placeholder {
    display: block;
    height: clamp(56px, 6vw, 88px);
    margin: 0 auto 10px;
}

.materials__item img {
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.materials__placeholder {
    background: url("../images/sparkle-sm.png") center / 30px no-repeat;
}

.materials__name {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

/* ---------- «Як робити?» ---------- */

.costume-howto__title {
    margin: 0 0 20px;
    font-size: clamp(28px, 3.4vw, 48px);
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--gold);
}

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

@media (max-width: 1024px) {
    .costume-intro {
        gap: 32px;
        margin-bottom: 44px;
    }

    .materials {
        padding: 18px;
    }
}

/* Телефон, як у макеті: назва → опис → фото на всю ширину → «Що знадобиться?».
   display: contents «розгортає» праву колонку, і її блоки стають у спільну сітку з фото */
@media (max-width: 767px) {
    .costume-intro {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        margin-bottom: 32px;
    }

    .costume-intro__body {
        display: contents;
    }

    .costume-intro__head {
        order: 1;
        justify-content: center;
        gap: 14px;
        margin-bottom: 16px;
    }

    /* кнопка шаблону — одразу під назвою, по центру */
    .costume-intro__download {
        order: 1;
        justify-self: center;
        margin: 0 0 16px;
    }

    .costume-intro__text {
        order: 2;
        margin-bottom: 20px;
    }

    .costume-intro__media {
        order: 3;
        justify-self: center;
        width: min(100%, 560px);
    }

    .costume-intro__media img,
    .costume-intro__placeholder {
        border-radius: 18px;
    }

    .materials {
        order: 4;
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .costume-intro__title {
        font-size: 26px;
    }

    .costume-intro__ornament {
        width: 90px;
    }

    .costume-intro__text,
    .costume-howto p {
        font-size: 15px;
    }

    .costume-howto__title {
        margin-bottom: 14px;
        font-size: 26px;
    }

    .materials {
        padding: 14px 12px 16px;
        border-radius: 14px;
    }

    .materials__list {
        row-gap: 16px;
    }

    .materials__item {
        padding: 0 4px;
    }

    .materials__name {
        font-size: 11px;
    }
}
