/* Основные стили проекта. Это стили для темы, которую вы верстаете первой. */

.page {
  /* сохраните в разметке и стилях класс page у тега body. Он удобен, чтобы составлять селекторы для разных цветовых тем. */
  background-image: var(--bg-img);
  background-color: var(--decor-color);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

/* ==== header ==== */

.header {
  display: grid;
  grid-template-rows: 1fr min-content 1fr;
  padding: 0 20px;
  margin-bottom: 60px;
  height: 100vh;
  min-height: 668px;
}

.decorated-zone {
  position: relative;
}

.decorated-zone::before {
  position: absolute;
  content: '';
  border-top: 1px solid var(--accent-color-btn);
  border-right: 1px solid var(--accent-color-btn);
  top: 20px;
  right: 20px;
  width: 25px;
  height: 25px;
}

.decorated-zone::after {
  position: absolute;
  content: '';
  border-bottom: 1px solid var(--accent-color-btn);
  border-left: 1px solid var(--accent-color-btn);
  bottom: 20px;
  left: 20px;
  width: 25px;
  height: 25px;
}

.header__theme-menu {
  padding-top: 20px;
}

.header__theme-menu-list {
  display: flex;
  justify-content: center;
  gap: 7px;
}

/* .header__theme-menu-item {} */

.header__theme-menu-button {
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  color: var(--accent-color-btn);
  font-size: var(--main-text-size);
  line-height: 100%;
  padding: 2.5px 14px;
  border: 1px solid transparent;
  background-color: transparent;
  cursor: pointer;
}

.header__theme-menu-button:hover {
  border: 1px solid rgba(var(--accent-color-hover-rgb), 0.4);
}

.header__theme-menu-button:focus-visible {
  outline: none;
  border-bottom: 1px solid var(--accent-color-btn);
}

.header__theme-menu-button_active {
  border: 1px solid var(--accent-color-btn);
  pointer-events: none
}

/* .header__theme-menu-button_type_light {} */

/* .header__theme-menu-button_type_auto {} */

/* .header__theme-menu-button_type_dark {} */

.span-decor {
  position: absolute;
  display: var(--span-decor-display);
  right: 49px;
  top: 20px;
  font-family: var(--font-family);
  font-size: var(--main-text-size);
  color: var(--accent-color);
}

.span-decor::after {
  position: absolute;
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 100%;
  fill: var(--accent-color);
  box-shadow: 0 0 4px 2px var(--accent-color);
  background-color: var(--accent-color);
  top: 6px;
  left: 42px;
}

.header__title {
  /* Для планшета и десктопа */
  font-size: clamp(7.5rem, 0.5625rem + 14.4531vw, 9.8125rem);
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  line-height: 83%;
  color: var(--title-color);
  text-shadow: 4px 4px 0 var(--accent-color);
  margin-left: -20px;
}

.title-decor {
  font-family: var(--font-family);
  font-size: var(--main-text-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--main-text-line);
  color: var(--decor-color-title);
  background-color: var(--accent-color);
}

.header__desc-box {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
}

.header__desc {
  max-width: 491px;
}

/* ==== main ==== */

.main {
  padding: 0 20px;
}

/* ==== section ==== */

.section {
  display: grid;
  grid-template-columns: 315px 1fr;
  gap: 20px;
  margin-bottom: 80px;
}

.section__title {
  max-width: 315px;
  color: var(--accent-color-text);
  background-color: transparent;
  margin-bottom: 20px;
}

/* .section__container {} */

.section__subtitle {
  margin-bottom: 10px;
}

.section__text {
  font-family: var(--font-family);
  font-size: var(--main-text-size);
  line-height: var(--main-text-line);
  color: var(--text-color);
}

.section__text:not(:last-child) {
  margin-bottom: 20px;
}

.text-shadow {
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--accent-color);
}

.text-shadow:hover {
  border-bottom: 1px solid var(--text-color);
}

.text-shadow:focus {
  outline: none;
}

.text-shadow:focus-visible {
  border: 1px solid var(--text-color);
}

.section-distractions {
  margin-bottom: 80px;
}

.section__list {
  display: grid;
  justify-content: space-around;
  grid-template-columns: repeat(3, 1fr);
  flex-wrap: wrap;
  gap: 19px;
}

.section__subtitle--desc {
  margin-bottom: 20px;
}

.section__tip-title {
  font-family: var(--font-family);
  font-size: var(--main-text-size);
  font-weight: var(--font-weight-normal);
  line-height: var(--main-text-line);
  color: var(--decor-color-title);
  background-color: var(--accent-color);
  margin-bottom: 10px;
}

/* ==== gallery ==== */

.gallery {
  margin-bottom: 60px;
}

.gallery__title {
  margin-bottom: 20px;
}

.gallery__box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-items: stretch;
  gap: 20px;
}

.gallery__img {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery__img:nth-child(1) {
  grid-column: span 2;
}

.gallery__img:nth-child(2) {
  grid-column: span 1;
  grid-row: span 2;
}

.gallery__img:nth-child(3) {
  grid-column: span 1;
  grid-row: span 2;
}

.gallery__img:nth-child(4) {
  grid-column: span 1;
}

.gallery__img:nth-child(5) {
  grid-column: span 2;
}

/* ==== footer ==== */

.footer {
  display: grid;
  align-items: center;
  position: relative;
  height: 100vh;
  min-height: 668px;
}

.footer__title {
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  color: var(--title-color);
  text-shadow: 2px 2px 0 var(--accent-color);
  font-size: clamp(7.25rem, 5.7694rem + 6.3174vw, 9.8125rem);
  line-height: 83%;
  text-align: center;
}

@media (max-width: 768px) {

  .header__theme-menu {
    margin-top: 60px;
    padding-top: 131px;
  }

  .header__theme-menu-list {
    flex-direction: column;
    align-items: flex-end;
    gap: 11px;
  }

  .header__desc {
    max-width: 364px;
  }

  /* ==== section ==== */
  .section {
    grid-template-columns: 236px 1fr;
  }

  .section__title {
    max-width: 236px;
  }

  .section__list {
    grid-template-columns: 1fr;
  }

  .section__items {
    max-width: 728px;
  }
}

@media (max-width: 760px) {
  .section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 376px) {

  .header {
    padding: 0;
    margin-bottom: 40px;
  }

  .decorated-zone::before {
    top: 10px;
    right: 10px;
  }

  .decorated-zone::after {
    left: 10px;
    bottom: 11px;
  }

  .span-decor {
    top: 10px;
    right: 38px;
  }

  .header__theme-menu {
    margin-top: 40px;
    margin-bottom: 64px;
    padding-top: 34px;
    padding-right: 8px;
  }

  .header__title {
    margin-left: 0;
    margin-bottom: 52px;
  }

  .header__desc-box {
    justify-content: center;
    margin-bottom: 35px;
  }

  .header__desc {
    max-width: 355px;
    margin-bottom: 31px;
  }

  /* ==== section ==== */

  .main {
    padding: 0 10px;
  }

  .section {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 50px;
  }

  .section-distractions {
    margin-bottom: 50px;
  }

  .section__title {
    max-width: 355px;
  }

  /* ==== gallery ==== */

  .gallery {
    margin-bottom: 40px;
  }

  .gallery__title {
    margin-bottom: 10px;
  }

  .gallery__box {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gallery__img:nth-child(1) {
    grid-column: span 1;
  }

  .gallery__img:nth-child(2) {
    grid-row: span 1;
  }

  .gallery__img:nth-child(3) {
    grid-row: span 1;
  }

  .gallery__img:nth-child(5) {
    grid-column: span 1;
  }
}