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

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

*/

.page {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    font-family: var(--main-font, sans-serif);
    background-color: #fff;
    background-image: var(--bg-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    min-inline-size: 320px;
    min-block-size: 100dvb;
    font-variation-settings: 'wght' var(--wght-main-font, 410);
}

.header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: var(--wdth, clamp(375px, 100%, 700px));
    padding: 128px;
    /* padding: 130px 122px 130px 122px; */
    border: 2px solid black;
    font-family: var(--accent-font, fantasy);
    font-weight: var(--wght-accent-font, 400);
    background-color: #fff;
    margin-top: 100px;
    margin-bottom: 98px;
}

.header-title {
    font-size: clamp(49px, 6vw + 24px, 65px);
    text-transform: uppercase;
}

.header-subtitle {
    font-size: clamp(14px, 2.769vw + 3.615px, 23px);
    text-transform: uppercase;
}

.main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

.section {
    width: var(--wdth, clamp(375px, 100%, 700px));
    border: 2px solid black;
    background-color: #fff;
}

.article {
    margin-bottom: 24px;
}

.title-card {
    vertical-align: middle;
    font-size: 18px;
    font-variation-settings: 'wght' 715;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 10px;
}

.picture {
    width: clamp(371px, 100%, 696px);
    border: 2px solid black;
    border-width: 2px 0 2px 0;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 1 / 1;
}

.card__text {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-top: 26px;
    padding-bottom: 5px;
}

.card-text {
    margin-right: 25px;
    margin-left: 25px;
    font-size: 18px;
    line-height: 21px;
}

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

.container__for-like {
    display: flex;
    justify-content: end;
    align-items: end;
    gap: 5px;
    margin-right: 25px;
}

.button-style {
    position: relative;
    box-shadow: none;
    overflow: hidden;
    background-color: transparent;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.card__like-button {
    min-width: 130px;
    margin-top: 17px;
    padding: 9px;
}

.card__icon-button {
    display: flex;
    margin-bottom: 2px;
    border: 2px solid transparent;
    padding: 0;
    outline: none;
    background-color: #fff;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.container__for-save {
    margin-bottom: 100px;
}

.save-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    max-width: 335px;
    border: 2px solid #000;
    padding: 12px 15px 10px 16px;
    font-size: 14px;
    background-color: #fff;
    white-space: nowrap;
}

.icon-floppy {
    flex-shrink: 0;
    width: 32px;
    height: 29px;
    mix-blend-mode: difference;
}

.wrapper {
    position: relative;
}

.label {
    position: absolute;
    top: 31px;
    right: 25px;
    vertical-align: middle;
    opacity: 0.5;
    font-family: var(--accent-font, fantasy);
    font-weight: var(--wght-accent-font, 400);
    font-size: 14px;
    text-transform: uppercase;
    text-shadow: -1px 0 var(--label-color, #fff),
    0 1px var(--label-color, #fff),
    1px 0 var(--label-color, #fff),
    0 -1px var(--label-color, #fff);
    mix-blend-mode: hard-light;
}

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

.dialog:open {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    max-width: 353px;
    border: 2px solid black;
    padding: 0;
    font-family: var(--accent-font, fantasy);
    font-size: 14px;
}

.dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.75);
}

.dialog__container {
    display: flex;
    gap: 20px;
    margin: 30px 31px 0 31px;
}

.dialog__text {
    line-height: 150%;
    text-transform: uppercase;
}

.dialog__button {
    align-self: center;
    width: 294px;
    height: 39px;
    margin-bottom: 30px;
    border: 2px solid black;
    padding: 0;
}

.dialog-form {
    display: flex;
    align-self: center;
}

.picture__filter-brightness {
    filter: brightness(200%);
}

.picture__filter-contrast {
    filter: contrast(200%);
}

.picture__filter-blur {
    filter: blur(5px);
}

.picture__filter-opaciy {
    filter: opacity(0.5);
}

.picture__filter-grayscale {
    filter: grayscale(0.9);
}

.picture__filter-saturate {
    filter: saturate(300%);
}

.picture__filter-sepia {
    filter: sepia(80%);
}

.picture__filter-mixing {
    filter: brightness(150%) contrast(150%) saturate(200%);
}

.button-style::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    transition: transform 0.5s ease-in-out;
    transform: translateX(-100%);
}

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

.button-style:focus {
    outline: none;
}

.button-style:focus-visible {
    box-shadow: 2px 2px 0 #000;
}

.card__icon-button:focus {
    outline: none;
}

.card__icon-button:focus-visible {
    border-color: #000;
}

.heart__sparks {
    opacity: 0;
}

.heart__contour {
    transition: fill 0.1s linear;
}

.heart__core {
    transition: fill 0.3s linear;
    transition-delay: 0.03s;
}

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

.like-icon {
    width: 38px;
    height: 35px;
}

.like-icon:has(:hover) .heart__core {
    fill: var(--accent-color, black);
    transition-delay: 0s;
}

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

.like-icon:has(:active) .heart__core {
    fill: var(--accent-color-active, red);
    transition-delay: 0s;
}

.like-icon:has(:active) .heart__main-body {
    fill: var(--accent-color-active, red);
    transition-delay: 0.05s;
}

.like-icon.is-liked .heart__core {
    fill: var(--accent-color-is-liked, red);
}

.like-icon.is-liked .heart__main-body {
    fill: var(--accent-color-is-liked, red);
    transition-delay: 0.05s;
}

.like-icon.is-liked .heart__contour {
    fill: var(--accent-color-is-liked, red);
    transition-delay: 0.06s;
}

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

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

@media (width <= 375px) {
    .header {
       padding: 121px 0 121px 0;
    }

    .title-card {
      padding-right: 10px;
    }

    .save-button {
        flex-direction: column;
        gap: 0;
        padding: 17px 18px 14px 18px;
    }

    .icon-floppy {
        width: 36px;
        height: 36px;
        margin-left: 7px;
    }

    .dialog__container {
        margin: 30px 35px 0 35px;
    }

    .dialog:open {
        max-width: 342px;
        background-color: rgba(255, 255, 255, 0.5);
    }

    .dialog__button {
        width: 260px;
        margin-right: 2px;
    }
}
