/* ARPIDA – základ: reset, typografie, fokus, formuláře, přístupnost. Načítá se po tokens.css. */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-height) + 1rem);
	hanging-punctuation: first last;
}

@media (prefers-reduced-motion: no-preference) {
	html:not([data-a11y-motion="off"]) {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-m);
	line-height: var(--leading-normal);
	color: var(--c-ink);
	background: var(--c-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}

/* Typografie */
h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--font-heading);
	font-weight: var(--weight-black);
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-tight);
	color: var(--c-primary);
	text-wrap: balance;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); font-weight: var(--weight-bold); }
h4 { font-size: var(--text-l); font-weight: var(--weight-bold); }
h5, h6 { font-size: var(--text-m); font-weight: var(--weight-bold); }

p, ul, ol, dl, blockquote, figure, table, pre {
	margin: 0;
}

p {
	text-wrap: pretty;
}

strong, b { font-weight: var(--weight-bold); }
small { font-size: var(--text-s); }

a {
	color: var(--c-link);
	text-decoration-thickness: 0.09em;
	text-underline-offset: 0.18em;
	transition: color var(--dur-fast) var(--ease);
}

a:hover {
	color: var(--c-link-hover);
}

::selection {
	background: var(--c-accent);
	color: var(--c-ink);
}

/* Fokus – dvoubarevný prstenec: modrá u prvku, žlutá vně (kontrast na bílé i modré) */
:focus {
	outline: none;
}

:focus-visible {
	outline: 3px solid var(--c-focus);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px var(--c-focus-inner);
	border-radius: var(--radius-xs);
}

/* Média */
img, picture, video, svg, canvas {
	display: block;
	max-width: 100%;
}

img, video {
	height: auto;
}

/* SVG bez explicitního fill atributu dědí barvu textu; ikony s fill="none" (obrysové) zůstávají */
svg:not([fill]) {
	fill: currentColor;
}

.icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

/* Formuláře */
button, input, select, textarea {
	font: inherit;
	color: inherit;
	margin: 0;
}

button {
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
}

input:not([type="checkbox"], [type="radio"], [type="range"]),
select,
textarea {
	width: 100%;
	min-height: 3rem;
	padding: 0.625rem 0.875rem;
	background: var(--c-surface);
	border: 2px solid var(--c-line-strong);
	border-radius: var(--radius-s);
	transition: border-color var(--dur-fast) var(--ease);
}

input:not([type="checkbox"], [type="radio"], [type="range"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
	border-color: var(--c-primary);
	outline-offset: 2px;
}

textarea {
	min-height: 8rem;
	resize: vertical;
}

label {
	font-weight: var(--weight-medium);
}

fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

::placeholder {
	color: var(--c-neutral-500);
	opacity: 1;
}

/* Tabulky v textu */
table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--text-s);
}

th, td {
	text-align: left;
	vertical-align: top;
	padding: 0.625rem 0.75rem;
	border-bottom: 1px solid var(--c-line);
}

th {
	font-weight: var(--weight-bold);
	color: var(--c-primary);
}

thead th {
	border-bottom: 2px solid var(--c-line-strong);
}

/* Details */
summary {
	cursor: pointer;
}

/* Přeskočit na obsah */
.skip-link {
	position: fixed;
	top: 0.75rem;
	left: 0.75rem;
	z-index: var(--z-toast);
	padding: 0.75rem 1.25rem;
	background: var(--c-primary);
	color: var(--c-on-primary);
	font-weight: var(--weight-bold);
	border-radius: var(--radius-pill);
	text-decoration: none;
	transform: translateY(calc(-100% - 1.5rem));
	transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus-visible {
	transform: none;
	color: var(--c-on-primary);
}

/* Vizuálně skryté, ale dostupné pro čtečky */
.u-visually-hidden:not(:focus, :active) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Omezený pohyb: systémová volba i volba v panelu přístupnosti */
@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;
	}
}

html[data-a11y-motion="off"] *,
html[data-a11y-motion="off"] *::before,
html[data-a11y-motion="off"] *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
}

/* Podtržení odkazů všude (a11y panel) */
html[data-a11y-links="underline"] a {
	text-decoration: underline !important;
}

/* Tisk */
@media print {
	.site-header, .site-footer, .a11y-panel, .a11y-toggle, .skip-link, .anchor-nav, [data-noprint] {
		display: none !important;
	}

	body {
		color: #000;
		background: #fff;
	}

	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
	}
}
