/* Owner review 241. Load after theme.css and the format/fox-brand sheets. */

.site-header { grid-template-columns: minmax(220px, 1fr) minmax(0, 360px) auto; }
.header-meta.header-contacts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0 12px;
  min-width: 0;
  text-align: right;
}
.header-contacts .header-phone {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  min-height: 40px;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-decoration: none;
}
.header-contacts .header-address {
  grid-column: 1;
  grid-row: 2;
  justify-self: end;
  min-height: 40px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.5;
  text-wrap: balance;
  text-decoration-color: var(--line);
}
.telegram-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  border-radius: var(--control-radius);
  background: var(--green);
  color: var(--green-deep);
  text-decoration: none;
}
.telegram-link svg { flex: none; }
.header-contacts > .telegram-link { grid-column: 2; grid-row: 1 / 3; min-height: 44px; }
.site-nav > a, .header-about-toggle { min-height: 44px; }
.header-about { position: relative; }
.header-about-label { display: block; font-weight: 650; }
/* With scripting available, reserve the final control geometry immediately.
   The readable fallback remains unchanged when scripting is disabled. */
@media (scripting: enabled) {
 .header-about:not([data-about-ready]) .header-about-links,
 .header-about:not([data-about-ready]) .header-about-label { display: none; }
 .header-about:not([data-about-ready]) .header-about-toggle[hidden] { display: inline-flex !important; visibility: hidden; }
}
.header-about-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 4px;
  border: 0;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
}
.header-about-toggle svg { flex: none; }
.header-about-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.header-about[data-current="true"] .header-about-toggle { color: var(--accent); font-weight: 700; }
.header-about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.header-about[data-about-ready="true"] .header-about-links {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 1;
  display: block;
  width: max-content;
  min-width: 224px;
  max-width: min(300px, calc(100vw - 40px));
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(38 62 50 / .16), 0 3px 8px rgb(38 62 50 / .08);
}
.header-about-links li { margin: 0; padding: 0; }
.header-about-links li::before { content: none; }
.site-nav .header-about-links a {
  display: flex;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: calc(var(--radius) - 8px);
  white-space: nowrap;
}
.site-nav .header-about-links a[aria-current="page"] { background: var(--accent-soft); }
:is(.header-about-toggle, .header-about-links a, .telegram-link):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* A warm portrait card on the existing deep-green steps section. */
.home .home-steps .specialist-card {
  background: var(--peach);
  color: var(--ink);
}
.home .home-steps .specialist-card p { color: var(--accent-hover); }
.home .home-steps .specialist-card .text-link { color: var(--accent-hover); text-decoration-color: currentColor; }

/* The situations read as their own soft green sheet, distinct from the hero. */
.home .home-situations {
  padding: clamp(24px, 4vw, 48px);
  margin-block-start: var(--section);
  border-radius: var(--radius);
  background: var(--green);
}
.home .home-situations .situation-more { border-color: var(--green-deep); }

/* Format copy is now paragraphs/lists, not a single text node. */
.format-preview :is(.fp-body, .fp-note) > p { margin: 0; }
.format-preview :is(.fp-body, .fp-note) > p + p { margin-block-start: 10px; }
.format-preview :is(.fp-body, .fp-note) ul {
  display: grid;
  gap: 7px;
  margin-block: 12px;
  padding-inline-start: 1.2em;
  list-style: disc;
}
.format-preview :is(.fp-body, .fp-note) li { margin: 0; padding: 0; line-height: 1.55; }
.format-preview :is(.fp-body, .fp-note) li::marker { color: var(--accent); font-size: .85em; }
.format-preview :is(.fp-body, .fp-note) > :last-child { margin-block-end: 0; }
.format-preview .fp-result .fp-content-link {
  display: inline;
  min-height: 0;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: .2em;
}

/* One disclosure surface; the calculator inside has no second outer card. */
.home-cost {
  margin-block: 28px 0;
  padding: 0 clamp(20px, 3vw, 28px);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.home-cost > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 18px 32px 18px 0;
  color: var(--accent-hover);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.home-cost > summary::-webkit-details-marker { display: none; }
.home-cost > summary::after {
  content: "";
  position: absolute;
  inset-inline-end: 4px;
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.home-cost[open] > summary::after { transform: rotate(225deg); }
.home-cost .calculator {
  max-width: none;
  margin: 0;
  padding: 4px 0 28px;
  border-radius: 0;
  background: transparent;
}
.home-cost .calc-note { padding: 0; border: 0; background: transparent; color: var(--accent-hover); }
.online-calculator {
  max-width: 860px;
  margin-block: 28px 36px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--peach);
}
.online-calculator > h2 { margin: 0; font-size: clamp(23px, 2.4vw, 28px); }
.online-calculator > p { margin-block: 12px 18px; color: var(--ink); }

@media (hover: hover) {
  .header-about-toggle:hover, .site-nav .header-about-links a:hover, .telegram-link:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
  }
  .header-contacts .header-phone:hover, .header-contacts .header-address:hover { color: var(--accent-hover); }
  .format-preview .fp-result .fp-content-link:hover { color: var(--accent-hover); }
  .home-cost > summary:hover { color: var(--accent); }
}

@media (max-width: 1024px) and (min-width: 851px) {
  .site-header { grid-template-columns: minmax(200px, 1fr) minmax(0, 292px) auto; gap: 8px 16px; }
  .header-meta.header-contacts { gap: 0 8px; }
}

@media (max-width: 850px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto; }
  .header-meta.header-contacts { display: contents; }
  .header-contacts .header-phone { grid-column: 1; grid-row: 2; justify-self: start; font-size: 14px; min-height: 44px; }
  .header-contacts .header-address { grid-column: 1; grid-row: 3; justify-self: start; min-height: 44px; max-width: none; text-align: left; }
  .header-contacts > .telegram-link { grid-column: 2; grid-row: 2; justify-self: end; }
  .nav-toggle { grid-column: 2; grid-row: 3; min-height: 44px; }
  .site-nav {
    grid-row: 4;
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    max-height: min(52vh, 28rem);
    max-block-size: min(52svh, 28rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    scrollbar-gutter: stable;
  }
  .site-nav > a { padding: 8px 4px; }
  .header-about-toggle { width: 100%; }
  .header-about[data-about-ready="true"] .header-about-links {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
    margin-block-end: 8px;
    box-shadow: none;
    background: var(--green);
  }
  .site-nav .header-about-links a { white-space: normal; }
}

@media (max-width: 640px) {
  .home-cost { margin-block-start: 20px; }
  .home-cost .calculator { padding-block-end: 20px; }
  .online-calculator { padding: 22px 20px; }
}

@media (forced-colors: active) {
  .header-about[data-about-ready="true"] .header-about-links, .telegram-link, .home-cost, .online-calculator { border: 1px solid CanvasText; }
}
