/* ==========================================================================
   Сайт міського голови Нововолинська — karpus.in.ua
   Дизайн-система: DESIGN.md. Кольори й шрифт — з брендбуку Нововолинської міської ради
   (сфера «Адміністрація»: Eucalyptus #22985A + Olivine #8FC479, шрифт Montserrat).
   Розміри в rem — панель доступності масштабує весь сайт через font-size на <html>.
   ========================================================================== */

:root {
    /* Бренд. #22985A на білому — 3,7:1: лише великий текст, іконки, декор.
       Для тексту й кнопок — темніші відтінки того самого зеленого (≥ 5,4:1). */
    --brand: #22985A;          /* Eucalyptus */
    --brand-ink: #18794A;      /* посилання, кнопки — 5,4:1 з білим */
    --brand-deep: #0F5C34;     /* наведення, темні блоки — 8,1:1 з білим */
    --olive: #8FC479;          /* Olivine — лише декор */
    --brand-soft: #EEF6EA;     /* тло карток і бейджів */

    --ink: #1C1E1D;
    --ink-2: #3A3D3B;
    --muted: #5C5F5D;          /* 6,4:1 на білому */
    --line: #E3E8E4;
    --line-strong: #CCD5CF;
    --bg: #ffffff;
    --bg-soft: #F5F8F5;
    --warm: #F7F3EA;
    --graphite: #4A4846;       /* нейтральний з брендбуку: підвал */

    --success: #157a3c;
    --success-soft: #eff8f2;
    --danger: #c42020;
    --danger-soft: #fdf2f2;

    --radius-sm: 10px;
    --radius: 20px;
    --shield: 18px 18px 50% 50% / 18px 18px 22% 22%; /* «щит» — форма знака міста */

    --header-h: 4.5rem;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* --- База --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--brand-ink); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--brand-deep); }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.18; font-weight: 700; letter-spacing: -0.02em; }

:focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 3px; border-radius: 6px; }

.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }

.skip-link {
    position: absolute; left: 1rem; top: -3rem; z-index: 2000;
    background: var(--ink); color: #fff; padding: 0.5rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: #fff; }

/* --- Сітка сторінки --- */
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 2rem; }
.container--narrow { max-width: 46rem; }
.container--article { max-width: 44rem; }
.narrow { max-width: 40rem; }

.section { padding: 5rem 0; }
.section--soft { background: var(--bg-soft); }
.section--line { border-top: 1px solid var(--line); }
.section--tight { padding: 2rem 0 5rem; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 0.75rem 2rem; margin-bottom: 2.25rem; }
.section-head h2 { font-size: clamp(1.625rem, 3.2vw, 2.25rem); font-weight: 800; }
.section-head p { color: var(--muted); margin-top: 0.5rem; }
.section-head--stack { flex-direction: column; align-items: flex-start; gap: 0; }

.kicker, .eyebrow {
    font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--brand-ink); margin-bottom: 0.875rem;
}

.empty-state { color: var(--muted); padding: 2rem 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }

/* --- Кнопки й посилання --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 2.875rem; padding: 0 1.375rem;
    border-radius: 999px; border: 1.5px solid transparent;
    font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
    cursor: pointer; transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn-sm { min-height: 2.375rem; padding: 0 1.125rem; font-size: 0.875rem; }
.btn-lg { min-height: 3.375rem; padding: 0 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-brand, .btn-dark { background: var(--brand-ink); color: #fff; }
.btn-brand:hover, .btn-dark:hover { background: var(--brand-deep); color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-light:hover { border-color: var(--brand-ink); color: var(--brand-ink); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.link-arrow { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.9375rem; font-weight: 600; color: var(--brand-ink); white-space: nowrap; }
.link-arrow .icon { transition: transform 0.15s var(--ease); }
.link-arrow:hover { color: var(--brand-deep); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* --- Шапка --- */
.site-header {
    position: sticky; top: 0; z-index: 1000; height: var(--header-h);
    background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }

.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-sign { width: 2rem; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 1rem; font-weight: 700; }
.brand-role { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav ul { list-style: none; display: flex; gap: 0.25rem; }
.site-nav ul a { display: block; padding: 0.5rem 0.875rem; border-radius: 999px; color: var(--muted); font-size: 0.9375rem; font-weight: 500; }
.site-nav ul a:hover { color: var(--ink); }
.site-nav ul a.active { color: var(--ink); background: var(--bg-soft); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-lang { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.nav-lang:hover, .nav-lang.active { color: var(--ink); }
.nav-lang .lang-full { display: none; }

.nav-toggle {
    display: none; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; margin-right: -0.5rem;
    background: none; border: none; color: var(--ink); cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle.is-open .icon-open { display: none; }
.nav-toggle.is-open .icon-close { display: inline-block; }

/* --- Головний екран: текст ліворуч, фото у формі щита праворуч --- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--bg-soft), #fff 75%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 4rem; align-items: center; padding-top: 4.5rem; padding-bottom: 5rem; }
.hero-title { font-size: clamp(2.75rem, 6.5vw, 4.75rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; }
.hero-lead { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 34rem; margin-top: 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 2.25rem; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2.25rem; }
.hero-reception { display: inline-flex; align-items: center; gap: 0.625rem; font-size: 0.875rem; color: var(--ink-2); }
.hero-reception .icon { color: var(--brand-ink); }
.hero-reception a { font-weight: 600; }
.hero-socials { display: flex; gap: 0.5rem; list-style: none; }
.hero-socials a { display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.hero-socials a:hover { color: var(--brand-ink); border-color: var(--brand-ink); }

.hero-photo { position: relative; isolation: isolate; justify-self: end; width: 100%; max-width: 27rem; }
.hero-photo .photo-frame { aspect-ratio: 4 / 5; border-radius: var(--shield); overflow: hidden; background: var(--brand-soft); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 58% 18%; }
/* Фірмова лінія-вказівник з брендбуку — декоративна, за фото */
.hero-line { position: absolute; z-index: -1; width: 150%; right: -45%; top: -12%; color: var(--olive); opacity: 0.55; pointer-events: none; }
.hero-photo .photo-frame { position: relative; }

/* --- 2025 у цифрах --- */
.stats { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats li { background: #fff; padding: 1.75rem 1.5rem; display: flex; flex-direction: column; gap: 0.625rem; }
.stats strong { font-size: clamp(1.75rem, 3vw, 2.375rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--brand-deep); }
.stats span { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.stats-source { font-size: 0.8125rem; color: var(--muted); margin-top: 1rem; }

/* --- Пріоритети --- */
.priorities { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.priorities li { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem 1.5rem; }
.prio-icon { display: inline-flex; width: 3rem; height: 3.5rem; align-items: center; justify-content: center; margin-bottom: 1.25rem; background: var(--brand-soft); color: var(--brand-ink); border-radius: 10px 10px 50% 50% / 10px 10px 28% 28%; }
.prio-num { position: absolute; top: 1.75rem; right: 1.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.priorities h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 0.5rem; }
.priorities p { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }

/* --- Картки новин і звітів --- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.card { display: flex; flex-direction: column; }
.card-media { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); margin-bottom: 1rem; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
a.card-media:hover img { transform: scale(1.03); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.5rem; }
.badge { display: inline-block; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; font-size: 0.75rem; }
.card-title { font-size: 1.0625rem; font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand-ink); }
.card-text {
    color: var(--muted); font-size: 0.9375rem; line-height: 1.55; margin-top: 0.5rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: 0.75rem; font-size: 0.8125rem; font-weight: 600; }
.card-tags a { color: var(--brand-ink); }
.card-tags a:hover { color: var(--brand-deep); }
.card-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 1rem; }
.card-links a { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.9375rem; font-weight: 600; color: var(--brand-ink); }
.card-links a:hover { color: var(--brand-deep); }

/* Звіт: великий рік, поруч — мала обкладинка у формі щита (якщо є) */
.report-card { padding: 1.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.report-card .card-media { display: none; }
.report-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.report-year { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--brand); }
.report-thumb { flex: none; width: 4.5rem; aspect-ratio: 4 / 5; border-radius: var(--shield); overflow: hidden; background: var(--brand-soft); }
.report-thumb img { width: 100%; height: 100%; object-fit: cover; }
.report-card:first-child { background: var(--brand-deep); border-color: var(--brand-deep); }
.report-card:first-child .report-year { color: var(--olive); }
.report-card .card-text { display: block; overflow: visible; -webkit-line-clamp: unset; }
.report-card .card-links { margin-top: auto; padding-top: 1.25rem; }
.report-card:first-child .card-title, .report-card:first-child .card-title a, .report-card:first-child .card-links a { color: #fff; }
.report-card:first-child .card-title a:hover, .report-card:first-child .card-links a:hover { color: var(--olive); }
.report-card:first-child .card-meta, .report-card:first-child .card-text { color: #D3E8D9; }

/* --- Звернення та прийом --- */
.appeal-band { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3rem; align-items: center; padding: 3rem; border-radius: 28px; background: var(--warm); }
.appeal-band h2 { font-size: clamp(1.625rem, 3.2vw, 2.25rem); font-weight: 800; margin-bottom: 1rem; }
.appeal-band p { color: var(--muted); max-width: 32rem; margin-bottom: 1.75rem; }
.reception { display: flex; flex-direction: column; gap: 1.25rem; }
.reception dt { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9375rem; }
.reception dt .icon { color: var(--brand-ink); }
.reception dd { margin: 0.25rem 0 0 1.75rem; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; }
.reception dd small { display: block; color: var(--muted); font-size: 0.8125rem; }

/* --- Заголовок внутрішніх сторінок --- */
.page-head { padding: 4rem 0 1.75rem; background: linear-gradient(180deg, var(--bg-soft), #fff); }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }
.page-lead { color: var(--muted); font-size: 1.0625rem; max-width: 38rem; margin-top: 0.75rem; }

/* --- Фільтри новин --- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.5rem; }
.filter { color: var(--muted); font-size: 0.875rem; font-weight: 600; padding: 0.5rem 1rem; border: 1px solid var(--line); border-radius: 999px; }
.filter:hover { color: var(--ink); border-color: var(--line-strong); }
.filter.active { color: #fff; background: var(--brand-ink); border-color: var(--brand-ink); }
/* Теми — легші за рубрики: рубрика — тип матеріалу, тема — додатковий зріз */
.filter--tag { font-size: 0.8125rem; font-weight: 500; padding: 0.3125rem 0.75rem; background: var(--bg-soft); border-color: transparent; color: var(--ink-2); }
.filter--tag:hover { color: var(--brand-ink); border-color: transparent; background: var(--brand-soft); }
.filter--tag.active { color: var(--brand-deep); background: var(--brand-soft); border-color: var(--brand-ink); }

/* --- Сторінки новин --- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.25rem; margin-top: 3.5rem; }
.pagination-pages { list-style: none; display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pagination-pages a, .pagination-pages span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.5rem;
    border-radius: 999px; font-weight: 600; font-size: 0.9375rem; color: var(--ink-2); border: 1px solid var(--line);
}
.pagination-pages a:hover { border-color: var(--brand-ink); color: var(--brand-ink); }
.pagination-pages span { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.pagination-step { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; font-size: 0.9375rem; }

/* --- Стаття --- */
.article { padding: 2.5rem 0 5rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--muted); font-size: 0.9375rem; font-weight: 500; margin-bottom: 2rem; }
.back-link:hover { color: var(--ink); }
.article-head h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.025em; margin-top: 0.25rem; }
.article-lead { font-size: 1.125rem; color: var(--ink-2); margin-top: 1rem; }
.article-cover { margin: 2rem 0; }
.article-cover img { width: 100%; height: auto; border-radius: var(--radius); background: var(--bg-soft); }
.article-cover figcaption { margin-top: 0.625rem; font-size: 0.8125rem; color: var(--muted); }
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.5rem; }
.preview-note { margin-bottom: 1.5rem; padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: #FFF4E0; color: #6B4100; font-size: 0.9375rem; }
.preview-note a { color: inherit; font-weight: 700; text-decoration: underline; }
.report-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.report-prose { margin-top: 2.5rem; }
.report-note { margin-top: 2rem; color: var(--muted); }
.report-source { margin-top: 1.5rem; font-size: 0.8125rem; color: var(--muted); }
.report-source a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.report-source a:hover { color: var(--brand-ink); }

/* --- Поділитися новиною --- */
.share { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.share-label { font-weight: 700; font-size: 0.9375rem; color: var(--ink); margin-bottom: 0.75rem; }
.share-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-btn {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.875rem;
    font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--ink-2); background: #fff;
    border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
}
.share-btn:hover { color: var(--brand-ink); border-color: var(--brand-ink); }
.share-btn .icon { color: var(--brand-ink); }
.article-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); }

/* Текст із редактора (новини, біографія) */
.prose { font-size: 1.0625rem; line-height: 1.8; color: var(--ink-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.375rem; margin-top: 2em; }
.prose h3 { font-size: 1.1875rem; margin-top: 1.75em; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li + li { margin-top: 0.375em; }
.prose blockquote { border-left: 3px solid var(--olive); padding-left: 1.25em; color: var(--muted); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius-sm); }
.prose pre { background: var(--bg-soft); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.875rem; }
/* Порожні абзаци, які редактор вставляє як розділювачі, не додають зайвих відступів */
.prose p:has(> br:only-child) { display: none; }

/* --- Біографія --- */
.bio-layout { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 4rem; align-items: start; }
.bio-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); display: flex; flex-direction: column; gap: 2rem; }

.portrait { position: relative; aspect-ratio: 4 / 5; border-radius: var(--shield); overflow: hidden; background: var(--brand-soft); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 58% 18%; }
.portrait figcaption { display: none; }
.portrait--empty { display: flex; align-items: center; justify-content: center; }
.portrait-initials { font-size: 4rem; font-weight: 700; color: var(--line-strong); letter-spacing: -0.04em; }

.facts h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.facts ul { list-style: none; }
.facts li { padding: 0.75rem 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.9375rem; line-height: 1.5; }
.facts strong { display: block; color: var(--muted); font-weight: 500; font-size: 0.8125rem; }

.bio-main > h2 { font-size: 1.75rem; margin-bottom: 1.25rem; }
.bio-subhead { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }

.timeline { list-style: none; margin-top: 0.5rem; position: relative; }
.timeline-item { position: relative; display: grid; grid-template-columns: 8rem minmax(0, 1fr); column-gap: 1.75rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.timeline-item:first-child { border-top: none; }
.timeline-year { grid-row: span 2; font-size: 0.9375rem; font-weight: 700; color: var(--muted); }
.timeline-item.is-highlighted .timeline-year { color: var(--brand-ink); }
.timeline-item.is-highlighted h3::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brand); margin-right: 0.5rem; vertical-align: 0.15em; }
.timeline-item h3 { font-size: 1.0625rem; letter-spacing: 0; }
.timeline-item p { color: var(--muted); font-size: 0.9375rem; margin-top: 0.25rem; }

/* --- Контакти --- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4rem; align-items: start; }
.contact-aside h2, .contact-form h2 { font-size: 1.375rem; margin-bottom: 0.25rem; }
.contact-form > .muted { margin-bottom: 1.75rem; }
.contact-form { padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.contact-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.75rem; }
.aside-subhead { font-size: 1rem; margin: 2rem 0 0.75rem; }
.social-list { display: flex; flex-direction: column; gap: 0.625rem; }
.social-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-2); font-size: 0.9375rem; font-weight: 500; }
.social-link:hover { color: var(--brand-ink); }

.info-list { list-style: none; display: flex; flex-direction: column; gap: 1.125rem; margin-top: 1.5rem; }
.info-list li { display: flex; align-items: flex-start; gap: 0.75rem; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; }
.info-list strong { display: block; color: var(--muted); font-weight: 500; font-size: 0.8125rem; }
.info-list a { color: var(--ink-2); word-break: break-word; }
.info-list a:hover { color: var(--brand-ink); }
.info-icon { display: inline-flex; color: var(--brand-ink); margin-top: 0.125rem; }
.info-box { margin-top: 2rem; padding: 1.5rem; border-radius: var(--radius); background: var(--warm); }
.info-box h3 { font-size: 1.0625rem; margin-bottom: 0.75rem; }
.info-box p { font-size: 0.9375rem; color: var(--ink-2); white-space: pre-line; }
.info-box p + p { margin-top: 0.75rem; color: var(--muted); }
.contact-aside > h2.aside-subhead { font-size: 1.375rem; margin-top: 2.25rem; }
.contact-aside > .info-box:first-child { margin-top: 0; }

/* --- Форма звернення --- */
.appeal-form { display: flex; flex-direction: column; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.375rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 0.8125rem; color: var(--muted); }
.req { color: var(--danger); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
    width: 100%; padding: 0.75rem 0.9375rem;
    font: inherit; font-size: 1rem; /* 16px — без авто-зуму на iOS */
    color: var(--ink); background: #fff;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input::placeholder, .field textarea::placeholder { color: #9aa19c; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-soft); }

.priority-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.priority-value { font-size: 0.875rem; font-weight: 600; color: var(--brand-ink); }
.priority input[type="range"] { width: 100%; accent-color: var(--brand-ink); cursor: pointer; }

.consent { display: flex; align-items: flex-start; gap: 0.625rem; font-size: 0.875rem; color: var(--muted); line-height: 1.5; cursor: pointer; }
.consent input { width: 1.125rem; height: 1.125rem; margin-top: 0.125rem; accent-color: var(--brand-ink); flex-shrink: 0; cursor: pointer; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.875rem 1rem; border-radius: var(--radius-sm); font-size: 0.9375rem; line-height: 1.5; margin-bottom: 1.5rem; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* --- Цитата --- */
.quote { max-width: 48rem; padding-left: 1.75rem; border-left: 4px solid var(--olive); }
.quote blockquote { font-size: clamp(1.25rem, 2.4vw, 1.625rem); line-height: 1.45; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.quote figcaption { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.5rem; color: var(--muted); font-size: 0.9375rem; }
.quote-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; object-position: center top; }

/* --- Сторінки результату (успіх, 404, обслуговування) --- */
.result-section { min-height: 60vh; display: flex; align-items: center; }
.result-card { width: 100%; max-width: 34rem; margin: 0 auto; display: flex; flex-direction: column; align-items: flex-start; }
.result-card h1 { font-size: 2rem; margin: 1rem 0 0.75rem; }
.result-card p { color: var(--muted); margin-bottom: 2rem; }
.result-icon { color: var(--success); display: inline-flex; }
.result-code { font-size: 1rem; font-weight: 700; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.standalone-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--bg-soft); }
.standalone-page .result-icon { color: var(--muted); }
.standalone-page .kicker { margin: 0; }

/* --- Заглушка «Сайт оновлюється» --- */
.maintenance-sign { width: 2.75rem; margin-bottom: 1.5rem; }
.maintenance-card h1 { font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 800; margin: 0.75rem 0; }
.maintenance-card p { margin-bottom: 1.75rem; }
.maintenance-contacts { list-style: none; padding: 0; margin: 0 0 2.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.maintenance-contacts li { display: flex; align-items: center; gap: 0.625rem; color: var(--brand-ink); }
.maintenance-contacts a { color: var(--ink); text-decoration: none; }
.maintenance-contacts a:hover { text-decoration: underline; }
.maintenance-login { font-size: 0.8125rem; color: var(--muted); }

/* Смужка для адміністратора: сайт закритий для відвідувачів */
.admin-preview-bar { background: #fff4c2; color: #5c4400; border-bottom: 1px solid #f0d77a; font-size: 0.875rem; }
.admin-preview-bar .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.admin-preview-bar a { color: inherit; font-weight: 700; }

/* --- Підвал --- */
.site-footer { background: var(--graphite); color: #D9D7D4; padding: 3.5rem 0 5.5rem; font-size: 0.875rem; } /* знизу — місце для кнопки доступності, щоб вона не закривала іконки соцмереж */
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--olive); }
.site-footer .brand, .site-footer .brand:hover { color: #fff; }
.site-footer .brand-role { color: #C9C6C2; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem 2rem; flex-wrap: wrap; }
.footer-row--muted { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-weight: 500; }
.footer-contacts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.footer-contacts li { display: flex; align-items: center; gap: 0.5rem; }
.footer-contacts .icon { color: var(--olive); }
.footer-city { display: inline-flex; align-items: center; gap: 0.625rem; color: #fff; font-weight: 600; }
.footer-city img { width: 1.5rem; }
.social-icons { display: flex; gap: 0.5rem; }
.social-icon { display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; }
.social-icon:hover { border-color: var(--olive); color: var(--olive); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; margin-top: 2rem; }
.footer-copy { font-size: 0.8125rem; color: #C9C6C2; }

/* --- Панель доступності --- */
.acc-btn {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1100;
    width: 3rem; height: 3rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--ink); border: 1px solid var(--line-strong); cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.acc-btn:hover { border-color: var(--brand-ink); color: var(--brand-ink); }

.acc-panel {
    position: fixed; right: 1.25rem; bottom: 5rem; z-index: 1100;
    width: 19rem; padding: 1.25rem;
    background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    display: flex; flex-direction: column; gap: 1rem;
}
.acc-panel[hidden] { display: none; }
.acc-panel-head { display: flex; justify-content: space-between; align-items: center; }
.acc-panel-head h3 { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1rem; letter-spacing: 0; }
.acc-close { background: none; border: none; color: var(--muted); cursor: pointer; display: inline-flex; padding: 0.25rem; }
.acc-close:hover { color: var(--ink); }
.acc-group { display: flex; flex-direction: column; gap: 0.5rem; }
.acc-label { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--muted); }
.acc-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.375rem; }
.acc-row button {
    min-height: 2.25rem; padding: 0.25rem; font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1.2;
    overflow-wrap: anywhere;
    background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer;
}
.acc-row button:hover { border-color: var(--brand-ink); }
.acc-row button.active { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }
.acc-reset {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
    min-height: 2.25rem; font: inherit; font-size: 0.875rem;
    background: none; color: var(--muted); border: none; cursor: pointer;
}
.acc-reset:hover { color: var(--danger); }

/* Збільшений шрифт: масштабується весь сайт, бо всі розміри в rem */
html.acc-font-medium { font-size: 112.5%; }
html.acc-font-large { font-size: 125%; }

/* Контрастна тема: жовтий текст на чорному */
html.acc-theme-high body,
html.acc-theme-high body *:not(.acc-panel):not(.acc-panel *):not(.acc-btn):not(.acc-btn *) {
    background: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    box-shadow: none !important;
}
html.acc-theme-high body a { text-decoration: underline !important; }
html.acc-theme-high .hero-line { display: none; }
html.acc-theme-high img { filter: grayscale(100%) contrast(1.2); }

/* Чорно-біла тема */
html.acc-theme-monochrome { filter: grayscale(100%); }

/* ==========================================================================
   Адаптивність
   ========================================================================== */
@media (max-width: 1024px) {
    .site-nav { gap: 1rem; }
    .site-nav ul a { padding: 0.5rem 0.625rem; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .priorities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bio-layout { grid-template-columns: 16rem minmax(0, 1fr); gap: 2.5rem; }
    .contact-layout { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
    .contact-photo { aspect-ratio: 16 / 7; }
    .hero-grid { gap: 2.5rem; }
}

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    /* backdrop-filter робить шапку «контейнером» для position: fixed — меню обрізалося б її висотою */
    .site-header { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .site-nav {
        position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
        flex-direction: column; align-items: stretch; gap: 1.5rem;
        padding: 0.5rem 1.5rem 2rem; background: #fff; overflow-y: auto;
        visibility: hidden; opacity: 0;
        transition: opacity 0.15s var(--ease), visibility 0.15s;
    }
    .site-nav.is-open { visibility: visible; opacity: 1; }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav ul li + li { border-top: 1px solid var(--line); }
    .site-nav ul a { padding: 1rem 0; border-radius: 0; font-size: 1.0625rem; color: var(--ink); }
    .site-nav ul a.active { color: var(--brand-ink); background: none; }
    .nav-actions { flex-direction: column-reverse; align-items: stretch; gap: 1rem; }
    .nav-actions .btn { min-height: 3.25rem; font-size: 1rem; }
    .nav-lang { font-size: 1rem; padding: 0.25rem 0; }
    .nav-lang .lang-short { display: none; }
    .nav-lang .lang-full { display: inline; }
    body.menu-open { overflow: hidden; }
    body.menu-open .acc-btn, body.menu-open .acc-panel { display: none; }

    .hero-grid { grid-template-columns: minmax(0, 1fr); padding-top: 2.5rem; padding-bottom: 3rem; }
    .hero-photo { justify-self: center; max-width: 22rem; order: -1; }
    .hero-photo .photo-frame { aspect-ratio: 1 / 1; }
    .appeal-band { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding: 2rem; }

    .bio-layout { grid-template-columns: minmax(0, 1fr); }
    .bio-aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media (max-width: 640px) {
    :root { --header-h: 4rem; }
    .container { padding: 0 1rem; }

    .section { padding: 3.25rem 0; }
    .section--tight { padding: 1.5rem 0 3.5rem; }
    .section-head { margin-bottom: 1.5rem; }

    .hero-grid { padding-top: 2rem; padding-bottom: 2.75rem; } /* .container вище скидає вертикальні відступи */
    .hero-photo { max-width: 15rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-meta { flex-direction: column; align-items: flex-start; }

    .card-grid, .stats, .priorities { grid-template-columns: minmax(0, 1fr); }
    /* 14 тем у кілька рядків займають пів екрана: на телефоні — один рядок із прокруткою */
    .filters--tags { flex-wrap: nowrap; overflow-x: auto; margin-right: -1rem; padding-right: 1rem; scrollbar-width: none; }
    .filters--tags::-webkit-scrollbar { display: none; }
    .filters--tags .filter { flex: none; }
    .pagination-step { flex-basis: 100%; justify-content: center; }
    .card-grid { gap: 2.25rem; }

    .page-head { padding: 2.5rem 0 1rem; }
    .page-lead { font-size: 1rem; }

    .article { padding: 1.75rem 0 3.5rem; }
    .article-lead { font-size: 1.0625rem; }
    .prose { font-size: 1rem; }

    .bio-aside { grid-template-columns: minmax(0, 1fr); }
    .portrait { aspect-ratio: 1 / 1; }
    .portrait--empty { aspect-ratio: 16 / 7; }
    .portrait--empty .portrait-initials { font-size: 3rem; }
    .bio-main > h2 { font-size: 1.5rem; }
    .timeline-item { grid-template-columns: minmax(0, 1fr); }
    .timeline-year { grid-row: auto; margin-bottom: 0.125rem; }

    .field-row { grid-template-columns: minmax(0, 1fr); }
    .contact-form { padding: 1.25rem; }
    .appeal-band { padding: 1.5rem; border-radius: var(--radius); }

    .footer-row { flex-direction: column; align-items: flex-start; }
    .footer-contacts { flex-direction: column; }
    .footer-bottom { flex-direction: column-reverse; align-items: flex-start; }

    .acc-btn { right: 1rem; bottom: 1rem; }
    .acc-panel { left: 1rem; right: 1rem; bottom: 4.5rem; width: auto; max-height: calc(100dvh - 6rem); overflow-y: auto; }

    .result-actions { flex-direction: column; align-items: stretch; width: 100%; }
    .result-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
    .site-header, .site-footer, .acc-btn, .acc-panel, .hero-actions, .article-foot, .hero-line { display: none !important; }
    body { color: #000; }
}
