/* ==========================================================================
   hajrudin-ahmetovic 2.x — base.css
   Dizajn tokeni, reset, tipografija, sadržaj (prose), pristupačnost.
   ========================================================================== */

:root {
	/* Paleta */
	--ha-navy: #13294b;
	--ha-navy-deep: #0c1c35;
	--ha-green: #1e4a3d;
	--ha-green-deep: #133329;
	--ha-gold: #b8914f;
	--ha-gold-soft: #d9bf8c;
	--ha-gold-ink: #87652a;      /* zlatna za tekst na svijetloj podlozi (kontrast AA) */
	--ha-sand: #ece3d1;
	--ha-sand-soft: #f3ecdf;
	--ha-cream: #f8f5ee;
	--ha-white: #ffffff;
	--ha-text: #1d2127;
	--ha-muted: #59606a;
	--ha-border: #e3dccd;
	--ha-border-strong: #cfc4ad;
	--ha-surface: #ffffff;
	--ha-on-dark: #f4efe4;
	--ha-on-dark-muted: #c3cbd6;
	--ha-focus: #2f6fd6;
	--ha-danger: #9b2c2c;

	/* Tipografija */
	--ha-font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
	--ha-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ha-font-arabic: "Amiri", "Scheherazade New", "Traditional Arabic", "Noto Naskh Arabic", serif;

	--ha-fs-xs: 0.8125rem;
	--ha-fs-sm: 0.9375rem;
	--ha-fs-base: 1.0625rem;
	--ha-fs-lg: 1.1875rem;
	--ha-fs-h4: 1.1875rem;
	--ha-fs-h3: clamp(1.25rem, 1.12rem + 0.45vw, 1.5rem);
	--ha-fs-h2: clamp(1.75rem, 1.38rem + 1.4vw, 2.5rem);
	--ha-fs-h1: clamp(2.125rem, 1.55rem + 2.5vw, 3.5rem);
	--ha-fs-display: clamp(2.5rem, 1.7rem + 3.4vw, 4.25rem);

	/* Razmaci / layout */
	--ha-container: 1280px;
	--ha-container-medium: 960px;
	--ha-reading: 760px;
	--ha-gutter: clamp(16px, 4vw, 40px);
	--ha-section: clamp(56px, 4.5rem + 2.5vw, 104px);
	--ha-section-sm: clamp(40px, 3rem + 1.5vw, 72px);
	--ha-gap: clamp(16px, 1rem + 1vw, 28px);

	/* Oblik */
	--ha-radius-sm: 8px;
	--ha-radius: 14px;
	--ha-radius-lg: 20px;
	--ha-shadow-sm: 0 1px 2px rgba(19, 41, 75, 0.06);
	--ha-shadow: 0 8px 28px -12px rgba(19, 41, 75, 0.22);
	--ha-shadow-lg: 0 22px 50px -24px rgba(12, 28, 53, 0.4);
	--ha-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--ha-dur: 0.22s;

	--ha-header-h: 76px;
	--ha-pattern: url("../images/pattern.svg");
}

/* ---------- Reset ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--ha-header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background: var(--ha-cream);
	color: var(--ha-text);
	font-family: var(--ha-font-sans);
	font-size: var(--ha-fs-base);
	line-height: 1.65;
	font-feature-settings: "kern", "liga";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

img {
	display: block;
	border-style: none;
}

svg {
	flex-shrink: 0;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

button {
	cursor: pointer;
}

[hidden] {
	display: none !important;
}

a {
	color: var(--ha-green);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--ha-dur) var(--ha-ease);
}

a:hover {
	color: var(--ha-gold-ink);
}

/* ---------- Tipografija ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	font-family: var(--ha-font-serif);
	font-weight: 600;
	line-height: 1.18;
	color: var(--ha-navy);
	letter-spacing: -0.01em;
	overflow-wrap: break-word;
	hyphens: manual;
}

h1 { font-size: var(--ha-fs-h1); }
h2 { font-size: var(--ha-fs-h2); }
h3 { font-size: var(--ha-fs-h3); }
h4 { font-size: var(--ha-fs-h4); }

p {
	margin: 0 0 1em;
}

strong,
b {
	font-weight: 600;
}

small {
	font-size: var(--ha-fs-xs);
}

::selection {
	background: var(--ha-gold-soft);
	color: var(--ha-navy-deep);
}

/* ---------- Pristupačnost ---------- */

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

.hl-skip-link {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 1000;
	padding: 12px 18px;
	background: var(--ha-navy);
	color: var(--ha-white);
	border-radius: var(--ha-radius-sm);
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-160%);
	transition: transform var(--ha-dur) var(--ha-ease);
}

.hl-skip-link:focus {
	transform: translateY(0);
	color: var(--ha-white);
}

:focus-visible {
	outline: 3px solid var(--ha-focus);
	outline-offset: 3px;
	border-radius: 4px;
}

.hl-main:focus {
	outline: none;
}

/* ---------- Sadržaj (prose) ---------- */

.hl-prose {
	font-size: var(--ha-fs-lg);
	line-height: 1.78;
	color: var(--ha-text);
	overflow-wrap: break-word;
}

.hl-prose > * + * {
	margin-top: 1.1em;
}

.hl-prose > :first-child {
	margin-top: 0;
}

.hl-prose p {
	margin: 0;
}

.hl-prose p + p {
	margin-top: 1.1em;
}

.hl-prose h2 {
	margin-top: 1.9em;
	margin-bottom: 0.6em;
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.95rem);
}

.hl-prose h3 {
	margin-top: 1.6em;
	margin-bottom: 0.5em;
	font-size: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
}

.hl-prose h4 {
	margin-top: 1.4em;
	margin-bottom: 0.4em;
}

.hl-prose a {
	color: var(--ha-green);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--ha-gold) 65%, transparent);
	text-decoration-thickness: 1.5px;
}

.hl-prose a:hover {
	color: var(--ha-gold-ink);
	text-decoration-color: currentColor;
}

.hl-prose ul,
.hl-prose ol {
	padding-left: 1.4em;
}

.hl-prose li + li {
	margin-top: 0.4em;
}

.hl-prose li::marker {
	color: var(--ha-gold-ink);
}

.hl-prose blockquote,
.hl-prose .wp-block-quote {
	margin-left: 0;
	margin-right: 0;
	padding: 0.4em 0 0.4em 1.4em;
	border-left: 3px solid var(--ha-gold);
	font-family: var(--ha-font-serif);
	font-size: 1.15em;
	line-height: 1.6;
	color: var(--ha-navy);
}

.hl-prose blockquote cite,
.hl-prose .wp-block-quote cite {
	display: block;
	margin-top: 0.6em;
	font-family: var(--ha-font-sans);
	font-size: var(--ha-fs-sm);
	font-style: normal;
	color: var(--ha-muted);
}

.hl-prose figure {
	margin-left: 0;
	margin-right: 0;
}

.hl-prose img {
	border-radius: var(--ha-radius-sm);
}

.hl-prose figcaption,
.hl-prose .wp-caption-text,
.hl-prose .wp-element-caption {
	margin-top: 0.6em;
	font-size: var(--ha-fs-sm);
	color: var(--ha-muted);
	text-align: center;
}

.hl-prose .wp-caption {
	max-width: 100%;
}

.hl-prose hr,
.hl-prose .wp-block-separator {
	width: 80px;
	margin: 2.4em auto;
	border: 0;
	border-top: 2px solid var(--ha-gold);
	opacity: 0.8;
}

.hl-prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--ha-fs-sm);
}

.hl-prose th,
.hl-prose td {
	padding: 0.6em 0.8em;
	border-bottom: 1px solid var(--ha-border);
	text-align: left;
}

.hl-prose pre {
	overflow-x: auto;
	padding: 1em;
	background: var(--ha-sand-soft);
	border-radius: var(--ha-radius-sm);
	font-size: 0.9em;
}

.hl-prose :where(iframe, embed, object, video) {
	max-width: 100%;
}

.hl-prose .wp-block-embed,
.hl-prose .wp-block-audio,
.hl-prose .wp-block-video {
	margin-top: 1.6em;
	margin-bottom: 1.6em;
}

.hl-prose audio {
	width: 100%;
}

/* Arapski tekst u sadržaju (ako postoji) */
.hl-prose [lang="ar"],
.hl-prose [dir="rtl"] {
	font-family: var(--ha-font-arabic);
	font-size: 1.3em;
	line-height: 2;
}

/* Poravnanja (klasični editor + blokovi) */
.alignleft {
	float: left;
	margin: 0.3em 1.4em 1em 0;
}

.alignright {
	float: right;
	margin: 0.3em 0 1em 1.4em;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.hl-prose .alignwide {
	width: min(100vw - 2 * var(--ha-gutter), 1040px);
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.hl-prose .alignfull {
	width: 100vw;
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.hl-prose::after {
	content: "";
	display: table;
	clear: both;
}

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

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Print ---------- */

@media print {
	.hl-header,
	.hl-footer,
	.hl-mini,
	.hl-share,
	.hl-player,
	.hl-readbar {
		display: none !important;
	}

	body {
		background: #fff;
	}
}
