/* ============================================================
   СаратовВет · «Город на Волге»
   Поверх main.css: шрифт Manrope, синий акцент, плавающее меню,
   плоские фоны, каталог клиник по районам Саратова.
   Отступы только из шкалы 2/4/8/12/16/24/32/40/48/64/80/96 px.
   ============================================================ */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../vendor/fonts/manrope-cyrillic-wght-normal.d02c8c2a9140.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../vendor/fonts/manrope-latin-wght-normal.fc03edc2c673.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --city-ink: #141A21;
  --city-muted: #5D6670;
  --city-bg: #F7F8F5;
  --city-surface: #FFFFFF;
  --city-sky: #E9EEF4;
  --city-line: #DDE3E8;
  --city-blue: #2450B8;
  --city-blue-hover: #1B3F94;
  --city-green: #22703A;
  --city-green-bg: #E2F2E4;
  --city-river: #CFE0F0;
  --city-land: #EEF1EA;
  --city-curve: cubic-bezier(0.22, 1, 0.36, 1);
  --city-font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --primary: var(--city-blue);
  --primary-hover: var(--city-blue-hover);
  --secondary: var(--city-green);
  --secondary-hover: #1A5A2E;
  --background: var(--city-bg);
  --surface: var(--city-surface);
  --text: var(--city-ink);
  --text-muted: var(--city-muted);
  --border: var(--city-line);
  --border-hover: #C8D1D9;
  --box-shadow: none;
  --box-shadow-hover: 0 8px 24px rgba(20, 26, 33, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

:root[data-theme="light"] {
  --pico-font-family: var(--city-font);
  --pico-font-weight: 400;
  --pico-background-color: var(--city-bg);
  --pico-color: var(--city-ink);
  --pico-muted-color: var(--city-muted);
  --pico-muted-border-color: var(--city-line);
  --pico-card-box-shadow: none;
  --pico-border-radius: 8px;
  --pico-form-element-background-color: var(--city-surface);
  --pico-form-element-border-color: var(--city-line);
  --pico-form-element-focus-color: var(--city-blue);
  --pico-form-element-active-border-color: var(--city-blue);
  --pico-secondary: var(--city-ink);
  --pico-secondary-background: var(--city-ink);
  --pico-secondary-border: var(--city-ink);
  --pico-secondary-hover: #2B3540;
  --pico-secondary-hover-background: #2B3540;
  --pico-secondary-hover-border: #2B3540;
  --pico-secondary-focus: rgba(20, 26, 33, 0.2);
}

body {
  font-family: var(--city-font);
  background: var(--city-bg);
  color: var(--city-ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; }

.ph {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
  vertical-align: -0.125em;
}

.icon-sprite { position: absolute; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -64px;
  left: 16px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--city-ink);
  color: #FFFFFF;
  font-weight: 600;
  transition: transform 300ms var(--city-curve);
}

.skip-link:focus { transform: translateY(80px); color: #FFFFFF; }

:focus-visible {
  outline: 2px solid var(--city-blue);
  outline-offset: 2px;
}

/* --- Кнопки: 8×12 px, полужирные, мягкое нажатие --- */
[role="button"], button, input[type="submit"], input[type="button"] {
  border-radius: 8px;
  font-weight: 600;
  transition: background-color 300ms var(--city-curve), border-color 300ms var(--city-curve),
    color 300ms var(--city-curve), transform 300ms var(--city-curve);
}

button:not(.nav-logout-btn):not(.city-near):hover,
[role="button"]:hover {
  transform: translateY(-1px);
}

button:active, [role="button"]:active, input[type="submit"]:active {
  transform: scale(0.98);
}

/* --- Плавающее меню --- */
body > nav.container-fluid {
  position: sticky;
  top: 12px;
  z-index: 50;
  gap: 24px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 12px auto 0;
  padding: 4px 8px 4px 16px;
  border: 1px solid var(--city-line);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: none;
}

body > nav .logo-link {
  gap: 8px;
}

.logo-pin {
  width: 24px;
  height: 24px;
  color: var(--city-blue);
}

.logo-text {
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body > nav ul li a {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  padding: 8px 12px;
}

body > nav ul li a:hover {
  background: var(--city-sky);
  color: var(--city-ink);
}

.nav-logout-btn {
  font-size: 14px;
  line-height: 20px;
}

/* --- Карточки и панели: плоские, рамка вокруг --- */
.dashboard-card,
.pet-editor-card,
article {
  box-shadow: none;
}

/* --- Страница клиники: плоский первый экран --- */
.clinic-hero {
  background: var(--city-surface);
  border: 1px solid var(--city-line);
  border-radius: 16px;
  box-shadow: none;
}

.clinic-hero h1,
.city-title {
  background: linear-gradient(90deg, #000000, #666666);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.clinic-hero-media {
  background: var(--city-sky);
}

/* ============================================================
   Главная: каталог по районам
   ============================================================ */
.city-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: start;
  padding-block: 48px 40px;
}

.city-hero > *,
.city-filters,
.city-chips { min-width: 0; min-inline-size: 0; }

.city-hero-text {
  display: grid;
  gap: 24px;
  align-content: start;
}

.city-eyebrow {
  margin: 0;
  color: var(--city-muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.city-title {
  max-width: 680px;
  margin: 0;
  font-size: 60px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.city-lead {
  max-width: 680px;
  margin: 0;
  color: var(--city-muted);
  font-size: 18px;
  line-height: 28px;
}

.city-filters {
  display: grid;
  gap: 16px;
  margin: 0;
}

.city-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 4px 4px 16px;
  border: 1px solid var(--city-line);
  border-radius: 12px;
  background: var(--city-surface);
  color: var(--city-muted);
  transition: border-color 300ms var(--city-curve);
}

.city-search:focus-within { border-color: var(--city-blue); }

.city-search input[type="search"] {
  flex: 1;
  margin: 0;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  line-height: 24px;
}

.city-search input[type="search"]:focus { box-shadow: none; }

.city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.city-chip,
.city-toggle {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.city-chip input,
.city-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.city-chip span,
.city-toggle span,
.city-near {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid var(--city-line);
  border-radius: 9999px;
  background: var(--city-surface);
  color: var(--city-ink);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  transition: background-color 300ms var(--city-curve), color 300ms var(--city-curve),
    border-color 300ms var(--city-curve);
}

.city-chip small {
  color: var(--city-muted);
  font-size: 12px;
  line-height: 16px;
}

.city-chip:hover span,
.city-toggle:hover span { border-color: var(--city-ink); }

.city-chip input:checked + span {
  background: var(--city-ink);
  border-color: var(--city-ink);
  color: #FFFFFF;
}

.city-chip input:checked + span small { color: #C8D1D9; }

.city-chip input:focus-visible + span,
.city-toggle input:focus-visible + span {
  outline: 2px solid var(--city-blue);
  outline-offset: 2px;
}

.city-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.city-toggle span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #9AA6B2;
  margin-right: 4px;
}

.city-toggle input:checked + span {
  background: var(--city-green-bg);
  border-color: var(--city-green);
  color: var(--city-green);
}

.city-toggle input:checked + span::before { background: var(--city-green); }

.city-near {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.city-near:hover { border-color: var(--city-blue); color: var(--city-blue); }
.city-near.is-on { background: var(--city-sky); border-color: var(--city-blue); color: var(--city-blue); }

.city-map-wrap {
  overflow: hidden;
  border: 1px solid var(--city-line);
  border-radius: 16px;
  background: var(--city-land);
}

.city-map {
  height: 440px;
  color: var(--city-muted);
}

.city-scheme {
  display: block;
  width: 100%;
  height: auto;
}

.scheme-land { fill: var(--city-land); }
.scheme-river { fill: var(--city-river); }
.scheme-river-label { fill: #5D7FA8; font-size: 12px; font-family: var(--city-font); }
.scheme-roads path { fill: none; stroke: #D2D9CE; stroke-width: 2; }

.scheme-district { text-decoration: none; }

.scheme-district text {
  fill: var(--city-ink);
  font-family: var(--city-font);
  font-size: 12px;
  font-weight: 600;
  transition: fill 300ms var(--city-curve);
}

.scheme-district:hover text,
.scheme-district.is-current text { fill: var(--city-blue); }

/* --- Список клиник --- */
.city-list { padding-block: 24px 48px; }

.city-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 24px;
}

.city-list-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 36px;
}

.city-count {
  margin-left: 8px;
  color: var(--city-muted);
  font-weight: 500;
}

.city-list-note {
  margin: 0;
  color: var(--city-green);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.city-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.city-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--city-line);
  border-radius: 16px;
  background: var(--city-surface);
  color: var(--city-ink);
  text-decoration: none;
  transition: transform 500ms var(--city-curve), border-color 300ms var(--city-curve);
}

.city-card:hover {
  transform: translateY(-4px);
  border-color: #C8D1D9;
  color: var(--city-ink);
  text-decoration: none;
}

.city-card-photo {
  display: grid;
  place-items: center;
  min-height: 96px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--city-sky);
  color: var(--city-blue);
  font-size: 32px;
}

.city-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.city-card-body {
  display: grid;
  gap: 4px;
  align-content: start;
  padding-block: 8px;
  min-width: 0;
}

.city-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
}

.city-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 28px;
}

.city-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--city-muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.city-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #9AA6B2;
}

.city-status.is-open { color: var(--city-green); }
.city-status.is-open::before { background: var(--city-green); }

.city-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--city-muted);
  font-size: 14px;
  line-height: 20px;
}

.city-meta > span { min-width: 0; }
.city-meta .ph { align-self: center; }

.city-rating {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--city-ink);
  font-weight: 600;
}

.city-rating .ph { color: #C98A00; }

.city-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.city-tags span {
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--city-sky);
  color: var(--city-ink);
  font-size: 12px;
  line-height: 16px;
}

.city-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 48px 24px;
  border: 1px solid var(--city-line);
  border-radius: 16px;
  background: var(--city-surface);
  text-align: center;
  color: var(--city-muted);
}

.city-empty .ph { width: 32px; height: 32px; color: var(--city-blue); }
.city-empty p { margin: 0; max-width: 480px; }

/* --- Слоган: слова загораются по прокрутке --- */
.city-tagline { padding-block: 64px; }

.city-tagline p {
  max-width: 680px;
  margin: 0;
  font-size: 36px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.city-tagline .w {
  color: rgba(20, 26, 33, 0.3);
  transition: color 600ms var(--city-curve);
}

.city-tagline .w.on { color: var(--city-ink); }

/* --- Как записаться --- */
.city-steps { padding-block: 24px 64px; }

.city-steps h2 {
  margin: 0 0 24px;
  font-size: 30px;
  line-height: 36px;
}

.city-steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.city-steps li {
  display: grid;
  gap: 8px;
  align-content: start;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--city-line);
  border-radius: 16px;
  background: var(--city-surface);
  list-style: none;
}

.city-steps li .ph { width: 24px; height: 24px; color: var(--city-blue); }
.city-steps li b { font-size: 18px; line-height: 28px; }
.city-steps li span { color: var(--city-muted); font-size: 14px; line-height: 20px; }

/* --- Страница клиники: часы и адрес --- */
.clinic-where-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: start;
}

.clinic-where-info {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.clinic-where-address { margin: 0; font-size: 18px; line-height: 28px; font-weight: 600; }
.clinic-where-address span { color: var(--city-muted); font-size: 14px; line-height: 20px; font-weight: 500; }

.clinic-hours {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.clinic-hours div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--city-line);
}

.clinic-hours dt { margin: 0; color: var(--city-muted); font-weight: 500; }
.clinic-hours dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.clinic-where-map {
  height: 320px;
  overflow: hidden;
  border: 1px solid var(--city-line);
  border-radius: 16px;
}

.clinic-hero-meta .city-status { font-size: 14px; line-height: 20px; }

/* --- Настройки клиники: район, карта, часы --- */
.catalog-fields {
  display: grid;
  gap: 16px;
  margin: 24px 0;
  padding: 24px;
  border: 1px solid var(--city-line);
  border-radius: 16px;
  background: var(--city-surface);
}

.catalog-fields legend {
  padding: 0 8px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.map-picker {
  height: 320px;
  overflow: hidden;
  border: 1px solid var(--city-line);
  border-radius: 12px;
}

.map-picker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.map-picker-actions button { width: auto; margin: 0; }

.coords-manual { margin-top: 12px; }
.coords-manual summary { color: var(--city-muted); font-size: 14px; line-height: 20px; }

.coords-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-line input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
}

.hours-table { display: grid; gap: 8px; }

.hours-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.hours-row input { margin: 0; }

/* --- Иконки разделов кабинета (Phosphor вместо эмодзи) --- */
.section-button-icon,
.section-tile-icon {
  color: var(--city-blue);
  background: var(--city-sky);
}

.section-button-icon { width: 48px; height: 48px; font-size: 24px; }
.section-tile-icon { width: 40px; height: 40px; font-size: 20px; }

.empty-state .empty-icon {
  font-size: 48px;
  color: var(--city-blue);
  opacity: 1;
}

/* --- Подвал --- */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

body > footer {
  border-top: 1px solid var(--city-line);
  background: var(--city-surface);
}

/* --- Узкие экраны --- */
@media (max-width: 960px) {
  .city-hero,
  .clinic-where-grid { grid-template-columns: minmax(0, 1fr); }
  .city-map { height: 360px; }
}

@media (max-width: 640px) {
  body > nav.container-fluid {
    top: 8px;
    max-width: calc(100% - 16px);
    margin-top: 8px;
    padding-left: 12px;
  }
  .logo-text { font-size: 16px; line-height: 24px; }
  .city-hero { padding-block: 32px 24px; gap: 24px; }
  .city-title { font-size: 36px; line-height: 40px; }
  .city-lead { font-size: 16px; line-height: 24px; }
  .city-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .city-chip span { white-space: nowrap; }
  .city-map { height: 280px; }
  .city-cards { grid-template-columns: minmax(0, 1fr); }
  .city-card { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .city-card-photo { min-height: 72px; font-size: 24px; }
  .city-tagline { padding-block: 40px; }
  .city-tagline p { font-size: 24px; line-height: 32px; }
  .city-steps ol { grid-template-columns: minmax(0, 1fr); }
  .hours-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hours-row > span:first-child { grid-column: 1 / -1; }
  .hours-row > span[aria-hidden] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
  .city-card:hover,
  button:hover,
  [role="button"]:hover { transform: none; }
}
