/* ==========================================================================
   SIMPLY the BEST – Seitenlayout (nur Frontend)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-size: 16px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }

.stb-container,
.stb-header__inner,
.stb-footer__grid { width: min(980px, 100% - 40px); margin-inline: auto; }

/* Barrierefreiheit */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	left: 12px; top: 12px; z-index: 1000;
	background: #fff; color: var(--stb-dark);
	padding: 10px 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
:focus-visible { outline: 2px solid var(--stb-orange); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.stb-header { background: #fff; position: relative; z-index: 50; }
.stb-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 117px;
	gap: 24px;
}
.stb-header__logo img,
.stb-header__logo .custom-logo { display: block; width: auto; height: 46px; }

/* Text-Logo, solange kein Logo hochgeladen ist */
.stb-logo-text {
	display: inline-grid;
	grid-template-columns: auto auto auto;
	align-items: baseline;
	column-gap: 2px;
	color: var(--stb-dark);
	text-decoration: none !important;
	font-family: var(--wp--preset--font-family--dm-sans);
	font-weight: 700;
	font-size: 26px;
	letter-spacing: .02em;
	line-height: 1;
}
.stb-logo-text em {
	font-family: var(--wp--preset--font-family--playfair);
	font-style: italic;
	font-weight: 400;
	color: var(--stb-orange);
	font-size: 30px;
}
.stb-logo-text small {
	grid-column: 1 / -1;
	font-size: 8px;
	font-weight: 500;
	letter-spacing: .12em;
	text-align: center;
	color: var(--stb-red);
	margin-top: 3px;
}

/* Navigation */
.stb-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(24px, 4.3vw, 64px); }
.stb-menu li { position: relative; }
.stb-menu a {
	display: block;
	color: rgba(0, 0, 0, .9);
	font-size: 17px;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
	text-decoration: none !important;
	transition: color .2s ease, border-color .2s ease;
}
.stb-menu a:hover { color: var(--stb-orange); }
.stb-menu :is(.current-menu-item, .current-menu-ancestor, .current_page_item, .current_page_parent) > a { border-bottom-color: var(--stb-orange); }
/* Untermenüs (falls später gebraucht) */
.stb-menu .sub-menu {
	list-style: none; margin: 0; padding: 10px 0;
	position: absolute; left: -16px; top: 100%;
	min-width: 220px; background: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	display: none;
}
.stb-menu .sub-menu a { padding: 8px 16px; border: 0; }
.stb-menu li:hover > .sub-menu,
.stb-menu li:focus-within > .sub-menu { display: block; }

.stb-nav-toggle {
	display: none;
	background: none;
	border: 0;
	width: 44px; height: 44px;
	padding: 10px;
	cursor: pointer;
	color: var(--stb-dark);
}
.stb-nav-toggle__bars,
.stb-nav-toggle__bars::before,
.stb-nav-toggle__bars::after {
	display: block;
	width: 24px; height: 2px;
	background: currentColor;
	position: relative;
	transition: transform .2s ease, opacity .2s ease;
}
.stb-nav-toggle__bars::before, .stb-nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.stb-nav-toggle__bars::before { top: -7px; }
.stb-nav-toggle__bars::after { top: 7px; }
.stb-nav-toggle[aria-expanded="true"] .stb-nav-toggle__bars { background: transparent; }
.stb-nav-toggle[aria-expanded="true"] .stb-nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.stb-nav-toggle[aria-expanded="true"] .stb-nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 991px) {
	.stb-header__inner { min-height: 84px; }
	.stb-header__logo img, .stb-header__logo .custom-logo { height: 38px; }
	.stb-nav-toggle { display: block; }
	.stb-nav {
		position: absolute; left: 0; right: 0; top: 100%;
		background: #fff;
		box-shadow: 0 10px 18px rgba(0, 0, 0, .08);
		display: none;
	}
	.stb-nav.is-open { display: block; }
	.stb-menu { flex-direction: column; gap: 0; width: min(980px, 100% - 40px); margin: 0 auto; padding: 8px 0 20px; }
	.stb-menu a { padding: 12px 0; font-size: 18px; border-bottom: 1px solid #eee; }
	.stb-menu :is(.current-menu-item, .current_page_item, .current_page_parent) > a { color: var(--stb-orange); border-bottom-color: #eee; }
	.stb-menu .sub-menu { position: static; display: block; box-shadow: none; padding: 0 0 0 16px; }
}

/* --------------------------------------------------------------------------
   Inhaltsbereich
   -------------------------------------------------------------------------- */
.stb-main { display: block; }
.stb-page > .entry-content > :first-child { margin-block-start: 0; }
.entry-content > .alignfull { margin-block: 0; }
.entry-content > :last-child { margin-block-end: 0; }
.entry-content > p,
.entry-content .wp-block-group > p { line-height: 1.5; }

.stb-entry-header {
	width: min(980px, 100% - 40px);
	margin: 0 auto;
	padding-top: clamp(32px, 5vw, 56px);
}
.stb-entry-title {
	font-size: clamp(30px, 4vw, 46px);
	margin: 0 0 14px;
}

.stb-page--titled .entry-content,
.stb-single .entry-content { padding-bottom: var(--stb-section-space); }
.stb-single .entry-content { padding-top: 24px; }

.stb-single__footer { width: min(980px, 100% - 40px); margin: 0 auto var(--stb-section-space); }

/* Meta-Zeile: Datum | Kategorie */
.stb-meta { font-size: 15px; margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stb-meta svg { width: 1em; height: 1em; fill: currentColor; vertical-align: -2px; margin-right: 5px; }
.stb-meta a { color: inherit; }
.stb-meta__sep { opacity: .9; }

/* --------------------------------------------------------------------------
   News-Liste (Shortcode [stb_news] und Archivseiten)
   -------------------------------------------------------------------------- */
.stb-archive { padding-bottom: var(--stb-section-space); }
.stb-archive .stb-news-list,
.stb-archive .stb-pagination,
.stb-archive > p,
.stb-archive__desc { width: min(980px, 100% - 40px); margin-inline: auto; }
.stb-archive .stb-news-list { margin-top: 40px; }

.stb-news-list { display: grid; gap: clamp(40px, 6vw, 78px); }
.stb-news-item { display: grid; grid-template-columns: minmax(0, 310px) minmax(0, 1fr); gap: 36px; align-items: start; }
.stb-news-item__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--wp--preset--color--stb-grey); }
.stb-news-item__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.stb-news-item__media:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .stb-news-item__media img { transition: none; } }
.stb-news-item__placeholder { display: block; width: 100%; height: 100%; }
.stb-news-item__title {
	font-family: var(--wp--preset--font-family--nanum);
	font-size: var(--wp--preset--font-size--subtitle);
	line-height: 1.1;
	margin: 0 0 12px;
}
.stb-news-item__title a { color: var(--stb-accent); text-decoration: none; }
.stb-news-item__title a:hover { text-decoration: underline; }
.stb-news-item__teaser p { margin: 0 0 14px; font-size: 16px; }
@media (max-width: 640px) {
	.stb-news-item { grid-template-columns: 1fr; gap: 16px; }
}

/* Seitennummerierung */
.stb-pagination,
.stb-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 10px; font-size: 16px; margin-top: 40px; }
.stb-pagination .nav-links { margin: 0; }
.stb-pagination a { color: var(--stb-accent); }
.stb-pagination .current { color: var(--stb-dark); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.stb-footer { background: var(--stb-dark); color: #fff; font-size: 16px; padding: 60px 0 36px; }
.stb-footer a { color: var(--stb-orange); text-decoration: none; }
.stb-footer a:hover { text-decoration: underline; }
.stb-footer__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.stb-footer__address p { margin: 0; }
.stb-footer__contact { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; margin: 0; }
.stb-footer__contact dd { margin: 0; color: var(--stb-orange); }
.stb-footer__menu,
.stb-legal-menu { list-style: none; margin: 0; padding: 0; }
.stb-legal-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 15px; }
.stb-footer__legal { margin-top: 54px; }
@media (max-width: 760px) {
	.stb-footer__grid { grid-template-columns: 1fr; }
}

/* Nach-oben-Button */
.stb-to-top {
	position: fixed;
	right: 18px;
	bottom: 18px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--stb-orange);
	color: #fff;
	display: grid;
	place-items: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
	z-index: 40;
}
.stb-to-top svg { width: 24px; height: 24px; }
.stb-to-top.is-visible { opacity: 1; visibility: visible; }

/* WordPress-Kernklassen */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.wp-caption-text, figcaption { font-size: 14px; }
.search-form { display: flex; gap: 8px; margin: 20px 0; }
.search-form label { flex: 1; }
