/* ==========================================================================
   Cannabis Sorten Plugin – Frontend-Styles
   ========================================================================== */

.cs-frontend-wrapper { max-width: 1100px; margin: 0 auto; padding: 20px; }

.cs-main-nav {
	display: flex; flex-wrap: wrap; gap: 4px;
	border-bottom: 2px solid #1c3428; margin-bottom: 24px; padding-bottom: 10px;
}
.cs-main-nav a {
	padding: 8px 14px; text-decoration: none; color: #1c3428; font-weight: 600;
	border-radius: 4px; transition: background .15s;
}
.cs-main-nav a:hover { background: #eef4ea; }
.cs-compare-count-badge {
	display: inline-block; background: #c08a3e; color: #fff; border-radius: 50%;
	min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px;
}

.cs-toolbar-form, .cs-search-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cs-search-form input, .cs-search-form select,
.cs-toolbar-form select { padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; }
.cs-search-form input[type=search] { flex: 1; min-width: 200px; }

.cs-btn {
	display: inline-block; padding: 10px 18px; background: #1c3428; color: #fff;
	border: none; border-radius: 6px; cursor: pointer; text-decoration: none; font-weight: 600;
}
.cs-btn:hover { background: #2c5c3f; color: #fff; }
.cs-btn-outline { background: transparent; border: 1px solid #1c3428; color: #1c3428; }
.cs-btn-outline:hover { background: #eef4ea; color: #1c3428; }
.cs-btn-small { padding: 6px 12px; font-size: 13px; }

.cs-strain-grid, .cs-bildergalerie-grid { display: grid; gap: 16px; margin: 16px 0; }
.cs-strain-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.cs-strain-card {
	border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; background: #fff;
	display: flex; flex-direction: column; gap: 8px;
}
.cs-strain-card-image { width: 100%; height: 160px; object-fit: cover; object-position: center center; border-radius: 6px 6px 0 0; margin: -16px -16px 12px; display: block; }
.cs-strain-card-image-placeholder { width: calc(100% + 32px); height: 120px; margin: -16px -16px 12px; border-radius: 6px 6px 0 0; }
.cs-strain-card-image-wrap {
	width: calc(100% + 32px);
	height: 160px;
	margin: -16px -16px 12px;
	border-radius: 6px 6px 0 0;
	overflow: hidden;
	background-color: #f0f0f0;
}
.cs-strain-card-image-wrap .cs-strain-card-image {
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 0;
}
.cs-strain-card-image-contain { object-fit: contain; }
.cs-strain-card-has-bg {
	background-size: 100% 100%;
	background-position: center;
	background-repeat: no-repeat;
}
.cs-strain-card-title a { color: #1c3428; text-decoration: none; }
.cs-strain-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.cs-badge-typ { background: #eef4ea; color: #2c5c3f; }
.cs-badge-thc { background: #fbeee0; color: #a05a1e; }
.cs-badge-cbd { background: #eef1f7; color: #2f4f7f; }
.cs-strain-card-facts { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #444; }
.cs-strain-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.cs-strain-card-actions a.cs-btn:not(.cs-btn-outline) {
	color: #fff !important;
	text-align: center;
	flex: 1;
}

.cs-pagination { display: flex; gap: 6px; margin: 20px 0; flex-wrap: wrap; }
.cs-page-link { padding: 6px 11px; border: 1px solid #ccc; border-radius: 4px; text-decoration: none; color: #1c3428; }
.cs-page-link.active { background: #1c3428; color: #fff; border-color: #1c3428; }

.cs-no-results { color: #777; font-style: italic; }

.cs-estimate-hint { font-size: 12px; color: #888; }

/* --- Detailseite --- */
.cs-single-header h1 { margin-bottom: 8px; }
.cs-single-body { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-top: 20px; }
.cs-facts-table { width: 100%; border-collapse: collapse; }
.cs-facts-table th, .cs-facts-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; }
.cs-facts-table th { width: 160px; color: #555; font-weight: 600; }
@media (max-width: 700px) { .cs-single-body { grid-template-columns: 1fr; } }

/* --- Vergleich --- */
.cs-compare-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cs-compare-table-wrap { overflow-x: auto; }
.cs-compare-table, .cs-strainlist-table { width: 100%; border-collapse: collapse; }
.cs-compare-table th, .cs-compare-table td,
.cs-strainlist-table th, .cs-strainlist-table td {
	border: 1px solid #e0e0e0; padding: 8px 10px; text-align: left; font-size: 13px;
}
.cs-compare-label { font-weight: 600; background: #f7f7f5; white-space: nowrap; }
.cs-strainlist-table-wrapper { overflow-x: auto; }
.cs-strainlist-table th { background: #1c3428; color: #fff; white-space: nowrap; }
.cs-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.cs-thumb-placeholder {
	display: inline-block; width: 60px; height: 60px; border-radius: 6px;
	background: linear-gradient(135deg, var(--ph-color-1, #cfe0d4), var(--ph-color-2, #eef4ea));
}
.cs-placeholder-indica { --ph-color-1: #2c5c3f; --ph-color-2: #b6d2c0; }
.cs-placeholder-sativa { --ph-color-1: #c08a3e; --ph-color-2: #f0dcb8; }
.cs-placeholder-hybrid { --ph-color-1: #7c9885; --ph-color-2: #dbe6de; }
.cs-placeholder-unknown { --ph-color-1: #999; --ph-color-2: #e0e0e0; }

/* --- Statistik --- */
.cs-stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cs-stat-box { flex: 1; min-width: 140px; background: #f7f7f5; border-radius: 8px; padding: 16px; text-align: center; }
.cs-stat-box .cs-stat-value { display: block; font-size: 28px; font-weight: 700; color: #1c3428; }
.cs-stat-box .cs-stat-label { font-size: 13px; color: #666; }
.cs-stat-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.cs-chart-box { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 16px; }

/* --- KI-Empfehlung --- */
.cs-ai-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 20px 0; }
.cs-form-row { display: flex; flex-direction: column; gap: 6px; }
.cs-form-row select, .cs-form-row input {
	padding: 8px; border-radius: 6px; border: 1px solid #ccc;
}
.cs-ai-form .cs-btn { grid-column: 1 / -1; justify-self: start; }

.cs-ai-result { margin-top: 10px; }
.cs-ai-explanation {
	background: #eef4ea;
	border-left: 4px solid #2f6f2f;
	padding: 14px 18px;
	border-radius: 6px;
	margin-bottom: 16px;
}

/* --- THC-Rubriken --- */
.cs-thc-rubriken-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin: 20px 0;
}
.cs-thc-rubrik-card {
	display: block;
	padding: 20px;
	border-radius: 8px;
	text-decoration: none;
	color: #1a1a16;
	border-left: 5px solid #999;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.08);
	transition: transform .15s, box-shadow .15s;
}
.cs-thc-rubrik-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.cs-thc-rubrik-niedrig { border-left-color: #1e6a4e; }
.cs-thc-rubrik-mittel { border-left-color: #4a7c2f; }
.cs-thc-rubrik-hoch { border-left-color: #8a5a1e; }
.cs-thc-rubrik-sehr_hoch { border-left-color: #a33333; }
.cs-thc-rubrik-label { display: block; font-size: 18px; font-weight: 700; }
.cs-thc-rubrik-range { display: block; font-size: 12px; color: #777; margin-top: 2px; }
.cs-thc-rubrik-count { display: block; font-size: 28px; font-weight: 700; margin-top: 8px; }
.cs-thc-rubrik-sub { display: block; font-size: 12px; color: #2f6f2f; margin-top: 10px; }

.cs-badge-thc-niedrig { background: #e3ede8; color: #1e6a4e; }
.cs-badge-thc-mittel { background: #eef4ea; color: #4a7c2f; }
.cs-badge-thc-hoch { background: #f6e6d2; color: #8a5a1e; }
.cs-badge-thc-sehr_hoch { background: #f8dede; color: #a33333; }

/* --- Identifizierung --- */
.cs-disclaimer {
	background: #fbf3e4;
	border: 1px solid #ecd9b3;
	color: #7a5a2a;
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 13px;
	margin: 16px 0;
	line-height: 1.5;
}
.cs-identify-wrap { max-width: 640px; }
.cs-identify-actions { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.cs-identify-result { margin-top: 16px; }

/* --- Bildergalerie-Album (Bilder um 50% verkleinert: 160px -> 80px) --- */
.cs-bildergalerie-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
	gap: 8px;
	margin: 16px 0;
}
.cs-bildergalerie-item {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: #1a1a16;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e0e0e0;
	transition: transform .15s, box-shadow .15s;
}
.cs-bildergalerie-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.cs-bildergalerie-image-wrap { position: relative; width: 100%; height: 80px; flex-shrink: 0; }
.cs-bildergalerie-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-bildergalerie-item .cs-strain-card-image-placeholder { width: 100%; height: 80px; margin: 0; border-radius: 0; flex-shrink: 0; }

/* hanf.blog-Wasserzeichen, das sich über jedes Bild in der Galerie legt */
.cs-bildergalerie-watermark {
	position: absolute;
	bottom: 3px;
	right: 3px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-family: 'IBM Plex Mono', monospace, monospace;
	font-size: 8px;
	letter-spacing: 0.02em;
	padding: 1px 4px;
	border-radius: 3px;
	pointer-events: none;
	user-select: none;
	line-height: 1.4;
}

.cs-bildergalerie-label {
	display: block;
	padding: 5px 6px;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	line-height: 1.3;
}
.cs-bildergalerie-grid-wrap { transition: opacity .2s ease; min-height: 60px; }

.cs-album-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 18px;
}
.cs-album-page-indicator {
	font-family: monospace;
	font-size: 13px;
	color: #555;
	min-width: 110px;
	text-align: center;
}
.cs-album-prev, .cs-album-next { min-width: 100px; }
.cs-album-prev:disabled, .cs-album-next:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Pfeil-Icon-Buttons für die Sortenraster-Pagination */
.cs-icon-btn {
	min-width: 0;
	width: 42px;
	height: 42px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
}
.cs-icon-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Sortenraster-Pagination: Buttons links gruppiert, Seitenanzeige rechtsbündig */
.cs-list-nav {
	justify-content: flex-start !important;
	width: 100%;
}
.cs-list-nav .cs-list-prev { order: 1 !important; }
.cs-list-nav .cs-list-next { order: 2 !important; }
.cs-list-nav .cs-album-page-indicator {
	order: 3 !important;
	margin-left: auto !important;
}

/* Alle Buttons im Sortenraster ([cannabis_sorten]) auf halbe Höhe */
.cs-strain-list-album .cs-btn-small {
	padding-top: 3px;
	padding-bottom: 3px;
	line-height: 1.2;
}
.cs-strain-list-album .cs-icon-btn {
	width: 21px;
	height: 21px;
	font-size: 11px;
}

.cs-list-search-row { margin-bottom: 16px; }
.cs-list-search-input {
	width: 100%;
	max-width: 360px;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 14px;
}

/* Sortenraster-Hintergrundbild: Karten leicht transparent, damit der Hintergrund
   sichtbar durchscheint, aber Text weiterhin gut lesbar bleibt */
.cs-has-background {
	position: relative;
	padding: 24px;
	border-radius: 10px;
	overflow: hidden;
}
.cs-has-background::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--cs-grid-bg-image);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0.5;
	z-index: 0;
}
.cs-has-background > * {
	position: relative;
	z-index: 1;
}
.cs-has-background .cs-strain-card {
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(2px);
}
.cs-has-background .cs-list-search-input {
	background: rgba(255, 255, 255, 0.95);
}
.cs-has-background .cs-album-page-indicator {
	background: rgba(255, 255, 255, 0.85);
	padding: 4px 10px;
	border-radius: 6px;
}

/* --- Zufallssorte-Shortcode --- */
.cs-zufallssorte-wrap { max-width: 340px; }
.cs-zufallssorte-wrap .eyebrow {
	display: block;
	font-family: monospace;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #9c6a28;
	margin-bottom: 8px;
}

/* --- Zähler-Shortcode --- */
.cs-sorten-zaehler {
	font-weight: 700;
	color: #2f6f2f;
}

/* ==========================================================================
   Responsive / Mobile
   ========================================================================== */

/* Verhindert horizontales Scrollen durch Padding + width:100%-Kombinationen */
.cs-frontend-wrapper,
.cs-frontend-wrapper *,
.cs-frontend-wrapper *::before,
.cs-frontend-wrapper *::after {
	box-sizing: border-box;
}
.cs-frontend-wrapper img { max-width: 100%; height: auto; }
.cs-frontend-wrapper .cs-strain-card-image,
.cs-frontend-wrapper .cs-bildergalerie-image-wrap img,
.cs-frontend-wrapper .cs-thumb {
	height: revert; /* die o.g. generische img-Regel für gezielt höhenfixierte Bilder wieder aufheben */
}

@media (max-width: 782px) {
	.cs-frontend-wrapper { padding: 16px; }

	.cs-main-nav { gap: 2px; margin-bottom: 18px; }
	.cs-main-nav a { padding: 7px 10px; font-size: 14px; }

	.cs-toolbar-form, .cs-search-form { flex-direction: column; align-items: stretch; }
	.cs-search-form input[type=search] { min-width: 0; width: 100%; }
	.cs-search-form select, .cs-toolbar-form select { width: 100%; }

	.cs-strain-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
	.cs-strain-card-image { height: 130px; }
	.cs-strain-card-image-placeholder { height: 100px; }
	.cs-strain-card-image-wrap { height: 130px; }

	.cs-single-header h1 { font-size: 22px; }
	.cs-facts-table th { width: 40%; font-size: 13px; }
	.cs-facts-table th, .cs-facts-table td { padding: 6px 8px; font-size: 13px; }

	.cs-ai-form { grid-template-columns: 1fr; }
	.cs-thc-rubriken-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
	.cs-thc-rubrik-card { padding: 14px; }
	.cs-thc-rubrik-count { font-size: 22px; }

	.cs-stat-charts { grid-template-columns: 1fr; }
	.cs-stat-row { gap: 10px; }
	.cs-stat-box { min-width: 110px; padding: 12px; }
	.cs-stat-box .cs-stat-value { font-size: 22px; }

	.cs-identify-actions { flex-direction: column; }
	.cs-identify-actions .cs-btn { text-align: center; }
	.cs-identify-wrap { max-width: 100%; }

	.cs-album-nav { gap: 10px; flex-wrap: wrap; }
	.cs-list-nav { justify-content: space-between !important; }
	.cs-list-nav .cs-album-page-indicator { margin-left: 0 !important; }

	.cs-zufallssorte-wrap { max-width: 100%; }
}

@media (max-width: 480px) {
	.cs-frontend-wrapper { padding: 12px; }
	.cs-main-nav a { padding: 6px 9px; font-size: 13px; }

	.cs-strain-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
	.cs-bildergalerie-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; }
	.cs-bildergalerie-image-wrap { height: 60px; }

	.cs-strain-card { padding: 12px; }
	.cs-strain-card-image { margin: -12px -12px 10px; height: 110px; }
	.cs-strain-card-image-placeholder { width: calc(100% + 24px); margin: -12px -12px 10px; height: 90px; }
	.cs-strain-card-image-wrap { width: calc(100% + 24px); margin: -12px -12px 10px; height: 110px; }

	.cs-strain-card-actions { flex-direction: column; }
	.cs-strain-card-actions a.cs-btn:not(.cs-btn-outline) { flex: none; }

	.cs-facts-table th { width: auto; display: block; border-bottom: none; padding-bottom: 0; }
	.cs-facts-table td { display: block; padding-top: 2px; margin-bottom: 6px; }
	.cs-facts-table tr { display: block; border-bottom: 1px solid #eee; padding: 6px 0; }

	.cs-has-background { padding: 14px; }
}

