/* Contacts page styles from barn-estate-homepage-clone handoff.
 * Scoped for Nuxt: no global font-face / body resets / clone menu/dialog.
 */

body.contacts-page {
  --ink: #1e1e1e;
  --secondary: #4f4d49;
  --muted: #656462;
  --brand: #8b1d25;
  --line: #d8d6d2;
  --surface: #fff;
  --barn-page-gutter: clamp(24px, calc(-26.66667px + 6.59722vw), 100px);
  --section-space: clamp(72px, 6vw, 100px);
  --heading: 38px;
  --lead: 22px;
  --action: 17px;
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 130px;
}

@media (min-width: 1441px) {
  body.contacts-page {
    --heading: 44px;
    --action: 19px;
  }
}

@media (min-width: 1921px) {
  body.contacts-page {
    --barn-page-gutter: 0px;
  }
}

@media (max-width: 540px) {
  body.contacts-page {
    --barn-page-gutter: 22px;
    --section-space: 48px;
    --heading: 22px;
    --lead: 15px;
    --action: 18px;
    scroll-padding-top: 100px;
  }
}

body.contacts-page .container {
  width: 100%;
  max-width: 1920px;
  margin-inline: auto;
  padding-inline: var(--barn-page-gutter);
}

body.contacts-page .section {
  padding-block: var(--section-space);
}

/* Compact white header on contacts (in-flow solid header, like /team). */
html body.contacts-page {
  --mh-gutter: var(--barn-page-gutter) !important;
}

html body.contacts-page .site-header__logo img {
  filter: brightness(0) !important;
}

html body.contacts-page .site-header__top {
  border-bottom-color: rgba(30, 30, 30, 0.14) !important;
}

html body.contacts-page .mh-subnav {
  border-top-color: rgba(30, 30, 30, 0.14);
  background: #fff;
}

/*
  Крошки живут в хедере (как на /team), поэтому не складываем их «след»
  в padding H1 — ритм как у team-directory.
*/
.contacts-top {
  padding-top: 40px;
}

.contacts-heading {
  padding-block: 28px 40px;
}

.contacts-heading h1 {
  margin: 0;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.contacts-page .offices {
  padding-top: 0;
}

@media (max-width: 1024px) {
  .contacts-top {
    padding-top: 32px;
  }
}

@media (max-width: 540px) {
  .contacts-top {
    padding-top: 28px;
  }

  .contacts-heading {
    padding-block: 22px 28px;
  }

  .contacts-heading h1 {
    font-size: 32px;
  }
}

.office-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
  gap: 48px;
}

.office-tabs a,
.office-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 0 20px;
  font: inherit;
  font-size: 22px;
  font-weight: 300;
  color: var(--secondary);
  line-height: 1.3;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.office-tabs [aria-selected='true'] {
  border-color: var(--brand);
  color: var(--brand);
}

.office-tabs a:focus-visible,
.office-tabs button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 5px;
}

.office-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 100px);
}

.office-panel[hidden] {
  display: none !important;
}

.office-panel[role='tabpanel'] + .office-panel {
  margin-top: 0;
}

.office-details {
  padding-block: 0;
}

.office-details h2 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 300;
  line-height: 1.2;
}

.office-details address {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  font-style: normal;
  max-width: 520px;
}

.office-note {
  margin: 24px 0 0;
  font-size: 22px;
  line-height: 33px;
  color: var(--secondary);
  max-width: 460px;
}

.office-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 28px 0 32px;
}

.office-meta dt {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
}

.office-meta dd {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.office-meta a {
  color: inherit;
  text-decoration: none;
}

.office-map {
  position: relative;
  min-height: 530px;
  background: #f1f1f1;
  display: flex;
  flex-direction: column;
}

.office-map iframe {
  border: 0;
  width: 100%;
  flex: 1;
  min-height: 450px;
  background: #f1f1f1;
}

.map-fallback {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  min-height: 60px;
  padding: 16px 22px;
  background: var(--surface);
  font-size: 16px;
  font-weight: 400;
  color: var(--secondary);
  text-decoration: none;
}

.office-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
}

.office-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 70px;
  padding: 0 20px;
  border: 1px solid #8b8986;
  border-radius: 1px;
  color: var(--secondary);
  font-size: var(--action);
  font-weight: 400;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.office-action img,
.office-action svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.office-action--route {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.office-action--route svg {
  width: 24px;
  height: 24px;
}

@media (hover: hover) {
  .office-meta a:hover,
  .map-fallback:hover {
    color: var(--brand);
  }
}

@media (hover: hover) and (pointer: fine) {
  .office-action:hover {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
  }

  .office-action--route:hover {
    background: #70171e;
    border-color: #70171e;
  }
}

@media (min-width: 1441px) {
  .office-meta dd {
    font-size: 20px;
  }
}

@media (max-width: 1280px) {
  .office-panel {
    grid-template-columns: 1fr 1.1fr;
    gap: 32px;
  }
}

@media (max-width: 1024px) {
  .office-tabs {
    gap: 32px;
  }

  .office-tabs a,
  .office-tabs button {
    font-size: 20px;
  }

  .office-panel {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .office-details h2 {
    font-size: 20px;
  }

  .office-details address {
    font-size: 19px;
    line-height: 1.35;
  }

  .office-note {
    font-size: 22px;
    line-height: 33px;
    margin-top: 24px;
  }

  .office-meta dd {
    font-size: 18px;
  }

  .office-map {
    min-height: 510px;
  }

  .office-map iframe {
    min-height: 450px;
  }

  .office-action {
    padding-inline: 12px;
    gap: 8px;
  }
}

@media (max-width: 767px) {
  .office-panel {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .office-details {
    padding: 0;
  }

  .office-meta {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .office-meta > div:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .office-map {
    min-height: 380px;
  }

  .office-map iframe {
    min-height: 340px;
  }
}

@media (max-width: 540px) {
  .office-tabs {
    display: flex;
    justify-content: flex-start;
    gap: clamp(2px, calc((100vw - 315px) / 2), 16px);
    margin-bottom: 28px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .office-tabs::-webkit-scrollbar {
    display: none;
  }

  .office-tabs a:focus-visible,
  .office-tabs button:focus-visible {
    outline-offset: -2px;
  }

  .office-tabs a,
  .office-tabs button {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    min-height: 54px;
    padding: 12px 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.25;
  }

  .office-tabs a:first-child,
  .office-tabs button:first-child {
    justify-content: flex-start;
    text-align: left;
    padding-left: 0;
  }

  .office-details h2 {
    font-size: 20px;
  }

  .office-details address {
    font-size: 18px;
    line-height: 1.35;
  }

  .office-note {
    font-size: 15px;
    line-height: 21px;
    margin-top: 16px;
  }

  .office-meta {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
  }

  .office-meta > div:nth-child(2) {
    grid-column: auto;
    grid-row: auto;
  }

  .office-meta dt {
    font-size: 13px;
  }

  .office-meta dd {
    font-size: 17px;
  }

  .office-map {
    min-height: 350px;
  }

  .office-map iframe {
    min-height: 300px;
  }

  .map-fallback {
    font-size: 13px;
    min-height: 50px;
    padding: 14px 16px;
  }

  .office-actions {
    gap: 12px;
  }

  .office-action {
    height: 58px;
    padding-inline: 10px;
    gap: 8px;
  }

  .office-action img {
    width: 22px;
    height: 22px;
  }

  .office-action--route svg {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.contacts-page {
    scroll-behavior: auto;
  }

  body.contacts-page *,
  body.contacts-page *::before,
  body.contacts-page *::after {
    transition: none !important;
    animation: none !important;
  }
}
