/* =========================================================================
   Hund24 — global layout & components (loaded on every page)
   ========================================================================= */

body {
	font-family: var(--h24-font);
	font-size: var(--h24-fs-base);
	color: var(--h24-text);
	background: var(--h24-bg);
	display: flex;
	flex-direction: column;
}

.site-main { flex: 1 0 auto; }

a { color: var(--h24-primary-dark); }
a:hover { color: var(--h24-primary); }

/* ---- Layout containers --------------------------------------------------- */
.container {
	width: min(100% - 2rem, var(--h24-wide));
	margin-inline: auto;
}

.container--narrow { width: min(100% - 2rem, var(--h24-content)); }
.container--wide { width: min(100% - 2rem, var(--h24-wide)); }

/* ---- Accessibility helpers ---------------------------------------------- */
.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;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
}
.skip-link:focus {
	left: 1rem;
	top: 1rem;
	width: auto; height: auto;
	clip: auto;
	padding: .6rem 1rem;
	background: var(--h24-text);
	color: #fff;
	border-radius: var(--h24-radius-sm);
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .7rem 1.25rem;
	border-radius: var(--h24-radius-sm);
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn .icon { width: 1.1em; height: 1.1em; }
.btn--accent { background: var(--h24-accent); color: #fff; }
.btn--accent:hover { background: var(--h24-accent-dark); color: #fff; }
.btn--primary { background: var(--h24-primary); color: #fff; }
.btn--primary:hover { background: var(--h24-primary-dark); color: #fff; }
.btn--ghost { border: 2px solid var(--h24-border); color: var(--h24-text); }
.btn--ghost:hover { border-color: var(--h24-primary); color: var(--h24-primary); }

/* ---- Header ------------------------------------------------------------- */
.site-header {
	position: relative;
	border-bottom: 1px solid var(--h24-border);
	background: var(--h24-bg);
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--h24-s2);
	min-height: 64px;
	padding-block: .6rem;
}
.site-branding { display: flex; align-items: center; }
.site-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.site-title a { color: var(--h24-text); text-decoration: none; }
.site-title a:hover { color: var(--h24-primary); }
.custom-logo { max-height: 48px; width: auto; }

/* ---- Navigation: toggle ------------------------------------------------- */
.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px; height: 44px;
	color: var(--h24-text);
	border-radius: var(--h24-radius-sm);
}
.nav-enhanced .nav-toggle { display: inline-flex; }
.nav-toggle__icon { display: inline-flex; }
.nav-toggle .icon--close { display: none; }
.nav-open .nav-toggle .icon--menu { display: none; }
.nav-open .nav-toggle .icon--close { display: inline-block; }

/* ---- Navigation: menu (mobile-first, no-JS friendly) -------------------- */
.primary-menu {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1rem;
	padding: 0;
	margin: 0;
}
.primary-menu a {
	display: block;
	padding: .55rem .25rem;
	text-decoration: none;
	color: var(--h24-text);
	font-weight: 600;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a { color: var(--h24-primary); }
.sub-menu { list-style: none; padding: 0; margin: 0; }
.submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px; height: 38px;
	color: var(--h24-muted);
}

/* Enhanced (JS on): collapse into a panel on small screens */
.nav-enhanced .primary-nav {
	display: none;
	position: absolute;
	left: 0; right: 0; top: 100%;
	background: var(--h24-bg);
	border-bottom: 1px solid var(--h24-border);
	box-shadow: var(--h24-shadow);
	padding: var(--h24-s2);
	z-index: 50;
}
.nav-enhanced.nav-open .primary-nav { display: block; }
.nav-enhanced .primary-menu { flex-direction: column; gap: 0; }
.nav-enhanced .primary-menu > li { border-bottom: 1px solid var(--h24-border); }
.nav-enhanced .primary-menu > li:last-child { border-bottom: 0; }
.nav-enhanced .menu-item-has-children {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}
.nav-enhanced .menu-item-has-children > a { flex: 1; }
.nav-enhanced .menu-item-has-children > .sub-menu { flex-basis: 100%; display: none; padding-left: var(--h24-s2); }
.nav-enhanced .submenu-open > .sub-menu { display: block; }

/* Desktop nav */
@media (min-width: 768px) {
	.nav-enhanced .nav-toggle { display: none; }
	.nav-enhanced .primary-nav {
		display: block;
		position: static;
		padding: 0;
		border: 0;
		box-shadow: none;
		background: none;
	}
	.primary-menu,
	.nav-enhanced .primary-menu { flex-direction: row; align-items: center; gap: .25rem 1.25rem; }
	.nav-enhanced .primary-menu > li { border: 0; }
	.menu-item-has-children { position: relative; }
	.submenu-toggle { display: none; }
	.sub-menu {
		position: absolute;
		left: 0; top: 100%;
		min-width: 210px;
		display: none;
		background: var(--h24-bg);
		border: 1px solid var(--h24-border);
		border-radius: var(--h24-radius-sm);
		box-shadow: var(--h24-shadow);
		padding: .4rem 0;
		z-index: 60;
	}
	.sub-menu a { padding: .5rem 1rem; }
	.menu-item-has-children:hover > .sub-menu,
	.menu-item-has-children:focus-within > .sub-menu,
	.nav-enhanced .menu-item-has-children:hover > .sub-menu,
	.nav-enhanced .menu-item-has-children:focus-within > .sub-menu { display: block; }
}

/* ---- Breadcrumbs -------------------------------------------------------- */
.breadcrumbs {
	font-size: var(--h24-fs-sm);
	color: var(--h24-muted);
	padding-block: var(--h24-s2) .25rem;
}
.breadcrumbs a { color: var(--h24-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--h24-primary); text-decoration: underline; }
.breadcrumbs__sep { padding-inline: .35rem; }
.breadcrumbs [aria-current="page"] { color: var(--h24-text); }

/* ---- Card grid ---------------------------------------------------------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: var(--h24-s3);
}
.card {
	background: var(--h24-bg);
	border: 1px solid var(--h24-border);
	border-radius: var(--h24-radius);
	overflow: hidden;
	transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--h24-shadow); transform: translateY(-2px); }
.card__link { display: block; height: 100%; text-decoration: none; color: inherit; }
.card__media { aspect-ratio: 3 / 2; background: var(--h24-surface); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--h24-s2) var(--h24-s2) var(--h24-s3); }
.card__cat {
	display: inline-block;
	font-size: var(--h24-fs-sm);
	font-weight: 700;
	color: var(--h24-primary);
	text-transform: uppercase;
	letter-spacing: .03em;
	margin-bottom: .35rem;
}
.card__title { font-size: var(--h24-fs-lg); margin-bottom: .4rem; }
.card__link:hover .card__title { color: var(--h24-primary-dark); }
.card__excerpt { color: var(--h24-muted); font-size: .97rem; }

/* ---- Archive header ----------------------------------------------------- */
.archive { padding-block: var(--h24-s3) var(--h24-s5); }
.archive-header { margin-bottom: var(--h24-s3); }
.archive-title { font-size: var(--h24-fs-h1); }
.archive-title span { color: var(--h24-primary); }
.archive-desc { color: var(--h24-muted); margin-top: .5rem; max-width: var(--h24-content); }
.archive-header__search { margin-top: var(--h24-s2); max-width: 28rem; }
.no-results { padding-block: var(--h24-s4); color: var(--h24-muted); }
.no-results .search-form { margin-top: var(--h24-s2); max-width: 28rem; }

/* ---- Pagination --------------------------------------------------------- */
.pagination { margin-top: var(--h24-s4); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	padding: .5rem .7rem;
	border: 1px solid var(--h24-border);
	border-radius: var(--h24-radius-sm);
	text-decoration: none;
	color: var(--h24-text);
}
.pagination .page-numbers:hover { border-color: var(--h24-primary); color: var(--h24-primary); }
.pagination .page-numbers.current { background: var(--h24-primary); border-color: var(--h24-primary); color: #fff; }
.pagination .page-numbers.dots { border: 0; }

/* ---- Search form -------------------------------------------------------- */
.search-form { display: flex; gap: .5rem; }
.search-form__input {
	flex: 1;
	padding: .65rem .9rem;
	border: 1px solid var(--h24-border);
	border-radius: var(--h24-radius-sm);
	background: var(--h24-bg);
}
.search-form__input:focus-visible { outline: 3px solid var(--h24-focus); outline-offset: 1px; border-color: var(--h24-primary); }
.search-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	border-radius: var(--h24-radius-sm);
	background: var(--h24-primary);
	color: #fff;
}
.search-form__submit:hover { background: var(--h24-primary-dark); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
	flex-shrink: 0;
	margin-top: var(--h24-s5);
	background: var(--h24-surface);
	border-top: 1px solid var(--h24-border);
	padding-block: var(--h24-s4);
}
.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: var(--h24-s3);
	justify-content: space-between;
	align-items: flex-start;
}
.site-footer__desc { color: var(--h24-muted); font-size: .97rem; margin-top: .35rem; max-width: 32rem; }
.footer-menu { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 0; margin: 0; }
.footer-menu a { color: var(--h24-text); text-decoration: none; font-weight: 600; }
.footer-menu a:hover { color: var(--h24-primary); }
.site-footer__legal {
	margin-top: var(--h24-s3);
	padding-top: var(--h24-s2);
	border-top: 1px solid var(--h24-border);
	color: var(--h24-muted);
	font-size: var(--h24-fs-sm);
}
.site-footer__custom { margin-bottom: .5rem; }
