/* DNT Union theme — main styles */

:root {
	--red: #B11E39;
	--red-dark: #8a1830;
	--indigo: #39489C;
	--ink-900: #1a2150;
	--ink-800: #252f6b;
	--ink-700: #2f3c85;
	--ink-100: #e3e6f3;
	--ink-50: #f4f5fa;
	--paper: #eef0f5;
	--surface: #ffffff;
	--line: #e2e5ee;
	--line-strong: #cdd2e0;
	--text: #1c2033;
	--muted: #6b7189;
	--shadow-card: 0 1px 2px rgba(26, 33, 80, .06);
	--radius: 10px;
	--font-body: "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-head: "Google Sans", "Noto Sans Georgian", system-ui, sans-serif;
	--max: 1200px;
	--content-max: 880px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--paper);
	background-image: none;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	color: var(--ink-900);
	line-height: 1.3;
	margin: 0 0 .5em;
}

a { color: var(--indigo); }
a:hover { color: var(--red); }

img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }

:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
}
.skip-link:focus {
	left: 16px;
	top: 16px;
	z-index: 100;
	background: var(--surface);
	padding: 8px 12px;
	border-radius: 6px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.site-header__inner {
	max-width: var(--max);
	margin: 0 auto;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.site-logo { margin-right: auto; }
.site-logo a { display: block; line-height: 0; }
.site-logo img { height: 48px; width: auto; }

/* ---------- Navigation ---------- */
.site-nav .menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
}

.site-nav li { position: relative; }

.site-nav a {
	display: block;
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--ink-900);
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item > a { background: var(--ink-50); color: var(--indigo); }

.site-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	margin-left: 6px;
	border: 4px solid transparent;
	border-top-color: currentColor;
	border-bottom: 0;
	vertical-align: middle;
}

/* Dropdown */
.site-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 6px;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 50;
	min-width: 200px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 10px 30px -12px rgba(26, 33, 80, .35);
	/* Closed: hidden from view, tab order and assistive tech. */
	visibility: hidden;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity .15s, transform .15s, visibility 0s linear .15s;
}

.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition-delay: 0s;
}

.site-nav .sub-menu a { font-weight: 500; }

/* Red member button */
.btn-member,
.site-nav .menu-item-member > a {
	display: inline-block;
	background-color: var(--red);
	color: #fff;
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
}

.btn-member:hover,
.site-nav .menu-item-member > a:hover { background-color: var(--red-dark); color: #fff; }

/* ---------- Header tools: language switch and search ---------- */
.site-nav { order: 1; }
.header-tools { order: 2; display: flex; align-items: center; gap: 4px; }

.header-langs { display: flex; gap: 2px; }
.header-langs a {
	display: block;
	padding: 6px 8px;
	border-radius: 6px;
	color: var(--muted);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.header-langs a:hover { background: var(--ink-50); color: var(--indigo); }
.header-langs a[aria-current] { color: var(--ink-900); background: var(--ink-100); }

.search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ink-900);
	cursor: pointer;
}
.search-toggle:hover,
.search-toggle[aria-expanded="true"] { background: var(--ink-50); color: var(--indigo); }

.header-search { border-top: 1px solid var(--line); background: var(--surface); }
.header-search[hidden] { display: none; }
.header-search__inner { max-width: var(--content-max); margin: 0 auto; padding: 12px 16px; }

/* ---------- Layout ---------- */
.layout {
	max-width: var(--content-max);
	margin: 0 auto;
	padding: 24px 16px 40px;
	width: 100%;
	flex: 1 0 auto;
}

.content { min-width: 0; }

/* ---------- Cards ---------- */
.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	padding: 20px;
	margin-bottom: 16px;
}

.post-card h2 { font-size: 20px; margin-bottom: 8px; overflow-wrap: anywhere; }
.post-card h2 a { color: var(--ink-900); text-decoration: none; }
.post-card h2 a:hover { color: var(--red); }
.post-card h2 + .entry > :first-child { margin-top: 0; }
.post-card .entry > :last-child { margin-bottom: 0; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 8px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }

.pagination .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 8px 12px;
	text-align: center;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--ink-900);
	font-weight: 600;
	text-decoration: none;
}

.pagination a.page-numbers:hover { border-color: var(--indigo); color: var(--indigo); }
.pagination .page-numbers.current { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.pagination .page-numbers.dots { background: transparent; border-color: transparent; }

/* ---------- Search form (header) ---------- */
.header-search .search-form { display: flex; gap: 6px; }
.header-search .search-form label { flex: 1; }

.header-search input[type="search"] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--line-strong);
	border-radius: 6px;
	font: inherit;
	font-size: 15px;
	color: var(--text);
	background: var(--surface);
}

.header-search input[type="search"]:focus { outline: 2px solid var(--indigo); outline-offset: 0; border-color: var(--indigo); }

.header-search .search-submit {
	padding: 8px 12px;
	border: 0;
	border-radius: 6px;
	background: var(--indigo);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.header-search .search-submit:hover { background: var(--ink-800); }

/* ---------- Footer ---------- */
.site-footer {
	background-color: var(--ink-900);
	color: #c9cee8;
	font-size: 14px;
}

.site-footer__inner {
	max-width: var(--max);
	margin: 0 auto;
	padding: 20px 16px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
}

.footer-langs { display: flex; gap: 12px; }
.footer-langs a { color: #c9cee8; text-decoration: none; }
.footer-langs a:hover, .footer-langs a[aria-current] { color: #fff; }

/* ---------- Empty state, search title ---------- */
.empty-state h1 { font-size: 24px; }
.empty-state .search-form { display: flex; gap: 6px; margin: 16px 0; }
.empty-state .search-form label { flex: 1; }
.empty-state input[type="search"] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--line-strong);
	border-radius: 6px;
	font: inherit;
	background: var(--surface);
}
.empty-state .search-submit {
	padding: 8px 14px;
	border: 0;
	border-radius: 6px;
	background: var(--indigo);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.page-title { font-size: 22px; margin-bottom: 16px; }

/* ---------- Single post and page ---------- */
.single-card { padding: 28px 32px; }
.single-card .entry-title { font-size: 28px; margin-bottom: 20px; overflow-wrap: anywhere; }

@media (max-width: 599px) {
	.single-card { padding: 20px 16px; }
	.single-card .entry-title { font-size: 22px; }
}

.entry {
	color: var(--text);
	font-size: 16px;
	line-height: 1.7;
	overflow-wrap: anywhere;
}

/* Old content has fixed widths in inline styles and attributes. */
.entry * { max-width: 100%; }
.entry > :first-child { margin-top: 0; }
.entry > :last-child { margin-bottom: 0; }

.entry p,
.entry ul,
.entry ol,
.entry blockquote,
.entry h2, .entry h3, .entry h4, .entry h5, .entry h6 { max-width: 72ch; }

.entry p { margin: 0 0 1em; }
.entry h2 { font-size: 22px; margin: 1.4em 0 .5em; }
.entry h3 { font-size: 19px; margin: 1.3em 0 .5em; }
.entry h4, .entry h5, .entry h6 { font-size: 17px; margin: 1.2em 0 .4em; }

.entry ul, .entry ol { margin: 0 0 1em; padding-left: 1.4em; }
.entry li { margin-bottom: .3em; }
.entry li > ul, .entry li > ol { margin: .3em 0 0; }

.entry img { height: auto; min-width: 0; border-radius: 6px; }
.entry figure { margin: 0 0 1em; }
.entry figcaption, .entry .wp-caption-text { color: var(--muted); font-size: 14px; margin-top: 6px; }
.entry .wp-caption { width: auto !important; }
.entry .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry .alignleft { float: left; margin: 4px 16px 8px 0; }
.entry .alignright { float: right; margin: 4px 0 8px 16px; }
.entry::after { content: ""; display: table; clear: both; }

@media (max-width: 599px) {
	.entry .alignleft, .entry .alignright { float: none; margin: 0 0 1em; }
}

.entry blockquote,
.entry .wp-block-quote {
	margin: 0 0 1em;
	padding: 8px 0 8px 16px;
	border-left: 3px solid var(--red);
	color: var(--ink-800);
}
.entry blockquote p:last-child { margin-bottom: 0; }
.entry blockquote cite { color: var(--muted); font-size: 14px; font-style: normal; }

/* Tables scroll inside themselves on small screens. */
.entry table {
	display: block;
	overflow-x: auto;
	width: auto !important;
	border-collapse: collapse;
	margin: 0 0 1em;
	font-size: 15px;
}
.entry th, .entry td { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.entry th { background: var(--ink-50); text-align: left; }
.entry .wp-block-table { margin: 0 0 1em; }

.entry hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }

/* PDF rows: plain links to .pdf files */
.entry a[href$=".pdf" i] {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	margin: 0 0 8px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--ink-900);
	font-weight: 500;
	text-decoration: none;
}
.entry a[href$=".pdf" i]:hover { border-color: var(--red); color: var(--red); }

.entry a[href$=".pdf" i]::before,
.entry .wp-block-file:has(a[href$=".pdf" i])::before {
	content: "PDF";
	flex: none;
	padding: 3px 6px;
	border-radius: 4px;
	background: #fbe9ec;
	color: var(--red);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .02em;
}

/* A list of PDF links: rows, no bullets. */
.entry li:has(> a[href$=".pdf" i]) { list-style: none; margin: 0; }
.entry ul:has(> li > a[href$=".pdf" i]) { padding-left: 0; }

/* PDF rows: Gutenberg file block. The block is the row; its links stay plain. */
/* div.wp-block-file beats the block library's font-size: .8em. */
.entry div.wp-block-file {
	font-size: inherit;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 8px 12px;
	margin: 0 0 8px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
}
.entry .wp-block-file a[href$=".pdf" i] {
	display: inline;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
}
.entry .wp-block-file a[href$=".pdf" i]::before { content: none; }
.entry .wp-block-file > a:first-of-type { flex: 1 1 12em; min-width: 0; color: var(--ink-900); font-weight: 500; text-decoration: none; }
.entry .wp-block-file > a:first-of-type:hover { color: var(--red); }

/* a.wp-block-file__button beats the plain-link reset above (its href ends in .pdf too). */
.entry .wp-block-file a.wp-block-file__button {
	flex: none;
	margin-left: auto;
	display: inline-block;
	padding: 4px 10px;
	border-radius: 6px;
	background: var(--indigo);
	line-height: 1.4;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.entry .wp-block-file a.wp-block-file__button:hover { background: var(--ink-800); color: #fff; }

/* Embeds and video: always visible, 16:9.
   The "html" prefix beats the block library's padding-top trick
   (.wp-embed-responsive .wp-embed-aspect-16-9 ...), so aspect-ratio does the work. */
.entry .wp-block-embed { margin: 0 0 1em; }
html .entry .wp-block-embed .wp-block-embed__wrapper { position: static; }
html .entry .wp-block-embed .wp-block-embed__wrapper::before { content: none; display: none; }
.entry .fluid-width-video-wrapper { padding-top: 0 !important; height: auto; }

html .entry .wp-block-embed.is-type-video iframe,
.entry iframe[src*="youtube.com"],
.entry iframe[src*="youtube-nocookie.com"],
.entry iframe[src*="vimeo.com"] {
	display: block;
	position: static;
	visibility: visible;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 8px;
}

/* ---------- Mobile menu ---------- */
.nav-toggle { display: none; }

@media (max-width: 899px) {
	.nav-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: var(--surface);
		border: 1px solid var(--line-strong);
		border-radius: 8px;
		cursor: pointer;
	}

	.nav-toggle__bars,
	.nav-toggle__bars::before,
	.nav-toggle__bars::after {
		display: block;
		width: 20px;
		height: 2px;
		background: var(--ink-900);
		border-radius: 2px;
		content: "";
	}
	.nav-toggle__bars { position: relative; }
	.nav-toggle__bars::before { position: absolute; top: -6px; }
	.nav-toggle__bars::after { position: absolute; top: 6px; }

	.site-header__inner { gap: 8px; }
	.site-logo img { height: 36px; }
	.header-tools { gap: 0; }
	.header-tools { order: 1; }
	.nav-toggle { order: 2; }
	.site-nav { order: 3; display: none; flex-basis: 100%; }
	.site-nav.is-open { display: block; }

	.site-nav .menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.site-nav .menu > li > a { padding: 12px; }
	.site-nav .menu-item-member > a { display: block; text-align: center; }

	/* Submenus are always open inside the open mobile menu. */
	.site-nav .sub-menu {
		position: static;
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: none;
		min-width: 0;
		margin: 0 0 4px 16px;
		padding: 0;
		border: 0;
		border-left: 2px solid var(--line);
		border-radius: 0;
		box-shadow: none;
	}
	.site-nav .menu-item-has-children > a::after { display: none; }
}

/* ---------- Print ---------- */
@media print {
	.site-header,
	.site-footer,
	.nav-toggle,
	.skip-link { display: none !important; }
	body { background: #fff; }
	.card,
	.single-card { border: 0; box-shadow: none; }
	.layout { display: block; }
}
