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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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), Arial, sans-serif;
    font-variation-settings: "wght" var(--text-weight);
    background-color: #fff;
    background-image: var(--page-background);
    background-attachment: fixed;
    background-size: cover;
}

.content-section {
    width: var(--content-width);
    margin-inline: auto;
}

.header {
    margin-block: 100px;
    padding-block: var(--header-padding-block);
    border: 2px solid #000;
    background-color: #fff;
    font-family: var(--accent-font), fantasy;
    text-align: center;
}

.header__logo {
    font-size: var(--header-logo-size);
    line-height: 1;
}

.header__title {
    margin-top: 20px;
    font-size: var(--header-title-size);
    line-height: 1;
    text-transform: uppercase;
}

.card {
    margin-bottom: 50px;
    border: 2px solid #000;
    background-color: #fff;
}

.card__title {
    padding: 6px 10px 6px;
    font-size: 18px;
    line-height: 21px;
    font-variation-settings: "wght" var(--title-weight);
}

.card__image-wrapper {
    position: relative;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
    block-size: 371px;
    overflow: hidden;
}

.card__image {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    object-position: right;
}
.filter-original {
    filter: none;
}

.filter-warm {
    filter: sepia(35%) saturate(70%) brightness(0.95) contrast(0.9);
}

.filter-pink {
    filter: hue-rotate(55deg) saturate(190%) brightness(1.08) contrast(1.05);
}

.filter-violet {
    filter: hue-rotate(18deg) saturate(140%) brightness(0.92) contrast(1.05);
}

.filter-green {
    filter: hue-rotate(145deg) saturate(85%) brightness(1.12) contrast(0.9);
}

.filter-sepia {
    filter: sepia(65%) saturate(55%) brightness(0.92) contrast(0.95);
}

.filter-blur {
    filter: blur(6px) saturate(135%) brightness(1.05);
}

.filter-fade {
    filter: sepia(30%) hue-rotate(300deg) saturate(75%) brightness(1.05) opacity(0.8);
}

.card__label {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 1;
    font-family: var(--accent-font), fantasy;
    font-size: 14px;
    line-height: 14px;
    opacity: 0.5;
    mix-blend-mode: hard-light;
    text-shadow:
        -1px 0 #fff,
        0 1px #fff,
        1px 0 #fff,
        0 -1px #fff;
}

@supports ((-webkit-text-stroke: 1px #fff) or (text-stroke: 1px #fff)) {
    .card__label {
        text-shadow: none;
        -webkit-text-stroke: 1px #fff;
        text-stroke: 1px #fff;
    }
}

.card__content {
    padding: 29px 25px 25px;
}

.card__text {
    font-size: 18px;
    line-height: 21px;
    font-variation-settings: "wght" var(--text-weight);
    margin: 0;
}

.card__text + .card__text {
    margin-top: 25px;
}

.card__buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 23px;
}

.button {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #000;
    background-color: #fff;
    font-family: var(--accent-font), fantasy;
    font-size: 14px;
    line-height: 90%;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.button:focus {
    outline: none;
}

.button:focus-visible {
    box-shadow: 2px 2px 0 var(--accent-color);
}

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

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

.card__like-button {
    inline-size: 130px;
    block-size: 38px;
}

.button__text {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--button-text-color);
    mix-blend-mode: difference;
}

.card__icon-button {
    display: flex;
    justify-content: center;
    align-items: center;
    inline-size: 39px;
    block-size: 38px;
    padding: 0;
    border: 2px solid transparent;
    background-color: transparent;
    cursor: pointer;
    transition: border-color 0.3s ease;
}
.card__icon-button:focus {
    outline: none;
}

.card__icon-button:focus-visible {
    border-color: var(--accent-color);
}

.like-icon {
    display: block;
    inline-size: 39px;
    block-size: 36px;
    transform-origin: center;
}

.contour {
    transition: fill 0.1s linear;
}

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

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

.sparks {
    opacity: 0;
}

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

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

.like-icon:active .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 .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 .contour {
    fill: var(--animation-fill-color);
    transition: fill 0.3s linear 0.06s;
}

.like-icon.is-liked .heart {
    animation: heart-scale 0.3s ease-in 0.1s 1;
    transform-origin: center;
}

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

.footer {
    display: flex;
    justify-content: center;
    margin-block-start: 50px;
    margin-block-end: 100px;
}

.save-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    inline-size: 310px;
    min-block-size: 84px;
    gap: 8px;
    padding: 12px 20px;
}

.save-button__icon {
    display: block;
    inline-size: 30px;
    block-size: 30px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    color: var(--button-text-color);
    mix-blend-mode: difference;
}
.dialog {
    display: none;
    padding: 0;
    border: 2px solid #000;
    background-color: #fff;
    inline-size: 353px;
}

.dialog[open] {
    display: block;
}

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

.dialog__container {
    padding: 30px 40px;
}

.dialog__content {
    display: grid;
    grid-template-columns: 39px 1fr;
    align-items: center;
    column-gap: 20px;
}

.dialog__icon {
    inline-size: 39px;
    block-size: 39px;
    color: var(--button-text-color);
    mix-blend-mode: difference;
}

.dialog__text {
    font-family: var(--accent-font);
    font-size: 14px;
    line-height: 150%;
    text-transform: uppercase;
}

.dialog__form {
    margin-top: 30px;
}

.dialog__button {
    inline-size: 100%;
    min-block-size: 38px;
    text-transform: uppercase;
}

@media (width >= 1440px) {
    .card {
        margin-bottom: 49px;
    }

    .card__title {
        padding: 4px 10px 6px;
    }

    .card__image-wrapper {
        block-size: 696px;
    }

    .card__content {
        padding: 25px 25px 28px;
        box-sizing: border-box;
    }

    .card__text:first-of-type {
        margin-bottom: 27px;
    }

    .card__text:last-of-type {
        margin-top: 0;
    }

    .card__text_offset {
        margin-top: 25px;
    }

    .card__buttons {
        margin-top: 25px;
    }

    .save-button {
        flex-direction: row;
        inline-size: 335px;
        min-block-size: 55px;
        padding: 15px 20px;
    }

    .save-button__icon {
        inline-size: 21px;
        block-size: 21px;
    }

    .save-button .button__text {
        white-space: nowrap;
    }

    .dialog {
        inline-size: 357px;
    }
}