/* Здесь вы напишете основную часть стилей страницы.

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в HTML некоторые классы были названы особым образом:
✦ like-icon — для svg-иконки анимированного сердца
✦ card__like-button — для кнопки Like рядом с иконкой
✦ card__icon-button — для кнопки, оборачивающей иконку
✦ card__icon-button — для кнопки, оборачивающей иконку
✦ is-liked — для обозначения состояния лайкнутой иконки в виде сердца
✦ button__text — для обозначения текстового элемента внутри кнопки

*/
.page {
    min-inline-size: 320px;
    min-block-size: 100dvb;
    font-family: var(--main-font), sans-serif;
    font-variation-settings: 'wdth' var(--main-font-weight);
    background-size: cover;
    background-image: var(--bg-image);
    background-attachment: fixed;
    background-color: var(--main-color);
    display: grid;
    justify-items: center;
}

.header {
    display: grid;
    background-color: var(--main-color);
    border: 2px solid var(--accent-color);
    font-family: var(--accent-font), fantasy;
    text-align: center;
    gap: 20px;
    margin: 100px 0;
    block-size: clamp(327px, calc(327px + 41 * ((100vw - 375px) / 1065)), 368px);
}

.stretch_size {
    inline-size: clamp(375px, 100%, 700px);
}

.header__title {
    text-transform: uppercase;
    font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
    align-self: end;
}

.header__subtitle {
    text-transform: uppercase;
    font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
}

.main__content {
    display: grid;
    gap: 50px;
    justify-content: center;
}

.save__dialog {
    display: none;
    background-color: var(--main-color);
    font-family: var(--accent-font), fantasy;
    font-size: 14px;
    text-align: left;
    text-transform: uppercase;
    max-width: 353px;
    padding: 30px 40px;
    line-height: 150%;
    block-size: 191px;
}

.save__dialog .floppy-icon {
    height: 39px;
    justify-self: start;
    align-self: center;
}

.save__dialog[open] {
    display: grid;
    grid-template-columns: 1fr 3fr;
}

.dialog__button {
    width: 100%;
    height: 38px;
    grid-column: 1/3;
    align-self: end;
    text-transform: uppercase;
}

.button__text {
    position: relative;
    mix-blend-mode: difference;
    font-family: var(--accent-font), fantasy;
    font-size: 14px;
    line-height: 90%;
}

.button_effects {
    position: relative;
    background-color: var(--main-color);
    color: var(--main-color);
    border: 2px solid var(--accent-color);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.button_effects::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--accent-color);
    transform: translateX(-100%);
    transition: transform 0.5s ease-in-out;
}

.button_effects:hover::before {
    transform: translateX(0);
}

.button_effects:focus {
    outline: none;
    box-shadow: 2px 2px 0 var(--accent-color);
}

.save__dialog::backdrop {
    background-color: rgb(0 0 0 / 0.75);
}

.main__section__block {
    background-color: var(--main-color);
    border: 2px solid var(--accent-color);
}

.main__section__block__title {
    font-variation-settings: 'wdth' var(--title-font-weight);
    font-size: 18px;
    padding: 4px 10px;
    border-block-end: 2px solid var(--accent-color);
}

.main__section__block__content {
    position: relative;
}

.main__section__label {
    font-family: var(--accent-font), fantasy;
    font-size: 14px;
    text-transform: uppercase;
    opacity: 0.5;
    position: absolute;
    z-index: 2;
    right: 25px;
    top: 25px;
    mix-blend-mode: hard-light;
    text-shadow: -1px 0 var(--main-color),
    0 1px var(--main-color),
    1px 0 var(--main-color),
    0 -1px var(--main-color);
}

@supports ((text-stroke: 1px var(--main-color)) or (-webkit-text-stroke: 1px var(--main-color))) {
    .main__section__label {
        -webkit-text-stroke: 1px var(--main-color);
        text-stroke: 1px var(--main-color);
        text-shadow: none;
    }
}

.main__section__block__img {
    object-fit: cover;
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
}

.main__section__block__text {
    border-block-start: 2px solid var(--accent-color);
    font-weight: var(--main-font-weight);
    font-size: 18px;
    line-height: 21px;
    padding: 25px 25px 0;
}

.main__section__block__text p {
    padding-bottom: 25px;
}

.card__like-button {
    width: 130px;
    height: 38px;
    transition: border 10s ease;
}

.card__icon-button {
    background-color: var(--main-color);
    border: 2px solid transparent;
    padding: 0;
    height: 38px;
    cursor: pointer;
}

.card__icon-button:focus-visible {
    outline: none;
    border: 2px solid var(--accent-color);
}

.contour {
    transition: fill 0.1s linear 0s;
}

.core {
    transition: fill 0.3s linear 0.03s;
    fill: transparent;
}

.main-body {
    transition: fill 0.3s linear 0s;
    fill: transparent;
}

.heart {
    transform-origin: center;
}

.like-icon:hover .contour {
    fill: var(--accent-color);
}

.like-icon:hover .core {
    fill: var(--accent-color);
    transition-delay: 0s;
}

.like-icon:hover .main-body {
    fill: var(--accent-color);
    transition-delay: 0.05s;
}

.like-icon:active .core {
    fill: var(--animation-fill-color);
    transition-delay: 0s;
}

.like-icon.is-liked .main-body {
    fill: var(--animation-fill-color);
    transition-delay: 0.05s;
}

.like-icon.is-liked .core {
    fill: var(--animation-fill-color);
    transition-delay: 0s;
}

.like-icon:active .main-body {
    fill: var(--animation-fill-color);
    transition-delay: 0.05s;
}

.like-icon.is-liked .contour {
    fill: var(--animation-fill-color);
    transition-duration: 0.3s;
    transition-delay: 0.06s;
}

.like-icon.is-liked .sparks {
    animation: heart_sparks 0.3s 0.3s ease-in;
}

.like-icon.is-liked .heart {
    animation: heart 0.3s 0.1s ease-in;
}

.sparks {
    opacity: 0;
}

.main__section__block__reaction {
    display: flex;
    justify-content: end;
    margin: 0 25px 25px;
    gap: 6px;
}

.filter_saturate_less {
    filter: saturate(20%);
}

.filter_saturate_more {
    filter: saturate(500%);
}

.filter_hue_rotate {
    filter: hue-rotate(30deg);
}

.filter_invert {
    filter: invert(0.8);
}

.filter_sepia {
    filter: sepia(80%);
}

.filter_blur {
    filter: blur(0.3rem);
}

.filter_multiple {
    filter: hue-rotate(90deg) opacity(0.7) blur(1px);;
}

.save__button .floppy-icon {
    height: clamp(21px, calc(28px - 7 * ((100vw - 375px) / 1065)), 28px);
    justify-self: center;
    aspect-ratio: 1 / 1;
    position: relative;
    mix-blend-mode: difference;
}

.save__button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: clamp(306px, calc(306px + 29 * ((100vw - 375px) / 1065)), 335px);
    height: clamp(55px, calc(84px - 29 * ((100vw - 375px) / 1065)), 84px);
    margin-block-end: 100px;
    grid-template-columns: 41px 1fr;
    padding: 0;
    justify-self: center;
}

@media (width <= 375px) {
    .save__button {
        display: grid;
        grid-template-columns: 1fr;
        align-content: center;
        gap: 10px;
        justify-content: center;
    }

    .save__button .floppy-icon {
        justify-self: center;
    }
}