/* =====================================================================
   SG Speyer-Schwegenheim – gemeinsames Stylesheet
   ---------------------------------------------------------------------
   Gestaltungsidee: das Partieformular. Linien statt Karten, eckige
   Kanten, keine Verläufe, keine Schatten, keine Emojis als Symbole.
   Als Wiedererkennungszeichen dienen der Schachbrettrand und Brett-
   nummern in hell und dunkel wechselnden Feldern.

   Orange erscheint nur dort, wo es etwas bedeutet: beim Endstand und
   als Randmarke für die eigene Mannschaft.

   Diese Datei wird von allen eingebetteten Seiten (Tabellen, Paarungen,
   Top-Performer, Ligenpyramide, DWZ-Liste) eingebunden und über das
   Muss-Plugin sg-datensparsam.php zusätzlich auf allen WordPress-Seiten.
   ===================================================================== */

@import url('/lib/fonts/barlow.css');

:root {
  --sg-tief:  #12233a;   /* Linien, Überschriften      */
  --sg-navy:  #1a3a5c;   /* dunkle Felder, Beschriftung */
  --sg-blau:  #2a5298;
  --sg-orange:#ec8524;   /* nur Endstand und Marken    */
  --sg-text:  #1d2733;
  --sg-grau:  #7d8a97;   /* Nebenangaben               */
  --sg-linie: #d5dde6;   /* Zeilenlinien               */
  --sg-hell:  #e8eef6;   /* helle Felder               */
}

/* ---------- Grundlage der eingebetteten Seiten ---------- */
body.sg-seite {
  margin: 0;
  padding: 4px 2px 12px;
  background: transparent;
  font-family: Barlow, Arial, Helvetica, sans-serif;
  color: var(--sg-text);
  font-size: 16px;
  line-height: 1.45;
  opacity: 0;
  transition: opacity .3s;
}
body.sg-seite.sg-bereit { opacity: 1; }

/* ---------- Beschriftungen ---------- */
.sg-marke {
  margin: 0 0 4px;
  font-size: .72em;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--sg-navy);
}

/* Abschnittskopf: Titel mit kräftiger Linie darunter */
.sg-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 0;
  padding: 0 0 6px;
  border-bottom: 2px solid var(--sg-tief);
}
.sg-kopf .sg-titel {
  margin: 0;
  font-size: 1.05em;
  font-weight: 700;
  color: var(--sg-tief);
  line-height: 1.25;
}
.sg-kopf .sg-unter {
  font-size: .78em;
  color: var(--sg-grau);
  white-space: nowrap;
}

/* Großer Endstand, die einzige große Orange-Fläche */
.sg-stand {
  font-size: 2.2em;
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.02em;
  white-space: nowrap;
  color: var(--sg-orange);
  font-variant-numeric: tabular-nums;
}
.sg-stand i { font-style: normal; color: var(--sg-tief); margin: 0 2px; }

/* ---------- Formular-Tabelle ---------- */
table.sg-formular {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  border: none;
  border-top: 2px solid var(--sg-tief);
  border-bottom: 2px solid var(--sg-tief);
  font-size: .92em;
  font-variant-numeric: tabular-nums;
  background: transparent;
}
table.sg-formular > thead > tr > th,
table.sg-formular > tbody > tr > td,
table.sg-formular > tfoot > tr > td {
  border: none;
  background: transparent;
  vertical-align: middle;
}
table.sg-formular > thead > tr > th {
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--sg-tief);
  text-align: left;
  font-size: .78em;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--sg-navy);
  white-space: nowrap;
}
table.sg-formular > tbody > tr > td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--sg-linie);
}
table.sg-formular > tbody > tr:last-child > td { border-bottom: none; }
table.sg-formular > tfoot > tr > td {
  padding: 7px 8px;
  border-top: 3px double var(--sg-tief);
  font-weight: 700;
  color: var(--sg-tief);
}

/* Spaltentypen */
table.sg-formular .sg-nr {
  width: 44px;
  text-align: center;
  border-right: 1px solid var(--sg-linie);
  color: var(--sg-navy);
  font-weight: 600;
}
table.sg-formular > thead > tr > th.sg-nr { border-right: 1px solid var(--sg-tief); }
table.sg-formular .sg-zahl   { text-align: right; white-space: nowrap; }
table.sg-formular .sg-mitte  { text-align: center; white-space: nowrap; }
table.sg-formular .sg-neben  { color: var(--sg-grau); font-size: .92em; }
table.sg-formular .sg-erg {
  width: 64px;
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
  color: var(--sg-tief);
  border-left: 1px solid var(--sg-linie);
  border-right: 1px solid var(--sg-linie);
}
table.sg-formular .sg-erg i { font-style: normal; font-weight: 400; color: #9aa6b2; margin: 0 2px; }
table.sg-formular .sg-offen { color: #b4bec9; font-weight: 400; }
table.sg-formular .sg-wir    { color: var(--sg-tief); font-weight: 600; }

/* Zeile der eigenen Mannschaft: kräftig, mit oranger Randmarke */
table.sg-formular tr.sg-wir > td { color: var(--sg-tief); font-weight: 700; }
table.sg-formular tr.sg-wir > td:first-child { box-shadow: inset 3px 0 0 var(--sg-orange); }

/* Nebenzahl hinter einem Namen, etwa die DWZ */
.sg-dwz { color: var(--sg-grau); font-size: .86em; font-weight: 400; margin-left: 6px; }

/* ---------- Brettfelder ---------- */
/* Brettnummer oder Platz in einem quadratischen Feld */
table.sg-formular td.sg-feld,
table.sg-formular th.sg-feld { width: 34px; padding: 0; text-align: center; border-right: none; }
.sg-feld b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-weight: 700;
  font-size: .9em;
  vertical-align: middle;
}
.sg-feld .sg-d { background: var(--sg-navy); color: #fff; }
.sg-feld .sg-h { background: var(--sg-hell); color: var(--sg-navy); }

/* ---------- Schachbrettrand ---------- */
.sg-brettrand {
  height: 12px;
  background: conic-gradient(var(--sg-navy) 25%, #fff 0 50%, var(--sg-navy) 0 75%, #fff 0) 0 0 / 12px 12px;
}

/* ---------- Aufklappbare Abschnitte ---------- */
details.sg-klapp { border-bottom: 1px solid var(--sg-linie); }
details.sg-klapp:first-of-type { border-top: 2px solid var(--sg-tief); }
details.sg-klapp > summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 9px 2px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--sg-tief);
}
details.sg-klapp > summary::-webkit-details-marker { display: none; }
details.sg-klapp > summary::before {
  content: '+';
  display: inline-block;
  width: 1.1em;
  color: var(--sg-navy);
  font-weight: 600;
}
details.sg-klapp[open] > summary::before { content: '–'; }
details.sg-klapp > summary .sg-unter { margin-left: auto; font-weight: 400; color: var(--sg-grau); font-size: .86em; }
details.sg-klapp > summary > span:first-child { flex: 1; }
details.sg-klapp[open] > summary { border-bottom: 1px solid var(--sg-tief); }
details.sg-klapp > table.sg-formular { border-top: none; border-bottom: none; }

/* ---------- Kennzahlen in einer Zeile ---------- */
.sg-zahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  border-top: 2px solid var(--sg-tief);
  border-bottom: 1px solid var(--sg-linie);
}
.sg-zahlen > div { padding: 10px 12px 9px; border-right: 1px solid var(--sg-linie); }
.sg-zahlen > div:last-child { border-right: none; }
.sg-zahlen b {
  display: block;
  font-size: 1.35em;
  line-height: 1.15;
  color: var(--sg-tief);
  font-variant-numeric: tabular-nums;
}
.sg-zahlen b small { font-size: .55em; font-weight: 400; color: var(--sg-grau); }
.sg-zahlen span {
  display: block;
  margin-top: 2px;
  font-size: .7em;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sg-grau);
}

/* ---------- Kleinteile ---------- */
.sg-kuerzel {               /* Titel wie GM, IM, FM */
  display: inline-block;
  margin-right: 6px;
  padding: 0 4px;
  border: 1px solid var(--sg-navy);
  font-size: .68em;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.55;
  color: var(--sg-navy);
  vertical-align: 1px;
}
.sg-quadrat {               /* Farbquadrat für Klassen und Legenden */
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: 0;
}
.sg-quelle {
  margin: 8px 0 0;
  font-size: .76em;
  color: var(--sg-grau);
  text-align: right;
}
.sg-leer { padding: 12px 0; font-size: .9em; color: var(--sg-grau); }
.sg-abstand { margin-top: 28px; }

/* Suchfeld als Formularlinie */
.sg-suche input {
  box-sizing: border-box;
  width: 100%;
  padding: 7px 2px;
  border: none;
  border-bottom: 2px solid var(--sg-tief);
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: var(--sg-text);
  outline: none;
}
.sg-suche input:focus { border-bottom-color: var(--sg-orange); }

/* ---------- Spielberichte in WordPress ---------- */
.sg-bericht-kopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--sg-tief);
}
.sg-bericht-kopf .sg-paarung {
  margin: 0;
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--sg-tief);
}
.sg-bericht-kopf .sg-paarung span { color: #8b98a6; font-weight: 400; }
.sg-fuss {
  margin: 10px 0 1.4em;
  font-size: .82em;
  color: var(--sg-grau);
}

/* ---------- Handy ---------- */
@media (max-width: 600px) {
  table.sg-formular { font-size: .86em; }
  table.sg-formular > tbody > tr > td,
  table.sg-formular > thead > tr > th { padding-left: 5px; padding-right: 5px; }
  table.sg-formular .sg-nr { width: 30px; }
  table.sg-formular .sg-erg { width: 52px; }
  .sg-feld b { width: 26px; height: 26px; }
  table.sg-formular td.sg-feld { width: 28px; }
  .sg-stand { font-size: 1.8em; }
  .sg-bericht-kopf .sg-paarung { font-size: 1.05em; }
  .sg-nur-breit { display: none; }
}
