/*
Theme Name: defactolegal
Theme URI: https://defactolegal.bg
Author: DevClick
Description: Правна новинарска редакция — блокова тема с мастхед, секции и издание.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: defactolegal
*/

/* size-adjust fallback so the serif swap does not jump the masthead */
@font-face {
	font-family: "Source Serif 4 Fallback";
	src: local("Times New Roman");
	size-adjust: 100%;
	ascent-override: 92%;
	descent-override: 24%;
	line-gap-override: 0%;
}

:root {
	--df-serif: "Source Serif 4", "Source Serif 4 Fallback", "Times New Roman", Times, serif;
	--df-sans: "Source Sans 3", "Segoe UI", sans-serif;
	--df-ink: var(--wp--preset--color--ink, #1a1814);
	--df-paper: var(--wp--preset--color--paper, #f4f0e6);
	--df-rule: var(--wp--preset--color--rule, #d8d2c6);
	--df-kicker: var(--wp--preset--color--kicker, #0f5e56);
	--df-kicker-hover: var(--wp--preset--color--kicker-hover, #0a4842);
	--df-muted: var(--wp--preset--color--muted, #6a645c);
	--df-surface: var(--wp--preset--color--surface, #ebe6dc);
	--df-white: var(--wp--preset--color--white, #fffcf8);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--df-paper);
	color: var(--df-ink);
	font-family: var(--df-sans);
	font-size: 1.1875rem;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
}

.skip-link a {
	position: fixed;
	left: 0.75rem;
	top: -5rem;
	z-index: 100;
	background: var(--df-white);
	color: var(--df-ink);
	padding: 0.6rem 0.9rem;
	min-height: 44px;
}

.skip-link a:focus { top: 0.75rem; }

:focus-visible {
	outline: 2px solid var(--df-kicker);
	outline-offset: 2px;
}

a { color: inherit; text-underline-offset: 0.15em; transition: color 150ms ease; }
a:hover { color: var(--df-kicker); }

img { max-width: 100%; height: auto; }

/* Masthead. The three rails are separate template parts; the gap between them is the page colour. */
.wp-site-blocks > header.wp-block-template-part {
	margin: 0 !important;
	background: var(--df-ink);
	color: var(--df-paper);
}

.ticker-rail,
.masthead,
.section-nav-wrap {
	background: var(--df-ink);
	color: var(--df-paper);
	margin: 0 !important;
}

.ticker-rail.is-layout-constrained > *,
.masthead.is-layout-constrained > *,
.section-nav-wrap.is-layout-constrained > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.masthead {
	position: sticky;
	top: 0;
	z-index: 40;
	padding-top: env(safe-area-inset-top);
	border-top: 1px solid rgba(244, 240, 230, 0.14);
	border-bottom: 0;
}

.ticker-rail {
	border-bottom: 1px solid rgba(244, 240, 230, 0.16);
	font-size: 0.8125rem;
	line-height: 1.3;
}

.ticker-rail .wp-block-group,
.ticker-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
	align-items: center;
	justify-content: space-between;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0;
	min-height: 40px;
}

.df-clock,
.df-weather,
.df-markets {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 40px;
	color: var(--df-paper);
	background: transparent;
	border: 0;
	font: inherit;
	text-align: left;
	padding: 0;
	margin: 0;
}

.df-clock time { font-variant-numeric: tabular-nums; font-weight: 600; }
.df-date { color: var(--df-rule); }

.df-weather { cursor: pointer; }
.df-weather-temp { font-weight: 600; font-variant-numeric: tabular-nums; }
.df-weather-panel {
	position: absolute;
	z-index: 50;
	background: var(--df-white);
	color: var(--df-ink);
	border: 1px solid var(--df-rule);
	padding: 0.75rem 1rem;
	min-width: 220px;
}
.df-weather-panel[hidden] { display: none; }
.ticker-rail { position: relative; }

.df-markets { overflow: hidden; max-width: min(640px, 100%); }
.df-tape { display: flex; gap: 1.25rem; }
.df-tick { white-space: nowrap; font-variant-numeric: tabular-nums; }
.df-tick b { font-weight: 600; }
.df-up { color: #d7efe8; }
.df-down { color: #f0d2c4; }
.df-src { color: var(--df-rule); font-size: 0.75rem; }

.skip-link { margin: 0; height: 0; }

.masthead-brand {
	align-items: center;
	width: 100%;
	min-height: 4.75rem;
	margin: 0;
	padding: 0.55rem 0;
	gap: 1.25rem 1.75rem;
}
.wordmark-lockup {
	align-items: center;
	gap: 0.65rem;
	margin: 0;
}
.wordmark-lockup .wp-block-site-logo { margin: 0; display: flex; align-items: center; }
.wordmark,
.wp-block-site-title {
	font-family: var(--df-serif);
	font-weight: 600;
	font-size: clamp(2rem, 4.2vw, 3.15rem);
	letter-spacing: -0.045em;
	line-height: 1;
	margin: 0;
	display: flex;
	align-items: center;
}
.wordmark a,
.wp-block-site-title a { text-decoration: none; color: var(--df-paper); }
.wordmark a:hover,
.wp-block-site-title a:hover { color: var(--df-paper); }

.tagline,
.edition-kicker {
	color: var(--df-rule);
	font-size: 0.95rem;
	line-height: 1.3;
	margin: 0;
	max-width: 22rem;
	align-self: center;
}
.masthead .wp-block-search {
	margin: 0;
	align-self: center;
	width: auto;
}

.masthead .wp-block-search__input {
	font-size: 16px;
	min-height: 44px;
	background: transparent;
	color: var(--df-paper);
	border: 1px solid rgba(244, 240, 230, 0.35);
	border-radius: 2px;
}
.masthead .wp-block-search__button {
	min-height: 44px;
	min-width: 44px;
	background: transparent;
	color: var(--df-paper);
	border: 0;
}

.masthead.is-stuck .ticker-rail,
.masthead.is-stuck .tagline { display: none; }
.masthead.is-stuck .wordmark,
.masthead.is-stuck .wp-block-site-title { font-size: 1.45rem; }

.section-nav-wrap { border-top: 1px solid rgba(244, 240, 230, 0.14); }
.section-nav {
	width: 100%;
	margin: 0;
	line-height: 1;
}
.section-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
	display: flex;
	align-items: center;
	width: 100%;
}
.section-nav .wp-block-navigation__container {
	display: flex;
	align-items: stretch;
	gap: 0 1.15rem;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	min-height: 2.75rem;
	width: 100%;
	line-height: 1;
}
.section-nav .wp-block-navigation-item {
	margin: 0;
	display: flex;
	align-items: stretch;
	line-height: 1;
}
/* Core sets these links to display:block, which pins the label to the top of the bar. */
.section-nav.wp-block-navigation .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	align-self: stretch;
	box-sizing: border-box;
	height: 2.75rem;
	min-height: 2.75rem;
	margin: 0;
	padding: 0;
	color: var(--df-paper);
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	border: 0;
	box-shadow: inset 0 -2px 0 transparent;
}
.section-nav .wp-block-navigation-item__label {
	display: block;
	line-height: 1;
	margin: 0;
	padding: 0;
}
.section-nav.wp-block-navigation .wp-block-navigation-item__content:hover,
.section-nav.wp-block-navigation .wp-block-navigation-item__content:focus-visible {
	color: var(--df-paper);
	box-shadow: inset 0 -2px 0 var(--df-kicker);
}
.section-nav .wp-block-navigation__responsive-container-open {
	min-height: 44px;
	min-width: 44px;
	color: var(--df-paper);
}
.section-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--df-ink);
	color: var(--df-paper);
	padding: env(safe-area-inset-top) 1.25rem 2rem;
}
.section-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.section-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch;
}
.section-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	border-left: 2px solid var(--df-kicker);
	width: 100%;
}
.section-nav .wp-block-navigation__responsive-container-close {
	min-height: 44px;
	min-width: 44px;
	color: var(--df-paper);
}

/* Breaking */
.is-breaking:not(:has(p:not(:empty))) { display: none; }
.is-breaking {
	background: var(--df-kicker);
	color: var(--df-white);
}
.is-breaking p { margin: 0; padding: 0.55rem 0; font-weight: 600; font-size: 0.95rem; }
.is-breaking a { color: var(--df-white); }

/* Edition grid. The reading measure stays 720px. The front page uses the wide measure. */
.home-main { padding-top: 1.5rem; padding-bottom: 2rem; }
.home-main.is-layout-constrained > *,
.masthead.is-layout-constrained > .masthead-brand,
.ticker-rail.is-layout-constrained > .ticker-inner,
.section-nav-wrap.is-layout-constrained > .section-nav,
.site-footer.is-layout-constrained > *,
main.archive-intro.is-layout-constrained > * {
	max-width: var(--wp--style--global--wide-size, 1240px) !important;
}
.archive-intro .wp-block-term-description,
.archive-intro > .wp-block-paragraph.market-note {
	max-width: 46rem;
}

ul.wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}
.wp-block-post-featured-image { margin: 0; }
.wp-block-post-featured-image a,
.wp-block-post-featured-image img { display: block; width: 100%; }

.lead-pack {
	align-items: start;
	gap: 2rem;
}
.lead-pack > .wp-block-column { min-width: 0; }
.is-lead .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	height: auto;
}
.is-kicker,
.wp-block-post-terms,
.kicker {
	font-family: var(--df-sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--df-kicker);
	text-decoration: none;
}
.is-kicker a,
.wp-block-post-terms a { color: var(--df-kicker); text-decoration: none; }
.is-kicker a:hover,
.wp-block-post-terms a:hover { color: var(--df-kicker-hover); }

.is-lead .wp-block-post-title {
	font-size: var(--wp--preset--font-size--lead);
	margin: 0.35rem 0 0.45rem;
	letter-spacing: -0.03em;
}
.is-lead .wp-block-post-title a { text-decoration: none; }
.is-lead .wp-block-post-excerpt { font-size: 1.2rem; color: var(--df-ink); max-width: 42rem; }
.byline,
.desk-byline,
.wp-block-post-date {
	color: var(--df-muted);
	font-size: 0.875rem;
}
.desk-byline { margin: 0; }

.is-pack .wp-block-post {
	display: grid;
	grid-template-columns: 7.25rem minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
	padding: 0.9rem 0;
	border-top: 1px solid var(--df-rule);
}
.is-pack .wp-block-post:first-child { border-top: 0; padding-top: 0; }
.is-pack .wp-block-post-featured-image { grid-column: 1; grid-row: 1; }
.is-pack .pack-copy { grid-column: 2; grid-row: 1; min-width: 0; }
.is-pack .pack-copy > * { margin-top: 0; margin-bottom: 0; }
.is-pack .wp-block-post-title {
	font-size: 1.15rem;
	line-height: 1.25;
	margin: 0.2rem 0;
}
.is-pack .wp-block-post-title a { text-decoration: none; }
.is-pack .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	height: auto;
}

.module-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	border-top: 1px solid var(--df-ink);
	margin-top: 2rem;
	padding-top: 0.45rem;
}
.module-head h2 { font-size: 1.35rem; margin: 0; letter-spacing: -0.02em; }

.is-latest .wp-block-post,
.is-most-read .wp-block-post {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.35rem 1rem;
	align-items: baseline;
	border-bottom: 1px solid var(--df-rule);
	padding: 0.7rem 0;
}
.is-latest .wp-block-post-title,
.is-most-read .wp-block-post-title { font-size: 1.15rem; margin: 0; }
.is-latest .wp-block-post-title a,
.is-most-read .wp-block-post-title a { text-decoration: none; }
.is-most-read { counter-reset: read; }
.is-most-read .wp-block-post { counter-increment: read; }
.is-most-read .wp-block-post-title::before {
	content: counter(read) " ";
	font-family: var(--df-serif);
	color: var(--df-kicker);
	margin-right: 0.35rem;
}

.is-section-band { align-items: start; }
.is-section-band > .wp-block-column { min-width: 0; }
.is-section-band h2 {
	font-size: 1.35rem;
	margin: 0 0 0.35rem;
	border-top: 1px solid var(--df-ink);
	padding-top: 0.45rem;
}
.is-section-band h2 a { text-decoration: none; }
.section-band .wp-block-post {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.35rem 0.75rem;
	align-items: baseline;
	border-top: 1px solid var(--df-rule);
	padding: 0.7rem 0;
}
.section-band .wp-block-post-title { font-size: 1.15rem; margin: 0; }
.section-band .wp-block-post-title a { text-decoration: none; }

.is-opinion .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
}
.is-opinion .wp-block-post {
	border-top: 3px solid var(--df-kicker);
	padding-top: 0.75rem;
	min-width: 0;
}
.is-opinion .wp-block-post-title { margin-top: 0.35rem; }
.is-opinion .wp-block-post-title a { text-decoration: none; }
.is-multimedia .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
}
.is-multimedia .wp-block-post { min-width: 0; }
.is-multimedia .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	height: auto;
}
.is-multimedia .wp-block-post-title { font-size: 1.2rem; margin: 0.35rem 0 0; }
.is-multimedia .wp-block-post-title a { text-decoration: none; }

.is-opinion .wp-block-post-featured-image { display: none; }
.is-opinion .wp-block-post-excerpt,
.is-opinion .wp-block-post-excerpt__excerpt {
	font-family: var(--df-serif);
	font-size: 1.35rem;
	line-height: 1.35;
}
.category-mnenia .river .wp-block-post-featured-image { display: none; }
.category-mnenia .river .wp-block-post { grid-template-columns: minmax(0, 1fr); }
.category-mnenia .wp-block-post-excerpt { font-family: var(--df-serif); font-size: 1.25rem; }

.is-latest,
.is-section-band,
.is-most-read { content-visibility: auto; contain-intrinsic-size: auto 520px; }

.ad-slot {
	border: 1px solid var(--df-rule);
	color: var(--df-muted);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	padding: 1.25rem;
	margin: 1.5rem 0;
}

/* Article */
.article-wrap { padding-top: 1.5rem; }
.article-header .wp-block-post-title { margin: 0.4rem 0 0.6rem; }
.dek,
.article-header .wp-block-post-excerpt { font-size: 1.25rem; max-width: 42rem; }
.article-header .wp-block-post-featured-image { margin-top: 1rem; }
.article-header figcaption,
.wp-block-post-featured-image figcaption,
.wp-element-caption {
	font-size: 0.875rem;
	color: var(--df-muted);
	margin-top: 0.35rem;
}
.single .wp-block-post-content > p:first-of-type::first-letter {
	font-family: var(--df-serif);
	float: left;
	font-size: 3.3rem;
	line-height: 0.8;
	padding: 0.15rem 0.45rem 0 0;
	font-weight: 600;
	color: var(--df-kicker);
}
.wp-block-post-content h2 { margin-top: 1.6rem; }
.df-share { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.df-share button,
.df-share a {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	padding: 0 0.9rem;
	border: 1px solid var(--df-ink);
	background: transparent;
	color: var(--df-ink);
	text-decoration: none;
	border-radius: 2px;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
}
.df-share button:hover,
.df-share a:hover { background: var(--df-ink); color: var(--df-paper); }
.df-correction {
	border-top: 1px solid var(--df-rule);
	padding-top: 0.6rem;
	color: var(--df-muted);
	font-size: 0.95rem;
}

/* Archive */
.archive-intro { max-width: 46rem; }
.archive-intro .wp-block-term-description,
.archive-intro p { font-size: 1.05rem; color: var(--df-ink); }
.river .wp-block-post {
	display: grid;
	grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
	gap: 1.15rem;
	align-items: start;
	border-top: 1px solid var(--df-rule);
	padding: 1rem 0;
}
.river .wp-block-post-title { margin: 0.2rem 0; font-size: 1.45rem; }
.river .wp-block-post-title a { text-decoration: none; }
.river .wp-block-post-featured-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Newsletter + forms */
.newsletter {
	background: var(--df-surface);
	border-top: 1px solid var(--df-ink);
	border-bottom: 1px solid var(--df-ink);
	padding: 1.25rem 0;
	margin-top: 2rem;
}
.wpcf7 label { display: block; font-size: 0.95rem; margin-bottom: 0.65rem; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="search"],
.wpcf7 textarea {
	width: 100%;
	max-width: 32rem;
	font-size: 16px;
	min-height: 44px;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--df-rule);
	border-radius: 2px;
	background: var(--df-white);
	color: var(--df-ink);
	font-family: inherit;
}
.wpcf7 textarea { min-height: 8rem; }
.wpcf7 input[type="submit"] {
	min-height: 44px;
	padding: 0 1.1rem;
	background: var(--df-ink);
	color: var(--df-paper);
	border: 0;
	border-radius: 2px;
	font-weight: 600;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--df-kicker); color: var(--df-white); }
.wpcf7-acceptance { font-size: 0.875rem; }
.df-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* Footer */
.site-footer {
	background: var(--df-ink);
	color: var(--df-paper);
	margin-top: 2.5rem;
	padding: 2rem 0 2.5rem;
	font-size: 0.95rem;
}
.site-footer a { color: var(--df-paper); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--df-paper); }
.site-footer .wordmark a { font-family: var(--df-serif); font-size: 1.8rem; letter-spacing: -0.04em; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.25rem 0; }
.copy { color: var(--df-rule); margin-top: 1.5rem; font-size: 0.85rem; }

/* Cookie */
.df-cookie {
	position: fixed;
	left: 0.75rem;
	right: 0.75rem;
	bottom: 0.75rem;
	z-index: 70;
	background: var(--df-ink);
	color: var(--df-paper);
	padding: 0.85rem 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	max-width: 880px;
	margin: 0 auto;
	border: 1px solid rgba(244, 240, 230, 0.2);
}
.df-cookie[hidden] { display: none; }
.df-cookie p { margin: 0; font-size: 0.95rem; flex: 1 1 280px; }
.df-cookie a { color: var(--df-paper); }
.df-cookie button {
	min-height: 44px;
	padding: 0 0.9rem;
	background: var(--df-paper);
	color: var(--df-ink);
	border: 0;
	border-radius: 2px;
	font-weight: 600;
	cursor: pointer;
}
.df-cookie button.ghost { background: transparent; color: var(--df-paper); border: 1px solid var(--df-rule); }

.market-note { display: none; font-size: 0.875rem; color: var(--df-muted); }
.category-biznes .market-note { display: block; }

@media (min-width: 782px) {
	.lead-pack > .wp-block-column:last-child {
		border-left: 1px solid var(--df-rule);
		padding-left: 1.5rem;
	}
	.home-split > .wp-block-column:last-child {
		border-left: 1px solid var(--df-rule);
		padding-left: 1.5rem;
	}
}

@media (max-width: 900px) {
	.is-section-band > .wp-block-column { flex-basis: 100% !important; }
	.is-opinion .wp-block-post-template,
	.is-multimedia .wp-block-post-template { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
	.river .wp-block-post { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.75rem; }
	.river .wp-block-post-excerpt { display: none; }
	.footer-cols { grid-template-columns: 1fr; }
	.is-latest .wp-block-post,
	.is-most-read .wp-block-post,
	.section-band .wp-block-post { grid-template-columns: minmax(0, 1fr); }
	.is-pack .wp-block-post { grid-template-columns: 5.5rem minmax(0, 1fr); }
	.section-nav .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none; }
	.ticker-inner { justify-content: flex-start; }
	.df-markets { max-width: 100%; overflow: visible; }
	.df-tape { flex-wrap: wrap; row-gap: 0.2rem; }
	.masthead-brand { align-items: flex-start; }
	.lead-pack > .wp-block-column,
	.home-split > .wp-block-column { flex-basis: 100% !important; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
	}
	.is-breaking { animation: none; }
}
