/* [NAV-1] Единая шапка и подвал публичного сайта (решение Алексея 10.10).
   Разметку строят три адаптера одного контракта webapp_shared/publicHeaderContract.json:
   api/public_chrome.py, site/public-header.js, web_public PublicHeader/PublicFooter.svelte. */

.public-header-host {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #d5e3e1;
  box-shadow: 0 6px 18px rgba(44, 75, 77, .05);
}

.public-header {
  width: min(1280px, calc(100% - 48px));
  min-height: 68px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 28px;
  color: #19313b;
  font: 500 15px/1.25 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.public-header a { text-decoration: none; }

.public-header__brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #123746;
}

.public-header__brand img {
  width: 38px;
  height: 38px;
  flex: none;
  object-fit: contain;
}

.public-header__brand span {
  font: 700 21px/1.1 Georgia, "Times New Roman", serif;
  white-space: nowrap;
}

.public-header__nav {
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 24px;
}

.public-header__nav a {
  display: inline-flex;
  align-items: center;
  color: #19313b;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 transparent;
}

.public-header__nav a:hover { color: #0b6399; }

.public-header__nav a[aria-current='page'] {
  color: #0b6399;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 #0b6399;
}

.public-header__actions {
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.public-header__login {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #0b6399;
  font-weight: 600;
}

.public-header__cta,
.public-header__cabinet {
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 7px;
  color: #fff;
  background: #0b6399;
  font: 700 16px/1.1 Georgia, "Times New Roman", serif;
  white-space: nowrap;
}

.public-header__cta:hover { background: #084a73; }

.public-header__cabinet {
  border-radius: 22px;
  color: #123746;
  background: #e4eeec;
  font: 600 15px/1.1 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.public-header__short { display: none; }

.public-header a:focus-visible,
.public-footer a:focus-visible {
  outline: 3px solid rgba(0, 95, 204, .34);
  outline-offset: 2px;
}

/* Планшет и узкое окно: значок без подписи, короткие подписи, «Войти» — внутри «Начать». */
@media (max-width: 1023px) {
  .public-header { width: calc(100% - 32px); gap: 18px; }
  .public-header__brand span,
  .public-header__login,
  .public-header__long { display: none; }
  .public-header__short { display: inline; }
  .public-header__nav { gap: 16px; }
}

/* Телефон: строка разделов всегда на виду под шапкой (вариант Б макета). */
@media (max-width: 760px) {
  .public-header {
    width: 100%;
    min-height: 0;
    flex-wrap: wrap;
    gap: 0;
  }
  .public-header__brand { order: 1; padding: 10px 0 8px 16px; }
  .public-header__brand img { width: 32px; height: 32px; }
  .public-header__brand span { display: inline; font-size: 17px; }
  .public-header__actions { order: 2; gap: 12px; padding: 8px 12px 6px 0; }
  .public-header__login { display: inline-flex; font-size: 15px; }
  .public-header__cta,
  .public-header__cabinet { min-height: 40px; padding: 0 14px; font-size: 15px; }
  .public-header__nav {
    order: 3;
    flex: 1 0 100%;
    align-self: auto;
    gap: 8px;
    padding: 2px 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }
  .public-header__nav::-webkit-scrollbar { display: none; }
  .public-header__nav a {
    min-height: 40px;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: 20px;
    background: #e4eeec;
    box-shadow: none;
    font-size: 14px;
  }
  .public-header__nav a[aria-current='page'] {
    color: #fff;
    background: #0b6399;
    box-shadow: none;
  }
}

@media (max-width: 389px) {
  .public-header__brand span { display: none; }
}

/* ── Подвал ─────────────────────────────────────────────────────────────── */

.public-footer {
  margin-top: 56px;
  padding: 0;
  color: #19313b;
  background: #e4eeec;
  border-top: 1px solid #d5e3e1;
  font: 400 14px/1.5 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
}

.public-footer * { box-sizing: border-box; }

.public-footer__inner {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.public-footer p { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }

.public-footer__pitch {
  background: #fff;
  border-bottom: 1px solid #d5e3e1;
}

.public-footer__pitch-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 0;
}

.public-footer__pitch-text {
  flex: 1 1 0;
  min-width: 0;
  color: #4f6b79;
  font-size: 15px;
}

.public-footer .public-footer__title {
  margin-bottom: 6px;
  color: #123746;
  font: 700 26px/1.2 Georgia, "Times New Roman", serif;
}

.public-footer__pitch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.public-footer__btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1.5px solid #0b6399;
  border-radius: 7px;
  color: #0b5d8d;
  background: #fff;
  font: 700 16px/1.15 Georgia, "Times New Roman", serif;
  text-decoration: none;
  text-align: center;
}

.public-footer__btn--primary {
  color: #fff;
  background: #0b6399;
}

.public-footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.25fr 1fr 1.15fr;
  gap: 28px;
  padding: 32px 0 26px;
}

.public-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #123746;
  text-decoration: none;
}

.public-footer__brand img {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: contain;
}

.public-footer__brand span { font: 700 20px/1.1 Georgia, "Times New Roman", serif; }

.public-footer__about p {
  margin-top: 12px;
  color: #4f6b79;
}

.public-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.public-footer .public-footer__col-title {
  margin-bottom: 2px;
  color: #123746;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.public-footer__col a {
  color: #19313b;
  text-decoration: none;
}

.public-footer__col a:hover {
  color: #0b6399;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.public-footer__col a.public-footer__more {
  color: #0b6399;
  font-weight: 600;
}

.public-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 14px 0 22px;
  border-top: 1px solid #d5e3e1;
  color: #4f6b79;
  font-size: 13px;
}

@media (max-width: 1023px) {
  .public-footer__inner { width: calc(100% - 32px); }
  .public-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-footer__about { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .public-footer__pitch-row { flex-direction: column; align-items: stretch; gap: 16px; padding: 22px 0; }
  .public-footer .public-footer__title { font-size: 22px; }
  .public-footer__pitch-actions { flex-direction: column; }
  .public-footer__grid { gap: 22px 14px; padding: 24px 0 20px; }
}
