/* Тема «Ліцей №1». Основа — погоджений макет (redesign/mockup/assets/styles.css), далі — доповнення для WordPress. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/inter-latin.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 {
  --green: #307d5d;          /* шкільний зелений, основний */
  --green-700: #26664b;
  --green-900: #163d2d;
  --green-50: #eaf3ee;
  --red: #b3262e;            /* з герба */
  --red-50: #fbecec;
  --gold: #e9b72c;           /* з герба; лише на темному тлі */
  --paper: #f6f4ee;
  --surface: #ffffff;
  --ink: #16211b;
  --muted: #4b5a52;
  --line: #e1ddd2;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgb(22 33 27 / 6%), 0 6px 20px rgb(22 33 27 / 6%);
  --wrap: 1200px;
  --gutter: 24px;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

a { color: var(--green-700); text-underline-offset: 3px; }
a:hover { color: var(--green-900); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; color: #fff; }

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

/* Позначка «уточнити у школи» */
.todo {
  background: #fff4d1;
  border-bottom: 2px dashed #c99a12;
  padding: 0 4px;
  border-radius: 3px;
  color: #5a4300;
}
.on-dark .todo { background: rgb(233 183 44 / 18%); color: #ffe7a3; border-bottom-color: var(--gold); }

/* ---------- Верхня смуга ---------- */
.topbar { background: var(--green-900); color: #dfeae4; font-size: 14px; }
.topbar .wrap { display: flex; gap: 28px; align-items: center; min-height: 40px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar .spacer { flex: 1; }
.topbar svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; gap: 24px; min-height: 76px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 55px; object-fit: contain; }
.brand b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.brand small { display: block; font-size: 13px; color: var(--muted); line-height: 1.3; }

.nav { margin-left: auto; }
.nav > ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav a, .nav button {
  display: block; padding: 10px 14px; border-radius: 10px;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ink);
  text-decoration: none; background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button:hover, .nav [aria-current="page"] { background: var(--green-50); color: var(--green-900); }
.nav button::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}
.nav .sub {
  display: none; position: absolute; top: 100%; left: 0; min-width: 280px;
  list-style: none; margin: 0; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav .sub a { font-weight: 500; padding: 10px 12px; }
.nav li:hover > .sub, .nav li:focus-within > .sub, .nav li.open > .sub { display: block; }
.nav li.closed > .sub { display: none; }
.nav button[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--green-50); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.burger { display: none; }

.searchbar { border-top: 1px solid var(--line); background: var(--surface); }
.searchbar[hidden] { display: none; }
.searchbar form { display: flex; gap: 10px; padding: 14px 0; }
.searchbar input {
  flex: 1; min-width: 0; font: inherit; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--paper);
}
.searchbar input:focus { border-color: var(--green); outline: none; }

/* Мобільне меню на весь екран */
.mnav {
  position: fixed; inset: 0; z-index: 80; background: var(--surface);
  overflow-y: auto; padding: 16px var(--gutter) 40px;
}
.mnav[hidden] { display: none; }
.mnav-head { display: flex; justify-content: space-between; align-items: center; min-height: 48px; margin-bottom: 8px; }
.mnav h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 6px; }
.mnav ul { list-style: none; margin: 0; padding: 0; }
.mnav a { display: block; padding: 12px 0; font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.mnav .contact { margin-top: 26px; padding: 18px; border-radius: var(--radius); background: var(--green-50); font-size: 16px; }
.mnav .contact a { border: 0; padding: 4px 0; font-size: 17px; color: var(--green-900); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 16px;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--green); color: var(--green-900); }

/* ---------- Перший екран ---------- */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red);
}
.eyebrow::before { content: ""; width: 26px; height: 3px; border-radius: 2px; background: var(--red); }
.hero h1 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; margin: 14px 0 18px; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 34em; margin: 0 0 28px; }
.hero-photo { position: relative; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); }
.motto {
  position: absolute; left: -22px; bottom: 26px;
  background: var(--green-900); color: #fff; border-radius: 14px; padding: 14px 18px;
  box-shadow: var(--shadow); font-size: 14px;
}
.motto b { display: block; color: var(--gold); font-size: 17px; font-style: italic; letter-spacing: .02em; }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.quick a {
  display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px;
  transition: border-color .15s, transform .15s;
}
.quick a:hover { border-color: var(--green); transform: translateY(-2px); }
.quick svg { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Секції ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.more { font-weight: 700; white-space: nowrap; text-decoration: none; }
.more::after { content: " →"; }

/* Оголошення */

/* Картки новин */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--green-50); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.meta { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--green-50); color: var(--green-900); font-size: 13px; font-weight: 700;
}
.chip-album { background: var(--red-50); color: var(--red); }
.card h3 { font-size: 19px; font-weight: 700; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card p {
  margin: 0; color: var(--muted); font-size: 15.5px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters a {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none;
}
.filters a[aria-current="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* Ліцей у датах */
.facts { background: var(--green-900); color: #e6efe9; }
.facts .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.fact b { display: block; font-size: clamp(36px, 4vw, 50px); font-weight: 800; color: var(--gold); letter-spacing: -0.02em; line-height: 1.1; }
.fact span { display: block; margin-top: 8px; font-size: 16px; }

/* Про ліцей */
.about .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start; }
.about h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; margin-bottom: 18px; }
.about p { margin: 0 0 16px; }
.goal {
  margin: 22px 0; padding: 18px 22px; border-left: 4px solid var(--green);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; font-size: 18px; font-weight: 600;
}
.goal small { display: block; font-size: 14px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.links-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.links-list li + li { border-top: 1px solid var(--line); }
.links-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 20px; color: var(--ink); text-decoration: none; font-weight: 600;
}
.links-list a:hover { background: var(--green-50); }
.links-list a::after { content: "→"; color: var(--green); }
.links-list small { display: block; color: var(--muted); font-weight: 400; font-size: 14px; }

/* Батькам і учням */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.tile:hover { border-color: var(--green); }
.tile b { font-size: 18px; }
.tile span { color: var(--muted); font-size: 15px; }
.tile svg { width: 30px; height: 30px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Партнери */
.partners { padding: 36px 0; border-top: 1px solid var(--line); }
.partners .wrap { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; justify-content: center; }
.partners h2 { font-size: 15px; font-weight: 600; color: var(--muted); }
.partners a { display: block; border-radius: 10px; }
.partners img { width: 176px; height: 96px; object-fit: cover; filter: grayscale(1); opacity: .85; transition: filter .2s, opacity .2s; }
.partners a:hover img { filter: none; opacity: 1; }

/* ---------- Футер ---------- */
.footer { background: var(--green-900); color: #d7e4dc; padding: 56px 0 28px; font-size: 16px; }
.footer a { color: #fff; }
.footer .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 40px; }
.footer h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 0 0 8px; }
.footer .brand { color: #fff; margin-bottom: 14px; }
.footer .brand small { color: #b8cbbf; }
.map {
  display: grid; place-items: center; text-align: center; min-height: 150px; padding: 16px;
  border: 1px dashed rgb(255 255 255 / 35%); border-radius: var(--radius); color: #b8cbbf; font-size: 14px;
}
.footer-bottom {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / 15%); font-size: 14px; color: #b8cbbf;
}

/* ---------- Сторінка новини ---------- */
.crumbs { font-size: 14px; color: var(--muted); padding: 22px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: #a3aca6; }
.crumbs a { color: var(--muted); }

.article { padding: 22px 0 56px; }
.article-head { max-width: 820px; }
.article-head h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; margin: 14px 0 0; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; margin-top: 28px; align-items: start; }
.lead-photo { margin: 0 0 28px; }
.lead-photo img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 4 / 3; object-fit: cover; }
.lead-photo figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.prose { font-size: 18px; max-width: 70ch; }
.prose p { margin: 0 0 18px; }
.prose .wins { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.prose .wins li {
  display: flex; gap: 12px; align-items: center; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-weight: 700;
}
.medal { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--green-900); font-weight: 800; font-size: 15px; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.tags a { font-size: 14px; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--muted); }

.gallery-head { display: flex; justify-content: space-between; align-items: baseline; margin: 40px 0 14px; }
.gallery-head h2 { font-size: 24px; font-weight: 800; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery a { display: block; border-radius: 12px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .25s; }
.gallery a:hover img { transform: scale(1.04); }

.share { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); align-items: center; }
.share b { margin-right: 6px; }
.share .btn { min-height: 44px; padding: 8px 16px; font-size: 15px; }

.aside { position: sticky; top: 100px; display: grid; gap: 18px; }
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.aside-box h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.mini { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; position: relative; padding: 10px 0; }
.mini + .mini { border-top: 1px solid var(--line); }
.mini img { width: 84px; height: 64px; object-fit: cover; border-radius: 10px; }
.mini a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.35; }
.mini a::after { content: ""; position: absolute; inset: 0; }
.mini time { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Перегляд фото на весь екран */
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgb(8 14 11 / 94%);
  display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: 56px 12px 40px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: calc(100vh - 110px); width: auto; margin: 0 auto; border-radius: 8px; }
.lightbox button {
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(255 255 255 / 12%); color: #fff; font-size: 26px; line-height: 1;
}
.lightbox button:hover { background: rgb(255 255 255 / 24%); }
.lightbox .lb-close { position: absolute; top: 12px; right: 16px; }
.lightbox .lb-count { position: absolute; top: 24px; left: 24px; color: #cfd8d3; font-size: 15px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .burger { display: inline-grid; }
  .header .actions { margin-left: auto; display: flex; gap: 8px; }
  .hero .wrap, .about .wrap { grid-template-columns: 1fr; gap: 36px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .aside { position: static; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .topbar { display: none; }
  .header .wrap { min-height: 64px; gap: 12px; }
  .brand img { width: 34px; height: 42px; }
  .brand b { font-size: 16px; }
  .brand small { display: none; }
  .icon-btn { width: 44px; height: 44px; }
  .hero { padding: 24px 0 28px; }
  .hero .wrap { gap: 22px; }
  .hero-photo { order: -1; }
  .hero-photo img { aspect-ratio: 16 / 10; border-radius: var(--radius); }
  .motto { left: 12px; bottom: 12px; padding: 10px 14px; font-size: 13px; }
  .motto b { font-size: 15px; }
  .hero h1 { margin: 10px 0 12px; }
  .hero .lead { font-size: 17px; margin-bottom: 20px; }
  .quick { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick a { flex-direction: row; align-items: center; padding: 14px; font-size: 15px; }
  .quick svg { width: 24px; height: 24px; flex: none; }
  .section { padding: 40px 0; }
  .section-head { flex-direction: column; align-items: start; gap: 8px; }
  .cards, .tiles { grid-template-columns: 1fr; }
  .cards { gap: 16px; }
  .card h3 { font-size: 18px; }
  .facts .wrap { grid-template-columns: 1fr 1fr; gap: 24px; }
  .partners .wrap { gap: 8px 16px; }
  .partners h2 { width: 100%; text-align: center; }
  .partners img { width: 104px; height: 64px; }
  /* компактні картки новин на телефоні */
  .cards .card { display: grid; grid-template-columns: 112px 1fr; }
  .cards .card img { height: 100%; min-height: 112px; aspect-ratio: auto; }
  .cards .card-body { padding: 12px 14px; gap: 6px; }
  .cards .card p { display: none; }
  .cards .card h3 { font-size: 16px; line-height: 1.3; }
  .cards .meta { font-size: 13px; gap: 8px; }
  .cards .chip { display: none; }
  .footer .cols { grid-template-columns: 1fr; gap: 30px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .prose { font-size: 17px; }
  .lightbox { grid-template-columns: 1fr; padding: 56px 8px 80px; }
  .lightbox .lb-prev, .lightbox .lb-next { position: absolute; bottom: 16px; }
  .lightbox .lb-prev { left: calc(50% - 64px); }
  .lightbox .lb-next { right: calc(50% - 64px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.section.tight { padding-top: 8px; }

/* Зони натискання не менше 32 px (WCAG 2.2, 2.5.8) */
.footer li { margin: 0 0 2px; }
.footer li a { display: inline-block; padding: 6px 0; }
.crumbs a { display: inline-block; padding: 6px 0; }
.tags a { display: inline-block; padding: 7px 12px; }
.more { display: inline-block; padding: 6px 0; }
.topbar a { display: inline-block; padding: 9px 0; }

/* Головна новина: на всю ширину, фото зліва в натуральному розмірі (фото з Facebook ~590 px) */
@media (min-width: 1081px) {
  .cards-featured .card:first-child { grid-column: 1 / -1; flex-direction: row; }
  .cards-featured .card:first-child img { width: 50%; max-width: 590px; aspect-ratio: 3 / 2; flex: none; }
  .cards-featured .card:first-child .card-body { padding: 32px 36px; justify-content: center; gap: 14px; }
  .cards-featured .card:first-child h3 { font-size: 28px; }
  .cards-featured .card:first-child p { font-size: 17.5px; -webkit-line-clamp: 4; }
  .cards-featured .card:not(:first-child) p { -webkit-line-clamp: 2; }
}
@media (min-width: 721px) and (max-width: 1080px) {
  .cards-featured .card:first-child { grid-column: 1 / -1; }
  .cards-featured .card:first-child img { aspect-ratio: 2 / 1; }
}

/* Галерея: показати 6, решта — за кнопкою «+N» */
.gallery .g-more { position: relative; }
.gallery .g-more span {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgb(22 61 45 / 72%); color: #fff; font-size: 26px; font-weight: 800; border-radius: 12px;
}
.gallery .g-hidden { display: none; }
/* Те саме ще до виконання site.js (клас js ставиться в <head>), щоб приховані фото не вантажились */
.js .prose .gallery > a:nth-of-type(n+7),
.js .prose .gallery > .gallery-item:nth-of-type(n+7) { display: none; }

/* Попередня / наступна новина */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.pager a {
  display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.35;
}
.pager a:hover { border-color: var(--green); }
.pager small { display: block; font-weight: 600; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.pager .next { text-align: right; }

@media (max-width: 720px) {
  .quick { max-width: none; }
  .quick a { padding: 12px 14px; min-height: 52px; }
  .cards-featured .card:first-child { display: flex; grid-template-columns: none; }
  .cards-featured .card:first-child img { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .cards-featured .card:first-child .card-body { padding: 14px 16px 18px; }
  .cards-featured .card:first-child h3 { font-size: 19px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}
@media (max-width: 720px) {
  .cards-featured .card:first-child p { display: -webkit-box; -webkit-line-clamp: 2; }
}
@media (max-width: 720px) {
  /* портретні фото не розтягують компактну картку */
  .cards .card img { contain: size; contain-intrinsic-size: 112px 112px; height: 100%; }
  .cards-featured .card:first-child img { contain: none; height: auto; }
}
.crumbs ol { align-items: center; }
.tags span { display: inline-block; font-size: 14px; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.partners img { mix-blend-mode: multiply; }
@media (max-width: 720px) {
  .tile { display: grid; grid-template-columns: 28px 1fr; column-gap: 14px; row-gap: 2px; padding: 16px; align-items: start; }
  .tile svg { grid-row: span 2; width: 26px; height: 26px; }
}

/* ======================================================================
   Доповнення для WordPress
   ====================================================================== */

.admin-bar .header { top: 32px; }
@media (max-width: 782px) { .admin-bar .header { top: 46px; } }

.muted { color: var(--muted); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-light { background: #fff; color: var(--green-900); }
.btn-light:hover { background: var(--green-50); color: var(--green-900); }
.chip { text-decoration: none; }
a.chip:hover { background: var(--green); color: #fff; }

/* Картка без фото */
.thumb-ph { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 2; background: var(--green-50); }
.thumb-ph svg { width: 40px; height: 40px; fill: none; stroke: var(--green); stroke-width: 1.5; }
.mini .thumb-ph { width: 84px; height: 64px; aspect-ratio: auto; border-radius: 10px; }
.mini .thumb-ph svg { width: 24px; height: 24px; }
.mini time { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }


/* Стрічки: новини, рубрики, пошук */
.list { padding: 18px 0 56px; }
.list-head { margin-bottom: 26px; }
.list-head h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; margin: 10px 0 18px; }
.list .cards p { -webkit-line-clamp: 2; }
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.pagination .page-numbers.current { background: var(--green); border-color: var(--green); color: #fff; }
.pagination .page-numbers.dots { border: 0; background: none; }
.pagination a.page-numbers:hover { border-color: var(--green); }
.search-inline { display: flex; gap: 10px; max-width: 620px; margin-bottom: 10px; }
.search-inline input {
  flex: 1; min-width: 0; font: inherit; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--surface);
}
.search-inline input:focus { border-color: var(--green); outline: none; }
.empty { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* 404 */
.notfound { max-width: 720px; padding: 64px 0 72px; }
.notfound h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; margin: 14px 0 14px; }
.notfound .lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.notfound .search-inline { margin-bottom: 26px; }

/* Сторінки */
.page-article { padding: 22px 0 56px; }
.page-article .article-head { max-width: 860px; margin-bottom: 26px; }
.page-article .article-head h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; margin: 10px 0 0; }
.page-article .lead { font-size: 19px; color: var(--muted); margin: 14px 0 0; }
.page-prose { max-width: 860px; }
.child-pages { max-width: 860px; margin-top: 32px; }

/* Вміст записів і сторінок */
.prose { overflow-wrap: anywhere; }
/* Текст, скопійований з Facebook, приходить блоками <div> замість абзаців */
.prose > div:not(.gallery):not(.wp-video) { margin: 0 0 16px; }
.prose > div > div { margin: 0 0 4px; }
.prose h2 { font-size: 26px; font-weight: 800; margin: 34px 0 12px; }
.prose h3 { font-size: 21px; font-weight: 700; margin: 26px 0 10px; }
.prose h4 { font-size: 18px; margin: 22px 0 8px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 18px; }
.prose li { margin: 0 0 6px; }
.prose a { color: var(--green-700); }
.prose img { border-radius: 10px; }
.prose blockquote { margin: 22px 0; padding: 14px 20px; border-left: 4px solid var(--green); background: var(--surface); border-radius: 0 12px 12px 0; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 22px; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--green-50); }
.prose iframe { max-width: 100%; }
.prose .wp-video, .prose .wp-video-shortcode, .prose video { width: 100% !important; max-width: 100%; height: auto; border-radius: 12px; }
.prose div[style*="width"] { max-width: 100%; }
.prose .wp-caption { max-width: 100%; }
.prose .wp-caption-text, .prose figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.prose .alignleft { float: left; margin: 4px 22px 14px 0; max-width: 50%; }
.prose .alignright { float: right; margin: 4px 0 14px 22px; max-width: 50%; }
.prose .aligncenter { display: block; margin: 0 auto 18px; }
.prose > div > a > img, .prose p > a > img { display: inline-block; }
.prose .gallery { margin: 24px 0; }
.prose .gallery img { border-radius: 0; height: 100%; }
.prose .gallery .gallery-item { margin: 0; }
.prose .gallery .gallery-icon a { display: block; border-radius: 12px; overflow: hidden; position: relative; }
.prose .gallery .gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.prose .gallery .gallery-caption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.prose .gallery br { display: none; }

/* Розділи-акордеони (шаблон «Сторінка з розділами») */
.section-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; }
.section-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; cursor: pointer; list-style: none;
}
.section-item summary::-webkit-details-marker { display: none; }
.section-item summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--green); border-bottom: 2px solid var(--green);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.section-item[open] summary::after { transform: rotate(225deg) translateY(-3px); }
.section-item summary h2 { font-size: 19px; font-weight: 700; margin: 0; }
.section-item summary:hover h2 { color: var(--green-900); }
.section-item .section-body { padding: 0 22px 18px; }

@media (max-width: 720px) {
  .search-inline { flex-direction: column; }
  .prose .alignleft, .prose .alignright { float: none; margin: 0 0 14px; max-width: 100%; }
  .section-item summary { padding: 16px; }
  .section-item .section-body { padding: 0 16px 16px; }
  .notfound { padding: 36px 0 48px; }
}
.footer-bottom a { display: inline-block; padding: 6px 0; }
