/* ============================================================
   HWS Buttons – einheitliches Button-Design
   Shortcode: [hws_button ...]
   ============================================================ */

.hb-btn {
  --hb-red: #e30613;
  --hb-red-dark: #c1050f;
  --hb-dark: #3a3a3a;
  --hb-dark-hover: #222;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.7em;
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: .85rem;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.hb-btn:hover { text-decoration: none; }
.hb-btn:focus-visible { outline: 3px solid var(--hb-dark); outline-offset: 2px; }

/* ---- Grössen ---- */
.hb-btn--sm { padding: .6em 1.2em; font-size: .75rem; }
.hb-btn--lg { padding: 1.1em 2.4em; font-size: .95rem; }

/* ---- Varianten: solid ---- */
.hb-btn--solid.hb-btn--red  { background: var(--hb-red);  color: #fff; border-color: var(--hb-red); }
.hb-btn--solid.hb-btn--red:hover  { background: var(--hb-red-dark);  border-color: var(--hb-red-dark);  color: #fff; }
.hb-btn--solid.hb-btn--dark { background: var(--hb-dark); color: #fff; border-color: var(--hb-dark); }
.hb-btn--solid.hb-btn--dark:hover { background: var(--hb-dark-hover); border-color: var(--hb-dark-hover); color: #fff; }

/* ---- Varianten: outline ---- */
.hb-btn--outline.hb-btn--red  { background: transparent; color: var(--hb-red);  border-color: var(--hb-red); }
.hb-btn--outline.hb-btn--red:hover  { background: var(--hb-red);  color: #fff; }
.hb-btn--outline.hb-btn--dark { background: transparent; color: var(--hb-dark); border-color: var(--hb-dark); }
.hb-btn--outline.hb-btn--dark:hover { background: var(--hb-dark); color: #fff; }

/* ---- Varianten: ghost ---- */
.hb-btn--ghost { background: transparent; border-color: transparent; padding-left: .4em; padding-right: .4em; }
.hb-btn--ghost.hb-btn--red  { color: var(--hb-red); }
.hb-btn--ghost.hb-btn--red:hover  { color: var(--hb-red-dark); }
.hb-btn--ghost.hb-btn--dark { color: var(--hb-dark); }
.hb-btn--ghost.hb-btn--dark:hover { color: var(--hb-dark-hover); }

/* ---- Variante: Pfeil ---- */
.hb-btn--pfeil {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, .9em 50%);
  padding-left: 2.4em;
}
.hb-btn--pfeil.hb-btn--red  { background: var(--hb-red);  color: #fff; }
.hb-btn--pfeil.hb-btn--red:hover  { background: var(--hb-red-dark); }
.hb-btn--pfeil.hb-btn--dark { background: var(--hb-dark); color: #fff; }
.hb-btn--pfeil.hb-btn--dark:hover { background: var(--hb-dark-hover); }

/* ---- Variante: Raute (SVG) ---- */
.hb-btn--raute {
  position: relative;
  border: none;
  border-radius: 0;
  background: transparent !important;
  width: 13.5em;
  aspect-ratio: 280 / 110;
  padding: 0;
}
.hb-btn--raute.hb-btn--sm { width: 11em; }
.hb-btn--raute.hb-btn--lg { width: 16em; }
.hb-btn__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hb-btn__shape polygon { stroke-width: 24; }
.hb-btn--raute.hb-btn--red  .hb-btn__shape polygon { fill: var(--hb-red);  stroke: var(--hb-red); }
.hb-btn--raute.hb-btn--red:hover  .hb-btn__shape polygon { fill: var(--hb-red-dark);  stroke: var(--hb-red-dark); }
.hb-btn--raute.hb-btn--dark .hb-btn__shape polygon { fill: var(--hb-dark); stroke: var(--hb-dark); }
.hb-btn--raute.hb-btn--dark:hover .hb-btn__shape polygon { fill: var(--hb-dark-hover); stroke: var(--hb-dark-hover); }
.hb-btn--raute .hb-btn__label {
  position: relative;
  z-index: 1;
  color: #fff;
  padding: 0 .35em;
  text-align: center;
  line-height: 1.12;         /* eng, damit mehrere Zeilen in die Rautenmitte passen */
  max-width: 12em;
  overflow-wrap: normal;     /* Wörter nicht mitten drin brechen – JS verkleinert stattdessen */
  hyphens: none;
}
.hb-btn--raute .hb-btn__label br { display: block; }

/* Label */
.hb-btn__label { display: inline-block; }

/* Ausrichtung */
.hb-btn-align { display: block; }
.hb-btn-align--left   { text-align: left; }
.hb-btn-align--center { text-align: center; }
.hb-btn-align--right  { text-align: right; }

/* ---- Mobil: alles etwas kleiner ---- */
@media (max-width: 600px) {
  .hb-btn      { font-size: .8rem;  padding: .8em 1.4em; }
  .hb-btn--sm  { font-size: .7rem;  padding: .55em 1.05em; }
  .hb-btn--lg  { font-size: .88rem; padding: .95em 1.9em; }
  /* Raute: Breite ist in em -> schrumpft automatisch mit der Schrift.
     Hier zusätzlich der Label-Buchstabenabstand etwas enger. */
  .hb-btn--raute .hb-btn__label { letter-spacing: .12em; }
}

/* Für Sonderfälle: eigene Grösse per class + Customizer-CSS.
   z.B. class="klein-mobil" und im Customizer:
   @media(max-width:600px){ .klein-mobil.hb-btn{ font-size:.7rem } } */

@media (prefers-reduced-motion: reduce) {
  .hb-btn { transition: none; }
}
