/* ================================================================
   Hilf Al-Fudul — FAQ Accordion v1.0
   SEO-friendly, accessible, smooth CSS-powered transitions
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --faq-teal:   #0D3B38;
  --faq-mid:    #1D7C6E;
  --faq-gold:   #C8962B;
  --faq-cream:  #F7F3EC;
  --faq-white:  #FFFFFF;
  --faq-dark:   #0A0F0E;
  --faq-gray:   #6B7472;
  --faq-border: #E8E2D9;
  --faq-fd:     'Cormorant Garamond', Georgia, serif;
  --faq-fb:     'DM Sans', sans-serif;
  --faq-tr:     .32s cubic-bezier(.4,0,.2,1);
}

/* ── Full-width breakout ────────────────────────────────── */
.elementor-widget-haf_faq {
  width:        100vw !important;
  max-width:    100vw !important;
  margin-left:  calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  box-sizing:   border-box;
}
.elementor-widget-haf_faq .elementor-widget-container {
  padding: 0 !important;
  margin:  0 !important;
}

/* ── Section wrapper ────────────────────────────────────── */
.haf-faq {
  background: var(--faq-cream);
  padding: 100px 0;
  width: 100%;
}

/* ── Header ─────────────────────────────────────────────── */
.faq-header {
  max-width: 720px;
  margin: 0 auto 64px;
  text-align: center;
  padding: 0 24px;
}

.faq-label {
  display: inline-block;
  font-family: var(--faq-fb);
  font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--faq-gold);
  padding: 4px 14px;
  border: 1px solid var(--faq-gold);
  border-radius: 100px;
  margin-bottom: 18px;
}

.faq-heading {
  font-family: var(--faq-fd);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 700;
  color: var(--faq-teal);
  line-height: 1.1;
  margin: 0 0 16px;
}

.faq-subheading {
  font-family: var(--faq-fb);
  font-size: 16px; font-weight: 300; line-height: 1.75;
  color: var(--faq-gray);
  margin: 0;
}

/* ── FAQ list ───────────────────────────────────────────── */
.faq-list {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Individual item ────────────────────────────────────── */
.faq-item {
  background: var(--faq-white);
  border: 1px solid var(--faq-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(13,59,56,.04);
  transition: box-shadow var(--faq-tr);
}

.faq-item:last-child { margin-bottom: 0; }

.faq-item.faq-open {
  box-shadow: 0 8px 32px rgba(13,59,56,.1);
  border-color: rgba(200,150,43,.25);
}

/* ── Question button ────────────────────────────────────── */
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 22px 28px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--faq-tr);
}

.faq-question:hover { background: rgba(13,59,56,.03); }
.faq-item.faq-open .faq-question { background: rgba(200,150,43,.06); }

.faq-question__text {
  font-family: var(--faq-fb);
  font-size: 16px; font-weight: 500; line-height: 1.5;
  color: var(--faq-teal);
  transition: color var(--faq-tr);
  flex: 1;
}

.faq-item.faq-open .faq-question__text { color: var(--faq-gold); }

/* ── Icon (plus → minus) ────────────────────────────────── */
.faq-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--faq-teal);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--faq-tr), transform var(--faq-tr);
}

.faq-icon svg { width: 12px; height: 12px; }
.faq-icon svg path { stroke: #fff; }

/* Rotate vertical stroke to zero (turns + into −) */
.faq-item.faq-open .faq-icon { transform: rotate(45deg); }

/* ── Answer panel ───────────────────────────────────────── */
.faq-answer {
  /* CSS-driven height animation */
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--faq-tr);
}

/* hidden attribute → collapsed; JS removes it → expanded */
.faq-answer:not([hidden]) {
  grid-template-rows: 1fr;
}

/* Fallback for browsers that don't support grid row animation */
@supports not (grid-template-rows: 0fr) {
  .faq-answer[hidden]     { display: none; }
  .faq-answer:not([hidden]) { display: block; }
}

.faq-answer__inner {
  overflow: hidden;
  /* Extra inner wrapper needed for grid-row animation */
  min-height: 0;
}

.faq-answer__inner > * {
  /* Applies to the p tags output by wp_kses_post */
  font-family: var(--faq-fb);
  font-size: 15px; font-weight: 300; line-height: 1.85;
  color: var(--faq-gray);
  padding: 0 28px 24px;
  margin: 0;
}

/* Ensure padding-top on first child when open */
.faq-answer:not([hidden]) .faq-answer__inner > *:first-child {
  padding-top: 4px;
}

/* Divider between question and answer */
.faq-item.faq-open .faq-question {
  border-bottom: 1px solid rgba(200,150,43,.15);
}

/* ── Focus styles (accessibility) ──────────────────────── */
.faq-question:focus-visible {
  outline: 2px solid var(--faq-gold);
  outline-offset: -2px;
  border-radius: 10px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .haf-faq { padding: 64px 0; }
  .faq-header, .faq-list { padding: 0 16px; }
  .faq-header { margin-bottom: 40px; }
  .faq-question { padding: 18px 20px; gap: 12px; }
  .faq-question__text { font-size: 14px; }
  .faq-answer__inner > * { padding: 0 20px 20px; font-size: 14px; }
}
