/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
}

/**
 * Render the `main` element consistently in IE.
 */

main {
  display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input {
  /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select {
  /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  src: url(35d26b781dc5fda684cc.ttf) format("truetype");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  src: url(673ed42382ab264e0bf5.ttf) format("truetype");
}

.page {
  background: #fcf5e5;
  font-family: Poppins, Arial, Helvetica, sans-serif;
  min-height: 100vh;
  color: #212121;
}

.page__section {
  max-width: 1280px;
  margin: 0 auto;
}

.header {
  background-color: #fff;
  padding: 10px 0;
  display: flex;
  justify-content: center;
}

.header__logo {
  margin: 0 auto;
  width: 94px;
  height: 26px;
}

.profile {
  display: flex;
  padding: 34px 0 20px;
  border-bottom: 1px rgba(33, 33, 33, 0.4) solid;
}

.profile__avatar-btn {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: absolute;
  width: 100%;
  height: 100%;
  visibility: hidden;
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 8px;
  color: white;
  padding-bottom: 12px;
  gap: 8px;
}

.profile__avatar-container {
  position: relative;
  margin-right: 20px;
}

.profile__avatar-container:hover .profile__avatar-btn {
  visibility: visible;
}

.profile__avatar {
  height: 190px;
  width: 190px;
  border-radius: 8px;
  object-fit: cover;
}

.profile__avatar-btn {
  margin-bottom: 12px;
}

.profile__avatar-btn::after {
  content: "Edit Avatar";
}

.profile__column {
  display: flex;
  flex-direction: column;
}

.profile__name {
  margin: 0 0 12px;
  font-weight: 500;
  font-size: 32px;
  line-height: 1;
  max-width: 420px;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.profile__description {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  opacity: 70%;
  max-width: 420px;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.profile__edit-btn {
  display: flex;
  margin-top: auto;
  padding: 0;
  background-color: transparent;
  border: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  align-self: flex-start;
  opacity: 70%;
  gap: 8px;
}

.profile__edit-btn:hover {
  cursor: pointer;
  opacity: 100%;
}

.profile__new-post-btn {
  margin-left: auto;
  border: 0;
  background-color: #212121;
  font-size: 16px;
  color: #fcf5e5;
  width: 149px;
  height: 52px;
  border-radius: 8px;
  gap: 8px;
  align-self: flex-end;
  line-height: 1;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile__new-post-btn:hover {
  cursor: pointer;
  opacity: 80%;
}

@media screen and (max-width: 627px) {
  .profile {
    flex-direction: column;
    max-width: 288px;
    align-items: center;
    text-align: center;
    padding-top: 20px;
  }

  .profile__avatar-btn {
    justify-content: flex-end;
    top: -10px;
  }

  .profile__avatar-btn .profile__pencil-icon {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    padding: 4px;
    justify-content: flex-end;
    visibility: visible;
    border: none;
  }

  .profile__avatar-btn::after {
    content: "";
  }

  .profile__avatar {
    margin-right: 0;
    height: 80px;
    width: 80px;
    margin: 0 0 12px;
  }

  .profile__name {
    font-size: 20px;
    margin: 0 0 6px;
    max-width: 288px;
  }

  .profile__description {
    margin: 0 0 32px;
    max-width: 288px;
  }

  .profile__column {
    margin: 0 0 20px;
  }

  .profile__new-post-btn {
    margin: 0;
    width: 100%;
  }

  .profile__edit-btn {
    margin: 0;
    width: 100%;
    align-self: center;
    justify-content: center;
  }
}

.content {
  padding: 0 20px;
}

@media screen and (max-width: 320px) {
  .content {
    padding: 0 16px;
  }
}

.cards {
  padding-top: 20px;
}

.cards__list {
  list-style-type: none;
  padding: 0 0 40px 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, 413px);
  gap: 40px 20px;
  justify-content: center;
  border-bottom: 1px rgba(33, 33, 33, 0.4) solid;
}

@media screen and (max-width: 627px) {
  .cards__list {
    grid-template-columns: repeat(auto-fit, 288px);
    row-gap: 20px;
    padding-bottom: 20px;
  }
}

.card {
  position: relative;
}

.card__image {
  height: 413px;
  width: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.card__image:hover {
  cursor: pointer;
}

.card__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.card__title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  max-width: 350px;
  line-height: 1.2;
}

.card__delete-btn {
  background-image: url(d19faa0112f44e2b6e01.svg);
  border: none;
  background-color: transparent;
  width: 32px;
  height: 32px;
  position: absolute;
  top: 10px;
  right: 10px;
}

.card__delete-btn:hover {
  cursor: pointer;
  background-image: url(86ae92bd1a937388d496.svg);
}

.card__like-btn {
  background-image: url(56df9a78b253cb335045.svg);
  width: 23px;
  height: 20px;
  border: none;
  background-color: transparent;
  opacity: 40%;
}

.card__like-btn:hover {
  cursor: pointer;
  opacity: 100%;
}

.card__like-btn_active {
  background-image: url(5ba14d29c8f0f8b51069.svg);
  opacity: 1;
  background-repeat: no-repeat;
}

.card__like-btn_active:hover {
  opacity: 0.4;
}

@media screen and (max-width: 627px) {
  .card__image {
    height: 288px;
  }

  .card__title {
    font-size: 16px;
    max-width: 250px;
  }
}

.footer {
  display: flex;
  justify-content: center;
  background-color: #fcf5e5;
}

.footer__author {
  margin: 60px 0;
  font-size: 16px;
  font-weight: 400;
  opacity: 70%;
  line-height: 1;
}

.modal {
  visibility: hidden;
  opacity: 0;
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
}

.modal_type_preview {
  padding: 0 16px;
}

.modal_is-opened {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease-in-out, visibility 0s 0s;
}

.modal__container {
  max-width: 730px;
  width: 100%;
  border-radius: 8px;
  background-color: #fff;
  padding: 32px 50px;
  position: relative;
  transition: transform 0.3s ease-in-out;
  box-sizing: border-box;
}

.modal__close-btn {
  background: transparent;
  position: absolute;
  top: 32px;
  right: 50px;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 40%;
  border: none;
  opacity: 100%;
}

.modal__close-btn_type_preview {
  top: 0;
  right: -25px;
}

.modal__title {
  margin: 0 0 32px;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
}

.modal__form {
  display: flex;
  flex-direction: column;
  margin: 0px;
}

.modal__label {
  margin-bottom: 32px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.1;
}

.modal__input {
  display: block;
  margin: 8px 0 0;
  width: 100%;
  padding: 16px 12px;
  border-radius: 8px;
  border: 1px;
  border-style: outset;
  border-color: rgba(21, 21, 21, 0.4);
  box-sizing: border-box;
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
}

.modal__input_type_error {
  border: 1px solid rgba(255, 0, 0);
}

.modal__input::placeholder {
  color: #2121214d;
  font-weight: 500;
  font-size: 20px;
}

.modal__error {
  display: block;
  color: red;
  margin-top: 8px;
}

.modal__submit-btn {
  margin: 0;
  padding: 18px 32px;
  background-color: #212121;
  color: #fcf5e5;
  border-radius: 8px;
  width: 156px;
  opacity: 100%;
  border: none;
}

.modal__submit-btn-is-disabled {
  opacity: 50%;
}

#delete-modal .modal__form {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
}

#delete-modal .modal__container {
  max-width: none;
  width: auto;
}

#delete-modal .modal__title {
  white-space: nowrap;
}

#delete-form .modal__submit-btn {
  background-color: #ff6565;
}

#delete-form .modal__submit-btn:hover {
  background-color: #ff3333;
}

#delete-form .modal__cancel-btn {
  background-color: #fff;
  border: 1px solid #212121;
  color: #212121;
}

#delete-form .modal__cancel-btn:hover {
  background-color: #212121;
  cursor: pointer;
  color: #fff;
}

#delete-modal .modal__close-btn {
  position: absolute;
  top: -10px;
  right: -50px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.modal__cancel-btn {
  margin: 0;
  padding: 18px 32px;
  background-color: #212121;
  color: #fcf5e5;
  border-radius: 8px;
  width: 156px;
  opacity: 100%;
  border: none;
}

.modal__input:hover {
  cursor: pointer;
  border: 1px solid #212121;
}

.modal__close-btn:hover {
  cursor: pointer;
  opacity: 40%;
}

.modal__form:not(#delete-form) .modal__submit-btn:hover {
  cursor: pointer;
  opacity: 70%;
}

.modal__image-container {
  position: relative;
}

.modal__image {
  max-width: 80vw;
  max-height: 80vh;
  width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.modal__caption {
  background-color: #212121;
  color: #fff;
  border-radius: 8px;
  margin: 8px 0;
  padding: 4px 8px;
  font-size: 20px;
  line-height: 1.2;
  display: inline-block;
}

@media screen and (max-width: 627px) {
  .modal__container {
    padding: 12px 12px;
  }

  .modal__close-btn {
    top: 15px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .modal__close-btn_type_preview {
    top: -25px;
    right: 0;
  }

  .modal__image {
    max-width: unset;
  }

  .modal__submit-btn {
    width: 100%;
    max-width: none;
  }

  .modal__cancel-btn {
    width: 100%;
    max-width: none;
  }

  .modal__input {
    font-size: 16px;
    max-width: none;
  }

  .modal__title {
    margin-top: 12px;
    font-size: 20px;
  }

  .modal__caption {
    font-size: 16px;
  }

  #delete-modal .modal__form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  #delete-modal .modal__title {
    white-space: wrap;
  }

  #delete-modal .modal__close-btn {
    position: absolute;
    top: -50px;
    right: 8px;
    width: 40px;
    height: 40px;
  }
}



