/* Problems block — dark pain-point accordion. Figma 215-5351. */
.sun-problems {
  overflow-anchor: none;                         /* opening an entry never scrolls the page (no browser scroll anchoring) */
  background: var(--sun-secondary);              /* #132140 */
  color: var(--sun-base);
  padding-block: clamp(48px, 6vw, 96px);
}
.sun-problems__inner {
  box-sizing: border-box;
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4vw, 56px);
}

/* Heading — accent orange, lead white; centered. */
.sun-problems__heading {
  margin: 0;
  max-width: 800px;
  margin-inline: auto;
  text-align: center;
  font-family: var(--wp--preset--font-family--brand);
  font-size: clamp(30px, 3.3vw, 48px);
  font-weight: 500;
  line-height: 1.1667;
  letter-spacing: -0.48px;
  color: var(--sun-primary);
}
.sun-problems__lead { color: var(--sun-base); }
/* Accent = the orange part; starts white (matching the lead) and wipes to
   orange when the scroll-reveal toggle is on. */
.sun-problems__accent { --sun-accent-base: var(--sun-base); }  /* hi defaults to primary (orange) */

/* Row: image + accordion. */
.sun-problems__row {
  display: flex;
  gap: clamp(24px, 3vw, 48px);
  align-items: flex-start;                       /* image keeps its size when details expand */
}
/* Media box — does not stretch with the accordion. The template hands it the
   asset's own ratio, so the image fills it edge to edge at its true proportions;
   the Figma 432/489 stays as the fallback for the empty placeholder. */
.sun-problems__media {
  flex: 0 0 auto;
  width: 27rem;                                  /* 432px (Figma) */
  max-width: 40%;
  aspect-ratio: var(--sun-problems-media-ratio, 432 / 489);
  border-radius: 4px;
  overflow: hidden;
}
.sun-problems__media--empty { background: rgba(255, 255, 255, .06); }
/* No object-fit: the box already has the image's ratio, so there is nothing to
   crop and nothing to letterbox. */
.sun-problems__img { display: block; width: 100%; height: auto; }

.sun-problems__list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Item */
.sun-problems__item { position: relative; border-bottom: 1px solid var(--sun-bluegrey); }
/* Active line grows in left→right over the grey divider. */
.sun-problems__item::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: 1px;
  background: var(--sun-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .45s ease;
}
.sun-problems__item:has(.sun-problems__btn[aria-expanded="true"])::after { transform: scaleX(1); }
.sun-problems__q { margin: 0; }
.sun-problems__btn {
  display: flex;
  gap: 24px;
  align-items: center;                           /* summary vertically centred with the icons */
  width: 100%;
  padding: 24px 24px 25px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.sun-problems__x {
  width: 32px; height: 32px; flex-shrink: 0;
  color: var(--sun-primary);
}
.sun-problems__summary {
  flex: 1 1 auto;
  font-family: var(--wp--preset--font-family--brand);
  font-size: clamp(20px, 1.7vw, 24px);
  font-weight: 500;
  line-height: 1.3333;
  color: var(--sun-base);
}
.sun-problems__item:has(.sun-problems__btn[aria-expanded="true"]) .sun-problems__summary { color: var(--sun-primary); }
.sun-problems__caret {
  width: 32px; height: 32px; flex-shrink: 0;
  color: var(--sun-base);
  transition: transform .2s ease;
}
.sun-problems__btn[aria-expanded="true"] .sun-problems__caret { transform: rotate(180deg); }

/* Panel (details) — aligned under the summary. */
/* Smooth height animation via grid-template-rows (same pattern as FAQ). */
.sun-problems__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s cubic-bezier(.4, 0, .2, 1);
  /* Align with the summary text column: 24 (btn pad) + 32 (X) + 32 (gap) = 88.
     Right: stop at the chevron's imagined line: 24 (btn pad) + 40 (caret box) = 64. */
  padding: 0 64px 0 88px;
}
.sun-problems__panel[data-open] { grid-template-rows: 1fr; }
.sun-problems__panel[hidden] { display: none; }   /* pre-JS server state */
/* Content fades out FIRST on collapse (top lines stay in view while the row
   shrinks — without the fade that reads as an abrupt pop at the end). */
.sun-problems__details {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility 0s linear .3s;
}
.sun-problems__panel[data-open] .sun-problems__details {
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease .1s, visibility 0s;
}
/* Bottom spacing as clipped CONTENT, not padding — border-box floors at the
   padding, which left the closed panel 24px tall. */
.sun-problems__details::after {
  content: "";
  display: block;
  height: 24px;
}
.sun-problems__details {
  font-size: var(--wp--preset--font-size--md);   /* 16 */
  line-height: 1.5;
  color: var(--sun-base);
}
.sun-problems__details p { margin: 0 0 12px; }
.sun-problems__details p:last-child { margin-bottom: 0; }

/* Responsive */
@media (max-width: 900px) {
  .sun-problems__row { flex-direction: column; }
  /* Full width, still the asset's own ratio — the old hard 3/2 here re-cropped
     the image on phones, which is exactly what the box ratio removes. */
  .sun-problems__media { width: 100%; max-width: none; }
  .sun-problems__list { flex-basis: auto; }
  .sun-problems__panel { padding-left: 88px; padding-right: 64px; }
}
@media (max-width: 520px) {
  .sun-problems__btn { gap: 16px; padding: 16px 4px 17px; }
  .sun-problems__x, .sun-problems__caret { width: 26px; height: 26px; }
  .sun-problems__panel { padding: 0 46px 0 46px; }
}
