/* ════════════════════════════════════════════════════════════════════
   Wolf IPTV — FAQ Section (M1.7.C Classic Premium Accordion)
   ════════════════════════════════════════════════════════════════════

   File:    wolf-home-faq.css
   Loaded:  via index.php extra_css (after wolf-home-blog.css)
   Scoped:  .faq-section, .faq-grid, .faq-item, .faq-summary*, .faq-answer

   Philosophy:
     - Native HTML5 <details>/<summary> — zero JS required
     - Chevron rotates 180° on [open] (pure CSS)
     - Brand accent stripe on right edge appears when item is open (RTL)
     - "Q" number badge changes to brand gradient when opened
     - First item is initially open (rendered by PHP via `open` attribute)

   Structure:
     1. Section background (subtle radial gradients)
     2. Grid layout (single column, max-width 880px)
     3. FAQ item card (with brand stripe + hover/open states)
     4. Summary (question row) with __num | __text | __icon
     5. Question number badge (Q1, Q2... visual)
     6. Question text typography
     7. Chevron icon (rotates 180° when open)
     8. Answer container with fade-in animation
     9. Answer typography (paragraphs, lists, links, strong)
    10. Responsive breakpoints
    11. Reduced motion accessibility
   ════════════════════════════════════════════════════════════════════ */


/* ── 1. Section background ───────────────────────────────────────── */
.faq-section {
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, var(--brand-faint), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, var(--brand-faint), transparent 70%);
}


/* ── 2. Grid layout ──────────────────────────────────────────────── */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 880px;
  margin-inline: auto;
  gap: var(--sp-3);
}


/* ── 3. FAQ item card ────────────────────────────────────────────── */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  position: relative;
}

.faq-item:hover {
  border-color: var(--border-strong);
}

.faq-item[open] {
  background: var(--bg-elev);
  border-color: var(--border-brand);
  box-shadow: 0 8px 24px rgba(137, 96, 199, 0.10);
}

/* Brand accent stripe on right edge (RTL) — appears when open */
.faq-item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--brand) 50%, var(--brand-deep) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
}

.faq-item[open]::before {
  opacity: 1;
}


/* ── 4. Summary (the question row) ───────────────────────────────── */
.faq-summary {
  list-style: none;
  cursor: pointer;
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  user-select: none;
  position: relative;
  transition: padding 0.2s ease;
}

.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::marker { display: none; }

.faq-summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.faq-summary:hover .faq-summary__icon {
  background: var(--brand-tint);
  border-color: var(--border-brand);
  color: var(--brand-soft);
}


/* ── 5. Question number badge (Q1, Q2...) ────────────────────────── */
.faq-summary__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: -0.5px;
  transition: background 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, box-shadow 0.25s ease;
}

.faq-item[open] .faq-summary__num {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(137, 96, 199, 0.35);
}


/* ── 6. Question text ────────────────────────────────────────────── */
.faq-summary__text {
  flex: 1;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.6vw, 17px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.2px;
  transition: color 0.25s ease;
}


/* ── 7. Chevron icon (rotates 180° when open) ────────────────────── */
.faq-summary__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-summary__icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item[open] .faq-summary__icon {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(137, 96, 199, 0.35);
}

.faq-item[open] .faq-summary__icon svg {
  transform: rotate(180deg);
}


/* ── 8 + 9. Answer container + typography ────────────────────────── */
.faq-answer {
  padding: 0 var(--sp-6) var(--sp-6) var(--sp-6);
  /* align answer text with question text (skip the Q badge width) */
  padding-right: calc(var(--sp-6) + 36px + var(--sp-4));
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.85;
  font-weight: 500;
  animation: faq-fade-in 0.35s ease;
}

.faq-answer p { margin: 0; }
.faq-answer p + p { margin-top: var(--sp-3); }

.faq-answer strong {
  color: var(--text);
  font-weight: 700;
}

.faq-answer a {
  color: var(--brand-soft);
  text-decoration: underline;
  text-decoration-color: var(--border-brand);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.faq-answer a:hover {
  color: var(--brand);
  text-decoration-color: currentColor;
}

/* Answer lists (for steps/items inside answers — future enhancement) */
.faq-answer ul {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.faq-answer ul li {
  position: relative;
  padding-right: var(--sp-5);
  color: var(--text-soft);
}

.faq-answer ul li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand-glow);
}

@keyframes faq-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── 10. Responsive breakpoints ──────────────────────────────────── */
@media (max-width: 720px) {
  .faq-grid { gap: var(--sp-2); }

  .faq-summary {
    padding: var(--sp-4) var(--sp-4);
    gap: var(--sp-3);
  }
  .faq-summary__num { width: 32px; height: 32px; font-size: 11px; }
  .faq-summary__text { font-size: 14.5px; line-height: 1.45; }
  .faq-summary__icon { width: 28px; height: 28px; }
  .faq-summary__icon svg { width: 12px; height: 12px; }

  .faq-answer {
    padding: 0 var(--sp-4) var(--sp-4) var(--sp-4);
    padding-right: calc(var(--sp-4) + 32px + var(--sp-3));
    font-size: 13.5px;
    line-height: 1.8;
  }
}


/* ── 11. Reduced motion accessibility ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-summary,
  .faq-summary__num,
  .faq-summary__text,
  .faq-summary__icon,
  .faq-summary__icon svg {
    transition: none;
  }
  .faq-answer {
    animation: none;
  }
}


/* ══════════════════════════════════════════════════════════════════════════════
   HOTFIX 003 (2026-06-10) — Title wrap fix
   ──────────────────────────────────────────────────────────────────────────────
   The FAQ title "كل اللي محتاج تعرفه قبل ما تنضم للقطيع" wraps unpredictably
   based on container width. The design intends the accent text to start on a
   new line — force this with `display: block` on the accent span (FAQ-scoped).

   Other sections (Trial, Reviews, Blog) intentionally keep the accent inline,
   so this rule is scoped to .faq-section only.
   ══════════════════════════════════════════════════════════════════════════════ */

.faq-section .section-head__title .accent {
  display: block;
}

/* Ensure chevron SVG inherits color + size correctly (defensive — some browsers
   need explicit display + dimensions on inline SVG inside <use>) */
.faq-summary__icon svg {
  display: block;
  width: 14px;
  height: 14px;
}
