/*
Theme Name: Techracker Glass
Template: generatepress
Description: Child-Theme fuer Techracker. Enthaelt das komplette visuelle
             Design (Farben, Typografie, Startseiten-Raster, Ticker,
             Hell-/Dunkel-Modus, Deal-Kacheln).
Version: 1.0
Text Domain: techracker-glass
*/

/* --------------------------------------------------------------
   1. Grundfarben und Variablen (hell/dunkel)
   -------------------------------------------------------------- */
:root {
	--tr-bg: #f7f7f5;
	--tr-surface: #ffffff;
	--tr-text: #14141a;
	--tr-muted: #6b6b76;
	--tr-border: #e7e7e2;
	--tr-accent: #fff254;
	--tr-accent-text: #14141a;
	--tr-radius: 18px;
	--tr-radius-sm: 12px;
	--tr-shadow: 0 1px 2px rgba(20, 20, 26, 0.04), 0 8px 24px rgba(20, 20, 26, 0.05);

	--tr-c-telko: #3b82f6;
	--tr-c-mobilfunk: #3b82f6;
	--tr-c-smart-home: #8b5cf6;
	--tr-c-smart-home-deals: #8b5cf6;
	--tr-c-elektronik: #f59e0b;
	--tr-c-geschenke: #ef4444;
	--tr-c-buero: #14b8a6;
	--tr-c-buero-deals: #14b8a6;
	--tr-c-buero-homeoffice: #14b8a6;
	--tr-c-vpn: #22c55e;
	--tr-c-ratgeber: #6b6b76;
	--tr-c-default: #6b6b76;
}

:root[data-theme="dark"] {
	--tr-bg: #0f0f13;
	--tr-surface: #1a1a20;
	--tr-text: #f2f2f0;
	--tr-muted: #9a9aa4;
	--tr-border: #2b2b33;
	--tr-accent: #fff254;
	--tr-accent-text: #14141a;
	--tr-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--tr-bg);
	color: var(--tr-text);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	transition: background-color 0.2s ease, color 0.2s ease;
	opacity: 0;
}

body.tr-ready {
	opacity: 1;
	transition: opacity 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, .main-title {
	font-family: 'Archivo', 'Inter', sans-serif;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--tr-text);
}

a {
	color: inherit;
}

/* --------------------------------------------------------------
   2. Lesefortschritt
   -------------------------------------------------------------- */
.tr-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0%;
	background: var(--tr-accent);
	z-index: 9999;
}

/* --------------------------------------------------------------
   3. Farbschleier (dekorative Blobs im Hintergrund)
   -------------------------------------------------------------- */
.tr-blobs {
	position: fixed;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}

.tr-blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.25;
}

.tr-blob-1 {
	width: 420px;
	height: 420px;
	top: -120px;
	left: -100px;
	background: var(--tr-accent);
}

.tr-blob-2 {
	width: 360px;
	height: 360px;
	top: 20%;
	right: -140px;
	background: var(--tr-c-smart-home);
	opacity: 0.15;
}

.tr-blob-3 {
	width: 320px;
	height: 320px;
	bottom: -140px;
	left: 30%;
	background: var(--tr-c-vpn);
	opacity: 0.12;
}

/* --------------------------------------------------------------
   4. Laufband (Ticker) ueber der Kopfzeile
   -------------------------------------------------------------- */
.tr-ticker {
	background: var(--tr-surface);
	border-bottom: 1px solid var(--tr-border);
	position: relative;
	z-index: 2;
}

.tr-ticker-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 8px 24px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
	color: var(--tr-muted);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tr-ticker .tr-lab {
	flex: 0 0 auto;
	background: var(--tr-accent);
	color: var(--tr-accent-text);
	padding: 3px 9px;
	border-radius: 4px;
}

.tr-ticker p {
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* --------------------------------------------------------------
   5. Label-Text (ueberall wiederverwendet) - kein Pillen-Hintergrund,
      nur beim Ticker-Badge weiter unten
   -------------------------------------------------------------- */
.tr-lab {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tr-muted);
}

/* --------------------------------------------------------------
   6. Kopfzeile: Logo, Navigation, Hell/Dunkel-Schalter
   -------------------------------------------------------------- */
.main-title {
	font-size: 22px;
	margin: 0;
}

.main-title a {
	text-decoration: none;
	color: var(--tr-text);
}

.tr-star {
	color: var(--tr-accent);
	-webkit-text-stroke: 1px var(--tr-text);
}

.tr-switch {
	display: inline-flex;
	gap: 6px;
}

.tr-switch button {
	background: transparent;
	border: 1px solid var(--tr-border);
	color: var(--tr-muted);
	font-family: 'Archivo', 'Inter', sans-serif;
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 7px 13px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.tr-switch button:hover {
	background: var(--tr-accent);
	color: var(--tr-accent-text);
	border-color: var(--tr-accent);
}

.tr-switch button.is-active {
	background: var(--tr-accent);
	color: var(--tr-accent-text);
	border-color: var(--tr-accent);
}

/* --------------------------------------------------------------
   7. Startseiten-Layout
   -------------------------------------------------------------- */
.tr-home {
	max-width: 1180px;
	margin: 0 auto;
	padding: 32px 24px 64px;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 40px;
}

/* Aufmacher / Banner */
.tr-feature {
	background: var(--tr-accent);
	color: var(--tr-accent-text);
	border-radius: var(--tr-radius);
	padding: 40px;
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 32px;
	align-items: center;
}

.tr-feature .tr-lab {
	color: var(--tr-accent-text);
	opacity: 0.65;
}

.tr-feature h2 {
	font-size: 34px;
	line-height: 1.15;
	margin: 12px 0 14px;
}

.tr-feature p {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.55;
	max-width: 46ch;
}

.tr-btn {
	display: inline-block;
	background: var(--tr-text);
	color: var(--tr-bg);
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
	padding: 12px 22px;
	border-radius: 999px;
}

.tr-img {
	background: rgba(255, 255, 255, 0.55);
	border-radius: var(--tr-radius-sm);
	overflow: hidden;
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tr-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Kacheln */
.tr-tiles {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.tr-tile {
	background: var(--tr-surface);
	border: 1px solid var(--tr-border);
	border-radius: var(--tr-radius);
	overflow: hidden;
	text-decoration: none;
	color: var(--tr-text);
	box-shadow: var(--tr-shadow);
	display: flex;
	flex-direction: column;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tr-tile:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(20, 20, 26, 0.06), 0 14px 28px rgba(20, 20, 26, 0.08);
}

.tr-tile .tr-thumb {
	aspect-ratio: 16 / 10;
	background: var(--tr-bg);
	overflow: hidden;
}

.tr-tile .tr-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tr-tile-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.tr-tile-body h3 {
	font-size: 16px;
	line-height: 1.35;
	margin: 0;
}

/* Kachel-Rahmen bleibt neutral, Kategorie zeigt sich nur ueber das
   Text-Label und - in der Liste weiter unten - den farbigen Punkt. */

/* Panel-Baustein: "Alle Ratgeber"-Liste und die zwei Kacheln unten */
.tr-panel {
	background: var(--tr-surface);
	border: 1px solid var(--tr-border);
	border-radius: var(--tr-radius);
	padding: 22px 24px;
	box-shadow: var(--tr-shadow);
}

.tr-panel > .tr-lab {
	margin-bottom: 14px;
}

.tr-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
	border-top: 1px solid var(--tr-border);
	text-decoration: none;
	color: var(--tr-text);
}

.tr-row:first-of-type {
	border-top: none;
}

.tr-row .tr-n {
	font-size: 12px;
	font-weight: 700;
	color: var(--tr-muted);
	width: 20px;
	flex: 0 0 auto;
}

.tr-row .tr-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tr-c-default);
	flex: 0 0 auto;
}
.tr-dot.tr-telko { background: var(--tr-c-telko); }
.tr-dot.tr-mobilfunk { background: var(--tr-c-mobilfunk); }
.tr-dot.tr-smart-home { background: var(--tr-c-smart-home); }
.tr-dot.tr-smart-home-deals { background: var(--tr-c-smart-home-deals); }
.tr-dot.tr-elektronik { background: var(--tr-c-elektronik); }
.tr-dot.tr-geschenke { background: var(--tr-c-geschenke); }
.tr-dot.tr-buero { background: var(--tr-c-buero); }
.tr-dot.tr-buero-deals { background: var(--tr-c-buero-deals); }
.tr-dot.tr-buero-homeoffice { background: var(--tr-c-buero-homeoffice); }
.tr-dot.tr-vpn { background: var(--tr-c-vpn); }
.tr-dot.tr-ratgeber { background: var(--tr-c-ratgeber); }

.tr-row .tr-thumb {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	overflow: hidden;
	flex: 0 0 auto;
	background: var(--tr-bg);
}

.tr-row .tr-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tr-row h3 {
	font-size: 14px;
	font-weight: 600;
	margin: 0;
	flex: 1;
	line-height: 1.3;
}

.tr-row .tr-lab {
	flex: 0 0 auto;
}

/* Zwei-Spalten-Reihe unten (Angebot + Newsletter) */
.tr-duo {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.tr-duo h3 {
	font-size: 18px;
	margin: 10px 0 4px;
}

.tr-val {
	font-size: 14px;
	font-weight: 700;
	color: var(--tr-muted);
}

/* --------------------------------------------------------------
   8. Sticky-Werbeplatz
   -------------------------------------------------------------- */
.tr-sticky-ad {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999;
	background: var(--tr-surface);
	border-top: 1px solid var(--tr-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 18px;
	max-width: 360px;
	margin: 0 auto 12px;
	border-radius: var(--tr-radius-sm);
	box-shadow: var(--tr-shadow);
}

.tr-sticky-ad .tr-slot {
	font-size: 12px;
	color: var(--tr-muted);
}

.tr-sticky-ad .tr-close {
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	color: var(--tr-muted);
	padding: 4px 8px;
}

body.has-sticky-ad {
	padding-bottom: 64px;
}

/* --------------------------------------------------------------
   9. Einzelbeitrag: Inhaltsverzeichnis + Artikeltext
   -------------------------------------------------------------- */
.tr-layout {
	max-width: 1180px;
	margin: 0 auto;
	padding: 32px 24px 64px;
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 40px;
	align-items: start;
}

.tr-layout.tr-no-toc {
	grid-template-columns: 1fr;
}

#tr-toc {
	position: sticky;
	top: 24px;
	background: var(--tr-surface);
	border: 1px solid var(--tr-border);
	border-radius: var(--tr-radius-sm);
	padding: 16px;
}

.tr-toc-links {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 10px;
}

.tr-toc-links a {
	font-size: 13px;
	color: var(--tr-muted);
	text-decoration: none;
	line-height: 1.4;
}

.tr-toc-links a.is-active {
	color: var(--tr-text);
	font-weight: 700;
}

.tr-article-content {
	background: var(--tr-surface);
	border: 1px solid var(--tr-border);
	border-radius: var(--tr-radius);
	padding: 32px 36px;
	max-width: 760px;
	line-height: 1.7;
}

.tr-article-content h2 {
	font-size: 24px;
	margin: 32px 0 14px;
}

.tr-article-content h3 {
	font-size: 19px;
	margin: 26px 0 10px;
}

.tr-article-content p {
	margin: 0 0 16px;
}

.tr-article-content ul,
.tr-article-content ol {
	margin: 0 0 16px;
	padding-left: 22px;
}

.tr-article-content li {
	margin-bottom: 6px;
}

.tr-article-content img {
	border-radius: var(--tr-radius-sm);
	height: auto;
	max-width: 100%;
}

.tr-hero-img {
	margin: 0 0 24px;
	border-radius: var(--tr-radius-sm);
	overflow: hidden;
}

.tr-hero-img img {
	width: 100%;
	height: auto;
	display: block;
}

.tr-article-content .wp-block-button__link {
	border-radius: 999px !important;
	padding: 12px 24px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
}

/* --------------------------------------------------------------
   10. Responsive
   -------------------------------------------------------------- */
@media (max-width: 900px) {
	.tr-feature {
		grid-template-columns: 1fr;
	}

	.tr-tiles {
		grid-template-columns: repeat(2, 1fr);
	}

	.tr-duo {
		grid-template-columns: 1fr;
	}

	.tr-layout {
		grid-template-columns: 1fr;
	}

	#tr-toc {
		position: static;
	}
}

@media (max-width: 600px) {
	.tr-tiles {
		grid-template-columns: 1fr;
	}

	.tr-feature {
		padding: 28px 22px;
	}

	.tr-feature h2 {
		font-size: 26px;
	}

	.tr-article-content {
		padding: 24px 20px;
	}
}
