/* ============================================================
   Aptomix — FAQ Section CSS
   Enqueued by: Aptomix_FAQ_Widget::get_style_depends()
   Google Fonts: enqueued globally via wp_enqueue_scripts

   Accordion technique:
     <details>/<summary> with CSS grid-row animation.
     No JavaScript required.

     The key: .aptomix-faq__answer-wrap uses display:grid with
     grid-template-rows transitioning from 0fr → 1fr.
     This overrides the browser UA display:none on non-open
     <details> children (our class selector has higher specificity),
     giving us a smooth native CSS transition in both directions.
   ============================================================ */

/* ── Scoped reset ────────────────────────────────────────────── */
.aptomix-faq *,
.aptomix-faq *::before,
.aptomix-faq *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Section wrapper ─────────────────────────────────────────── */
.aptomix-faq {
  background: #F4F7FA;
  padding: 100px 0;
  font-family: 'DM Sans', sans-serif;
  color: #1A2E3B;
  scroll-margin-top: 72px;
}

/* ── Container ───────────────────────────────────────────────── */
.aptomix-faq__container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Section header ──────────────────────────────────────────── */
.aptomix-faq__head {
  margin-bottom: 40px;
}

.aptomix-faq__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: #00B0F0;
  margin-bottom: 14px;
}

.aptomix-faq__heading {
  font-family: 'Outfit', sans-serif;
  font-size: 46px;
  font-weight: 700;
  color: #0D1B2A;
  letter-spacing: -1px;
  line-height: 1.1;
  position: relative;
  padding-left: 20px;
}

/* Blue vertical accent bar */
.aptomix-faq__heading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: linear-gradient(to bottom, #00B0F0 0%, rgba(0, 176, 240, 0.5) 100%);
  border-radius: 2px;
}

/* ── Intro text ──────────────────────────────────────────────── */
.aptomix-faq__intro {
  max-width: 700px;
  margin-bottom: 48px;
  font-size: 17px;
  line-height: 1.75;
  color: #3D5166;
}

.aptomix-faq__intro p {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin-bottom: 0;
}

/* ── FAQ list ────────────────────────────────────────────────── */
.aptomix-faq__list {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Individual FAQ item (<details>) ─────────────────────────── */
.aptomix-faq__item {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #C8DDE8;
  border-left: 3px solid #C8DDE8;
  overflow: hidden;
  transition: border-left-color 0.2s ease, box-shadow 0.2s ease;
}

.aptomix-faq__item:hover {
  border-left-color: #00B0F0;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.aptomix-faq__item[open] {
  border-left-color: #00B0F0;
  box-shadow: 0 2px 20px rgba(0, 176, 240, 0.08);
}

/* ── Question (<summary>) ────────────────────────────────────── */
.aptomix-faq__question {
  /* Remove default browser triangle marker */
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Webkit: remove disclosure triangle */
.aptomix-faq__question::-webkit-details-marker {
  display: none;
}

/* Firefox: remove disclosure marker */
.aptomix-faq__question::marker {
  content: none;
}

.aptomix-faq__question-text {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #0D1B2A;
  letter-spacing: -0.15px;
  line-height: 1.35;
  transition: color 0.2s ease;
  flex: 1;
}

.aptomix-faq__item[open] .aptomix-faq__question-text {
  color: #00B0F0;
}

/* ── Chevron icon ────────────────────────────────────────────── */
.aptomix-faq__question-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 176, 240, 0.06);
  border: 1px solid rgba(0, 176, 240, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00B0F0;
  transition: transform 0.28s ease, background-color 0.2s ease;
}

.aptomix-faq__item[open] .aptomix-faq__question-icon {
  transform: rotate(180deg);
  background-color: rgba(0, 176, 240, 0.10);
}

/* ── Answer wrapper — CSS grid animation ─────────────────────── */
/*
 * display:grid overrides the UA stylesheet's display:none on
 * non-open <details> children (our class selector specificity 0,1,0
 * beats UA's element selectors 0,0,2).
 * grid-template-rows transitions 0fr → 1fr for a smooth open/close.
 */
.aptomix-faq__answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.aptomix-faq__item[open] > .aptomix-faq__answer-wrap {
  grid-template-rows: 1fr;
}

/* ── Answer inner — required for grid overflow clipping ─────── */
.aptomix-faq__answer-inner {
  overflow: hidden;
  border-top: 1px solid #E8F0F5;
}

/* ── Answer content ──────────────────────────────────────────── */
.aptomix-faq__answer {
  padding: 20px 28px 26px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  line-height: 1.75;
  color: #3D5166;
}

/* Inherit typography for WYSIWYG paragraphs */
.aptomix-faq__answer p {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin-bottom: 12px;
}

.aptomix-faq__answer p:last-child {
  margin-bottom: 0;
}

.aptomix-faq__answer strong {
  color: #0D1B2A;
  font-weight: 600;
}

.aptomix-faq__answer a {
  color: #00B0F0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.aptomix-faq__answer a:hover {
  color: #0D1B2A;
}

.aptomix-faq__answer ul,
.aptomix-faq__answer ol {
  padding-left: 20px;
  color: #3D5166;
}

.aptomix-faq__answer li {
  margin-bottom: 6px;
  font-size: 15.5px;
  line-height: 1.6;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .aptomix-faq__heading { font-size: 40px; }
}

@media (max-width: 900px) {
  .aptomix-faq__heading { font-size: 36px; letter-spacing: -0.6px; }
  .aptomix-faq__list    { max-width: 100%; }
}

@media (max-width: 600px) {
  .aptomix-faq                  { padding: 60px 0; }
  .aptomix-faq__container       { padding: 0 20px; }
  .aptomix-faq__heading         { font-size: 30px; padding-left: 16px; }
  .aptomix-faq__question        { padding: 18px 20px; }
  .aptomix-faq__question-text   { font-size: 15.5px; }
  .aptomix-faq__answer          { padding: 16px 20px 20px; }
  .aptomix-faq__list            { gap: 8px; }
}
