/*
 * Eisen und Salz Logbuch
 *
 * Farben aus den Presets des Themes (base, contrast, primary), wie beim Spielbogen.
 * Anpassen im Theme zum Beispiel mit  .esz-logbuch { --esz-accent: #3b5260; }
 */
.esz-logbuch {
	--esz-paper: var(--wp--preset--color--base, #ffffff);
	--esz-ink: var(--wp--preset--color--contrast, #1b1b1a);
	--esz-accent: var(--wp--preset--color--primary, #3b5260);
	--esz-accent-ink: var(--esz-paper);
	--esz-surface: color-mix(in srgb, var(--esz-ink) 5%, var(--esz-paper));
	--esz-salt: color-mix(in srgb, var(--esz-ink) 2%, var(--esz-paper));
	--esz-line: color-mix(in srgb, var(--esz-ink) 24%, var(--esz-paper));
	--esz-muted: color-mix(in srgb, var(--esz-ink) 62%, var(--esz-paper));
	--esz-warn: #a5552f;

	color: var(--esz-ink);
	font-size: 1rem;
	line-height: 1.55;
	margin-block: 2.5rem;
}
.esz-logbuch *, .esz-logbuch *::before, .esz-logbuch *::after { box-sizing: border-box; }
.esz-logbuch [hidden] { display: none !important; }
.esz-logbuch :focus-visible { outline: 2px solid var(--esz-accent); outline-offset: 2px; }
.esz-logbuch .esz-sr {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.esz-logbuch .kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 16px; border-bottom: 1px solid var(--esz-line); padding-bottom: 4px; }
.esz-logbuch h2 { font-size: 1.15rem; font-weight: 600; margin: 0; line-height: 1.3; }

.esz-logbuch button {
	font: inherit; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.2;
	color: var(--esz-ink); background: var(--esz-surface); border: 1px solid var(--esz-line); border-radius: 3px;
	padding: 7px 12px; min-height: 40px; cursor: pointer; box-shadow: none; margin: 0;
}
.esz-logbuch button:hover { border-color: var(--esz-ink); }
.esz-logbuch button.primary { background: var(--esz-accent); color: var(--esz-accent-ink); border-color: var(--esz-accent); }
.esz-logbuch button.primary:hover { filter: brightness(1.15); }
.esz-logbuch button.ghost { background: transparent; color: var(--esz-muted); }
.esz-logbuch button[disabled] { opacity: 0.55; cursor: default; }

.esz-logbuch input[type=text], .esz-logbuch textarea {
	font: inherit; color: var(--esz-ink); background: var(--esz-paper); border: 1px solid var(--esz-line); border-radius: 3px;
	padding: 8px 12px; width: 100%; min-width: 0; box-shadow: none; margin: 0; -webkit-appearance: none; appearance: none;
}
.esz-logbuch textarea { resize: vertical; min-height: 7rem; }
.esz-logbuch ::placeholder { color: var(--esz-muted); opacity: 1; }

/* Eintrag schreiben */
.esz-logbuch .neu { margin-top: 14px; }
.esz-logbuch .tipp { font-size: 0.8rem; color: var(--esz-muted); margin-left: auto; }
/* Schreibfläche ohne Rahmen: wächst mit dem Text, die Seite scrollt */
.esz-logbuch .ed { max-width: 70ch; }
.esz-logbuch .ed-area { position: relative; min-height: 4.5rem; padding: 6px 0 14px; outline: none; overflow-wrap: anywhere; cursor: text; font-size: 1.05rem; line-height: 1.65; caret-color: var(--esz-accent); }
.esz-logbuch .ed-area > * { margin: 0 0 0.9em; }
.esz-logbuch .ed-area > *:last-child { margin-bottom: 0; }
.esz-logbuch .ed-area.leer::before { content: attr(data-ph); position: absolute; left: 0; right: 0; top: 6px; color: var(--esz-muted); pointer-events: none; }
.esz-logbuch .neu { padding-top: 6px; border-bottom: 1px solid var(--esz-line); }
.esz-logbuch .neu .zeile { padding: 8px 0 14px; position: sticky; bottom: 0; background: var(--esz-paper); }
.esz-logbuch .ergform .ed-area { min-height: 3.5rem; border-left: 4px solid var(--esz-accent); padding-left: 12px; }
.esz-logbuch .ergform .ed-area.leer::before { left: 12px; }
.esz-logbuch form { display: grid; gap: 8px; margin: 0; }
.esz-logbuch .zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.esz-logbuch .status { font-size: 0.9rem; color: var(--esz-muted); }
.esz-logbuch .status.fehler { color: var(--esz-warn); font-weight: 600; }

/* Einträge */
.esz-logbuch .liste { display: grid; margin-top: 8px; }
.esz-logbuch .eintrag { padding: 16px 0 14px; border-bottom: 1px solid var(--esz-line); scroll-margin-top: 1rem; }
.esz-logbuch .eintrag:target { background: color-mix(in srgb, var(--esz-accent) 8%, var(--esz-paper)); outline: 8px solid color-mix(in srgb, var(--esz-accent) 8%, var(--esz-paper)); }
.esz-logbuch .eintrag header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.esz-logbuch .dat { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--esz-muted); text-decoration: none; }
.esz-logbuch .dat:hover { color: var(--esz-ink); text-decoration: underline; }
.esz-logbuch .priv { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--esz-warn); border: 1px solid currentColor; border-radius: 99px; padding: 0 8px; }
.esz-logbuch .eintrag h3 { flex-basis: 100%; margin: 2px 0 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.esz-logbuch .text { margin-top: 6px; max-width: 70ch; overflow-wrap: anywhere; }
.esz-logbuch .text > * { margin: 0 0 0.7em; }
.esz-logbuch .text > *:last-child { margin-bottom: 0; }
.esz-logbuch .text .esz-ergebnis, .esz-ergebnis {
	border-left: 4px solid var(--esz-accent, currentColor); padding: 2px 0 2px 12px; margin-top: 0.9em;
}
.esz-logbuch .text .esz-ergebnis::before {
	content: "Ergebnis"; display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--esz-muted);
}
.esz-logbuch .text .esz-ergebnis + .esz-ergebnis { margin-top: 0.5em; }
.esz-logbuch .text .esz-ergebnis + .esz-ergebnis::before { content: none; }

.esz-logbuch .werk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; }
.esz-logbuch .werk button { min-height: 32px; padding: 4px 10px; background: transparent; color: var(--esz-muted); }
.esz-logbuch .werk .edit { font-size: 0.85rem; color: var(--esz-muted); }
.esz-logbuch .ergform { margin-top: 10px; max-width: 70ch; }

.esz-logbuch .leer { color: var(--esz-muted); margin: 14px 0 0; }
.esz-logbuch .mehr-zeile { margin: 14px 0 0; }

.esz-zurueck { margin-top: 2rem; }

.esz-logbuch .beaform { margin-top: 6px; }
.esz-logbuch .ed-area p.esz-ergebnis { border-left: 4px solid var(--esz-accent); padding-left: 12px; }
.esz-logbuch .sicher { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.esz-logbuch .sicher .frage { font-size: 0.9rem; font-weight: 600; }
.esz-logbuch .werk button.warnb { background: var(--esz-warn); color: #fff; border-color: var(--esz-warn); }

.esz-logbuch .leit { list-style: none; margin: 0 0 10px; padding: 0 0 0 12px; border-left: 3px solid var(--esz-line); display: grid; gap: 2px; font-size: 0.9rem; color: var(--esz-muted); max-width: 70ch; }
.esz-logbuch .leit li { margin: 0; padding: 0; }

.esz-fragmente { margin-top: 3rem; }
.esz-fragmente .eintrag h3 a { color: inherit; text-decoration: none; }
.esz-fragmente .eintrag h3 a:hover { text-decoration: underline; }
.esz-fragmente .text { color: var(--esz-muted); }
.esz-fragmente .mehr-zeile a { color: var(--esz-muted); }

/* Auf dem Beitrag: Weiter in der Kampagne */
.esz-weiter { border-top: 1px solid var(--esz-line); padding-top: 14px; margin-block: 2.5rem 1rem; }
.esz-weiter .kampagne { margin: 0 0 10px; font-size: 0.95rem; }
.esz-weiter .kampagne a { color: var(--esz-accent); font-weight: 600; text-underline-offset: 2px; }
.esz-weiter .zahl { color: var(--esz-muted); }
.esz-weiter .schritte { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.esz-weiter .schritte a { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; background: var(--esz-surface); border: 1px solid var(--esz-line); border-radius: 6px; text-decoration: none; color: inherit; }
.esz-weiter .schritte a:hover { border-color: var(--esz-accent); }
.esz-weiter .vor { text-align: right; }
.esz-weiter .pf { font-size: 0.8rem; color: var(--esz-muted); letter-spacing: 0.02em; }
.esz-weiter .tt { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 520px) { .esz-weiter .schritte { grid-template-columns: 1fr; } .esz-weiter .vor { text-align: left; } }
