/* Sharepic-Generator "JA zur Feuerwerksinitiative" */

/* Eigene display-Angaben ueberschreiben sonst das hidden-Attribut, weil
   Klassenselektoren staerker wiegen. Diese Regel stellt hidden wieder her. */
.fwi-sharepic [hidden] { display: none !important; }

.fwi-sharepic {
  --sp-petrol:    #0C707A;
  --sp-petrol-dk: #095860;
  --sp-tuerkis:   #23BDCB;
  --sp-tiefton:   #14323C;
  --sp-sekundaer: #5A6B72;
  --sp-linie:     #CBD6DA;
  --sp-flaeche:   #F7F9F9;

  display: grid;
  /* Linke Spalte braucht eine Mindestbreite, sonst quetscht der Canvas sie
     bei hohen Fenstern zusammen. Rechte Spalte nach oben begrenzt, damit
     die Vorschau nicht ins Uferlose waechst. */
  grid-template-columns: minmax(17rem, 1fr) minmax(0, 26rem);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 52rem) {
  .fwi-sharepic {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  /* Auf dem Handy soll die Vorschau zuoberst stehen: sonst steht das Bild
     erst nach allen vier Schritten und man sieht gar nicht, dass es kommt.
     display:contents loest den Vorschau-Kasten auf, damit sich Titel, Canvas,
     Hinweis, Knoepfe und Einreichen einzeln einordnen lassen. Die Knoepfe
     bleiben dabei am Ende - sie gehoeren ans Ende des Ablaufs. */
  .fwi-sp-vorschau { display: contents; }

  .fwi-sp-vorschau-titel { order: 1; }
  .fwi-sp-canvas        { order: 2; }
  .fwi-sp-hinweis       { order: 3; }
  .fwi-sp-steuerung     { order: 4; }
  .fwi-sp-aktionen      { order: 5; }
  .fwi-sp-einreichen    { order: 6; }

  /* Der Hinweis erklaert das Verschieben des Fotos. Ohne Foto steht er sonst
     zuoberst und verwirrt. */
  .fwi-sharepic:not(.hat-foto) .fwi-sp-hinweis { display: none; }
}

/* --- Schritte ------------------------------------------------------- */

.fwi-sp-schritt {
  border: 1px solid var(--sp-linie);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.fwi-sp-schritt > h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--sp-tiefton);
}

.fwi-sp-nr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--sp-petrol);
  color: #fff;
  font-size: 0.8125rem;
  flex: 0 0 auto;
}

/* --- Foto ------------------------------------------------------------ */

.fwi-sp-dropzone {
  border: 1.5px dashed var(--sp-linie);
  border-radius: 10px;
  padding: 1.35rem 1rem;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.fwi-sp-dropzone.is-dragover {
  border-color: var(--sp-petrol);
  background: #E4F6F8;
}

.fwi-sp-dropzone p {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--sp-sekundaer);
}

.fwi-sp-privacy {
  margin: 0.75rem 0 0 !important;
  font-size: 0.8125rem !important;
  color: var(--sp-sekundaer);
}

.fwi-sharepic.hat-foto .fwi-sp-zoom-reihe {
  display: flex;
}

.fwi-sp-zoom-reihe {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.fwi-sp-zoom-reihe label {
  font-size: 0.8125rem;
  color: var(--sp-sekundaer);
  flex: 0 0 auto;
}

.fwi-sp-zoom { flex: 1 1 auto; width: 100%; }

/* --- Vorlagen und Felder --------------------------------------------- */

.fwi-sp-vorlagen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.fwi-sp-vorlage {
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  background: #EDF1F2;
  color: var(--sp-sekundaer);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.fwi-sp-vorlage:hover { background: #E1E8EA; }

.fwi-sp-vorlage.is-active {
  background: var(--sp-petrol);
  color: #fff;
}

.fwi-sharepic textarea,
.fwi-sharepic input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--sp-linie);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: var(--sp-flaeche);
  color: var(--sp-tiefton);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.fwi-sharepic textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.fwi-sharepic textarea:focus,
.fwi-sharepic input[type="text"]:focus {
  outline: 2px solid var(--sp-petrol);
  outline-offset: 1px;
  border-color: transparent;
}

.fwi-sp-zaehler {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--sp-sekundaer);
  text-align: right;
}

.fwi-sp-paar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.fwi-sp-paar label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
  color: var(--sp-sekundaer);
}

/* --- Format ----------------------------------------------------------- */

.fwi-sp-formate {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fwi-sp-format {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--sp-linie);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  background: #fff;
  color: var(--sp-tiefton);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.fwi-sp-format .mass {
  font-size: 0.75rem;
  color: var(--sp-sekundaer);
}

.fwi-sp-format.is-active {
  border-color: var(--sp-petrol);
  background: #E4F6F8;
}

.fwi-sp-format.is-active .mass { color: var(--sp-petrol); }

.fwi-sp-symbol {
  display: block;
  width: 0.85rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  flex: 0 0 auto;
}

.fwi-sp-symbol.story { height: 1.35rem; }
.fwi-sp-symbol.post  { height: 1.05rem; }

/* --- Vorschau --------------------------------------------------------- */

.fwi-sp-vorschau {
  position: sticky;
  top: 1rem;
}

.fwi-sp-vorschau-titel {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sp-sekundaer);
}

/* Hochformate wuerden bei voller Spaltenbreite zu hoch. Deshalb ueber die
   Hoehe begrenzen: aspect-ratio (per JS gesetzt) rechnet die Breite aus. */
.fwi-sp-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 10px;
  background: #101E2E;
  cursor: grab;
  touch-action: none;
}

@media (max-width: 52rem) {
  /* Auf halbe Bildschirmhoehe begrenzt. Ein Story-Format waere sonst rund
     670 Pixel hoch und wuerde den ganzen Bildschirm fuellen. */
  .fwi-sp-canvas {
    width: auto;
    max-width: 100%;
    max-height: 50vh;
  }
}

.fwi-sharepic.hat-foto .fwi-sp-canvas:active { cursor: grabbing; }

.fwi-sp-hinweis {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--sp-sekundaer);
}

.fwi-sp-aktionen {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.fwi-sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 8px;
  padding: 0.8rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

.fwi-sp-btn svg { width: 1.1em; height: 1.1em; flex: 0 0 auto; }

.fwi-sp-btn-primaer {
  background: var(--sp-petrol);
  color: #fff;
}

.fwi-sp-btn-primaer:hover,
.fwi-sp-btn-primaer:focus-visible { background: var(--sp-petrol-dk); }

.fwi-sp-btn-zweit {
  background: transparent;
  color: var(--sp-tiefton);
  box-shadow: inset 0 0 0 1px var(--sp-linie);
}

.fwi-sp-btn-zweit:hover,
.fwi-sp-btn-zweit:focus-visible { box-shadow: inset 0 0 0 1px var(--sp-petrol); }

.fwi-sp-teilen-status {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--sp-petrol);
  text-align: center;
}

/* --- Zweites Format --------------------------------------------------- */

.fwi-sp-weiteres {
  padding: 0.85rem;
  border-radius: 8px;
  background: #E4F6F8;
  text-align: center;
}

.fwi-sp-weiteres[hidden] { display: none; }

.fwi-sp-weiteres-frage {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #0A5A62;
}

.fwi-sp-weiteres-knopf { width: 100%; background: #fff; }

/* --- Einreichen in die Galerie --------------------------------------- */

.fwi-sp-einreichen {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--sp-linie);
}

.fwi-sp-einreichen-titel {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--sp-tiefton);
}

.fwi-sp-einreichen-text {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--sp-sekundaer);
}

.fwi-sp-einwilligung-feld {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--sp-sekundaer);
  cursor: pointer;
}

.fwi-sp-einwilligung-feld input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  accent-color: var(--sp-petrol);
}

/* Unsichtbares Feld gegen Automaten. Nicht per display:none verstecken,
   sonst erkennen es viele Skripte und lassen es aus. */
.fwi-sp-honig {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fwi-sp-senden { width: 100%; }

.fwi-sp-status {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  min-height: 1.2em;
}

.fwi-sp-status.ist-gut    { color: var(--sp-petrol); }
.fwi-sp-status.ist-fehler { color: #A32D2D; }
