/* =========================================================
   Українське Різдво — головна сторінка
   Макети: 1440 (десктоп), 834 (таблет)
   Спільні стилі (змінні, кнопки, шапка, бургер-меню, футер) — у layout.css
   ========================================================= */

h1,
h2,
h3,
p {
    margin: 0;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    width: 100%;
    margin-left: 0;
    min-height: 1200px;
    background:
        linear-gradient(
            180deg,
            rgba(4, 15, 47, 0.18) 0%,
            rgba(4, 15, 47, 0.38) 36%,
            rgba(4, 15, 47, 0.8) 100%
        ),
        url("../images/main-bg.jpg") center center / cover no-repeat,
        var(--navy-700);
}
/* Плавний перехід Hero до карток */

.hero {
    position: relative;
    isolation: isolate;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 420px;

    background: linear-gradient(
        to bottom,
        rgba(0, 28, 91, 0) 0%,
        rgba(0, 28, 91, 0.15) 20%,
        rgba(0, 28, 91, 0.45) 45%,
        rgba(0, 28, 91, 0.8) 75%,
        #001c5b 100%
    );

    pointer-events: none;
    z-index: 0;
}

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

.sections {
    position: relative;
    z-index: 2;
    margin-top: -64px;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(255, 255, 255, 0.2),
            transparent 18%
        ),
        radial-gradient(
            circle at 80% 18%,
            rgba(255, 255, 255, 0.16),
            transparent 16%
        ),
        radial-gradient(
            circle at 52% 12%,
            rgba(255, 255, 255, 0.12),
            transparent 14%
        );
    pointer-events: none;
}

.hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--container);
    margin: 0 auto;
    padding: 170px var(--gutter) 100px;
}

.hero__copy {
    max-width: 560px;
    padding-left: 8px;
}

.hero__title {
    margin-bottom: 24px;
    font-size: clamp(2.4rem, 4.6vw, 4.2rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.06em;
    text-shadow: 0 8px 22px rgba(0, 10, 60, 0.45);
}

.hero__title-gold {
    color: var(--gold);
}

.hero__text {
    max-width: 510px;
    margin-bottom: 26px;
    font-size: 1.05rem;
    line-height: 1.45;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 12px rgba(0, 10, 60, 0.6);
}

/* ---------- Картки розділів ---------- */

.sections {
    position: relative;
    margin-top: -64px;
    z-index: 2;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: 18px 20px 20px;
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-card);
    background: linear-gradient(
        180deg,
        var(--navy-600) 0%,
        var(--navy-800) 100%
    );
    box-shadow: var(--card-glow);
    text-decoration: none;
    transition: box-shadow 0.25s ease;
}

.card:hover {
    box-shadow: 0 0 26px rgba(90, 170, 255, 0.7);
}

.card__img {
    width: 100%;
    height: 170px;
    object-fit: contain;
    margin-bottom: 14px;
}

.card__body {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.card__title {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.04em;
}

.card__text {
    max-width: 240px;
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: var(--white);
}

.card__go {
    flex: none;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 2.5px solid var(--white);
    border-radius: 50%;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.card__go svg {
    width: 26px;
    height: 26px;
}

.card:hover .card__go {
    background: var(--white);
    color: var(--navy-800);
}

/* ---------- Блок листівок ---------- */

.postcards {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    align-items: center;
    gap: 24px;
    margin-top: 64px;
    padding: 34px 40px;
    border: 1.5px solid var(--card-border);
    border-radius: 22px;
    background: linear-gradient(
        180deg,
        var(--navy-700) 0%,
        var(--navy-800) 100%
    );
    box-shadow: var(--card-glow);
}

.postcards__copy {
    position: relative;
    padding-left: 90px;
}

.postcards__title {
    margin-bottom: 14px;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.07em;
}

.postcards__text {
    max-width: 240px;
    margin-bottom: 36px;
    font-size: 15px;
    line-height: 1.35;
}

.postcards__img {
    width: 100%;
    height: auto;
}

/* грона зірочок */
.postcards__stars {
    position: absolute;
    width: 66px;
    height: 180px;
    pointer-events: none;
}

.postcards__stars svg {
    position: absolute;
    filter: drop-shadow(0 0 6px rgba(255, 212, 0, 0.8));
}

.postcards__stars .s1 {
    width: 44px;
    height: 44px;
    left: 12px;
    top: 0;
    color: var(--gold);
}
.postcards__stars .s2 {
    width: 30px;
    height: 30px;
    left: 18px;
    top: 74px;
    color: var(--white);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}
.postcards__stars .s3 {
    width: 26px;
    height: 26px;
    left: 0;
    top: 120px;
    color: var(--gold);
}
.postcards__stars .s4 {
    width: 20px;
    height: 20px;
    left: 36px;
    top: 140px;
    color: var(--gold-soft);
}

.postcards__stars--left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.postcards__stars--right {
    display: none;
}

/* ---------- Різдвяні історії ---------- */

.stories {
    margin-top: 80px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    font-size: clamp(1.6rem, 2.6vw, 2.25rem);
    font-weight: 500;
    letter-spacing: 0.07em;
}

.section-title__star {
    width: 50px;
    height: 50px;
    flex: none;
    color: var(--gold);
    filter: drop-shadow(0 0 8px rgba(255, 212, 0, 0.9));
}

.slider {
    position: relative;
}

.slider__track {
    --per-view: 4;
    --gap: 18px;
    display: flex;
    gap: var(--gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 10px 6px 24px;
    margin: -10px -6px 0;
}

.slider__track::-webkit-scrollbar {
    display: none;
}

.story {
    flex: 0 0
        calc((100% - var(--gap) * (var(--per-view) - 1)) / var(--per-view));
    display: flex;
    flex-direction: column;
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-card);
    background: linear-gradient(
        180deg,
        var(--navy-600) 0%,
        var(--navy-800) 100%
    );
    box-shadow: var(--card-glow);
    overflow: hidden;
    text-decoration: none;
    scroll-snap-align: start;
}

.story__img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-bottom: 1.5px solid var(--card-border);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
}

.story__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
}

.story__title {
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.07em;
}

.story__text {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.35;
}

.story__time {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    font-size: 14px;
}

.story__time svg {
    width: 16px;
    height: 16px;
    color: var(--gold);
}

.slider__arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 64px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.2s ease;
}

.slider__arrow svg {
    width: 36px;
    height: 36px;
}

.slider__arrow--prev {
    left: -64px;
}
.slider__arrow--next {
    right: -64px;
}
.slider__arrow--next svg {
    transform: scaleX(-1);
}

.slider__arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* =========================================================
   Таблет (макет 834)
   ========================================================= */

@media (max-width: 1360px) {
    /* стрілки слайдера не вміщаються за межами контейнера */
    .stories .slider {
        padding: 0 52px;
    }

    .slider__arrow--prev {
        left: 0;
    }
    .slider__arrow--next {
        right: 0;
    }
}

@media (max-width: 1024px) {
    .hero {
        min-height: 520px;
    }

    .hero__inner {
        padding-top: 110px;
        padding-bottom: 90px;
    }

    .hero__copy {
        max-width: 250px;
        padding-left: 12px;
    }

    .hero__title {
        margin-bottom: 14px;
        font-size: 32px;
        letter-spacing: 0.06em;
    }

    .hero__text {
        margin-bottom: 22px;
        font-size: 15px;
        letter-spacing: 0.02em;
    }


    .sections {
        margin-top: -20px;
    }

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

    .card {
        min-height: 320px;
        padding: 14px 26px 24px;
    }

    .card__img {
        height: 150px;
    }

    .card__title {
        font-size: 20px;
        margin-bottom: 18px;
    }

    .card__text {
        font-size: 12px;
        max-width: 220px;
    }

    .card__go {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }

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

    /* листівки: заголовок → картинка → текст → кнопка */
    .postcards {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "img"
            "text"
            "btn";
        justify-items: center;
        gap: 0;
        margin-top: 60px;
        padding: 40px 32px 30px;
        text-align: center;
    }

    .postcards__copy {
        display: contents;
    }

    .postcards__title {
        grid-area: title;
        margin-bottom: 20px;
        font-size: clamp(1.4rem, 3.4vw, 2rem);
    }

    .postcards__img {
        grid-area: img;
        max-width: 640px;
        margin-bottom: 30px;
    }

    .postcards__text {
        grid-area: text;
        max-width: none;
        margin-bottom: 24px;
    }

    .postcards .btn {
        grid-area: btn;
    }

    .postcards__stars {
        top: auto;
        bottom: 20px;
        height: 150px;
        transform: none;
    }

    .postcards__stars--left {
        left: 30px;
    }

    .postcards__stars--right {
        display: block;
        right: 30px;
    }

    .postcards__stars .s1 {
        width: 36px;
        height: 36px;
    }
    .postcards__stars .s2 {
        top: 60px;
        width: 24px;
        height: 24px;
    }
    .postcards__stars .s3 {
        top: 100px;
    }
    .postcards__stars .s4 {
        top: 116px;
    }

    .stories {
        margin-top: 70px;
    }

    .section-title {
        gap: 30px;
    }

    .section-title__star {
        width: 44px;
        height: 44px;
    }

    .stories .slider {
        padding: 0;
    }

    .slider__track {
        --per-view: 2;
        --gap: 20px;
    }

    .slider__arrow {
        width: 32px;
    }

    .slider__arrow svg {
        width: 28px;
        height: 28px;
    }

    .slider__arrow--prev {
        left: -38px;
    }
    .slider__arrow--next {
        right: -38px;
    }

    .story__title {
        font-size: 20px;
    }
}

/* =========================================================
   Мобайл
   ========================================================= */

@media (max-width: 600px) {
    .hero {
        min-height: 620px;
        background:
            linear-gradient(
                180deg,
                rgba(6, 26, 92, 0.75) 0%,
                rgba(6, 26, 92, 0) 45%,
                var(--navy-800) 100%
            ),
            url("../images/main-bg.jpg") 70% bottom / cover no-repeat,
            var(--navy-700);
    }

    .hero__inner {
        padding-top: 92px;
    }

    .hero__copy {
        padding-left: 0;
    }

    .hero__title {
        font-size: 30px;
    }

    .hero__text {
        font-size: 14px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        min-height: 0;
    }

    .postcards {
        padding: 30px 20px 24px;
    }

    .postcards__stars {
        display: none !important;
    }

    .section-title {
        gap: 16px;
    }

    .section-title__star {
        width: 30px;
        height: 30px;
    }

    .stories .slider {
        padding: 0 34px;
    }

    .slider__track {
        --per-view: 1;
    }

    .slider__arrow--prev {
        left: -4px;
    }
    .slider__arrow--next {
        right: -4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html,
    .slider__track {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Уточнення розмітки та інтерактивності */
.hero {
    background-position:
        center,
        center top,
        center;
}
.card__img {
    object-position: center;
}
.card,
.story {
    isolation: isolate;
}
.card__go {
    margin-left: auto;
}
.story__img {
    display: block;
}
.slider__arrow:focus-visible {
    outline: 2px solid var(--gold);
}
.slider__arrow:disabled {
    pointer-events: none;
}
@media (max-width: 1024px) {
    .hero {
        background-position:
            center,
            60% top,
            center;
    }
}
@media (max-width: 600px) {
    .hero {
        min-height: 560px;
    }
    .hero__inner {
        padding-bottom: 40px;
    }
    .hero__copy {
        max-width: 320px;
    }
    .sections {
        margin-top: -15px;
    }
    .card {
        padding: 14px 16px 18px;
    }
    .card__img {
        height: 144px;
    }
    .postcards {
        margin-top: 40px;
    }
    .stories {
        margin-top: 55px;
    }
    .story__body {
        padding: 14px;
    }
    .section-title {
        font-size: clamp(1.25rem, 5vw, 1.65rem);
    }
}

/* =========================================================
   MOBILE HERO — спеціальна композиція для 320–440 px
   Залишати в кінці файлу після інших media queries
   ========================================================= */
@media (max-width: 440px) {
    .hero {
        position: relative;
        isolation: isolate;
        min-height: clamp(700px, 195vw, 850px);
        background-color: #001c5b;
        background-image:
            linear-gradient(
                to bottom,
                rgba(0, 28, 91, 0) 71%,
                rgba(0, 28, 91, 0.2) 82%,
                #001c5b 100%
            ),
            url("../images/main-bg-mobile.png");
        background-size:
            100% 100%,
            100% auto;
        background-position:
            center bottom,
            center bottom;
        background-repeat: no-repeat;
    }
    .hero::before,
    .hero::after {
        display: none;
    }
    .hero__inner {
        position: relative;
        z-index: 2;
        width: 100%;
        max-width: none;
        padding: 98px 20px 0;
    }
    .hero__copy {
        width: 100%;
        max-width: 355px;
        padding: 0;
    }
    .hero__title {
        max-width: 355px;
        margin-bottom: 16px;
        font-size: clamp(28px, 8vw, 35px);
        font-weight: 800;
        line-height: 1.08;
        letter-spacing: -0.035em;
        text-shadow: 0 3px 12px rgba(0, 15, 55, 0.3);
    }
    .hero__title-gold {
        color: #ffd400;
    }
    .hero__text {
        max-width: 345px;
        margin-bottom: 24px;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.5;
        letter-spacing: 0;
        color: #f0f5ff;
    }
    .hero__copy .btn {
        width: 100%;
        max-width: 345px;
        min-height: 48px;
        padding: 10px 14px;
        gap: 10px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        text-align: center;
        white-space: normal;
        box-shadow: 0 4px 22px rgba(255, 212, 0, 0.3);
    }
    .hero__copy .btn__icon {
        width: 19px;
        height: 19px;
    }
    .sections {
        position: relative;
        z-index: 2;
        margin-top: -15px;
    }
    .hero__copy {
        animation: hero-reveal-mobile 0.9s ease-out both;
    }
}
@media (max-width: 360px) {
    .hero {
        min-height: 700px;
    }
    .hero__title {
        font-size: 28px;
    }
    .hero__text {
        font-size: 12px;
        line-height: 1.45;
    }
    .hero__copy .btn {
        font-size: 11px;
    }
}
@keyframes hero-reveal-mobile {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (prefers-reduced-motion: reduce) {
    .hero__copy {
        animation: none !important;
    }
}
