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

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

*/
html {
    width: 100%;
}


.page {
    min-inline-size: 320px;
    min-block-size: 100dvb;
    display: flex;
    flex-wrap: wrap;
    padding-left: clamp(0px, 0px + (100% - 375px) * 0.347, 370px);
    padding-right: clamp(0px, 0px + (100% - 375px) * 0.347, 370px);
    background-image: repeating-linear-gradient(to right, #d3d3d3 0px 2px, transparent 2px 4px),
        repeating-linear-gradient(to bottom, #d3d3d3 0px 2px, transparent 2px 4px),
        linear-gradient(to bottom, #e7e7e7, #1a1a1a);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    gap: 100px;
    container-type: inline-size;
    container-name: body_container;
    font-family: var(--main-font), sans-serif;
    font-variation-settings: "wght" var(--main-font-weight);
}

.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-block-start: 101px;
    background-color: #fff;
    border: 2px solid #000000;
}

h1 {
    font-family: var(--accent-font), sans-serif;
    font-weight: var(--accent-font-weight);
    line-height: 100%;
    letter-spacing: 0;
    vertical-align: bottom;
    text-transform: uppercase;
    margin-block-start: 0px;
    margin-block-end: 0px;
}

.header h2 {
    font-family: var(--accent-font), sans-serif;
    font-weight: var(--accent-font-weight);
    line-height: 100%;
    letter-spacing: 0;
    text-transform: uppercase;
    margin-block-start: 0px;
    margin-block-end: 0px;
}

main {
    display: flex;
    flex-direction: column;
    gap: 52px;
    container-type: inline-size;
    container-name: main-content;
    width: 100%;
}

@container main-content (min-width:375px) {
    .save-on-memory {
        align-self: center;
        width: clamp(306px, calc(306px + 29 * ((100cqw - 375px) / 325)), 335px);
        height: clamp(55px, calc(84px - 29 * ((100cqw - 375px) / 325)), 84px);
    }

    button.save-on-memory svg {
        width: clamp(21px, calc(28px - 7 * ((100cqw - 375px) / 325)), 28px);
        height: clamp(21px, calc(28px - 7 * ((100cqw - 375px) / 325)), 28px);
    }
}

@container body_container (min-width: 375px) {
    h1 {
        font-size: min(calc(49px + 16 * (100cqw - 375px) / 325), 65px);
    }
    header h2 {
        font-size: clamp(14px, calc(14px + 9 * (100cqw - 375px) / 325), 23px);
    }

    header {
        padding-top: clamp(120px, calc(120px + (100cqw - 375px) * 0.02461538462), 128px);
        padding-bottom: clamp(120px, calc(120px + (100cqw - 375px) * 0.02769230769), 129px);
    }
}

.card div {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    /*
  position: relative;
  */
    container-type: inline-size;
}

.card div + div {
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding-left: 25px;
    padding-right: 25px;
}

.card {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    border: 2px solid #000000;
    background-color: #fff;
    padding-bottom: 25px;
}

.card_img {
    width: 100%;
    object-fit: cover;
}

.card div h2::after {
    content: "</HTML>";
    position: absolute;
    top: calc(100% + 25px);
    right: 25px;
    font-family: var(--accent-font), sans-serif;
    font-weight: var(--accent-font-weight);
    font-style: normal;
    font-size: 14px;
    line-height: 100%;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #000000;
    mix-blend-mode: hard-light;
    z-index: 3;
    text-shadow: 1px 1px 0 #e7e7e7;
    opacity: 50%;
}

@supports (-webkit-text-stroke: 1px #e7e7e7) {
    .card div h2::after {
        -webkit-text-stroke: 1px #e7e7e7;
        text-shadow: none;
    }
}

.card h2 {
    padding-left: 10px;
    position: relative;
    font-variation-settings: "wght" var(--card-header-font);
    font-size: 18px;
    letter-spacing: 0;
    vertical-align: middle;
    line-height: 122.22%;
    padding-top: 5px;
    padding-bottom: 4px;
    margin-block-start: 0px;
    margin-block-end: 0px;
    width: 100%;
}

p {
    font-style: normal;
    font-size: 18px;
    line-height: 21px;
    letter-spacing: 0;
}

.card__icon-button:focus-visible {
    outline: none;
    border: 2px solid #000000;
}

.save-on-memory {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 14px;
}

.button-common-styles {
    position: relative;
    overflow: hidden;
    background-color: #fff;
    outline: none;
    box-shadow: 0px 0px 0px transparent;
    transition: box-shadow 0.3s ease;
    border: 2px solid #000000;
}

.button-common-styles:focus {
    outline: none;
    box-shadow: 2px 2px 0px #000000;
}

button.save-on-memory .button__text {
    position: static;
    transform: none;
}

.button__text {
    font-family: var(--accent-font), sans-serif;
    font-weight: var(--accent-font-weight);
    font-style: normal;
    font-size: 14px;
    line-height: 90%;
    letter-spacing: 0;
    vertical-align: middle;
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: #e7e7e7;
    mix-blend-mode: difference;
}

.button-common-styles::before {
    content: "";
    position: absolute;
    background-color: #e7e7e7;
    left: -100%;
    width: 100%;
    height: 100%;
    top: 0px;
    transition: left 0.5s ease-in-out;
}

.button-common-styles:hover::before {
    mix-blend-mode: difference;
    left: 0;
}

.card div.wrap-heart-and-like-button {
    display: flex;
    flex-direction: row;
    justify-content: end;
    height: 38px;
    gap: 7px;
}

.card__icon-button {
    display: flex;
    border: 2px solid transparent;
    transition: border 0.3s ease;
    padding-inline: 0px;
    width: 39px;
    height: 36px;
    border-width: 0px;
    justify-content: center;
    align-items: center;
    background-color: #fff;
}

.card__like-button {
    width: 130px;
    height: 38px;
}

.counter {
    fill: var(--counter-color);
    transition: fill 0.1s linear;
}

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

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

.sparks {
    opacity: 0;
}

.like-icon:hover .core {
    fill: var(--counter-color);
    transition: fill 0.3s linear;
}

.like-icon:hover .main-body {
    fill: black;
    transition: fill 0.3s linear 0.05s;
}

.like-icon:active .core {
    fill: #ff0000;
    transition: fill 0.3s linear;
}

.like-icon:active .main-body {
    fill: #ff0000;
    transition: fill 0.3s linear 0.05s;
}

.like-icon.is-liked .counter {
    fill: #ff0000;
    transition: fill 0.3s linear 0.06s;
}

.like-icon.is-liked .core {
    fill: #ff0000;
    transition: fill 0.3s linear;
}

.like-icon.is-liked .main-body {
    fill: #ff0000;
    transition: fill 0.3s linear 0.05s;
}

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

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

dialog {
    container-type: inline-size;
    container-name: dialog;
}

dialog[open] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: clamp(341px, calc(341px + 12 * ((100vw - 375px) / 1065)), 353px);
    gap: 29px;
    padding-top: 31px;
    padding-bottom: 30px;
    padding-left: 0px;
    padding-right: 0px;
    border: none;
}

dialog[open]::backdrop {
    background: #000000;
    opacity: 75%;
}

body:has(dialog[open]) button .button__text {
    mix-blend-mode: none;
}

dialog[open] .wrap-svg-p {
    width: clamp(261px, calc(261px + 32px * ((100cqw - 341px) / 12px)), 293px);
    display: flex;
    justify-content: start;
    gap: 20px;
}

dialog[open] .wrap-svg-p svg {
    align-self: center;
    flex-shrink: 0;
    width: 39px;
    height: 39px;
}

dialog[open] .wrap-svg-p p {
    display: flex;
    position: static;
    transform: none;
    align-items: center;
    line-height: 150%;
}

dialog[open] button {
    transform: none;
    height: 38px;
    width: clamp(261px, calc(261px + 32px * ((100cqw - 341px) / 12px)), 293px);
    padding-top: 0px;
    padding-bottom: 0px;
}

.card-filter-brigtness {
    filter: brightness;
}
.card-filter-multiply {
    filter: grayscale(0.8) opacity(0.6) brightness(0.9);
}
.card-filter-grayscale {
    filter: grayscale(100%);
}

.card-filter-hue-rotate {
    filter: hue-rotate(90deg);
}

.card-filter-vintage {
    filter: invert(90%), blur(2), contrast(1.5);
}

.card-filter-saturate {
    filter: saturate(200%);
}

.card-filter-sepia {
    filter: sepia(50%);
}

.card-filter-invert {
    filter: invert(30%);
}

@media (1200px <= width) {
    .page {
        gap: 97px;
    }
    main {
        gap: 49px;
    }
    .card div + div {
        padding-right: 27px;
    }
    .save-on-memory {
        padding-bottom: 10px;
    }
}
