/* Офисы: кнопки городов, под ними карта с адресом выбранного. Переключает initOffices в assets/js/site.js */

.ms-of { --ff-head: var(--ff-tt-firs-text, system-ui), system-ui; color: #121212; }
.ms-of__head { display: flex; align-items: baseline; justify-content: space-between; gap: 2.4rem; margin-bottom: 2.4rem; }
.ms-of h2 { margin: 0; font-family: var(--ff-head); font-weight: 500; font-size: 4.4rem; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.ms-of h2 em { font-style: normal; color: #e30613; }
.ms-of__head p { margin: 0; font-size: 1.8rem; line-height: 1.4; white-space: nowrap; }
.ms-of :is(a, button):focus-visible { outline: 2px solid #121212; outline-offset: 3px; }

/* Кнопки городов */
.ms-of__tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.6rem; margin-bottom: 1.6rem; }
.ms-of__tabs button { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; min-height: 9.6rem; padding: 1.6rem 2rem 1.6rem 2.4rem; border-radius: 2.4rem; color: #121212; background: #ffe6e7; cursor: pointer; transition: background-color 250ms ease, color 250ms ease; }
.ms-of__tabs b { display: block; font-family: var(--ff-head); font-weight: 500; font-size: 2.4rem; line-height: 1.2; }
.ms-of__tabs small { display: block; margin-top: 0.2rem; font-size: 1.6rem; line-height: 1.3; }
.ms-of__tabs svg { flex: none; box-sizing: border-box; width: 4.8rem; height: 4.8rem; padding: 1.2rem; border-radius: 50%; color: #e30613; background: #fff; }
.ms-of__tabs button:hover { background: #ffcfd2; }
.ms-of__tabs button[aria-pressed="true"] { color: #fff; background: #e30613; cursor: default; }

/* Карта: снимки городов лежат стопкой, виден выбранный. */
.ms-of__map { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: flex-end; min-height: 42rem; box-sizing: border-box; padding: 2.4rem; overflow: hidden; border-radius: 3.2rem; background: #eef5fb; }
.ms-of__map img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 0 50%; opacity: 0; transition: opacity 400ms ease; }
.ms-of__map .is-active img { opacity: 1; }

/* Адрес */
.ms-of__card { position: relative; z-index: 2; display: flex; flex-direction: column; box-sizing: border-box; width: 42rem; min-height: 37rem; padding: 3.2rem; border-radius: 2.4rem; background: #fff; }
.ms-of__office { display: none; font-size: 1.8rem; line-height: 1.45; }
.ms-of__office.is-active { display: block; animation: ms-of-in 400ms ease; }
.ms-of__office h3 { margin: 0 0 1.2rem; font-family: var(--ff-head); font-weight: 500; font-size: 2.8rem; line-height: 1.2; }
.ms-of__office address { font-style: normal; text-wrap: pretty; }
.ms-of__office div { margin-top: 0.6rem; }
.ms-of__contacts { order: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; margin: auto 0 0; padding-top: 2rem; font-family: var(--ff-head); font-weight: 500; font-size: 2rem; line-height: 1.35; }
.ms-of__contacts a { color: inherit; text-decoration: none; }
.ms-of__contacts a:hover { color: #e30613; }
.ms-of__go { order: 2; display: none; align-items: center; justify-content: center; box-sizing: border-box; min-height: 5.6rem; margin-top: 2rem; padding: 1rem 2.8rem; border-radius: 1.6rem; font-family: var(--ff-head); font-weight: 500; font-size: 1.6rem; line-height: 1.2; text-decoration: none; color: #fff; background: #e30613; transition: filter 250ms ease; }
.ms-of__go.is-active { display: flex; }
.ms-of__go:hover { filter: brightness(0.88); }
@keyframes ms-of-in { from { opacity: 0; } }

@media (min-width: 700.1px) and (max-width: 1100px) {
  .ms-of h2 { font-size: 3.2rem; }
  .ms-of__head p { font-size: 1.6rem; }
  .ms-of__tabs { gap: 1.2rem; margin-bottom: 1.2rem; }
  .ms-of__tabs button { min-height: 8rem; padding: 1.4rem 1.6rem; border-radius: 2rem; }
  .ms-of__tabs b { font-size: 2rem; }
  .ms-of__tabs small { font-size: 1.5rem; }
  .ms-of__tabs svg { width: 3.6rem; height: 3.6rem; padding: 0.8rem; }
  .ms-of__map { padding: 1.6rem; border-radius: 2.4rem; }
  .ms-of__map img { object-position: 28% 50%; }
  .ms-of__card { width: 35rem; padding: 2.4rem; border-radius: 2rem; }
  .ms-of__office { font-size: 1.6rem; }
}

@media (max-width: 900px) and (min-width: 700.1px) { .ms-of__tabs svg { display: none; } }

@media (max-width: 700px) {
  .ms-of__head { display: block; margin-bottom: 1.6rem; }
  .ms-of h2 { font-size: 2.8rem; }
  .ms-of__head p { margin-top: 0.8rem; font-size: 1.6rem; }
  .ms-of__tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 0.8rem; }
  .ms-of__tabs button { min-height: 6.4rem; padding: 1rem 1.2rem 1rem 1.6rem; border-radius: 1.6rem; gap: 0.8rem; }
  .ms-of__tabs b { font-size: 1.8rem; }
  .ms-of__tabs small { font-size: 1.4rem; }
  .ms-of__tabs svg { width: 3.2rem; height: 3.2rem; padding: 0.7rem; }
  .ms-of__map { min-height: 0; padding: 17rem 0.8rem 0.8rem; border-radius: 2.4rem; }
  .ms-of__map img { height: auto; object-position: 50% 0; top: -2rem; }
  .ms-of__card { width: 100%; min-height: 0; padding: 2rem; border-radius: 1.8rem; }
  .ms-of__office { font-size: 1.6rem; }
  .ms-of__office h3 { margin-bottom: 0.8rem; font-size: 2.2rem; }
  .ms-of__contacts { padding-top: 1.4rem; font-size: 1.8rem; }
  .ms-of__go { min-height: 5.2rem; margin-top: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) { .ms-of * { transition: none !important; animation: none !important; } }
