/* ==========================================================================
   Coffeeness - Kategorie-Hub (Template "Kategorie NEU")
   Scope root: .cn-cat  -- never use bare element selectors below it, the
   article body and ~24 ACF blocks style themselves via #main-content.
   ========================================================================== */

/* position:sticky needs an ancestor chain with no scroll container. style.css has
   html{overflow-y:scroll} - so html's overflow goes to the viewport and body keeps
   its own - plus body{overflow-x:hidden}, which makes body a scroll container and
   silently kills every sticky descendant. overflow-x:clip hides the same overflow
   without creating one. Scoped to this template's body class. */
body.cn-cat-page {
	overflow-x: clip;
}

.cn-cat {
	--cnc-white: #ffffff;
	--cnc-soft: #f9f9f9;
	--cnc-creme: #efecea;
	--cnc-blue: #285bb8;
	--cnc-blue-hover: #284985;
	--cnc-dark: #032936;
	--cnc-black: #001524;
	--cnc-grey: #757575;
	--cnc-light-grey: #9e9e9e;
	--cnc-yellow: #ffbb1e;
	--cnc-star-off: #d9d4d0;
	--cnc-border-soft: #e5e5e5;
	--cnc-hairline: #e6e1dd;
	--cnc-radius: 6px;
	--cnc-card-radius: 10px;
	--cnc-card-width: 300px;
	--cnc-card-gap: 24px;
	--cnc-card-shadow: 0 1px 3px rgba(0, 0, 0, .10), 0 1px 2px rgba(0, 0, 0, .06);

	/* Same box as .container-header: hero, stat row and the sticky tab bar */
	--cnc-maxw: 1250px;

	/* Flo #3: the carousel is deliberately narrower than the stat cards above it,
	   so the band reads as its own section instead of continuing the hero grid. */
	--cnc-carousel-maxw: 1140px;

	/* Set from js/category-hub.js: where the sticky tab bar pins and where it ends */
	--cnc-tabs-top: 0px;
	--cnc-tabs-bottom: 0px;

	display: flow-root;
	/* The header's sale banner (.black-section / .black-section-small) is a
	   full-width float. A flow-root box may not overlap a float, so without this
	   the whole hub is squeezed to 0px beside it and clipped - a blank page. */
	clear: both;
}

/* ============================= HERO ============================= */
/* Matched to the mockup's .hero block. The mockup's body sets line-height 1.6
   and h1-h5 Mulish 700 / 1.2 / margin 0 0 .5rem - the theme uses 1.5 and Mulish
   600 / margin-bottom 20px, so every one of those is restated here. Scoped to
   #main-content-page (the hero only); #main-content keeps the article styling. */

/* Narrower measure than the 1250px container, so the headline wraps after the
   year instead of running the full width. */
.cn-cat #main-content-page h1 {
	max-width: 800px;
	font-size: 38px;
	font-weight: 700 !important;
	line-height: 1.2;
	margin: 0 0 .5rem;
	color: var(--cnc-dark);
}

.cn-cat #main-content-page #breadcrumb {
	float: none;
	width: 100%;
	margin: 0 0 16px;
	color: #757575;
}

/* Flex so the gap either side of the chevron is only its own margin. As an inline
   list the space after it also picked up the collapsed newline between </li> and
   <li> plus the theme's li margin-right (style.css:3796), which made it wider than
   the space before it. A flex container drops whitespace-only text nodes. */
.cn-cat #main-content-page #breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	font-size: 14px;
	line-height: 1.65;
}

.cn-cat #main-content-page #breadcrumb ol li {
	margin-right: 0;
}

.cn-cat #main-content-page #breadcrumb ol a,
.cn-cat #main-content-page #breadcrumb ol li:last-of-type a {
	float: none;
	display: inline;
	color: #757575;
	font-weight: 600;
}

.cn-cat #main-content-page #breadcrumb ol a:hover {
	color: var(--cnc-blue);
}

/* The shortcode emits fa-angle-double-right site-wide; the design uses the
   single chevron, so swap the glyph here instead of touching the shortcode. */
.cn-cat #main-content-page #breadcrumb ol i {
	float: none;
	display: inline-block;
	vertical-align: baseline;
	width: auto;
	height: auto;
	margin: 0 6px;
	font-size: 11px;
	color: #757575;
}

.cn-cat #main-content-page #breadcrumb ol i::before {
	content: "\f105";
}

.cn-cat .cnc-stat-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-top: 28px;
}

.cn-cat .cnc-stat-card {
	background: var(--cnc-soft);
	border: 1px solid var(--cnc-border-soft);
	border-radius: var(--cnc-radius);
	padding: 20px;
	text-align: left;
}

/* Flo #1: Public Sans 700 on the number AND the "+" (both live in one element).
   The mockup itself has Mulish 800 here - this is the one place the design was
   deliberately overruled. Everything else on the card follows the mockup, incl.
   the inherited 1.6 line-height. */
.cn-cat .cnc-stat-num {
	font-family: 'Public Sans', Arial, sans-serif;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.6;
	color: var(--cnc-dark);
}

.cn-cat .cnc-stat-lbl {
	font-family: 'Public Sans', Arial, sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.6;
	color: #757575;
}

@media (max-width: 700px) {
	.cn-cat #main-content-page h1 {
		font-size: 28px;
	}

	.cn-cat .cnc-stat-row {
		grid-template-columns: 1fr;
	}
}

/* The carousel band and the product card moved to css/product-carousel.css, so they
   can render on every page with the ACF field display_product_slider and not just
   here. That file re-scopes them from .cn-cat to .kva-slider-scope and carries its
   own copy of the tokens below - the two files share no selectors, so their load
   order does not matter. */

/* ============================= CONTENT TABS ============================= */

.cn-cat #tabsStickySentinel {
	clear: both;
	width: 100%;
}

.cn-cat .content-tabs-wrap {
	position: sticky;
	top: var(--cnc-tabs-top, 0px);
	z-index: 900;
	display: block;
	width: 100%;
	float: none;
	clear: both;
	background: var(--cnc-dark);
	transition: box-shadow .25s ease;
}

.cn-cat .content-tabs-wrap.is-stuck {
	box-shadow: 0 8px 20px rgba(3, 41, 54, .35);
}

.cn-cat #vergleich {
	scroll-margin-top: var(--cnc-tabs-top, 0px);
}

.cn-cat .content-tabs {
	display: flex;
	align-items: center;
	width: var(--cnc-maxw);
	max-width: 100%;
	margin: 0 auto;
	padding: 13px 0;
}

.cn-cat .tabs-track {
	position: relative;
	display: inline-flex;
	gap: 2px;
	padding: 4px;
	background: rgba(255, 255, 255, .08);
	border: 1.5px solid rgba(255, 255, 255, .25);
	border-radius: 999px;
}

.cn-cat .tabs-thumb {
	position: absolute;
	top: 4px;
	height: calc(100% - 8px);
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: left .3s cubic-bezier(.4, 0, .2, 1), width .3s cubic-bezier(.4, 0, .2, 1);
	pointer-events: none;
}

.cn-cat .content-tab {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, .78);
	border-radius: 999px;
	padding: 9px 18px;
	font-family: 'Mulish', Arial, sans-serif;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	position: relative;
	z-index: 1;
	transition: color .2s ease, background .15s ease;
}

.cn-cat .content-tab:hover {
	color: #fff;
	background: rgba(255, 255, 255, .06);
}

.cn-cat .content-tab:active {
	opacity: .85;
}

.cn-cat .content-tab.is-active {
	color: var(--cnc-dark);
}

.cn-cat .content-tab.is-active:hover {
	background: transparent;
}

.cn-cat .content-tab i {
	font-size: 13px;
}

/* One-off attention pulse on the comparison tab (once per session, via JS) */
.cn-cat #tab-vergleich::after {
	content: "";
	position: absolute;
	inset: -5px;
	border-radius: 999px;
	border: 2px solid #fff;
	opacity: 0;
	pointer-events: none;
}

.cn-cat #tab-vergleich.pulse::after {
	animation: cncTabPulseRing 1.6s ease-out 3;
}

@keyframes cncTabPulseRing {
	0% {
		opacity: .6;
		transform: scale(1);
	}

	100% {
		opacity: 0;
		transform: scale(1.24);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cn-cat #tab-vergleich.pulse::after {
		animation: none;
	}
}

.cn-cat .content-tab-panel {
	display: flow-root;
	width: 100%;
	float: none;
	clear: both;
	background: #fff;
}

.cn-cat .content-tab-panel[hidden] {
	display: none !important;
}

/* display:none throws away the panel's layout, so re-showing #panel-artikel has to
   lay out ~540KB of markup, 147 images and 57 tables from scratch - that is the
   1-2s pause coming back from the filter tab. The filter panel is a quarter of that,
   which is why the other direction feels instant.
   content-visibility:hidden skips the contents the same way but keeps the rendering
   state cached, so showing it again is a resume rather than a rebuild. Size
   containment collapses the box to zero height, so it still takes no space.
   Guarded: browsers without it keep the display:none behaviour above. */
@supports (content-visibility: hidden) {
	.cn-cat .content-tab-panel[hidden] {
		display: flow-root !important;
		content-visibility: hidden;
	}
}

/* ===================== VERGLEICH PANEL (filter tool) ===================== */

/* The tool was written for a page where it was the only content, so it stacks high:
   .filter-container z-index 1000 (style-filter.css:26), .suggestion-list 1000 and
   .tooltip_custom-content 9999 - all of them above the sticky tab bar's 900. Making
   the panel its own stacking context contains every one of them in a single rule,
   and nothing inside it needs to paint outside the panel (the compare basket, the
   only fixed widget, lives in the hero above). */
.cn-cat #panel-vergleich {
	position: relative;
	z-index: 0;
}

/* The tool's heading and intro copy. On /kaffeevollautomat-vergleich/ these sat in
   the page hero and were styled by "#main-content-page h1/p" (style.css:2099/2109);
   in the tab they are an H2 in a plain .container, so those metrics are restated. */
/* padding-top only - the shorthand used to zero the 15px left/right that .container
   inherits from bootstrap, which let the heading and lead run to the screen edge on
   phones while the filter box below stayed inset. */
.cn-cat .cnc-filter-intro {
	padding-top: 40px;
}

.cn-cat .cnc-filter-intro h2 {
	font-family: 'Mulish', Arial, sans-serif;
	font-size: 34px;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 20px;
	color: var(--cnc-dark);
}

.cn-cat .cnc-filter-intro p.italic {
	width: 1000px;
	max-width: 100%;
	font-family: 'Public Sans', Arial, sans-serif;
	font-size: 17px;
	font-weight: normal;
	line-height: 27px;
	margin: 0 0 20px;
}

@media (max-width: 700px) {
	.cn-cat .cnc-filter-intro h2 {
		font-size: 26px;
	}
}

/* The tool's own #main-content gets style.css's generic 60px top padding. On the
   filter page that was cancelled by "#main-content-page + #main-content"; inside
   the tab the intro block sits in front of it instead, so trim it here. */
.cn-cat .content-tab-panel.page-template-page-Filter > #main-content {
	padding-top: 20px;
}

/* The sidebar TOC pins itself with position:fixed;top:0 (style.css) - push it
   below the sticky tab bar, plus a little air so it is not glued to it. */
.cn-cat #toc.fixed {
	top: calc(var(--cnc-tabs-bottom, 0px) + 10px);
}

@media (max-width: 1280px) {
	.cn-cat .content-tabs {
		padding-left: 15px;
		padding-right: 15px;
	}
}

@media (max-width: 480px) {
	.cn-cat .content-tabs {
		padding: 11px 14px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.cn-cat .content-tab {
		font-size: 13.5px;
		padding: 7px 14px;
		white-space: nowrap;
		flex: 0 0 auto;
	}
}
