/*
 * Seite «Optimierungsbeispiel» (Slug optimierungsbeispiel)
 * Gestaltung nach Entwurf Version 13 (Optimierung_v13.html).
 * Nur Klassen mit Präfix .stx-opt- – das gemeinsame Vokabular steht in basis.css.
 */

/* ---------- Kopf-Panel (karierte Fläche) ---------- */
.stx-raster.stx-opt-kopf {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: clamp(28px, 6vw, 56px) clamp(20px, 5vw, 48px);
}
.stx-opt-kopf > * {
	margin: 0;
}
.stx-opt-kopf .stx-h1 {
	line-height: 1.12;
	letter-spacing: -0.015em;
}
.stx-opt-kopf .stx-lead {
	line-height: 1.6;
	color: #555C66;
	max-width: 62ch;
	text-wrap: pretty;
}
.stx-opt-zurueck {
	font-size: 16px;
	font-weight: 500;
}
.stx-opt-zurueck a {
	text-decoration: none;
}

/* ---------- Kennzahlen (vier Karten) ---------- */
.stx-abschnitt.stx-opt-kennzahlen-abschnitt {
	padding: 56px 24px 0;
}
.stx-opt-kennzahlen {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: 16px;
}
.stx-opt-kennzahl {
	box-sizing: border-box;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 20px 24px;
	background: #FFFFFF;
	border: 1px solid #E3E6EA;
	border-radius: 12px;
}
.stx-opt-kennzahl--ersparnis {
	border-left: 4px solid #286A2A;
}
.stx-opt-kennzahl > * {
	margin: 0;
}
.stx-opt-kennzahl .stx-opt-kennzahl__wert {
	line-height: 1.2;
}
.stx-opt-kennzahl__text {
	font-size: 16px;
	color: #555C66;
}

/* ---------- Die Ausgangslage ---------- */
.stx-opt-ausgangslage {
	display: flex;
	flex-wrap: wrap;
	gap: 48px;
	align-items: flex-start;
}
.stx-opt-ausgangslage__text {
	flex: 1 1 320px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.stx-opt-ausgangslage__text > * {
	margin: 0;
}
/* Entwurf: diese beiden Abschnittstitel mit Zeilenhöhe 1.25 und ohne Laufweite */
.stx-opt-ausgangslage .stx-titel,
.stx-opt-ergebnis .stx-titel {
	line-height: 1.25;
	letter-spacing: 0;
}

/* Eckdaten (im Entwurf eine Begriffsliste) */
.wp-block-table.stx-opt-eckdaten {
	margin: 0;
	padding-top: 11px;
	border-top: 1px solid #E3E6EA;
	overflow: visible;
}
.wp-block-table.stx-opt-eckdaten table {
	width: auto;
	border-collapse: collapse;
	font-size: 16px;
}
.wp-block-table.stx-opt-eckdaten td {
	padding: 5px 0;
	border: 0;
	vertical-align: top;
	text-align: left;
}
/* Entwurf (dl mit gap 10px): kein Abstand über der ersten und unter der letzten Zeile */
.wp-block-table.stx-opt-eckdaten tr:first-child td {
	padding-top: 0;
}
.wp-block-table.stx-opt-eckdaten tr:last-child td {
	padding-bottom: 0;
}
.wp-block-table.stx-opt-eckdaten td:first-child {
	padding-right: 24px;
	color: #555C66;
	white-space: nowrap;
}
.wp-block-table.stx-opt-eckdaten td:last-child {
	font-weight: 500;
	color: #12161C;
}

/* Gemeinsame Tabellen-Grundlage dieser Seite.
   Selektoren mit .stx-tabelle, damit sie die Grundwerte aus basis.css
   (Grossbuchstaben im Kopf, Linie über dem Bildtext, Fussfeld fett) sicher überschreiben. */
.wp-block-table.stx-tabelle.stx-opt-zuschnitte,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster,
.wp-block-table.stx-opt-restlaengen {
	margin: 0;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte table,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster table,
.wp-block-table.stx-opt-restlaengen table {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	font-size: 16px;
	line-height: 1.6;
	font-variant-numeric: tabular-nums;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte :is(thead, tbody, tfoot),
.wp-block-table.stx-tabelle.stx-opt-schnittmuster :is(thead, tbody, tfoot) {
	border: 0;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte thead th,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster thead th {
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.6;
	color: #555C66;
	text-transform: none;
	letter-spacing: 0;
	text-align: left;
	vertical-align: middle;
	border: 0;
	border-bottom: 1px solid #E3E6EA;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte tbody td,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tbody td,
.wp-block-table.stx-tabelle.stx-opt-zuschnitte tbody tr:last-child > td,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tbody tr:last-child > td {
	border: 0;
	border-bottom: 1px solid #EEF0F3;
	text-align: left;
	vertical-align: middle;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte tfoot td,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tfoot td {
	border: 0;
	text-align: left;
	vertical-align: middle;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte .has-text-align-right.has-text-align-right,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster .has-text-align-right.has-text-align-right,
.wp-block-table.stx-opt-restlaengen .has-text-align-right {
	text-align: right;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte .wp-element-caption,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster .wp-element-caption {
	order: -1;
	margin: 0;
	border: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #555C66;
	text-align: left;
}

/* Zuschnitte der Stückliste (im Entwurf ohne Box) */
.wp-block-table.stx-tabelle.stx-opt-zuschnitte {
	flex: 2 1 480px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte .wp-element-caption {
	padding: 0 0 8px;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte thead th,
.wp-block-table.stx-tabelle.stx-opt-zuschnitte tbody td {
	padding: 8px 0;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte tfoot td {
	padding: 10px 0;
	font-weight: 400;
	color: #555C66;
}
.wp-block-table.stx-tabelle.stx-opt-zuschnitte tfoot td:first-child {
	font-weight: 600;
	color: #12161C;
}

/* ---------- Das Ergebnis von STABAmix 6 ---------- */
.stx-opt-ergebnis {
	display: flex;
	flex-direction: column;
	gap: 24px;
}
.stx-opt-ergebnis > * {
	margin: 0;
}
.stx-opt-ergebnis__kopf {
	max-width: 760px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.stx-opt-ergebnis__kopf > * {
	margin: 0;
}

/* Schnittmuster: weisse Box, scrollt auf dem Handy waagrecht in sich */
.wp-block-table.stx-tabelle.stx-opt-schnittmuster {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	padding: 4px 28px 20px;
	background: #FFFFFF;
	border: 1px solid #E3E6EA;
	border-radius: 12px;
	overflow-x: auto;
}
.wp-block-table.stx-tabelle.stx-opt-schnittmuster table {
	min-width: 620px;
}
/* Bildtext so breit wie die Tabelle: bleibt einzeilig und scrollt mit (wie im Entwurf) */
.wp-block-table.stx-tabelle.stx-opt-schnittmuster .wp-element-caption {
	box-sizing: border-box;
	min-width: 620px;
	padding: 16px 0 6px;
}
.wp-block-table.stx-tabelle.stx-opt-schnittmuster thead th,
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tbody td {
	padding: 10px 0;
}
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tfoot td {
	padding: 12px 0;
	font-weight: 600;
	color: #12161C;
}
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tr > :is(th, td):nth-child(2),
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tr > :is(th, td):nth-child(3),
.wp-block-table.stx-tabelle.stx-opt-schnittmuster thead th:nth-child(5),
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tbody td:nth-child(5) {
	padding-left: 24px;
}
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tbody td:first-child {
	font-weight: 600;
	color: #12161C;
}
.wp-block-table.stx-tabelle.stx-opt-schnittmuster tbody td:nth-child(2) {
	color: #555C66;
}
/* Prozentwert in Klammern (im Editor als «kursiv» markiert) gedämpft statt kursiv */
.wp-block-table.stx-tabelle.stx-opt-schnittmuster em {
	font-style: normal;
	color: #555C66;
}
/* Verwendbare Restlänge (im Editor «fett») grün */
.wp-block-table.stx-tabelle.stx-opt-schnittmuster strong {
	font-weight: 600;
	color: #286A2A;
}

/* ---------- Restlängen und Bericht ---------- */
.stx-opt-auswertung {
	display: flex;
	flex-direction: column;
	gap: 24px;
}
.stx-opt-auswertung > * {
	margin: 0;
}
.stx-opt-karten {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
	gap: 24px;
}
.stx-karte.stx-opt-karte {
	box-sizing: border-box;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px;
}
.stx-opt-karte > * {
	margin: 0;
}
.wp-block-table.stx-opt-restlaengen td {
	padding: 8px 0;
	border: 0;
	border-top: 1px solid #EEF0F3;
}
.wp-block-table.stx-opt-restlaengen td:last-child {
	font-weight: 600;
	color: #12161C;
}
.stx-opt-liste {
	margin: 0;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 16px;
}
.stx-opt-liste li {
	margin: 0;
}

/* ---------- Aufruf am Seitenende ---------- */
.stx-abschnitt.stx-opt-aufruf {
	padding: clamp(52px, 11vw, 80px) 20px;
	border-bottom: 0;
}
.stx-opt-aufruf__inhalt {
	display: flex;
	flex-wrap: wrap;
	gap: 24px 48px;
	align-items: center;
	justify-content: space-between;
}
.stx-opt-aufruf__text {
	flex: 1 1 520px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.stx-opt-aufruf__text > * {
	margin: 0;
}
.stx-opt-aufruf .stx-titel {
	text-wrap: balance;
}
.stx-opt-aufruf .stx-lead {
	max-width: none;
	line-height: 1.6;
	color: #555C66;
}

/* Kleine Knöpfe (Höhe 44) wie im Entwurf */
.wp-block-buttons.stx-opt-knoepfe {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}
.stx-opt-knoepfe .wp-block-button {
	margin: 0;
}
.stx-opt-knoepfe .wp-block-button .wp-block-button__link {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	height: 44px;
	min-height: 44px;
	padding: 0 20px;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}
/* Nebenknopf: im Entwurf 1px Rand #7A8491 (Hover-Zustand bleibt bei basis.css) */
.stx-opt-knoepfe .wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 1px;
	border-style: solid;
}
.stx-opt-knoepfe .wp-block-button.is-style-outline > .wp-block-button__link:not(:hover):not(:focus-visible) {
	border-color: #7A8491;
}
