/*
Theme Name: Самоврядна громада
Template: twentytwentyfive
Description: Дочірня тема Twenty Twenty-Five для ГО «Самоврядна громада» (vyhid-e.org.ua), концепт «Рух». Без плагінів.
Version: 2.0.0
Text Domain: vyhid-e
*/

:root {
	--vx-navy: var(--wp--preset--color--accent-3);
	--vx-blue: var(--wp--preset--color--accent-1);
	--vx-yellow: var(--wp--preset--color--accent-2);
	--vx-pink: var(--wp--preset--color--accent-4);
	--vx-muted: var(--wp--preset--color--accent-6);
	--vx-display: var(--wp--preset--font-family--unbounded);
}

/* ---------- Посилання ---------- */
/* Текстові посилання: тонке підкреслення кольору посилання, при наведенні — пурпурове й товстіше. */
a { transition: color .15s, text-decoration-color .15s, text-decoration-thickness .15s; }
/* Лише в тексті статей і звичайних сторінок — картки, плитки й смуги мають власні кольори. */
.vx-prose a, .wp-block-post-content > p a, .wp-block-post-content > ul a, .wp-block-post-content > ol a {
	color: var(--vx-blue);
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: .22em;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
.vx-prose a:hover, .wp-block-post-content > p a:hover, .wp-block-post-content > ul a:hover, .wp-block-post-content > ol a:hover {
	color: var(--vx-pink);
	text-decoration-color: currentColor;
	text-decoration-thickness: 2px;
}
/* Зовнішні посилання в статтях — маленька стрілка «назовні». */
.vx-prose a[href^="http"]:not([href*="vyhid-e."]):not(:has(img))::after {
	content: "↗"; display: inline-block; margin-left: .15em; font-size: .8em; text-decoration: none;
}
/* Заголовки-посилання (картки, стрічки) — без підкреслення, колір при наведенні. */
main .wp-block-post-title a, .vx-related-card, .vx-tile a { text-decoration: none !important; }
/* Кольорові плитки: посилання бере колір самої плитки (білий на пурпуровій і синій, темний на жовтій). */
main .vx-tile a, main .vx-tile a:hover { color: inherit !important; }
.vx-tile:hover h3 a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: .2em; }
.vx-cards .wp-block-post-title a, .vx-news .wp-block-post-title a { color: var(--vx-navy); }
.vx-lead .wp-block-post-title a, .vx-lead .vx-lead-text a { color: #fff; }
.vx-lead .wp-block-post-terms a { color: var(--vx-yellow); }
main .wp-block-post-title a:hover, .vx-lead .wp-block-post-title a:hover { color: var(--vx-pink); }
.vx-lead .wp-block-post-title a:hover { color: var(--vx-yellow); }
/* «Усі новини →», «Канал …→»: жирні, стрілка зсувається при наведенні. */
.vx-more a { font-weight: 700; text-decoration: none !important; color: var(--vx-navy); display: inline-flex; align-items: center; gap: .35em; }
.vx-more a::after { content: "→"; transition: transform .15s; }
.vx-more a:hover { color: var(--vx-pink); }
.vx-more a:hover::after { transform: translateX(4px); }
/* Посилання на темному тлі (підвал, темні смуги) — білі, підкреслення жовте при наведенні. */
.has-accent-3-background-color a:not(.wp-element-button), .has-accent-4-background-color a:not(.wp-element-button) {
	color: #fff; text-decoration: none;
}
.has-accent-3-background-color a:not(.wp-element-button):hover, .has-accent-4-background-color a:not(.wp-element-button):hover {
	color: var(--vx-yellow); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .22em;
}
/* Видимий фокус для клавіатури. */
a:focus-visible, button:focus-visible { outline: 3px solid var(--vx-yellow); outline-offset: 3px; border-radius: 4px; }

/* ---------- Шапка ---------- */
.vx-header { z-index: 50; }
.vx-brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; }
.vx-brand img { width: 58px; height: auto; flex: none; }
.vx-brand span { font-family: var(--vx-display); font-weight: 700; font-size: 1rem; line-height: 1.1; }
.vx-header .wp-block-navigation a { text-decoration: none; }
.vx-header .wp-block-navigation a:hover { color: var(--vx-yellow); }
.vx-header .wp-block-search__button { background: transparent; color: #fff; border: 0; }
.vx-social .wp-social-link a { padding: .15rem; }
.wp-block-button__link { white-space: nowrap; }

/* Меню згортається в кнопку вже на планшетах */
@media (min-width: 600px) and (max-width: 1100px) {
	.vx-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.vx-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
}
@media (max-width: 599px) {
	.vx-social { display: none !important; }
	.vx-brand { gap: .5rem; }
	.vx-brand span { font-size: .82rem; }
	.vx-brand img { width: 42px; }
	.vx-header .wp-block-group { gap: .6rem !important; }
	.vx-header .vx-pill .wp-block-button__link { padding: .45rem .8rem !important; font-size: .85rem; }
}

/* ---------- Банер ---------- */
.vx-hero { position: relative; overflow: hidden; }
.vx-badge { display: inline-block; background: var(--vx-blue); color: #fff; font-weight: 700; font-size: .9rem; padding: .4rem .85rem; border-radius: 999px; margin: 0; }
.vx-hero h1 { color: #fff; font-size: clamp(2.1rem, 4.4vw, 3.7rem); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; overflow-wrap: normal; word-break: normal; hyphens: manual; }

/* Без білих смуг між секціями, шапкою й підвалом */
.wp-site-blocks > * + * { margin-block-start: 0; }
@media (max-width: 599px) { .vx-hero h1 { font-size: 6.6vw; } }
.vx-hl { background: linear-gradient(transparent 62%, var(--vx-yellow) 62%); padding: 0 .1em; }
.vx-hero-art { background: var(--wp--preset--color--accent-5); border-radius: 28px; padding: 18px; transform: rotate(-2deg); }
.vx-hero-art img { mix-blend-mode: multiply; border-radius: 16px; width: 100%; height: auto; display: block; }
.vx-hero .is-style-outline .wp-block-button__link { border: 2px solid #fff; color: #fff; background: transparent; }
.vx-hero .is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--vx-navy); }

/* ---------- Кольорові картки поверх нижнього краю банера ---------- */
.vx-tiles { position: relative; margin-top: -3.2rem !important; z-index: 2; }
.vx-tile { border-radius: 22px; position: relative; height: 100%; transition: transform .15s; }
.vx-tile:hover { transform: translateY(-4px); }
.vx-tile h3 { font-size: 1.35rem; margin: 0 0 .4rem; color: inherit; }
.vx-tile p { margin: 0; }
.vx-tile a { color: inherit; text-decoration: none; }
.vx-tile a::after { content: ""; position: absolute; inset: 0; }

/* ---------- Відео ---------- */
.vx-videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
@media (max-width: 900px) { .vx-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .vx-videos { grid-template-columns: 1fr; } }
.vx-yt { margin: 0; }
.vx-yt button { all: unset; cursor: pointer; display: block; position: relative; width: 100%; aspect-ratio: 16/10; border-radius: 16px; overflow: hidden; background: #000; }
.vx-yt img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .15s, transform .3s; }
.vx-yt button:hover img, .vx-yt button:focus-visible img { opacity: 1; transform: scale(1.03); }
.vx-yt button:focus-visible { outline: 3px solid var(--vx-pink); outline-offset: 3px; }
.vx-yt button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 58px; height: 40px; margin: -20px 0 0 -29px; border-radius: 11px; background: #e62117 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/24px no-repeat; }
.vx-yt iframe { width: 100%; aspect-ratio: 16/10; height: auto; border: 0; border-radius: 16px; display: block; }
.vx-yt figcaption { margin-top: .55rem; font-weight: 600; line-height: 1.35; }
.vx-yt-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; aspect-ratio: 16/10; border-radius: 16px; background: var(--vx-yellow); color: var(--vx-navy); text-decoration: none; font-family: var(--vx-display); font-weight: 700; text-align: center; padding: 1rem; }
.vx-yt-more:hover { background: var(--vx-pink); color: #fff; }

/* ---------- Хроніка ---------- */
.vx-lead .wp-block-post { position: relative; border-radius: 22px; overflow: hidden; min-height: 420px; background: var(--vx-navy); }
.vx-lead .wp-block-post-featured-image { position: absolute; inset: 0; margin: 0; }
.vx-lead .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.vx-lead .vx-lead-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 1.6rem; background: color-mix(in srgb, var(--vx-navy) 90%, transparent); color: #fff; }
.vx-lead .vx-lead-text a { color: #fff; text-decoration: none; }
.vx-lead .wp-block-post-terms > :not(:first-child) { display: none; } /* лише перша рубрика */
.vx-lead .wp-block-post-title { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.75rem); line-height: 1.2; }
.vx-cards .wp-block-post { border: 2px solid var(--vx-navy); border-radius: 22px; overflow: hidden; }
.vx-cards .wp-block-post-featured-image { margin: 0; }
.vx-cards .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.vx-cards .vx-card-text { padding: 1rem 1.15rem 1.2rem; }
.vx-cards .wp-block-post-title { font-family: var(--wp--preset--font-family--manrope); font-weight: 800; font-size: 1.1rem; line-height: 1.3; margin: 0; }
.vx-cards .wp-block-post-title a { color: var(--vx-navy); text-decoration: none; }
.vx-cards .wp-block-post-title a:hover { color: var(--vx-pink); }

/* Сторінка «Новини»: сітка карток і посторінкова навігація */
.vx-news .wp-block-post-template { gap: 1.25rem; }
.vx-news .wp-block-post { display: flex; flex-direction: column; }
.vx-news .wp-block-post-terms > :not(:first-child) { display: none; }
.vx-news .wp-block-post-terms a { color: var(--vx-pink); text-decoration: none; }
.vx-news .wp-block-post-excerpt__excerpt { margin: 0; color: var(--vx-muted); }
.vx-news .wp-block-post-excerpt__more-text { display: none; }
@media (max-width: 900px) { .vx-news .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 560px) { .vx-news .wp-block-post-template { grid-template-columns: 1fr !important; } }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { display: inline-block; min-width: 2.6rem; padding: .55rem .8rem; border: 2px solid var(--vx-navy); border-radius: 12px; text-align: center; text-decoration: none; color: var(--vx-navy); font-weight: 700; }
.wp-block-query-pagination .page-numbers.current, .wp-block-query-pagination a:hover { background: var(--vx-navy); color: #fff; }
.wp-block-query-pagination .page-numbers.dots { border: 0; }

/* ---------- Як це працює ---------- */
.vx-steps { counter-reset: step; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.vx-steps li { counter-increment: step; }
.vx-steps li::before { content: counter(step); display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: .8rem; border-radius: 50%; font-family: var(--vx-display); font-weight: 800; font-size: 1.3rem; color: var(--vx-navy); background: var(--vx-yellow); }
.vx-steps strong { display: block; font-family: var(--vx-display); color: var(--vx-navy); margin-bottom: .3rem; }

/* ---------- Рубрики «хмаркою» ---------- */
.vx-chips ul, ul.vx-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.vx-chips li { margin: 0; }
.vx-chips li a { display: inline-block; padding: .45rem 1rem; border: 2px solid var(--vx-navy); border-radius: 999px; text-decoration: none; color: var(--vx-navy); font-weight: 600; }
.vx-chips li a:hover { background: var(--vx-navy); color: #fff; }
.vx-chips .cat-item-1 { display: none; } /* «Без категорії» */

/* ---------- Підтримати ---------- */
.vx-pay { display: grid; gap: .8rem; }
.vx-pay-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-radius: 16px; background: #fff; color: var(--vx-navy); }
.vx-pay-card span { display: block; font-size: .85rem; color: var(--vx-muted); }
.vx-pay-card code { font-family: inherit; font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; background: none; }
.vx-copy { cursor: pointer; border: 0; background: var(--vx-yellow); color: var(--vx-navy); border-radius: 10px; padding: .6rem 1rem; font: inherit; font-weight: 700; white-space: nowrap; }
.vx-copy:hover { background: var(--vx-navy); color: #fff; }
.vx-copy.is-done { background: #fff; outline: 2px solid var(--vx-navy); }
.vx-big { font-family: var(--vx-display); font-weight: 800; line-height: 1.02; }

/* ---------- Стаття ---------- */
.vx-article-band { padding: clamp(2rem, 5vw, 3.5rem) 1.25rem 6.5rem; }
.vx-pills { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .8rem; font-weight: 700; }
.vx-pills a { background: var(--vx-yellow); color: var(--vx-navy); text-decoration: none; padding: .3rem .75rem; border-radius: 999px; }
.vx-pills a:nth-of-type(n+3) { display: none; } /* не більше двох рубрик */
.vx-pills a:hover { background: #fff; }
.vx-article-title { color: #fff !important; font-size: clamp(1.75rem, 3.4vw, 2.7rem); line-height: 1.15; margin: 1rem 0 1.1rem; overflow-wrap: normal; letter-spacing: -.01em; }
.vx-meta { gap: .3rem 0; color: #C9D2E6; font-size: .95rem; }
.vx-meta > * { margin: 0; }
.vx-meta, .vx-meta a, .vx-meta time { color: #C9D2E6 !important; }
.vx-meta > * + *::before { content: "·"; margin: 0 .7rem; }
.vx-article-hero-wrap { margin-top: -5rem !important; padding-inline: 1.25rem; position: relative; z-index: 2; }
.vx-article-hero { margin: 0; }
.vx-article-hero img { border-radius: 22px; max-height: 540px; width: 100%; object-fit: cover; box-shadow: 0 18px 40px -20px rgba(14,34,70,.45); }
.vx-article-body { padding: 2.2rem 1.25rem 0; }
/* Якщо головного фото немає — текст не налазить на смугу */
.vx-article-hero-wrap:not(:has(img)) { margin-top: 0 !important; }
.vx-article-band:has(+ .vx-article-hero-wrap:not(:has(img))) { padding-bottom: 2.5rem; }

.vx-prose { font-size: 1.2rem; line-height: 1.75; color: #1d2236; }
.vx-prose > * { margin-block: 0 1.1em; }
.vx-prose p { text-indent: 0; }
/* Текст статті — по ширині, з переносами слів (щоб не було великих проміжків). На телефоні — по лівому краю. */
@media (min-width: 600px) {
	.vx-prose > p:not(.has-text-align-center):not([style*="center"]):not([style*="right"]),
	.vx-prose li { text-align: justify; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 7 3 3; }
}
.vx-prose > p:first-child { font-size: 1.25rem; line-height: 1.6; color: var(--vx-navy); }
.vx-prose a { color: var(--vx-blue); text-underline-offset: 3px; }
.vx-prose strong { color: var(--vx-navy); }
.vx-prose h2 { font-size: 1.55rem; margin-top: 2.2rem; }
.vx-prose h3 { font-size: 1.25rem; margin-top: 1.8rem; }
.vx-prose img { border-radius: 14px; height: auto; max-width: 100%; }
.vx-prose .alignleft { float: left; margin: .3rem 1.5rem 1rem 0; max-width: 50%; }
.vx-prose .alignright { float: right; margin: .3rem 0 1rem 1.5rem; max-width: 50%; }
.vx-prose .aligncenter { display: block; margin-inline: auto; }
.vx-prose::after { content: ""; display: block; clear: both; }
.vx-prose blockquote { margin: 1.6rem 0; padding: .3rem 0 .3rem 1.3rem; border-left: 5px solid var(--vx-yellow); font-size: 1.15rem; font-style: italic; }
.vx-prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.vx-prose td, .vx-prose th { border: 1px solid #d5d8e0; padding: .5rem .7rem; }
.vx-prose iframe[src*="youtube"] { width: 100%; height: auto; aspect-ratio: 16/9; border: 0; border-radius: 14px; }
.vx-prose .gallery { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; margin: 1.5rem 0 !important; }
.vx-prose .gallery-item { width: auto !important; margin: 0 !important; }
.vx-prose .gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; border: 0 !important; border-radius: 12px; }
.vx-prose .gallery br { display: none; }
.vx-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; font-size: .9rem; }
.vx-tags a { padding: .25rem .8rem; border-radius: 999px; background: var(--wp--preset--color--accent-5); color: var(--vx-navy); text-decoration: none; }
.vx-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.5rem 0; padding: 1rem 0; border-block: 1px solid #e3e5ec; }
.vx-share span { font-weight: 700; margin-right: .3rem; }
.vx-share a, .vx-share button { font: inherit; font-size: .9rem; font-weight: 600; padding: .45rem .9rem; border-radius: 999px; border: 2px solid var(--vx-navy); background: none; color: var(--vx-navy); text-decoration: none; cursor: pointer; }
.vx-share a:hover, .vx-share button:hover { background: var(--vx-navy); color: #fff; }
.vx-support-box { border-radius: 18px; align-items: center; margin-top: 1.5rem; }
.vx-support-box p { margin: 0; }
.vx-related-wrap { padding: 3.5rem 1.25rem 0; }
.vx-related h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1.2rem; }
.vx-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.vx-related-card { display: flex; flex-direction: column; border: 2px solid var(--vx-navy); border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--vx-navy); transition: transform .15s; }
.vx-related-card:hover { transform: translateY(-3px); }
.vx-related-card img, .vx-related-noimg { width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--wp--preset--color--accent-5); }
.vx-related-date { padding: .9rem 1.1rem 0; font-size: .82rem; color: var(--vx-muted); }
.vx-related-title { padding: .3rem 1.1rem 1.1rem; font-weight: 800; line-height: 1.3; }
@media (max-width: 800px) { .vx-related-grid { grid-template-columns: 1fr; } .vx-article-band { padding-bottom: 5rem; } .vx-article-hero-wrap { margin-top: -3.5rem !important; } }

/* PDF у статті */
.vx-pdf { margin: 1.8rem 0; border: 2px solid var(--vx-navy); border-radius: 16px; overflow: hidden; }
.vx-pdf object { display: block; width: 100%; height: min(85vh, 900px); }
.vx-pdf-fallback { padding: 1.2rem; margin: 0; }
.vx-pdf figcaption { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; padding: .8rem 1rem; background: var(--wp--preset--color--accent-5); }
.vx-pdf figcaption span { flex: 1; font-weight: 600; }
.vx-pdf-tag { display: inline-block; background: var(--vx-pink); color: #fff; border-radius: 6px; padding: .05rem .4rem; font-size: .75rem; margin-right: .3rem; }
.vx-pdf-btn { background: var(--vx-navy); color: #fff !important; text-decoration: none; border-radius: 10px; padding: .45rem .9rem; font-weight: 700; }
.vx-pdf-btn:hover { background: var(--vx-pink); }
@media (max-width: 700px) { .vx-pdf object { height: 70vh; } }

/* Архів по роках, пошук, «хлібні крихти» */
.vx-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.vx-year { border: 2px solid var(--vx-navy); border-radius: 18px; padding: 1rem 1.1rem; }
.vx-year h3 { margin: 0 0 .7rem; display: flex; justify-content: space-between; align-items: baseline; font-size: 1.4rem; }
.vx-year h3 a { color: var(--vx-navy); text-decoration: none; }
.vx-year h3 span { font-family: var(--wp--preset--font-family--manrope); font-size: .85rem; color: var(--vx-muted); font-weight: 600; }
.vx-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
.vx-months a, .vx-months span { text-align: center; padding: .3rem 0; border-radius: 8px; font-size: .85rem; }
.vx-months a { background: var(--vx-navy); color: #fff; text-decoration: none; font-weight: 700; }
.vx-months a:hover { background: var(--vx-pink); }
.vx-months span { color: #b7bccb; }
.vx-search { max-width: 640px; margin-block: 1rem 2rem; }
.vx-search .wp-block-search__input { border: 2px solid var(--vx-navy); border-radius: 12px; padding: .7rem 1rem; font: inherit; }
.vx-search .wp-block-search__button { background: var(--vx-navy); color: #fff; border: 0; border-radius: 12px; padding: .7rem 1.2rem; font-weight: 700; }
.vx-crumb { font-size: .9rem; margin-bottom: .2rem; }
.vx-crumb a { color: var(--vx-muted); }

/* Посилання з головної на секції не ховаються під липкою шапкою */
:target { scroll-margin-top: 6rem; }
