/* =========================================================
   Pichler SEO-Text Pro
   Schrift und Textfarbe kommen aus dem Shop, der Hintergrund aus dem OPC-Container.
   Farben über --pst-accent, --pst-link, --pst-link-hover und --pst-button (setzt das Portlet).
   Die Spalten richten sich nach der Breite des Portlets, nicht nach dem Gerät.
   Seit 1.2.0 lesen Linien, Knopf, Radius und Schriftstärke die Variablen des Templates PICHLER 2027 (--p27-*),
   der zweite Wert ist der bisherige Rückfall: ohne das Template bleibt der Kasten wie in 1.1.0.
   ========================================================= */

.opc-pst {
  container-type: inline-size;
  /* Innenabstand wächst mit der Spaltenbreite (Prozent = Breite des Platzes), in schmalen Spalten bleibt Raum für Text */
  padding: min(48px, 8%) min(56px, 6%);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.opc-pst .pst-title {
  max-width: 900px;
  margin: 0 0 20px;
  color: inherit;
  font-size: 36px;
  line-height: 1.12;
  font-weight: var(--p27-head-weight, 700);
  letter-spacing: -0.02em;
}

.opc-pst .pst-intro {
  max-width: 68ch;
  font-size: 19px;
}

.opc-pst .pst-intro > :last-child,
.opc-pst .pst-content > :last-child {
  margin-bottom: 0;
}

.opc-pst p {
  max-width: 72ch;
  margin: 0 0 14px;
}

.opc-pst strong {
  font-weight: 600;
}

.opc-pst .pst-content h3 {
  margin: 36px 0 8px;
  color: inherit;
  font-size: 19px;
  line-height: 1.3;
  font-weight: var(--p27-head-weight, 700);
}

/* Links im Text: dunklere Stufe des Akzents, damit sie auf hellem Grund lesbar bleiben */
.opc-pst .pst-intro a,
.opc-pst .pst-content a {
  color: var(--pst-link, #00589f);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.opc-pst .pst-intro a:hover,
.opc-pst .pst-content a:hover {
  color: var(--pst-link-hover, #004889);
}

/* Schnelllinks als ruhige Linkzeile, die Abstände trennen statt Rahmen */
.opc-pst .pst-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.opc-pst .pst-links a {
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.16s ease;
}

.opc-pst .pst-links a:hover {
  color: var(--pst-link, #00589f);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.opc-pst .pst-more {
  margin-top: 32px;
}

.opc-pst .pst-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--p27-r-ctl, 4px);
  background: var(--pst-button, var(--p27-ink, #2b2f33));
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.16s ease;
}

.opc-pst .pst-toggle::-webkit-details-marker {
  display: none;
}

.opc-pst .pst-toggle::after {
  content: "+";
  font-size: 19px;
  line-height: 1;
}

.opc-pst .pst-more[open] > .pst-toggle {
  margin-bottom: 8px;
}

.opc-pst .pst-more[open] > .pst-toggle::after,
.opc-pst .pst-toggle[aria-expanded="true"]::after {
  content: "\2212";
}

.opc-pst .pst-toggle[hidden] {
  display: none;
}

/* Verlauf: der Anfang des Aufklapptexts blendet nach unten aus. Die Maske braucht keine Hintergrundfarbe,
   deshalb passt sie auf jeden OPC-Container. */
.opc-pst .pst-more--fade .pst-content > :first-child {
  margin-top: 0;
}

.opc-pst .pst-more--fade.is-collapsed .pst-content {
  max-height: 170px;
  overflow: hidden;
  /* clip statt hidden: der Fokus auf einen Link im gekürzten Teil darf den Text nicht verschieben */
  overflow: clip;
  -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent);
  mask-image: linear-gradient(to bottom, #000 25%, transparent);
}

.opc-pst .pst-more--fade .pst-toggle {
  margin-top: 20px;
  font-family: var(--p27-font-head, inherit);
}

/* Nur mit Maus: auf Touchgeräten bliebe der Knopf nach dem Antippen in der Akzentfarbe stehen */
@media (hover: hover) {
  .opc-pst .pst-toggle:hover {
    background: var(--pst-accent, #0067c4);
  }
}

.opc-pst a:focus-visible,
.opc-pst .pst-toggle:focus-visible {
  outline: 2px solid var(--pst-accent, #0067c4);
  outline-offset: 3px;
}

/* Breites Portlet mit Schnelllinks: Text links, Schnelllinks rechts, Aufklapptext darunter über die volle Breite */
@container (min-width: 900px) {
  .opc-pst--links .pst-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    /* Ist die Linkliste länger als Überschrift und Einleitung, wächst nur die Zeile der Einleitung */
    grid-template-rows: auto 1fr;
    column-gap: 64px;
  }

  .opc-pst--links .pst-title,
  .opc-pst--links .pst-intro {
    grid-column: 1;
  }

  .opc-pst--links .pst-links {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: start;
  }

  .opc-pst--links .pst-links ul {
    flex-direction: column;
    gap: 12px;
    margin: 6px 0 0;
  }

  .opc-pst--links .pst-more,
  .opc-pst--links .pst-empty {
    grid-column: 1 / -1;
  }
}

/* Slim: zentriert, Schnelllinks als Band mit Mittelpunkt zwischen den Links, der lange Text bleibt linksbündig */
.opc-pst--slim .pst-inner {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.opc-pst--slim .pst-title,
.opc-pst--slim .pst-intro,
.opc-pst--slim p {
  margin-right: auto;
  margin-left: auto;
}

.opc-pst--slim .pst-links ul {
  justify-content: center;
  gap: 6px 0;
  margin: 0 0 24px;
  padding: 12px 0;
  border-top: 1px solid var(--p27-line, rgba(0, 0, 0, 0.12));
  border-bottom: 1px solid var(--p27-line, rgba(0, 0, 0, 0.12));
}

.opc-pst--slim .pst-links li + li::before {
  content: "\00B7";
  margin: 0 12px;
  opacity: 0.5;
}

.opc-pst--slim .pst-content {
  max-width: 72ch;
  margin: 0 auto;
  text-align: left;
}

.opc-pst--slim .pst-content p {
  margin-right: 0;
  margin-left: 0;
}

@container (max-width: 767px) {
  .opc-pst .pst-inner {
    font-size: 16px;
  }

  .opc-pst .pst-title {
    font-size: 21px;
  }

  .opc-pst .pst-intro {
    font-size: 17px;
  }

  .opc-pst .pst-content h3 {
    font-size: 17px;
  }

  .opc-pst .pst-links ul {
    gap: 8px 20px;
  }

  .opc-pst--slim .pst-links ul {
    gap: 4px 0;
  }

  .opc-pst--slim .pst-links li + li::before {
    margin: 0 8px;
  }

  .opc-pst .pst-toggle {
    gap: 8px;
    padding: 0 14px;
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .opc-pst {
    padding: 28px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .opc-pst a,
  .opc-pst .pst-toggle {
    transition: none;
  }
}
