.pg-terr {
  margin: 40px 0 60px;
  font-family: var(--font-primary, Geometria, sans-serif);
}

.page-template-template-contacts .pg-terr {
  margin-top: 80px;
}

.pg-terr *,
.pg-terr *::before,
.pg-terr *::after {
  box-sizing: border-box;
}

.pg-terr__container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
  grid-template-rows: auto 1fr;
  grid-template-areas: "title map" "legend map";
  column-gap: 56px;
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 3%;
  box-sizing: content-box;
}

.pg-terr__title {
  grid-area: title;
  margin: 0 0 24px;
  color: #333333;
  font-family: var(--font-heading, Arkhip, sans-serif);
  font-size: 30px;
  font-weight: 300;
  line-height: 1.2;
  text-transform: uppercase;
}

.pg-terr__legend {
  grid-area: legend;
}

.pg-terr__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pg-terr__item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.pg-terr__num {
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #124734;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.pg-terr__name {
  color: #333333;
  font-size: 16px;
  line-height: 1.35;
}

.pg-terr__floor {
  margin-left: 4px;
  color: #6f7f79;
  white-space: nowrap;
}

.pg-terr__subtitle {
  margin: 28px 0 14px;
  color: #124734;
  font-family: var(--font-heading, Arkhip, sans-serif);
  font-size: 20px;
  font-weight: 300;
  line-height: 1.2;
  text-transform: uppercase;
}

.pg-terr__map {
  grid-area: map;
  position: relative;
  display: block;
  align-self: start;
  padding: 16px;
  border: 1px solid #e5ebe9;
  border-radius: 16px;
  background: #ffffff;
  text-decoration: none;
  cursor: zoom-in;
  transition: border-color .25s ease;
}

.pg-terr__img {
  display: block;
  width: 100%;
  height: auto;
}

.pg-terr__zoom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #124734;
  border-radius: 6px;
  background: #ffffff;
  color: #124734;
  font-size: 15px;
  line-height: 1.2;
  transition: background-color .25s ease, color .25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .pg-terr__map:hover {
    border-color: #124734;
  }

  .pg-terr__map:hover .pg-terr__zoom {
    background: #124734;
    color: #ffffff;
  }
}

.pg-terr__map:focus-visible {
  outline: 2px solid #124734;
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .pg-terr__container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    column-gap: 32px;
  }

  .pg-terr__name {
    font-size: 15px;
  }
}

@media (max-width: 900px) {
  .pg-terr__container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "title" "map" "legend";
  }

  .pg-terr__map {
    justify-self: center;
    width: 100%;
    max-width: 600px;
    margin-bottom: 28px;
  }

  .pg-terr__list {
    display: block;
    columns: 2;
    column-gap: 32px;
  }

  .pg-terr__item {
    break-inside: avoid;
    margin-bottom: 10px;
  }
}

@media (max-width: 767px) {
  .pg-terr {
    margin: 0 0 50px;
  }

  .page-template-template-contacts .pg-terr {
    margin-top: 50px;
  }

  .pg-terr__list {
    display: flex;
    columns: auto;
  }

  .pg-terr__item {
    margin-bottom: 0;
  }

  .pg-terr__title {
    margin-bottom: 16px;
    font-size: 24px;
    text-align: center;
  }

  .pg-terr__map {
    margin-bottom: 24px;
    padding: 10px;
    border-radius: 12px;
  }

  .pg-terr__zoom {
    right: 10px;
    bottom: 10px;
    padding: 8px 12px;
  }

  .pg-terr__list {
    gap: 8px;
  }

  .pg-terr__item {
    gap: 10px;
  }

  .pg-terr__num {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .pg-terr__subtitle {
    margin: 22px 0 12px;
    font-size: 18px;
  }
}
