/* Администрация города Светлоречье — общий стиль */
@import url("https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&family=PT+Sans:wght@400;700&display=swap");

:root {
  --river: #1F4E79;      /* основной, цвет герба */
  --river-deep: #163A5B;
  --gold: #C9A227;       /* геральдическое золото */
  --sky: #EEF3F8;        /* светлый фон секций */
  --ink: #1B2430;        /* текст */
  --muted: #5A6878;
  --line: #D5DEE8;
  --white: #FFFFFF;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans", "Segoe UI", Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; display: block; }
a { color: var(--river); }
a:hover { color: var(--river-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: 68ch; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Верхняя служебная полоса */
.topbar { background: var(--river-deep); color: #C9D6E4; font-size: .9rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding: .45rem 0; }
.topbar a { color: var(--white); text-decoration: none; }

/* Шапка */
.header { background: var(--white); border-bottom: 4px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: auto; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.2rem; line-height: 1.15; }
.brand span { font-size: .88rem; color: var(--muted); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.nav a { display: block; padding: .55rem .85rem; text-decoration: none; color: var(--ink); font-weight: 700; border-radius: 4px; }
.nav a:hover { background: var(--sky); color: var(--river); }
.nav a[aria-current="page"] { color: var(--river); box-shadow: inset 0 -3px 0 var(--river); border-radius: 0; }
.menu-btn { display: none; background: none; border: 2px solid var(--river); color: var(--river); font: 700 1rem var(--sans); padding: .45rem .8rem; border-radius: 4px; cursor: pointer; }

/* Главный экран с панорамой */
.hero { position: relative; min-height: 560px; display: flex; align-items: flex-start; overflow: hidden; background: #F9ECC8; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.hero .wrap { position: relative; padding: 3.5rem 0 0; }
.hero h1 { color: var(--river-deep); max-width: 15ch; }
.hero p { font-size: 1.15rem; color: #3A4656; max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

.btn { display: inline-block; padding: .8rem 1.3rem; border-radius: 4px; font-weight: 700; text-decoration: none; border: 2px solid var(--river); background: var(--river); color: var(--white); cursor: pointer; font-family: var(--sans); font-size: 1rem; }
.btn:hover { background: var(--river-deep); border-color: var(--river-deep); color: var(--white); }
.btn-ghost { background: var(--white); color: var(--river); }
.btn-ghost:hover { background: var(--sky); color: var(--river-deep); }

/* Заголовок внутренних страниц */
.page-head { background: var(--river); color: var(--white); padding: 2.75rem 0 2.25rem; }
.page-head h1 { margin: 0; }
.page-head p { color: #D4E0EC; margin: .5rem 0 0; }
.crumbs { font-size: .9rem; margin-bottom: .75rem; color: #B9CBDD; }
.crumbs a { color: var(--white); }

.section { padding: 4rem 0; }
.section-alt { background: var(--sky); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }

/* Быстрые услуги — полоса под панорамой */
.services { background: var(--river); color: var(--white); }
.services .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.services a { display: block; padding: 1.5rem 1.25rem; color: var(--white); text-decoration: none; border-left: 1px solid rgba(255,255,255,.18); }
.services a:last-child { border-right: 1px solid rgba(255,255,255,.18); }
.services a:hover { background: var(--river-deep); }
.services strong { display: block; font-family: var(--serif); font-size: 1.15rem; margin-bottom: .25rem; }
.services span { font-size: .92rem; color: #C9D6E4; }

/* Новости */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.news-item img { aspect-ratio: 5 / 3; object-fit: cover; width: 100%; border-radius: 4px; margin-bottom: .9rem; }
.news-item time { font-size: .9rem; color: var(--muted); }
.news-item h3 { margin: .25rem 0 .4rem; }
.news-item h3 a { color: var(--ink); text-decoration: none; }
.news-item h3 a:hover { color: var(--river); text-decoration: underline; }
.news-lead { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: center; margin-bottom: 3rem; padding-bottom: 3rem; border-bottom: 1px solid var(--line); }
.news-lead img { border-radius: 4px; width: 100%; }
.news-lead h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }

/* Обращение главы */
.split { display: grid; grid-template-columns: 300px 1fr; gap: 3rem; align-items: start; }
.split img { border-radius: 4px; border-bottom: 6px solid var(--gold); }
.quote { font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; margin: 0 0 1rem; max-width: 52ch; }
.sign { color: var(--muted); }
.sign strong { color: var(--ink); display: block; }

/* Цифры о городе */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.facts li { border-top: 3px solid var(--gold); padding-top: .75rem; }
.facts b { display: block; font-family: var(--serif); font-size: 2rem; color: var(--river); }

/* Структура */
.dept-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
.dept { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.dept h3 { margin-bottom: .2rem; }
.dept p { margin: 0 0 .35rem; color: var(--muted); }
.dept .who { color: var(--ink); }
.leader { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; align-items: center; background: var(--white); border: 1px solid var(--line); border-left: 6px solid var(--river); padding: 1.5rem; margin-bottom: 2.5rem; }
.leader img { border-radius: 4px; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--gold); }
.timeline li { padding: 0 0 1.5rem 1.5rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: .45em; width: 15px; height: 15px; background: var(--white); border: 3px solid var(--river); border-radius: 50%; }
.timeline b { font-family: var(--serif); color: var(--river); font-size: 1.15rem; }

/* Контакты и форма */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; }
.contact-block { margin-bottom: 1.75rem; }
.contact-block h3 { margin-bottom: .3rem; }
.contact-block p { margin: 0; }
.hours { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.hours td { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; }

.form { background: var(--sky); padding: 2rem; border-radius: 4px; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .3rem; }
.field input, .field select, .field textarea { width: 100%; padding: .7rem .8rem; font: 1rem var(--sans); border: 1px solid #B8C6D5; border-radius: 4px; background: var(--white); color: var(--ink); }
.field textarea { min-height: 140px; resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; margin-bottom: 1.25rem; }
.check input { margin-top: .3rem; }
.form-note { font-size: .9rem; color: var(--muted); margin-top: .75rem; }
.form-ok { display: none; background: #E3F1E6; border-left: 5px solid #3E8E5A; padding: 1rem; margin-top: 1rem; }
.form-ok.show { display: block; }

.map { aspect-ratio: 16 / 9; background: var(--sky); border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--muted); margin-top: 1rem; }

/* Подвал */
.footer { background: var(--river-deep); color: #C9D6E4; padding: 3rem 0 1.5rem; font-size: .95rem; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer h3 { color: var(--white); font-size: 1.05rem; }
.footer a { color: var(--white); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .35rem; }
.footer .brand-foot { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.footer .brand-foot img { width: 40px; }
.footer .copy { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1.25rem; font-size: .85rem; }

/* Адаптив */
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 4px solid var(--gold); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: .5rem 1.25rem 1rem; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--river); }
  .services .wrap { grid-template-columns: repeat(2, 1fr); }
  .services a { border: 1px solid rgba(255,255,255,.12); }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .news-lead, .split, .contact-grid, .dept-list { grid-template-columns: 1fr; }
  .split img { max-width: 260px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .footer .cols { grid-template-columns: 1fr; }
  .hero { min-height: 480px; }
}
@media (max-width: 560px) {
  .news-grid, .services .wrap { grid-template-columns: 1fr; }
  .leader { grid-template-columns: 1fr; }
  .leader img { max-width: 160px; }
  .brand span { display: none; }
  .hero { min-height: 520px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
