/*
CTC Separate Stylesheet
Updated: 2026-04-18 20:15:16
*/


/* ============================================================
 * newdesign — post card grid (home + category archives)
 * 4 cards per row on desktop, 3 on tablet, 2 on mobile.
 * ============================================================ */

.nd-container {
	max-width: 1240px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

.nd-archive-header {
	margin: 0 0 20px;
}
.nd-page-title {
	font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
	margin: 0 0 6px;
	line-height: 1.2;
}
.nd-page-subtitle {
	margin: 0;
	color: #6b7280;
	font-size: 0.95rem;
}

/* Grid */
.nd-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
@media (max-width: 1024px) {
	.nd-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (max-width: 640px) {
	.nd-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.nd-container { padding: 16px 12px 32px; }
}

/* Card */
.c-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.c-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.08);
	border-color: #d4d4d8;
}

.c-img {
	position: relative;
	aspect-ratio: 3 / 4; /* vertical flyer ratio */
	background: #f3f4f6;
	overflow: hidden;
}
.c-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.c-t {
	padding: 10px 12px 14px;
	font-size: 0.92rem;
	font-weight: 500;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
@media (max-width: 640px) {
	.c-t {
		padding: 8px 10px 10px;
		font-size: 0.82rem;
	}
}

.badge-new {
	position: absolute;
	top: 8px;
	left: 8px;
	background: #e60023;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 3px 8px;
	border-radius: 4px;
	z-index: 2;
}

/* Pagination */
.nd-pagination {
	margin: 32px 0 0;
}
.nd-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}
.nd-pagination .page-numbers {
	display: inline-block;
	padding: 7px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
	font-size: 0.9rem;
}
.nd-pagination .page-numbers:hover {
	background: #f3f4f6;
}
.nd-pagination .page-numbers.current {
	background: #1a1a1a;
	color: #fff;
	border-color: #1a1a1a;
}

.nd-empty {
	padding: 40px 0;
	text-align: center;
	color: #6b7280;
}

/* ============================================================
 * newdesign — patch 2026-04-19
 *   #1 NEW badge: green + glow, larger on desktop
 *   #2 card title centered
 *   #3 archive H1 + subtitle centered
 * ============================================================ */

/* #2 — center card title */
.c-t {
	text-align: center;
}

/* #3 — center page H1 + subtitle */
.nd-archive-header {
	text-align: center;
}

/* #1 — green NEW badge with subtle glow that survives green thumbnails */
.badge-new {
	background: #16a34a;             /* green-600 */
	color: #fff;
	box-shadow:
		0 0 0 1.5px rgba(255, 255, 255, 0.9),     /* white separator ring */
		0 0 8px 1px rgba(22, 163, 74, 0.75),      /* close green glow */
		0 0 16px 3px rgba(22, 163, 74, 0.45);     /* outer green glow */
}
@media (min-width: 769px) {
	.badge-new {
		font-size: 0.82rem;          /* was 0.7rem */
		padding: 4px 11px;           /* was 3px 8px */
		top: 10px;
		left: 10px;
	}
}

/* ============================================================
 * newdesign — patch 2026-04-19 (b)
 *   Desktop grid: 5 cards per row (overrides earlier repeat(4)).
 *   Tablet stays 3, mobile stays 2.
 * ============================================================ */
@media (min-width: 1025px) {
	.nd-grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* ============================================================
 * newdesign — patch 2026-04-19 (c)
 *   AdSense placeholder slots + infinite scroll loader/sentinel.
 *   Reserved heights = no CLS when real <ins class="adsbygoogle"> swaps in.
 * ============================================================ */

/* Common slot styling */
.nd-ad-slot {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	margin: 16px auto 24px;
	width: 100%;
	background:
		repeating-linear-gradient(45deg,
			#f3f4f6 0 10px,
			#e9ebef 10px 20px);
	border: 1px dashed #d4d4d8;
	color: #9ca3af;
	font-size: 0.85rem;
}
.nd-ad-placeholder {
	font-weight: 700;
	letter-spacing: 0.18em;
}

/* Header slot — between H1/subtitle and grid */
.nd-ad-slot--header {
	max-width: 1200px;
	height: 280px;
}
@media (max-width: 768px) {
	.nd-ad-slot--header {
		max-width: 300px;
		height: 250px;
	}
}

/* Inline slot — full grid row, JS-inserted between groups of 2 rows */
.nd-grid .nd-ad-slot--inline {
	grid-column: 1 / -1;
	justify-self: center;
	max-width: 1200px;
	height: 280px;
	margin: 4px auto;
}
@media (max-width: 768px) {
	.nd-grid .nd-ad-slot--inline {
		max-width: 300px;
		height: 250px;
	}
}

/* Infinite scroll loader & sentinel */
.nd-loader {
	text-align: center;
	padding: 18px;
	color: #9ca3af;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
}
.nd-sentinel {
	height: 1px;
	width: 100%;
}

/* ============================================================
 * newdesign — single post layout
 *   header → H1 → 30/40/30 row (ad | gallery | ad) → related → ad → content → all-flyers
 * ============================================================ */

.nd-single-header {
	margin: 0 0 18px;
}
.nd-single-title {
	font-size: clamp(1.4rem, 1.05rem + 1vw, 2rem);
	line-height: 1.25;
	margin: 0;
}

/* 30 / 40 / 30 row */
.nd-single-row {
	display: grid;
	grid-template-columns: 30% 40% 30%;
	gap: 16px;
	align-items: start;
	margin: 0 0 28px;
}
@media (max-width: 768px) {
	.nd-single-row {
		grid-template-columns: 1fr;
		gap: 12px;
	}
}

.nd-single-col {
	min-width: 0;        /* prevents grid item from blowing out */
}
.nd-single-col--ad {
	display: flex;
	justify-content: center;
}
.nd-single-col--gallery {
	display: flex;
	justify-content: center;
}

/* Side ad (placeholder; CLS-safe) — desktop half-page, mobile rectangle */
.nd-ad-slot--side {
	width: 100%;
	max-width: 336px;
	height: 600px;
	margin: 0 auto;
}
@media (max-width: 768px) {
	.nd-ad-slot--side {
		max-width: 300px;
		height: 250px;
	}
}

/* Fotorama wrapper — keep gallery 100% of its column */
.nd-flyer {
	width: 100%;
}
.nd-flyer .fotorama,
.nd-flyer .fotorama--wp {
	width: 100% !important;
	max-width: 100%;
}
/* CLS fix: hide background placeholder once fotorama.js has wrapped its content.
   We KEEP aspect-ratio after init — collapsing to auto would cause a momentary
   reflow when wrap is empty. The 0..few-px gap at the bottom is harmless. */
.nd-flyer .fotorama:has(.fotorama__wrap) {
	background-image: none !important;
}
.nd-flyer--single img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

/* Related section */
.nd-related-section {
	margin: 32px 0 24px;
}
.nd-related-title,
.nd-section-title {
	font-size: clamp(1.15rem, 0.95rem + 0.6vw, 1.45rem);
	margin: 0 0 16px;
	text-align: center;
	font-weight: 700;
}
.nd-related-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 14px;
}
@media (max-width: 1024px) {
	.nd-related-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
	.nd-related-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
}

/* Post body — keep readable line length */
.nd-single-content {
	max-width: 720px;
	margin: 24px auto 0;
	line-height: 1.7;
	font-size: 1rem;
}
.nd-single-content p,
.nd-single-content h2,
.nd-single-content h3,
.nd-single-content ul,
.nd-single-content ol {
	margin: 0 0 1em;
}
.nd-single-content img {
	max-width: 100%;
	height: auto;
}

/* "All flyers" section — inherits .nd-grid behavior + JS */
.nd-all-flyers-section {
	margin: 48px 0 0;
}

/* ============================================================
 * newdesign — patch 2026-04-19 (d)
 *   #1 Single H1 centered
 *   #2 Related section: 4 cards on mobile, 5 on desktop/tablet
 * ============================================================ */

.nd-single-title {
	text-align: center;
}

/* Hide the 5th related card on mobile so we get a clean 2×2 = 4 grid */
@media (max-width: 640px) {
	.nd-related-grid > .c-card:nth-child(n+5) {
		display: none;
	}
}

/* ============================================================
 * newdesign — patch 2026-04-19 (e)
 *   Slim header (−35%) + sticky show/hide on scroll
 * ============================================================ */

/* Shrink the main header row to ~52px (80 * 0.65) on all viewports */
#masthead .site-main-header-inner-wrap {
	min-height: 52px;
}
.site-branding .site-title {
	font-size: 18px;
	line-height: 1.2;
}
.site-branding {
	padding: 0;
}
.main-navigation .primary-menu-container > ul > li.menu-item > a {
	padding-top: 0.35em;
	padding-bottom: 0.35em;
}
.mobile-toggle-open-container .menu-toggle-open {
	padding: 0.2em 0.5em;
}
#masthead .site-header-upper-inner-wrap,
#masthead .site-header-inner-wrap {
	min-height: 0;
}

/* Fixed header + show-on-scroll-up / hide-on-scroll-down */
html {
	scroll-padding-top: 56px;
}
body {
	padding-top: 52px;
}
header#masthead.site-header {
	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	z-index: 999;
	transform: translateY(0);
	transition: transform 0.28s ease;
	will-change: transform;
	background: #ffffff;
}
header#masthead.nd-header-scrolled {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
header#masthead.nd-header-hidden {
	transform: translateY(-100%);
}

/* ============================================================
 * newdesign — patch 2026-04-19 (f)
 *   Bigger burger, cleaner drawer, desktop mega-menu
 * ============================================================ */

/* ---- Mobile burger: bigger, better tap target ----------- */
.mobile-toggle-open-container .menu-toggle-open {
	padding: 0.35em 0.65em !important;
	font-size: 18px !important;
}
.mobile-toggle-open-container .menu-toggle-open .menu-toggle-icon {
	font-size: 30px !important;
	line-height: 1;
}
.mobile-toggle-open-container .menu-toggle-open svg {
	width: 30px;
	height: 30px;
}

/* ---- Mobile drawer: remove divider lines between items -- */
.mobile-navigation ul li.menu-item-has-children .drawer-nav-drop-wrap,
.mobile-navigation ul li:not(.menu-item-has-children) a,
.mobile-navigation ul li.menu-item > a {
	border-bottom: 0 !important;
}
.mobile-navigation:not(.drawer-navigation-parent-toggle-true)
	ul li.menu-item-has-children .drawer-nav-drop-wrap button {
	border-left: 0 !important;
}

/* ---- Desktop mega-menu (v2: respects Kadence hover visibility) ---- */
@media (min-width: 1025px) {
	/* Let the parent span full width so submenu can sit centered on page */
	.header-navigation .header-menu-container > ul > li.menu-item-has-children {
		position: static;
	}

	/* Layout for the submenu — applied whether hidden or shown.
	 * We do NOT set `display` here, so Kadence keeps `display:none` by default. */
	.header-navigation .header-menu-container ul ul.sub-menu {
		left: 0 !important;
		right: 0 !important;
		width: min(1200px, 96vw);
		margin: 0 auto;
		padding: 14px 18px;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 2px 10px;
		box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	}

	/* When Kadence reveals the submenu (hover / toggled-on / focus-within),
	 * swap its `display:block` for `display:grid` to get the 4-column layout. */
	.nav--toggle-sub:not(.click-to-open) .header-menu-container li:hover > ul.sub-menu,
	.nav--toggle-sub .header-menu-container li.menu-item--toggled-on > ul.sub-menu,
	.nav--toggle-sub .header-menu-container li:not(.menu-item--has-toggle):focus-within > ul.sub-menu {
		display: grid;
	}

	/* Submenu items */
	.header-navigation .header-menu-container ul ul.sub-menu li.menu-item {
		width: auto;
		border-bottom: 0 !important;
	}
	.header-navigation .header-menu-container ul ul.sub-menu li.menu-item > a {
		width: auto !important;
		padding: 8px 10px !important;
		font-size: 13px;
		white-space: nowrap;
	}
}

/* ============================================================
 * newdesign — patch 2026-04-20 (a)
 *   #1 Mobile: burger closer to right edge (half the right gap)
 *   #2 Light mobile drawer
 *   #3 Light desktop mega-menu
 * ============================================================ */

/* #1 — burger: убираем отступы справа у кнопки и контейнера на мобилке */
@media (max-width: 1024px) {
    .mobile-toggle-open-container {
        padding-right: 0 !important;
        margin-right: 0 !important;
    }
    .mobile-toggle-open-container .menu-toggle-open {
        /* прошлый: 0.35em 0.65em. Справа в два раза меньше: 0.325em */
        padding: 0.35em 0.325em 0.35em 0.65em !important;
    }
    /* страхуемся: если хедер-ряд контейнера задаёт свой правый паддинг */
    #masthead .site-header-row-container-inner,
    #masthead .site-main-header-wrap,
    #masthead .site-main-header-inner-wrap {
        padding-right: 8px !important;
    }
}

/* #2 — светлая мобильная шторка */
#mobile-drawer,
#mobile-drawer .drawer-inner,
#mobile-drawer .drawer-content-wrap,
#mobile-drawer .drawer-header {
    background: #ffffff !important;
    color: #1a1a1a !important;
}
#mobile-drawer .drawer-header .drawer-toggle,
.mobile-navigation ul li > a,
.mobile-navigation ul li.menu-item-has-children > .drawer-nav-drop-wrap,
.mobile-navigation ul li.menu-item-has-children .drawer-nav-drop-wrap button {
    color: #1a1a1a !important;
}
.mobile-navigation ul li.current-menu-item > a,
.mobile-navigation ul li.current-menu-item.menu-item-has-children > .drawer-nav-drop-wrap {
    color: #2B6CB0 !important; /* highlight */
}
/* тонкие разделители на светлом фоне (если вернутся границы) */
.mobile-navigation ul li.menu-item-has-children .drawer-nav-drop-wrap,
.mobile-navigation ul li:not(.menu-item-has-children) a {
    border-bottom-color: rgba(0,0,0,0.06) !important;
}
.mobile-navigation:not(.drawer-navigation-parent-toggle-true)
    ul li.menu-item-has-children .drawer-nav-drop-wrap button {
    border-left-color: rgba(0,0,0,0.06) !important;
}
/* ховер пункта */
.mobile-navigation ul li > a:hover,
.mobile-navigation ul li > a:focus {
    background: #f3f4f6 !important;
}

/* #3 — светлое мегаменю на десктопе */
@media (min-width: 1025px) {
    .header-navigation .header-menu-container ul ul.sub-menu {
        background: #ffffff !important;
        color: #1a1a1a !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12) !important;
    }
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item > a {
        color: #1a1a1a !important;
    }
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item > a:hover,
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item > a:focus {
        background: #f3f4f6 !important;
        color: #2B6CB0 !important;
    }
}

/* ============================================================
 * newdesign — patch 2026-04-20 (b)  [fix для (a)#1]
 *   Возвращаем бургер ближе к правому краю на мобилке.
 *   Причина: в (a) мы дописали padding-right:8px на inner-wrap,
 *   но это на мобильном было 0 у Kadence — поэтому бургер уехал
 *   левее на эти 8px. Плюс основной отступ даёт
 *   .site-container { padding-right: 24px }. Уменьшаем вдвое.
 * ============================================================ */
@media (max-width: 1024px) {
    /* отменяем лишний правый отступ, который мы же и добавили в (a) */
    #masthead .site-header-row-container-inner,
    #masthead .site-main-header-wrap,
    #masthead .site-main-header-inner-wrap {
        padding-right: 0 !important;
    }
    /* ополовиниваем правый отступ основного контейнера сайта */
    .site-container {
        padding-right: 12px !important;
    }
}

/* ============================================================
 * newdesign — patch 2026-04-20 (c)
 *   Expired flyer cards: grayscale + dimmed overlay.
 *   Class added by template-parts/card-post.php when
 *   ACF `end_date` < today.
 * ============================================================ */
.c-card--expired {
    position: relative;
}
.c-card--expired .c-img {
    filter: grayscale(1);
}
.c-card--expired .c-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(30, 41, 59, 0.35); /* slate-800 @ 35% */
    pointer-events: none;
    z-index: 1;
}
.c-card--expired .c-t {
    color: #6b7280; /* gray-500 */
}
.c-card--expired:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================================
 * newdesign — patch 2026-04-20 (d)
 *   Dark mode via prefers-color-scheme.
 *   Live: браузер сам переоценивает media query при смене OS-темы,
 *   страницу перезагружать не нужно.
 *   Перекрывает патчи (a)/(f)/(c), поэтому блок лежит в конце файла.
 * ============================================================ */
@media (prefers-color-scheme: dark) {

    /* ---- Kadence palette: инвертируем основные токены ---- */
    :root {
        --global-palette1: #60a5fa;  /* primary (links/accent) */
        --global-palette2: #3b82f6;
        --global-palette3: #0f1115;  /* dark-bg / submenu bg */
        --global-palette4: #1a1e27;
        --global-palette5: #d1d5db;  /* icon/text on dark */
        --global-palette6: #9ca3af;
        --global-palette7: #2a2f3a;  /* subtle borders */
        --global-palette8: #e5e7eb;  /* primary text */
        --global-palette9: #0f1115;  /* page bg */
        --global-palette-highlight: #60a5fa;
    }

    /* ---- Base ---- */
    html { background: #0f1115; }
    body,
    body.content-style-unboxed .site,
    .content-bg {
        background: #0f1115;
        color: #e5e7eb;
    }

    /* ---- Header ---- */
    header#masthead.site-header {
        background: #0f1115 !important;
    }
    #masthead .site-header-row-container-inner {
        background: #0f1115 !important;
    }
    header#masthead.nd-header-scrolled {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    .site-branding .site-title,
    .site-branding .site-title a {
        color: #e5e7eb !important;
    }

    /* Desktop primary nav links */
    .header-navigation .header-menu-container > ul > li.menu-item > a {
        color: #e5e7eb !important;
    }
    .header-navigation .header-menu-container > ul > li.menu-item > a:hover,
    .header-navigation .header-menu-container > ul > li.menu-item.current-menu-item > a {
        color: #60a5fa !important;
    }

    /* Burger icon */
    .mobile-toggle-open-container .menu-toggle-open {
        color: #e5e7eb !important;
    }

    /* ---- Archive / single headings ---- */
    .nd-page-title,
    .nd-single-title,
    .nd-section-title,
    .nd-related-title {
        color: #e5e7eb;
    }
    .nd-page-subtitle,
    .nd-empty,
    .nd-loader {
        color: #9ca3af;
    }

    /* ---- Cards ---- */
    .c-card {
        background: #1a1e27;
        border-color: #2a2f3a;
        color: #e5e7eb;
    }
    .c-card:hover {
        border-color: #3a4050;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
    .c-img {
        background: #11141a;
    }
    .c-t {
        color: #e5e7eb;
    }

    /* Expired cards — сильнее затемняем поверх и так тёмного фона */
    .c-card--expired .c-img::after {
        background: rgba(0, 0, 0, 0.5);
    }
    .c-card--expired .c-t {
        color: #6b7280;
    }

    /* ---- Pagination ---- */
    .nd-pagination .page-numbers {
        border-color: #2a2f3a;
        color: #e5e7eb;
    }
    .nd-pagination .page-numbers:hover {
        background: #1a1e27;
    }
    .nd-pagination .page-numbers.current {
        background: #e5e7eb;
        color: #0f1115;
        border-color: #e5e7eb;
    }

    /* ---- Ad slots (placeholders) ---- */
    .nd-ad-slot {
        background:
            repeating-linear-gradient(45deg,
                #1a1e27 0 10px,
                #20242e 10px 20px);
        border-color: #2a2f3a;
        color: #6b7280;
    }

    /* ---- Single post body ---- */
    .nd-single-content {
        color: #e5e7eb;
    }
    .nd-single-content a {
        color: #60a5fa;
    }
    .nd-single-content h1,
    .nd-single-content h2,
    .nd-single-content h3,
    .nd-single-content h4,
    .nd-single-content h5,
    .nd-single-content h6 {
        color: #e5e7eb !important;
    }

    /* ---- Mobile drawer (перекрываем светлый override из патча f) ---- */
    #mobile-drawer,
    #mobile-drawer .drawer-inner,
    #mobile-drawer .drawer-content-wrap,
    #mobile-drawer .drawer-header {
        background: #0f1115 !important;
        color: #e5e7eb !important;
    }
    #mobile-drawer .drawer-header .drawer-toggle,
    .mobile-navigation ul li > a,
    .mobile-navigation ul li.menu-item-has-children > .drawer-nav-drop-wrap,
    .mobile-navigation ul li.menu-item-has-children .drawer-nav-drop-wrap button {
        color: #e5e7eb !important;
    }
    .mobile-navigation ul li.current-menu-item > a,
    .mobile-navigation ul li.current-menu-item.menu-item-has-children > .drawer-nav-drop-wrap {
        color: #60a5fa !important;
    }
    .mobile-navigation ul li.menu-item-has-children .drawer-nav-drop-wrap,
    .mobile-navigation ul li:not(.menu-item-has-children) a {
        border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    }
    .mobile-navigation:not(.drawer-navigation-parent-toggle-true)
        ul li.menu-item-has-children .drawer-nav-drop-wrap button {
        border-left-color: rgba(255, 255, 255, 0.08) !important;
    }
    .mobile-navigation ul li > a:hover,
    .mobile-navigation ul li > a:focus {
        background: #1a1e27 !important;
    }
}

/* Desktop mega-menu в тёмной теме (отдельный блок — без nested media) */
@media (prefers-color-scheme: dark) and (min-width: 1025px) {
    .header-navigation .header-menu-container ul ul.sub-menu {
        background: #0f1115 !important;
        color: #e5e7eb !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5) !important;
    }
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item > a {
        color: #e5e7eb !important;
    }
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item > a:hover,
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item > a:focus {
        background: #1a1e27 !important;
        color: #60a5fa !important;
    }
}

/* ============================================================
 * newdesign — patch 2026-04-20 (d2)  [fix for (d)]
 *   Kadence inline <style> с :root{--global-palette*} подключается
 *   позже chld_thm_cfg_separate ctc-style.css, поэтому наши
 *   переменные перебивались. Ставим !important и поднимаем
 *   специфичность через :root:root.
 * ============================================================ */
@media (prefers-color-scheme: dark) {
    :root:root {
        --global-palette1: #60a5fa !important;
        --global-palette2: #3b82f6 !important;
        --global-palette3: #0f1115 !important;
        --global-palette4: #1a1e27 !important;
        --global-palette5: #d1d5db !important;
        --global-palette6: #9ca3af !important;
        --global-palette7: #2a2f3a !important;
        --global-palette8: #e5e7eb !important;
        --global-palette9: #0f1115 !important;
        --global-palette-highlight: #60a5fa !important;
    }
    /* Body фон/текст напрямую, на случай если Kadence ставит их через explicit цвета а не через var() */
    body {
        background: #0f1115 !important;
        color: #e5e7eb !important;
    }
    body.content-style-unboxed .site,
    .content-bg,
    .entry-content-wrap {
        background: #0f1115 !important;
    }
}

/* ============================================================
 * newdesign — patch 2026-04-20 (e)
 *   Card title: всегда 2 строки.
 *   1) .c-t__brand — "{Brand} gazetka"
 *   2) .c-t__dates — "DD.MM.YYYY - DD.MM.YYYY" (meta-строка)
 *   Если дат нет, во 2-й строке &nbsp; держит высоту.
 * ============================================================ */
.c-t {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* отменяем line-clamp из старого блока */
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    display: flex;
}
.c-t__brand,
.c-t__dates {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.c-t__brand {
    font-weight: 600;
    font-size: 0.95rem;
    color: inherit;
}
.c-t__dates {
    font-weight: 400;
    font-size: 0.8rem;
    color: #6b7280;
    letter-spacing: 0.01em;
}

/* мобильная компактность */
@media (max-width: 640px) {
    .c-t__brand { font-size: 0.82rem; }
    .c-t__dates { font-size: 0.72rem; }
}

/* expired вариант: приглушаем обе строки */
.c-card--expired .c-t__brand { color: #6b7280; }
.c-card--expired .c-t__dates { color: #9ca3af; }

/* dark-тема: меняем цвет дат */
@media (prefers-color-scheme: dark) {
    .c-t__dates { color: #9ca3af; }
    .c-card--expired .c-t__brand { color: #6b7280; }
    .c-card--expired .c-t__dates { color: #6b7280; }
}

/* ============================================================
 * newdesign — patch 2026-04-20 (f)
 *   Category description block — выводится ПОСЛЕ сетки/пагинации,
 *   читаемая ширина ~720px, разделитель сверху.
 * ============================================================ */
.nd-cat-description {
    margin: 32px auto 0;
    max-width: 720px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
}
.nd-cat-description p {
    margin: 0 0 1em;
}
.nd-cat-description p:last-child {
    margin-bottom: 0;
}
.nd-cat-description a {
    color: #2B6CB0;
    text-decoration: underline;
}
@media (prefers-color-scheme: dark) {
    .nd-cat-description {
        border-top-color: #2a2f3a;
        color: #cbd5e1;
    }
    .nd-cat-description a {
        color: #60a5fa;
    }
}


/* ============================================================
 * newdesign — patch 2026-04-21 (g)
 *   Collapsible category description: intro + centered button + hidden rest.
 * ============================================================ */
.nd-cat-description-rest[hidden] { display: none; }
.nd-cat-description-toggle {
    display: block;
    margin: 16px auto 0;
    padding: 10px 24px;
    border: 1px solid #2B6CB0;
    border-radius: 6px;
    background: #2B6CB0;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.nd-cat-description-toggle:hover,
.nd-cat-description-toggle:focus {
    background: #4A90D9;
    border-color: #4A90D9;
    color: #fff;
    outline: none;
}
.nd-cat-description--collapsible .nd-cat-description-intro > :last-child { margin-bottom: 0; }
@media (prefers-color-scheme: dark) {
    .nd-cat-description-toggle {
        background: #60a5fa;
        border-color: #60a5fa;
        color: #0f172a;
    }
    .nd-cat-description-toggle:hover,
    .nd-cat-description-toggle:focus {
        background: #93c5fd;
        border-color: #93c5fd;
        color: #0f172a;
    }
}


/* ============================================================
 * newdesign — patch 2026-04-21 (h)
 *   "Inne sklepy z kategorii {X}" — grid логотипов соседних
 *   брендов в той же секции меню. После .nd-cat-description.
 * ============================================================ */
.nd-siblings {
    margin: 40px auto 0;
    max-width: 1200px;
    padding-top: 32px;
    border-top: 1px solid #e5e7eb;
}
.nd-siblings-title {
    margin: 0 0 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
}
.nd-siblings-title span { color: #2B6CB0; }
.nd-siblings-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.nd-siblings-item { margin: 0; }
.nd-siblings-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.nd-siblings-link:hover,
.nd-siblings-link:focus {
    border-color: #2B6CB0;
    box-shadow: 0 4px 14px rgba(43, 108, 176, .12);
    transform: translateY(-2px);
    outline: none;
}
.nd-siblings-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #fff;
}
.nd-siblings-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.nd-siblings-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    border-radius: 50%;
}
.nd-siblings-name {
    font-size: 0.85rem;
    text-align: center;
    color: #374151;
    line-height: 1.3;
    word-break: break-word;
}
@media (max-width: 1024px) {
    .nd-siblings-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
    .nd-siblings-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .nd-siblings-logo { width: 64px; height: 64px; }
    .nd-siblings-title { font-size: 1.25rem; }
}
@media (prefers-color-scheme: dark) {
    .nd-siblings { border-top-color: #2a2f3a; }
    .nd-siblings-title { color: #f3f4f6; }
    .nd-siblings-title span { color: #60a5fa; }
    .nd-siblings-link {
        background: #1a1f2e;
        border-color: #2a2f3a;
    }
    .nd-siblings-link:hover,
    .nd-siblings-link:focus {
        border-color: #60a5fa;
        box-shadow: 0 4px 14px rgba(96, 165, 250, .18);
    }
    .nd-siblings-logo {
        background: #fff;   /* логотипы на тёмном теряют контраст — держим подложку белой */
        border-radius: 6px;
    }
    .nd-siblings-fallback {
        background: #2a2f3a;
        color: #cbd5e1;
    }
    .nd-siblings-name { color: #cbd5e1; }
}

/* ============================================================
 * newdesign — patch 2026-04-21
 *   Светлая подсветка активного пункта в десктопном сабменю.
 *   Без этого Kadence красит current-menu-item тёмным фоном
 *   (видно на /abc/ в выпадашке «Inne marki» — пункт «ABC» чёрный).
 * ============================================================ */
@media (min-width: 1025px) {
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item.current-menu-item > a,
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item.current-menu-parent > a,
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item.current-menu-ancestor > a,
    .header-navigation .header-menu-container ul ul.sub-menu li.menu-item.current_page_item > a {
        background: #f3f4f6 !important;
        color: #2B6CB0 !important;
    }
}

/* ============================================================
 * newdesign — patch 2026-04-24 (h)
 *   Tighten top gap between header bar and page content (desktop)
 *   + dark-mode heading colors on archives/category pages
 * ============================================================ */
@media (min-width: 1025px) {
    /* Kadence по умолчанию: .content-area { margin: 5rem 0 } — режем верх */
    body .content-area {
        margin-top: 16px !important;
    }
    body #inner-wrap.wrap {
        padding-top: 8px !important;
    }
    body.single .nd-single-header,
    body.archive .nd-page-header,
    body.home .nd-page-header {
        margin-top: 0 !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* Headings everywhere (category desc, siblings, related, entry content) */
    :root:root h1,
    :root:root h2,
    :root:root h3,
    :root:root h4,
    :root:root h5,
    :root:root h6,
    .nd-cat-description h1,
    .nd-cat-description h2,
    .nd-cat-description h3,
    .nd-cat-description h4,
    .nd-cat-description h5,
    .nd-cat-description h6,
    .nd-cat-description,
    .nd-cat-description p,
    .nd-siblings-title,
    .nd-section-title,
    .nd-related-title,
    .nd-page-title {
        color: #e5e7eb !important;
    }
    .nd-cat-description {
        border-top-color: #2a2f3a !important;
    }
    .nd-cat-description a {
        color: #60a5fa !important;
    }
    .nd-siblings {
        border-top-color: #2a2f3a !important;
    }
    .nd-siblings-title span {
        color: #60a5fa !important;
    }
}
