/* Module Tables block — Figma 339-2287 (desktop) / 415-8167 (mobile).
   Grey section band, centered heading, accordion modules; open module = white
   card with a FUNKTION × plan (BASIC/PRO/ENTERPRISE) comparison table. */
.sun-mt {
  background: var(--sun-border);                    /* #efefef band behind the cards */
  padding: clamp(48px, 6vw, 80px) 0;
}
.sun-mt--no-top { padding-top: 0; }                /* option „Kein Abstand oben" */
.sun-mt__inner {
  box-sizing: border-box;
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 3.75vw, 48px);
}

/* --- Centered header (section-header type scale) --- */
.sun-mt__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.sun-mt__heading {
  margin: 0;
  max-width: 760px;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: var(--wp--preset--font-size--h2, 48px);
  line-height: 1.1667;                              /* 56/48 */
  letter-spacing: -0.01em;                          /* -0.48px @ 48px */
  color: var(--sun-secondary);                      /* #132140 */
}
.sun-mt__subhead {
  margin: 0;
  max-width: 760px;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;                                 /* Text - Medium */
  font-size: var(--wp--preset--font-size--lg, 18px);
  line-height: 1.3334;                              /* 24/18 */
  color: var(--sun-bluegrey);                       /* #4f5563 */
}

/* --- Accordion modules --- */
.sun-mt__modules {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sun-mt__module {
  border-bottom: 1px solid var(--sun-muted);        /* #b6bac4 */
}
.sun-mt__module[data-open] {
  background: var(--sun-base);                      /* white card when open */
  border-radius: 4px;
  border-bottom-color: transparent;
}
.sun-mt__title-row { margin: 0; }
.sun-mt__btn {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--sun-secondary);
}
.sun-mt__btn:focus-visible {
  outline: 3px solid var(--sun-accent);
  outline-offset: 2px;
}
.sun-mt__title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Figma: module icon only appears on the open panel header. */
.sun-mt .sun-mt__module-icon {
  display: none;
  width: 32px;
  height: 32px;
  color: var(--sun-primary);                        /* orange */
}
.sun-mt__module[data-open] .sun-mt__module-icon { display: block; }
.sun-mt__title {
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: var(--wp--preset--font-size--h5, 24px);
  line-height: 1.3334;                              /* 32/24 */
  color: var(--sun-secondary);
}
/* Optional one-sentence intro under the module title. Sits outside the panel,
   so it stays readable while the entry is closed; the button gives up most of
   its bottom padding to keep title and intro together. */
.sun-mt__module--has-intro .sun-mt__btn { padding-bottom: 8px; }
.sun-mt__intro {
  margin: 0;
  padding: 0 72px 24px 24px;                        /* right: clear of the caret column */
  max-width: 800px;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--sun-bluegrey);
}
.sun-mt .sun-mt__caret {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: var(--sun-secondary);
  transition: transform .25s ease;
}
.sun-mt__module[data-open] .sun-mt__caret { transform: rotate(180deg); }

/* --- Panel: smooth height animation via grid-template-rows (faq pattern) --- */
.sun-mt__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
.sun-mt__module[data-open] .sun-mt__panel { grid-template-rows: 1fr; }
.sun-mt__panel-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility 0s linear .25s;
}
.sun-mt__module[data-open] .sun-mt__panel-inner {
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease .1s, visibility 0s;
}

/* --- Feature table --- */
.sun-mt__table {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* --- List layout (per module, instead of the plan table): two free rich-text
   columns; bullet lists render as orange checks (same mark as textmedia). --- */
.sun-mt__cols {
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 40px;
  align-items: start;
}
.sun-mt__col {
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 400;
  font-size: 18px;
  line-height: 24px;
  color: var(--sun-secondary);
}
.sun-mt__col > :first-child { margin-top: 0; }
.sun-mt__col > :last-child { margin-bottom: 0; }
.sun-mt__col p { margin: 0 0 12px; }
.sun-mt__col ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sun-mt__col ul li {
  position: relative;
  padding-left: 34px;                               /* icon 24 + 10 gap */
}
.sun-mt__col ul li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  background: var(--sun-primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sun-mt__col ol { margin: 0 0 12px; padding-left: 20px; }
.sun-mt__thead,
.sun-mt__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(96px, 200px));
  gap: 16px;
  align-items: center;
}
.sun-mt__thead {
  background: var(--sun-border);                    /* #efefef strip on the white card */
  padding: 16px;
  align-items: end;
}
.sun-mt__thead-label {
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: var(--wp--preset--font-size--lg, 18px);
  line-height: 1.3334;
  color: var(--sun-secondary);
}
.sun-mt__plan {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sun-mt .sun-mt__plan-icon {
  width: 32px;
  height: 32px;
  color: var(--sun-primary);
}
.sun-mt__pill {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 3.5px 8px 4.5px;
  background: var(--sun-primary);                   /* #ff710a */
  border: 1px solid var(--sun-primary);
  border-radius: 4px;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: var(--wp--preset--font-size--xs, 12px);
  line-height: 1.3334;
  color: var(--sun-base);
  text-transform: uppercase;
  white-space: nowrap;
}
.sun-mt__row {
  padding: 8px 16px;
  border-bottom: 1px solid var(--sun-muted);
}
.sun-mt__feature {
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 400;
  font-size: var(--wp--preset--font-size--lg, 18px);
  line-height: 1.3334;                              /* 24/18 */
  color: var(--sun-secondary);
}
.sun-mt__cell {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sun-mt .sun-mt__check {
  width: 32px;
  height: 32px;
  color: var(--sun-primary);                        /* orange check */
}
.sun-mt .sun-mt__minus {
  width: 32px;
  height: 32px;
  color: var(--sun-bluegrey);                       /* grey minus = not included */
}

/* --- CTA (left-aligned per Figma) --- */
.sun-mt__cta-row { display: flex; }
.sun-mt .sun-mt__cta-icon { width: 16px; height: 16px; }

/* --- Mobile pager (hidden on desktop) --- */
.sun-mt__pager { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sun-mt__panel,
  .sun-mt__panel-inner,
  .sun-mt .sun-mt__caret { transition: none; }
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .sun-mt__heading { font-size: clamp(32px, 6vw, 40px); line-height: 1.2; }
  .sun-mt__thead,
  .sun-mt__row { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(56px, 96px)); gap: 8px; }
}

/* ≤700px: one plan column at a time + pager (Figma mobile 415-8167). */
@media (max-width: 700px) {
  .sun-mt__inner { gap: 24px; }

  /* All three plan columns stay visible (customer 2026-11-24: a column pager is not
     understood). The pager markup stays but is hidden; room comes from a tighter
     function column (14px, hyphenated) and pills that wrap onto two lines. */
  .sun-mt__btn { padding: 16px; gap: 12px; }
  .sun-mt__module--has-intro .sun-mt__btn { padding-bottom: 6px; }
  .sun-mt__intro { padding: 0 52px 16px 16px; }
  .sun-mt__title { font-size: 18px; line-height: 1.3334; }
  .sun-mt .sun-mt__caret { width: 24px; height: 24px; }

  .sun-mt__table { padding: 0 8px 8px; }
  .sun-mt__cols { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; gap: 16px; }
  .sun-mt__col { font-size: 16px; }
  .sun-mt__col ul { gap: 10px; }
  .sun-mt__thead,
  .sun-mt__row { grid-template-columns: minmax(0, 1fr) repeat(3, 17%); gap: 4px; }   /* checks ≤ 55% of the row */
  .sun-mt__thead { padding: 12px 8px; }
  .sun-mt__row { padding: 8px; }
  .sun-mt__thead-label { font-size: 14px; }
  .sun-mt__feature { font-size: 14px; line-height: 20px; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 9 4 4; overflow-wrap: break-word; }
  .sun-mt__plan { gap: 6px; width: 100%; }
  .sun-mt__pill {
    height: auto;
    min-height: 30px;                    /* = two lines, so one-line pills line up */
    width: 100%;
    padding: 4px 2px;
    font-size: 9px;
    line-height: 11px;
    letter-spacing: -0.01em;
    word-spacing: 100vw;                 /* one word per line: every pill = 2 lines */
    text-align: center;
    white-space: normal;                 /* „SALES ENTERPRISE" → two lines */
  }


  .sun-mt .sun-mt__check,
  .sun-mt .sun-mt__minus,
  .sun-mt .sun-mt__plan-icon { width: 24px; height: 24px; }
}

/* Small phones (≤380): a bit more room for the function column. */
@media (max-width: 380px) {
  .sun-mt__inner { width: calc(100% - 32px); }
  .sun-mt__thead,
  .sun-mt__row { gap: 2px; }
  .sun-mt__pill { font-size: 8.5px; letter-spacing: 0; padding-inline: 0; }
}
