/* ============================================================
   Wass'Muffin Digital FAQ styling (v3.3.1)
   Premium treatment for the homepage FAQ (.wmdx-faq) and the
   service page FAQ (.wmd-faq-section). All selectors are scoped
   to the FAQ sections, so nothing else on the site is affected.
   Colours come from the theme variables defined in premium.css
   (:root and html[data-theme="dark"]), so one set of rules stays
   readable in both light and dark mode. The markup stays as
   <details>/<summary>; the open and close animation uses the
   grid-template-rows 0fr/1fr technique on the answer wrapper,
   plus a fade on the answer text. No new fonts or libraries.
   ============================================================ */

/* --- Section backgrounds --- */
.wmdx-faq {
  background: linear-gradient(180deg, var(--wmd-surface-2), var(--wmd-surface));
}
.wmd-faq-section .wmd-faq-items {
  gap: 14px;
}

/* --- FAQ cards --- */
.wmdx-faq-items details,
.wmd-faq-items details {
  position: relative;
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: 18px;
  padding: 22px 24px;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.wmdx-faq-items details:hover,
.wmd-faq-items details:hover {
  border-color: rgba(44, 101, 223, .45);
}

/* Gradient accent strip along the top edge of the open card. */
.wmdx-faq-items details::before,
.wmd-faq-items details::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--wmd-accent), var(--wmd-accent-bright), #9679ff);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

/* Open card: soft blue glow, tinted gradient wash, accent border. */
.wmdx-faq-items details[open],
.wmd-faq-items details[open] {
  border-color: rgba(44, 101, 223, .45);
  background:
    linear-gradient(180deg, rgba(44, 101, 223, .07), rgba(44, 101, 223, 0) 55%),
    var(--wmd-surface);
  box-shadow: 0 18px 40px rgba(23, 56, 112, .08), 0 0 0 1px rgba(44, 101, 223, .06);
}
.wmdx-faq-items details[open]::before,
.wmd-faq-items details[open]::before {
  opacity: 1;
}

/* --- Question row --- */
.wmdx-faq-items summary,
.wmd-faq-items summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  color: var(--wmd-text);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.45;
  letter-spacing: -.01em;
}
.wmdx-faq-items summary::-webkit-details-marker,
.wmd-faq-items summary::-webkit-details-marker {
  display: none;
}
.wmdx-faq-items summary::marker,
.wmd-faq-items summary::marker {
  content: none;
}

/* Plus indicator: circular button that turns into a cross on open. */
.wmdx-faq-items summary > span,
.wmd-faq-items summary > span {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--wmd-border-strong);
  border-radius: 50%;
  background: var(--wmd-surface-2);
  color: var(--wmd-accent);
  font-size: 22px;
  font-weight: 350;
  line-height: 1;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), background .25s ease, color .25s ease, border-color .25s ease;
}
.wmdx-faq-items summary:hover > span,
.wmd-faq-items summary:hover > span {
  border-color: var(--wmd-accent);
}
.wmdx-faq-items details[open] summary > span,
.wmd-faq-items details[open] summary > span {
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--wmd-accent), var(--wmd-accent-deep, #1749d0));
  border-color: transparent;
  color: #fff;
}

/* --- Answer: smooth open and close --- */
/* The wrapper is a grid with a single row. Closed it is 0fr, so the
   answer collapses to nothing; open it is 1fr and the row grows to
   fit the text. The inner element is clipped while the row is
   closed, and the text fades in as the card opens. */
.wmdx-faq-items .wmdx-faq-answer,
.wmd-faq-items .wmd-faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: grid-template-rows .38s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
}
.wmdx-faq-items details[open] .wmdx-faq-answer,
.wmd-faq-items details[open] .wmd-faq-answer {
  grid-template-rows: 1fr;
  opacity: 1;
}
.wmdx-faq-answer > *,
.wmd-faq-answer > * {
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}
.wmdx-faq-answer > p,
.wmd-faq-answer-inner {
  margin: 0;
  padding-top: 14px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--wmd-text-muted);
  transform: translateY(-4px);
  transition: transform .3s ease;
}
.wmdx-faq-items details[open] .wmdx-faq-answer > p,
.wmd-faq-items details[open] .wmd-faq-answer-inner {
  transform: translateY(0);
}

/* --- Keyboard focus --- */
.wmdx-faq-items summary:focus-visible,
.wmd-faq-items summary:focus-visible {
  outline: 3px solid var(--wmd-accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* --- Dark mode --- */
/* The light section gradient would stay pale in dark mode, so the
   homepage FAQ section gets a dark navy gradient here. Service page
   cards had no dark mode rules at all before this file, so the dark
   card colours below keep them readable on dark service pages. */
html[data-theme="dark"] .wmdx-faq {
  background: linear-gradient(180deg, #0b1526, #0a1327);
}
html[data-theme="dark"] .wmdx-faq-items details,
html[data-theme="dark"] .wmd-faq-items details {
  background: #101d38;
  border-color: var(--wmd-border);
}
html[data-theme="dark"] .wmdx-faq-items details:hover,
html[data-theme="dark"] .wmd-faq-items details:hover {
  border-color: rgba(143, 176, 255, .45);
}
html[data-theme="dark"] .wmdx-faq-items details[open],
html[data-theme="dark"] .wmd-faq-items details[open] {
  background:
    linear-gradient(180deg, rgba(120, 160, 255, .12), rgba(120, 160, 255, 0) 55%),
    #0e1a33;
  border-color: rgba(143, 176, 255, .45);
  box-shadow: 0 18px 40px rgba(2, 6, 20, .5);
}
html[data-theme="dark"] .wmdx-faq-items summary,
html[data-theme="dark"] .wmd-faq-items summary {
  color: #fff;
}
html[data-theme="dark"] .wmdx-faq-answer > p,
html[data-theme="dark"] .wmd-faq-answer-inner {
  color: var(--wmd-text-muted);
}
html[data-theme="dark"] .wmdx-faq-items summary > span,
html[data-theme="dark"] .wmd-faq-items summary > span {
  background: rgba(120, 160, 255, .14);
  border-color: rgba(120, 160, 255, .3);
  color: #a9c4ff;
}
html[data-theme="dark"] .wmdx-faq-items summary:hover > span,
html[data-theme="dark"] .wmd-faq-items summary:hover > span {
  border-color: rgba(143, 176, 255, .6);
}
html[data-theme="dark"] .wmdx-faq-items details[open] summary > span,
html[data-theme="dark"] .wmd-faq-items details[open] summary > span {
  background: linear-gradient(135deg, var(--wmd-accent), var(--wmd-accent-deep, #1749d0));
  border-color: transparent;
  color: #fff;
}

/* --- Small screens --- */
@media (max-width: 600px) {
  .wmdx-faq-items details,
  .wmd-faq-items details {
    padding: 18px;
    border-radius: 16px;
  }
  .wmdx-faq-items summary,
  .wmd-faq-items summary {
    font-size: 14.5px;
  }
  .wmdx-faq-items summary > span,
  .wmd-faq-items summary > span {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

/* --- Reduced motion: open and close instantly --- */
@media (prefers-reduced-motion: reduce) {
  .wmdx-faq-items details,
  .wmd-faq-items details,
  .wmdx-faq-items details::before,
  .wmd-faq-items details::before,
  .wmdx-faq-items summary > span,
  .wmd-faq-items summary > span,
  .wmdx-faq-items .wmdx-faq-answer,
  .wmd-faq-items .wmd-faq-answer,
  .wmdx-faq-answer > p,
  .wmd-faq-answer-inner {
    transition: none !important;
  }
}
