/*
Theme Name: Srpski4EU
Theme URI: https://srpski4eu.me
Author: Srpski4EU Civic Initiative
Author URI: https://srpski4eu.me
Description: Modern Full-Site Editing (FSE) block theme for the Srpski4EU civic initiative.
Version: 1.0.0
Requires at least: 7.1
Tested up to: 7.1.2
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: srpski4eu
Tags: block-theme, full-site-editing, one-column, wide-blocks, custom-colors, custom-typography
*/

/* -------------------------------------------------------------------------
 * 1. OpenType locl Serbian Cyrillic Typography Activation
 * ------------------------------------------------------------------------- */
:root,
html[lang^="sr"],
:lang(sr),
:lang(sr-Cyrl),
:lang(sr-Cyrl-ME),
:lang(sr-ME) {
	font-feature-settings: "locl" 1;
	-webkit-font-feature-settings: "locl" 1;
	-moz-font-feature-settings: "locl" 1;
	font-variant-ligatures: normal;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 76px;
}

/* -------------------------------------------------------------------------
 * 2. Typographic Polish & Balance
 * ------------------------------------------------------------------------- */
h1,
h2,
h3,
.wp-block-heading {
	text-wrap: balance;
}

/* Tabular figures for numbers and statistics (Strict Monospace Ban) */
.stat-number,
.key-fact-figure {
	font-variant-numeric: tabular-nums lining-nums;
	font-feature-settings: "tnum" 1, "lnum" 1, "locl" 1;
}

/* Italic descender clearance per DESIGN.md Section 3.3 */
em,
i,
.italic {
	line-height: 1.15;
	padding-bottom: 0.125rem;
}

/* Strict Paragraph max-width for stately readability (68ch) */
.wp-site-blocks p {
	max-width: 68ch;
}

.wp-site-blocks .wp-block-columns p,
.wp-site-blocks .wp-block-column p {
	max-width: 100%;
}

/* -------------------------------------------------------------------------
 * 3. Primary CTA Tactile Micro-Interactions
 * ------------------------------------------------------------------------- */
.wp-block-button__link {
	transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, background-color 0.15s ease;
	white-space: nowrap;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
}

.wp-block-button__link:active {
	transform: translateY(1px) scale(0.99);
}

.wp-block-button__link:focus-visible {
	outline: 3px solid var(--wp--preset--color--sovereign-blue);
	outline-offset: 2px;
}

.wp-block-button__link.has-sovereign-blue-background-color:hover,
.wp-block-button__link.has-sovereign-blue-background-color:focus-visible {
	background-color: var(--wp--preset--color--sovereign-blue-dark) !important;
	color: var(--wp--preset--color--eu-gold) !important;
}

/* -------------------------------------------------------------------------
 * 4. Two-Segment Pill Language Switcher ([ СРП | ENG ])
 * ------------------------------------------------------------------------- */
.srpski4eu-lang-switcher {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--wp--preset--color--slate-border);
	border-radius: 9999px;
	padding: 3px;
	background-color: var(--wp--preset--color--parchment-mist);
	gap: 2px;
}

.srpski4eu-lang-switcher a,
.srpski4eu-lang-switcher span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 10px;
	min-height: 28px;
	border-radius: 9999px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
	line-height: 1;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.srpski4eu-lang-switcher .active {
	background-color: var(--wp--preset--color--sovereign-blue);
	color: var(--wp--preset--color--eu-gold);
	cursor: default;
}

.srpski4eu-lang-switcher a:not(.active) {
	color: var(--wp--preset--color--subtle-slate);
}

.srpski4eu-lang-switcher a:not(.active):hover,
.srpski4eu-lang-switcher a:not(.active):focus-visible {
	color: var(--wp--preset--color--sovereign-blue);
	background-color: rgba(255, 204, 0, 0.22);
}

/* -------------------------------------------------------------------------
 * Bilingual Template Part Localization (Header & Footer)
 * ------------------------------------------------------------------------- */
html[lang^="en"] .lang-sr,
html:not([lang^="en"]) .lang-en {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Editorial Line-Length & Typographic Density per DESIGN.md § 1.2
 * ------------------------------------------------------------------------- */
p.editorial-lead,
.editorial-prose p {
	max-width: 65ch;
}

h1,
h2,
h3,
h4,
.wp-block-heading {
	text-wrap: balance;
}

.eyebrow-tag {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1;
	margin-bottom: 0.75rem;
}

.wp-block-group.alignwide > h2,
.wp-block-group.alignwide > p,
.wp-block-group.alignwide > .editorial-prose {
	margin-left: 0;
	margin-right: auto;
}

/* -------------------------------------------------------------------------
 * Full-Bleed Section Continuity & Footer Seamless Attachment
 * ------------------------------------------------------------------------- */
.site-main,
main.site-main,
.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part,
footer.wp-block-template-part,
.site-footer {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.wp-block-post-content > .alignfull,
.site-main > .alignfull,
.wp-site-blocks .alignfull {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.site-footer hr.wp-block-separator {
	opacity: 0.2;
}

.site-footer ul.wp-block-list {
	list-style: none;
	padding-left: 0;
}

/* -------------------------------------------------------------------------
 * 5. Institutional Header & Responsive Mobile Navigation Drawer
 * ------------------------------------------------------------------------- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 1000;
	width: 100%;
}

.admin-bar header.wp-block-template-part {
	top: 32px;
}

@media (max-width: 782px) {

	.admin-bar header.wp-block-template-part {
		top: 46px;
	}
}

.site-header {
	height: 72px;
	border-bottom: 1px solid var(--wp--preset--color--slate-border);
	position: relative;
	z-index: 1000;
	background-color: var(--wp--preset--color--canvas-white);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
	box-shadow: 0 4px 12px rgba(11, 48, 91, 0.08);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.header-inner > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.brand-emblem {
	display: flex !important;
	align-items: center !important;
	text-decoration: none;
	gap: 0.75rem;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.brand-emblem > * {
	margin: 0 !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.brand-emblem svg,
.brand-emblem img {
	flex-shrink: 0;
	width: 50px;
	height: 40px;
	display: block;
	object-fit: contain;
}

.brand-title {
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 700;
	font-size: 1.35rem;
	color: var(--wp--preset--color--sovereign-blue);
	line-height: 1.1;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.brand-subtitle {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.6875rem;
	font-weight: 500;
	color: var(--wp--preset--color--subtle-slate);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.nav-links,
.header-primary-nav .wp-block-navigation__container {
	display: flex;
	align-items: center;
	gap: 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.header-primary-nav .wp-block-navigation-item {
	margin: 0;
	padding: 0;
}

.nav-links a,
.header-primary-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--charcoal-ink);
	font-weight: 500;
	text-decoration: none;
	font-size: 0.9375rem;
	transition: color 0.15s ease;
	padding: 0;
}

.nav-links a:hover,
.header-primary-nav .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--sovereign-blue);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.mobile-menu-toggle {
	display: none;
	background: none;
	border: none;
	padding: 0.5rem;
	min-width: 44px;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--wp--preset--color--sovereign-blue);
	border-radius: 6px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-menu-toggle:hover {
	background-color: var(--wp--preset--color--parchment-mist);
}

.mobile-menu-toggle:focus-visible {
	outline: 2px solid var(--wp--preset--color--sovereign-blue);
	outline-offset: 2px;
}

.mobile-drawer {
	display: none;
}

@media (max-width: 860px) {

	html {
		scroll-padding-top: 68px;
	}

	.site-header {
		height: 64px;
	}

	.brand-emblem svg,
	.brand-emblem img {
		width: 42px;
		height: 34px;
	}

	.brand-title {
		font-size: 1.15rem;
		line-height: 1.1;
	}

	.brand-subtitle {
		font-size: 0.625rem;
		letter-spacing: 0.03em;
	}

	.nav-links,
	.header-primary-nav {
		display: none !important;
	}

	.header-cta {
		display: none;
	}

	.header-actions {
		gap: 0.75rem;
	}

	.mobile-menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
	}

	.mobile-drawer {
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 64px;
		left: 0;
		width: 100%;
		box-sizing: border-box;
		height: calc(100vh - 64px);
		background: var(--wp--preset--color--canvas-white);
		padding: 2rem 1.5rem;
		z-index: 999;
		overflow-y: auto;
		gap: 1.5rem;
		box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
		transform: translateY(-100%);
		opacity: 0;
		pointer-events: none;
		transition: transform 0.25s ease, opacity 0.25s ease;
	}

	.mobile-drawer.is-open {
		transform: translateY(0);
		opacity: 1;
		pointer-events: auto;
	}

	.mobile-drawer .drawer-nav,
	.drawer-primary-nav .wp-block-navigation__container {
		display: flex;
		flex-direction: column;
		gap: 1.25rem;
		list-style: none;
		padding: 0;
		margin: 0;
	}

	.drawer-primary-nav .wp-block-navigation-item {
		margin: 0;
		padding: 0;
	}

	.mobile-drawer .drawer-nav a,
	.drawer-primary-nav .wp-block-navigation-item__content {
		font-size: 1.125rem;
		font-weight: 600;
		color: var(--wp--preset--color--sovereign-blue);
		text-decoration: none;
		padding: 0.625rem 0.75rem;
		min-height: 44px;
		display: flex;
		align-items: center;
		border-radius: 6px;
		box-sizing: border-box;
		transition: background-color 0.15s ease, color 0.15s ease;
	}

	.mobile-drawer .drawer-nav a:hover,
	.mobile-drawer .drawer-nav a:active,
	.drawer-primary-nav .wp-block-navigation-item__content:hover,
	.drawer-primary-nav .wp-block-navigation-item__content:active {
		background-color: rgba(11, 48, 91, 0.05);
	}
}

@media (max-width: 480px) {

	.header-inner {
		padding: 0 1rem;
	}

	.brand-emblem {
		gap: 0.5rem;
	}

	.brand-emblem svg,
	.brand-emblem img {
		width: 38px;
		height: 30px;
	}

	.brand-title {
		font-size: 1.1rem;
	}

	.brand-subtitle {
		font-size: 0.5625rem;
		letter-spacing: 0.02em;
	}

	.header-actions {
		gap: 0.5rem;
	}

	.mobile-menu-toggle {
		padding: 0.375rem;
	}

	.mobile-menu-toggle svg {
		width: 24px;
		height: 24px;
	}
}

@media (max-width: 360px) {

	.header-inner {
		padding: 0 0.75rem;
	}

	.brand-title {
		font-size: 1.05rem;
	}

	.brand-subtitle {
		letter-spacing: 0.01em;
	}

	.srpski4eu-lang-switcher a,
	.srpski4eu-lang-switcher span {
		padding: 3px 7px;
		font-size: 0.6875rem;
	}
}

/* Reading Progress Indicator */
.reading-progress-indicator {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0%;
	height: 2.5px;
	background-color: var(--wp--preset--color--eu-gold);
	transition: width 0.1s ease-out;
	z-index: 1001;
}

/* Scrollspy Active Section Highlighting */
.desktop-nav .nav-links a.is-current-section,
.header-primary-nav .wp-block-navigation-item__content.is-current-section {
	color: var(--wp--preset--color--sovereign-blue);
	font-weight: 700;
}

.mobile-drawer .drawer-nav a.is-current-section,
.drawer-primary-nav .wp-block-navigation-item__content.is-current-section {
	color: var(--wp--preset--color--sovereign-blue);
	font-weight: 700;
	border-left: 3px solid var(--wp--preset--color--eu-gold);
	padding-left: calc(0.75rem - 3px);
}

/* Social Sharing Tray */
.srpski4eu-social-tray {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-top: 1.25rem;
}

.srpski4eu-social-tray p {
	margin: 0 !important;
}

.share-buttons-wrap {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.share-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.85rem;
	min-height: 40px;
	box-sizing: border-box;
	border-radius: 6px;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	background-color: var(--wp--preset--color--parchment-mist);
	color: var(--wp--preset--color--charcoal-ink);
	border: 1px solid var(--wp--preset--color--slate-border);
	cursor: pointer;
	position: relative;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.share-btn:hover,
.share-btn:focus-visible {
	background-color: var(--wp--preset--color--canvas-white);
	border-color: var(--wp--preset--color--sovereign-blue);
	color: var(--wp--preset--color--sovereign-blue);
	outline: none;
}

.share-btn-viber:hover,
.share-btn-viber:focus-visible {
	background-color: #7360f2;
	border-color: #7360f2;
	color: #fff;
}

.share-btn-whatsapp:hover,
.share-btn-whatsapp:focus-visible {
	background-color: #25d366;
	border-color: #25d366;
	color: #fff;
}

.share-btn-x:hover,
.share-btn-x:focus-visible {
	background-color: #000;
	border-color: #000;
	color: #fff;
}

.share-btn-facebook:hover,
.share-btn-facebook:focus-visible {
	background-color: #1877f2;
	border-color: #1877f2;
	color: #fff;
}

.share-feedback {
	display: none;
	position: absolute;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%);
	background-color: var(--wp--preset--color--charcoal-ink);
	color: var(--wp--preset--color--canvas-white);
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	white-space: nowrap;
	pointer-events: none;
	z-index: 10;
}

.share-feedback.is-shown {
	display: block;
}

.history-era-badge {
	display: inline-flex;
	align-items: center;
}

.history-era-icon {
	display: inline-block;
	vertical-align: -2.5px;
	margin-right: 0.45rem;
	flex-shrink: 0;
	color: currentcolor;
}

.petition-reassurance-icon {
	display: inline-block;
	vertical-align: -2.5px;
	margin-right: 0.4rem;
	flex-shrink: 0;
	color: currentcolor;
}

/* Footer Navigation (Native wp:navigation) */
.footer-nav,
.footer-nav .wp-block-navigation__container {
	display: flex;
	flex-direction: column;
	gap: 0 !important;
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-nav .wp-block-navigation-item {
	margin: 0;
	padding: 0;
}

.footer-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--parchment-mist);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.8;
	padding: 0;
	display: inline-block;
	transition: color 0.15s ease;
}

.footer-nav .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--canvas-white);
}

/* Tablet 2-Column Preservation for Bento Grid,
 * EU Practice, and History Cards */
@media (min-width: 600px) and (max-width: 781px) {

	.bento-grid .wp-block-columns,
	#kljucne-cinjenice .wp-block-columns,
	#key-facts .wp-block-columns,
	#evropska-praksa .wp-block-columns,
	#istorija .wp-block-columns,
	#eu-practice .wp-block-columns,
	#history .wp-block-columns {
		flex-wrap: nowrap !important;
	}

	.bento-grid .wp-block-column,
	#kljucne-cinjenice .wp-block-column,
	#key-facts .wp-block-column,
	#evropska-praksa .wp-block-column,
	#istorija .wp-block-column,
	#eu-practice .wp-block-column,
	#history .wp-block-column {
		flex-basis: calc(50% - 0.75rem) !important;
	}
}

/* Print Stylesheet */
@media print {

	@page {
		margin: 1.5cm;
		size: a4 portrait;
	}

	.mobile-menu-toggle,
	.mobile-drawer,
	.header-actions,
	.skip-link,
	.srpski4eu-social-tray,
	.reading-progress-indicator,
	#wpadminbar {
		display: none !important;
	}

	.site-header {
		position: static !important;
		box-shadow: none !important;
		border-bottom: 2px solid #000 !important;
		padding-bottom: 1rem !important;
	}

	body,
	.wp-site-blocks,
	.site-footer,
	#potpisi,
	#sign {
		background: #fff !important;
		color: #000 !important;
	}

	h1,
	h2,
	h3,
	h4,
	p,
	span,
	strong,
	a {
		color: #000 !important;
	}

	.wp-block-columns,
	.editorial-prose,
	.wp-block-group {
		break-inside: avoid;
		break-inside: avoid;
	}

	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
		font-weight: 400;
	}

	.site-footer {
		border-top: 1px solid #000 !important;
		margin-top: 2rem !important;
		padding-top: 1rem !important;
	}
}

