/*
 * AIXTRA Social-Widget, Gestaltung nach der Printclub-Vorlage (26.09.2026):
 * Haarlinien statt Kästen, Akzentfarbe nur für Sterne, Initialen und Fokus.
 * Schrift und Textfarbe kommen von der Kundenseite. Anpassung je Kunde über
 * Variablen, z. B. am Container: style="--as-accent:#e31e24".
 *   --as-accent        Sterne, Initialen, Fokus (Standard: Textfarbe)
 *   --as-display-font  Schrift der großen Bewertungszahl (Standard: Seite)
 *   --as-muted, --as-rule, --as-media-bg, --as-badge-bg, --as-badge-text
 * Dunkle Seiten: class="aixtra-social aixtra-social--dark".
 * Kanonische Quelle: AUTOMATION/web/aixtra-social/.
 */
.aixtra-social {
  --as-accent: currentColor;
  --as-display-font: inherit;
  --as-muted: color-mix(in srgb, currentColor 62%, transparent);
  --as-rule: color-mix(in srgb, currentColor 18%, transparent);
  --as-media-bg: color-mix(in srgb, currentColor 6%, transparent);
  --as-badge-bg: rgba(255, 255, 255, 0.92);
  --as-badge-text: #111111;
  --as-gap: 40px;
  font: inherit;
  color: inherit;
  min-width: 0;
  text-align: left;
}
.aixtra-social--dark { --as-badge-bg: rgba(0, 0, 0, 0.78); --as-badge-text: #ffffff; }
.aixtra-social *, .aixtra-social *::before, .aixtra-social *::after { box-sizing: border-box; }
.aixtra-social [hidden] { display: none !important; }

/* Themes der Kundenseiten stylen p/blockquote/img oft kräftig (Rahmen,
   kursiv, Blocksatz, Anführungszeichen, feste Schriftgrößen); zurücksetzen. */
.aixtra-social p, .aixtra-social blockquote {
  margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
  font-family: inherit; font-weight: inherit; font-style: normal; text-align: left; quotes: none;
  color: inherit; letter-spacing: normal; text-transform: none;
}
.aixtra-social blockquote::before, .aixtra-social blockquote::after,
.aixtra-social p::before, .aixtra-social p::after { content: none !important; }
.aixtra-social img { max-width: none; margin: 0; border: 0; }

.aixtra-social a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.aixtra-social a:focus-visible, .aixtra-social button:focus-visible, .aixtra-social__track:focus-visible {
  outline: 2px solid var(--as-accent); outline-offset: 5px;
}
.aixtra-social__arrow { white-space: nowrap; }
.aixtra-social__fallback a { font-weight: 600; }
.aixtra-social--center .aixtra-social__fallback { text-align: center; }

/* ── Bewertungszeile ─────────────────────────────────────── */
.aixtra-social__content--google { display: grid; gap: 36px; grid-template-columns: minmax(0, 1fr); }
.aixtra-social__rating { align-items: baseline; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.aixtra-social__rating p { font-size: 16px; line-height: 1.4; color: var(--as-muted); }
.aixtra-social__rating .aixtra-social__label { color: inherit; }
.aixtra-social .aixtra-social__number {
  color: inherit; font-family: var(--as-display-font); font-size: 40px; line-height: 1;
}
.aixtra-social__number span { color: var(--as-muted); font-family: inherit; font-size: 16px; margin-left: 6px; }
.aixtra-social__all { font-size: 16px; margin-left: auto; }

/* ── Slider ──────────────────────────────────────────────── */
.aixtra-social__slider { min-width: 0; }
.aixtra-social__track {
  display: flex; gap: var(--as-gap); overflow-x: auto; overscroll-behavior-x: contain;
  padding: 2px 0 8px; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.aixtra-social__track::-webkit-scrollbar { display: none; }
.aixtra-social__controls {
  align-items: center; color: var(--as-muted); display: flex; font-size: 14px;
  gap: 14px; justify-content: flex-end; margin-top: 20px;
}
.aixtra-social__controls.is-idle { display: none; }
.aixtra-social__controls button {
  appearance: none; background: transparent; border: 1px solid var(--as-rule); border-radius: 0;
  color: inherit; cursor: pointer; font: 300 20px/1 inherit; height: 44px; width: 44px; padding: 0;
  transition: border-color 0.2s ease;
}
.aixtra-social__controls button:hover:not(:disabled) { border-color: currentColor; }
.aixtra-social__controls button:disabled { cursor: default; opacity: 0.3; }

/* ── Rezensionen ─────────────────────────────────────────── */
.aixtra-social__review {
  border-top: 1px solid var(--as-rule); display: flex; flex: 0 0 calc((100% - 3 * var(--as-gap)) / 4);
  flex-direction: column; min-width: 0; padding: 24px 0 0; scroll-snap-align: start;
}
.aixtra-social .aixtra-social__stars { color: var(--as-accent); font-size: 13px; letter-spacing: 0.22em; line-height: 1; }
.aixtra-social .aixtra-social__quote { margin: 18px 0 28px; }
.aixtra-social__quote p { font-size: 18px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.aixtra-social__quote.is-collapsed p {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden;
}
.aixtra-social__more {
  appearance: none; align-self: flex-start; background: none; border: 0; color: inherit;
  cursor: pointer; font: inherit; font-size: 14px; min-height: 44px; padding: 0 0 16px;
  text-align: left; text-decoration: underline; text-underline-offset: 4px;
}
.aixtra-social__author { align-items: center; display: flex; gap: 12px; margin-top: auto; min-width: 0; }
.aixtra-social__avatar {
  align-items: center; background: var(--as-accent); border-radius: 50%; color: #ffffff; display: inline-flex;
  flex: 0 0 36px; font-size: 15px; font-weight: 600; height: 36px; justify-content: center; line-height: 1; width: 36px;
}
.aixtra-social--dark .aixtra-social__avatar { color: #000000; }
.aixtra-social__author div { min-width: 0; overflow-wrap: anywhere; }
.aixtra-social__author strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.aixtra-social time { color: var(--as-muted); display: block; font-size: 13px; line-height: 1.3; margin-top: 2px; }
.aixtra-social .aixtra-social__source { color: var(--as-muted); font-size: 13px; line-height: 1.45; margin-top: 18px; }

/* ── Instagram ───────────────────────────────────────────── */
.aixtra-social__slider--instagram .aixtra-social__track {
  display: grid; gap: 0 var(--as-gap); grid-auto-columns: calc((100% - 3 * var(--as-gap)) / 4); grid-auto-flow: column;
}
.aixtra-social__post { display: flex; flex-direction: column; min-width: 0; scroll-snap-align: start; }
.aixtra-social .aixtra-social__media {
  aspect-ratio: 4 / 5; background: var(--as-media-bg); display: block; overflow: hidden; position: relative; text-decoration: none;
}
.aixtra-social__media img {
  position: absolute; inset: 0; display: block; height: 100%; width: 100%; object-fit: cover; transition: transform 0.6s ease;
}
.aixtra-social__media:hover img { transform: scale(1.02); }
.aixtra-social__badge {
  background: var(--as-badge-bg); bottom: 12px; color: var(--as-badge-text); font-size: 11px; left: 12px;
  letter-spacing: 0.06em; line-height: 1; padding: 7px 9px 5px; position: absolute; text-transform: uppercase;
}
.aixtra-social .aixtra-social__meta { color: var(--as-muted); font-size: 13px; line-height: 1.3; margin: 16px 0 8px; }
.aixtra-social__meta time { display: inline; font-size: inherit; margin: 0; }
.aixtra-social .aixtra-social__text {
  -webkit-box-orient: vertical; -webkit-line-clamp: 4; display: -webkit-box; font-size: 16px; line-height: 1.5;
  overflow: hidden; overflow-wrap: anywhere; white-space: pre-line;
}
.aixtra-social__text strong { font-weight: 600; }

@media (max-width: 1100px) {
  .aixtra-social__review { flex-basis: calc((100% - var(--as-gap)) / 2); }
  .aixtra-social__slider--instagram .aixtra-social__track { grid-auto-columns: calc((100% - var(--as-gap)) / 2); }
}
@media (max-width: 767px) {
  .aixtra-social { --as-gap: 20px; }
  .aixtra-social__content--google { gap: 24px; }
  .aixtra-social__rating { column-gap: 18px; }
  .aixtra-social__all { flex-basis: 100%; margin-left: 0; }
  .aixtra-social__review { flex-basis: 86%; }
  .aixtra-social__slider--instagram .aixtra-social__track { grid-auto-columns: 86%; }
  .aixtra-social__controls { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .aixtra-social__track { scroll-behavior: auto; }
  .aixtra-social__media img { transition: none; }
}
