/* Schiessprogramm (Shortcodes [schiessprogramm] und [schiessprogramm_legende])
   Aufbau und Proportionen wie die SVG-Tabellen 2026 (Web 684 px, Mobile 415 px).
   Alle Groessen in cqw skalieren mit der Tabellenbreite wie vorher das SVG. */

.hub-sp,
.hub-sp-legende {
  --sp-linie: #738367;
  --sp-lw: 1.5px;
  --sp-text: #33392f;
  --sp-o: #acaf92; /* offen */
  --sp-m: #84a3b8; /* nur Mitglieder */
  --sp-x: #de6d69; /* geschlossen */
  --sp-k: #c79d62; /* Kurs / Spezialanlass */
  --sp-s: #8d8d8d; /* Arbeitstag / Vereinsanlass */
  --sp-a: #aa9ac0; /* Ausbildung / Pruefungen */
}

.hub-sp {
  container-type: inline-size;
  width: 100%;
  max-width: 684px;
  margin: 0 auto;
  color: var(--sp-text);
  text-align: left;
}

.hub-sp *,
.hub-sp *::before,
.hub-sp *::after {
  box-sizing: border-box;
}

/* Masse Web-Version */
.hub-sp > * {
  --sp-info: 24.5%;
  --sp-kopf: 22.3cqw;
  --sp-zeile: 6.05cqw;
  --sp-monat: 6.6cqw;
  --sp-disz: 2.35cqw;
  --sp-datum: 2.2cqw;
  --sp-label: 2.45cqw;
}

/* Masse Mobile-Version (wie 2026_*_mobile.svg) */
@container (max-width: 480px) {
  .hub-sp > * {
    --sp-info: 34.3%;
    --sp-kopf: 42cqw;
    --sp-zeile: 10.2cqw;
    --sp-monat: 9.2cqw;
    --sp-disz: 4.8cqw;
    --sp-datum: 3.65cqw;
    --sp-label: 3.1cqw;
  }
}

.hub-sp__kopf,
.hub-sp__zeile {
  display: grid;
  grid-template-columns: var(--sp-info) repeat(7, minmax(0, 1fr));
}

/* Kopf: Monat links, Disziplinen senkrecht mit gestaffelten Linien */
.hub-sp__kopf {
  height: var(--sp-kopf);
  /* Rechte Abschlusslinie als echter Rand (gleiche Rundung wie der Zeilenrand),
     per border-image erst ab 25 % Hoehe sichtbar wie die Linie bei Uebungsparcours. */
  border-right: var(--sp-lw) solid var(--sp-linie);
  border-bottom: var(--sp-lw) solid var(--sp-linie);
  border-image: linear-gradient(to bottom, transparent 25%, var(--sp-linie) 25%) 1;
}

.hub-sp__monat {
  align-self: end;
  padding-bottom: 0.38em;
  color: var(--sp-linie);
  font-family: "interblack", Arial, sans-serif;
  font-size: var(--sp-monat);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub-sp__disziplin {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  padding-bottom: 0.7em;
  font-size: var(--sp-disz);
}

.hub-sp__disziplin span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: "caecilia_lt_std55_roman", Georgia, serif;
  line-height: 1;
  white-space: nowrap;
}

.hub-sp__disziplin::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: calc(100% - var(--top, 0%));
  border-left: var(--sp-lw) solid var(--sp-linie); /* Rand statt Flaeche: gleiche Rundung wie die Zellen */
}


.hub-sp__disziplin:nth-child(3) { --top: 18%; }
.hub-sp__disziplin:nth-child(4) { --top: 30%; }
.hub-sp__disziplin:nth-child(5) { --top: 30%; }
.hub-sp__disziplin:nth-child(6) { --top: 32%; }
.hub-sp__disziplin:nth-child(7) { --top: 18%; }
.hub-sp__disziplin:nth-child(8) { --top: 25%; }

/* Zeilen */
.hub-sp__zeile {
  min-height: var(--sp-zeile);
  border-right: var(--sp-lw) solid var(--sp-linie);
  border-bottom: var(--sp-lw) solid var(--sp-linie);
}

.hub-sp__datum {
  display: grid;
  grid-template-columns: 2.05em minmax(0, 1fr);
  align-content: center;
  min-width: 0;
  padding: 0.2em 0;
  font-size: var(--sp-datum);
  line-height: 1.1;
  white-space: nowrap;
}

.hub-sp__tag {
  color: var(--sp-linie);
  font-family: "interblack", Arial, sans-serif;
}

.hub-sp__zeit {
  font-family: "intermedium", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

/* Hinweis unter der Uhrzeit (z. B. "Jägerflohmarkt") */
.hub-sp__notiz {
  grid-column: 2;
  margin-top: 0.2em;
  color: var(--sp-linie);
  font-family: "caecilia_lt_std55_roman", Georgia, serif;
  font-size: 0.8em;
  line-height: 1.15;
  white-space: normal;
}

/* Eine Zelle je Disziplin mit eigenem Rand: die Linien liegen exakt auf dem
   Spaltenraster wie die Kopflinien. Beschriftungen liegen als eigene Ebene
   (.hub-sp__label) ueber allen Zellen ihres Abschnitts. */
.hub-sp__datum,
.hub-sp__zelle,
.hub-sp__label {
  grid-row: 1;
}

.hub-sp__zelle {
  min-width: 0;
  border-left: var(--sp-lw) solid var(--sp-linie);
}

.hub-sp__label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.15em 0.35em;
  color: #fff;
  font-family: "caecilia_lt_std55_roman", Georgia, serif;
  font-size: var(--sp-label);
  line-height: 1.12;
  text-align: center;
  hyphens: auto;
  overflow-wrap: break-word;
  pointer-events: none;
}

/* Beschriftung fuer das schmale Feld rechts daneben (wie "Osterhasen-Schiessen >" 2026) */
.hub-sp__label--pfeil {
  padding-right: 1.3em;
}

.hub-sp__label--pfeil::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.35em;
  width: 0.6em;
  height: 0.6em;
  border-top: 1.5px solid #fff;
  border-right: 1.5px solid #fff;
  transform: translateY(-50%) rotate(45deg);
}

.hub-sp--o { background-color: var(--sp-o); }
.hub-sp--m { background-color: var(--sp-m); }
.hub-sp--x { background-color: var(--sp-x); }
.hub-sp--k { background-color: var(--sp-k); }
.hub-sp--s { background-color: var(--sp-s); }
.hub-sp--a { background-color: var(--sp-a); }

/* Legende (wie bisher: Kaestchen 30 px, zwei Spalten) */
.hub-sp-legende {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 40px;
  max-width: 735px;
  margin: 0 auto !important;
  padding: 0 !important;
  list-style: none !important;
  color: var(--sp-text);
}

.hub-sp-legende li {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0 !important;
  font-size: 15px;
  line-height: 1.3;
}

.hub-sp-legende li::before {
  content: none !important;
}

.hub-sp-legende__farbe {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}

@media (max-width: 767px) {
  .hub-sp {
    width: auto;
    margin: 0 14px;
  }

  .hub-sp-legende {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
