/* Основные стили проекта. Это стили для темы, которую вы верстаете первой. */
.page {
  /* сохраните в разметке и стилях класс page. На его основе работает скрипт. */
  display: flex;
  width: 100%;
  flex-direction: column;
  justify-content: center;
  gap: calc(var(--gap)*3);
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  background-color: var(--background-color);
  background-image: var(--background-image);
}

.header {
  height: 100vh;
  min-height: 668px;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  grid-auto-flow: column;
  padding: var(--gap);
}

.header__title {
  font-size: var(--title-font-size);
  font-weight: 700;
  line-height: 129.53px;
  color: var(--title-text-color);
  text-shadow: 4px 4px 0 var(--accent-color);
  align-self: center;
  margin-left: -20px;
} 

.header__subtitle {
  justify-self: end;
  align-self: center;
  width: 50%;
}

.header__theme-menu {
  justify-self: center;
  align-self: baseline;
}

.header__theme-menu-list {
  display: flex;
  gap: calc(var(--gap)/2);
}

.header__theme-menu-item {
  font-size: 18px;
  font-weight: 400;
  line-height: 18px;
  color: var(--menu-color);
}

.header__theme-menu-button {
  height: 26px;
  width: 70px;
  padding: 0px 13px;
  text-transform: lowercase;
  background: none;
  border: none;
  cursor: pointer;
}

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

.header__theme-menu-button:hover {
  outline: 1px solid var(--menu-hover-color);
}

.header__theme-menu-button:focus {
  outline: none;
}

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

.decorated-zone {
  position: relative;
  min-width: 375px;
}

.decorated-zone::before,
.decorated-zone::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 25px;
  border-style: solid;
  border-color: var(--menu-color);
  background-color: transparent;
}

.decorated-zone::before {
  border-width: 0 0 1px 1px;
  left: var(--gap);
  bottom: var(--gap);
}

.decorated-zone::after {
  border-width: 1px 1px 0 0;
  top: var(--gap);
  right: var(--gap);
}

.rec {
  position: absolute;
  top: var(--gap);
  right: 29px;
  color: var(--menu-color);
  font-size: 18px;
  font-weight: 400;
  line-height: 25px;
  text-transform: uppercase;
  visibility: var(--visibility);
}

.rec::after {
  content: "";
  margin-left: 10px;
  width: 9px;
  height: 9px;
  display: inline-block;
  background-color: var(--menu-color);
  border-radius: 50%;
  box-shadow: 0px 0px 4px 2px var(--accent-color);
  visibility: var(--visibility);
}

.main {
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap)*4);
  padding: 0 var(--gap);
  width: 100%;
}

.section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.section__difficulties,
.section__advices {
  grid-column: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.section__concentration {
  grid-row: 2 / 3;
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.section__titles {
  font-size: 18px;
  font-weight: 700;
  line-height: 23.4px;
}

.section__title {
  color: var(--subtitle-text-color);
}

.section__main-text {
  font-size: 18px;
  font-weight: 400;
  line-height: 23.4px;
  color: var(--main-text-color);
}

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

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

.link:focus {
  outline: none;
}

.link:focus-visible {
  outline: 1px solid var(--main-text-color);
}

.title-decor {
  background-color: var(--accent-color);
  color: var(--decorated-subtitle-text-color);
}

.section__item {
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap)/2);
}

.section__gallery {
  margin-top: var(--gap);
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.gallery-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section__gallery li:nth-child(1) {
  grid-column: 1/3;
}

.section__gallery li:nth-child(2) {
  grid-column: 3/4;
  grid-row: 1/3;
}

.section__gallery li:nth-child(3) {
  grid-column: 1/2;
  grid-row: 2/4;
}

.section__gallery li:nth-child(4) {
  grid-column: 2/3;
  grid-row: 2/3;
}

.section__gallery li:nth-child(5) {
  grid-column: 2/4;
  grid-row: 3/4;
}

.footer {
  height: 100vh;
  min-height: 668px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--gap);
}

.footer__title {
  font-size: var(--title-font-size);
  font-weight: 700;
  line-height: 95.7px;
  color: var(--title-text-color);
  text-shadow: 2px 2px 0 var(--accent-color);
}

@media screen and (max-width: 769px) {
  .header__title {
    line-height: 99px;
  } 

  .header__theme-menu {
    justify-self: end;
    align-self: center;
  }
  
  .header__theme-menu-list {
    flex-direction: column;
  }

  .section {
    grid-template-columns: 1fr 2fr;
    gap: var(--gap);
  }

  .section__concentration {
    grid-column: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
  }

  .section__difficulties,
  .section__advices {
    grid-column: 2 / 3;
  }
}

@media screen and (max-width: 767px) {
  .section {
    display: flex;
    flex-direction: column;
  }

  .header__subtitle {
    justify-self: center;
    align-self: center;
    width: 100%;
  }
}

@media screen and (max-width: 376px) {
  :root {
    --gap: 10px;
    --title-font-size: clamp(7.25rem, 7.0115rem + 1.0178vw, 7.5rem);
  }

  .page {
    gap: calc(var(--gap)*4);
  }

  .header__title {
    line-height: 95.7px;
    margin-left: 0;
  } 

  .header__theme-menu {
    justify-self: end;
    align-self: center;
  }

  .header__theme-menu-list {
    flex-direction: column;
    gap: var(--gap);
  }

  .rec {
    position: absolute;
    top: var(--gap);
    right: 19px;
  }
  
  .main {
    gap: calc(var(--gap)*5);
  }

  .section {
    gap: calc(var(--gap)*2);
  }

  .section__item {
    gap: var(--gap);
  }

  .section__gallery {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
  }

  .section__difficulties,
  .section__advices {
    gap: calc(var(--gap)*2);
  }

  .section__concentration {
    gap: calc(var(--gap)*2);
  }
}