@layer pages;

/* ========================================
   FAQ Archive - Page Specific Styles
   Extends archive-common.css
   ======================================== */

@layer pages {

/* Hero watermark text */
.post-type-archive-faq .archive-header::after,
.tax-faq_topic .archive-header::after {
  content: "FAQ";
}

/* FAQ specific filters */
.post-type-archive-faq .filters,
.tax-faq_topic .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
}

.post-type-archive-faq .filters__group,
.tax-faq_topic .filters__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.post-type-archive-faq .filters__actions,
.tax-faq_topic .filters__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Toggle buttons */
.post-type-archive-faq .qa-toggle-all,
.tax-faq_topic .qa-toggle-all {
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* ----------------------------------------
   QA Groups
   ---------------------------------------- */
.qa-groups {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vw, 64px);
}

.qa-group {
  border: 1px solid var(--arc-border);
  background: var(--arc-white);
}

.qa-group__head {
  background: var(--arc-dark);
  color: var(--arc-white);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 800;
  padding: clamp(16px, 3vw, 24px) clamp(20px, 4vw, 32px);
  margin: 0;
  position: relative;
}

.qa-group__head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--arc-gold);
}

/* ----------------------------------------
   QA List
   ---------------------------------------- */
.qa-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qa-item {
  border-bottom: 1px solid var(--arc-border);
}

.qa-item:last-child {
  border-bottom: none;
}

/* ----------------------------------------
   QA Accordion
   ---------------------------------------- */
.qa-accordion {
  width: 100%;
}

.qa-accordion summary {
  cursor: pointer;
  list-style: none;
}

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

.qa-q {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 20px);
  padding: clamp(16px, 3vw, 24px) clamp(20px, 4vw, 32px);
  background: var(--arc-white);
  transition: background 0.25s var(--arc-ease);
  position: relative;
}

.qa-q::after {
  content: "+";
  position: absolute;
  right: clamp(20px, 4vw, 32px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--arc-gold);
  transition: transform 0.3s var(--arc-ease);
}

.qa-accordion[open] .qa-q::after {
  transform: translateY(-50%) rotate(45deg);
}

.qa-q:hover {
  background: var(--arc-light);
}

.qa-q__label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--arc-gold);
  color: var(--arc-white);
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 0;
}

.qa-q__text {
  flex: 1;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 700;
  color: var(--arc-text);
  line-height: 1.6;
  padding-right: 40px;
}

/* ----------------------------------------
   QA Answer
   ---------------------------------------- */
.qa-a {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 20px);
  padding: clamp(16px, 3vw, 24px) clamp(20px, 4vw, 32px);
  background: var(--arc-light);
  border-top: 1px solid var(--arc-border);
  animation: qaSlideIn 0.3s var(--arc-ease);
}

.qa-a__label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--arc-dark);
  color: var(--arc-white);
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 0;
}

.qa-a__body {
  flex: 1;
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  line-height: 1.8;
  color: var(--arc-text);
}

.qa-a__body p {
  margin: 0 0 1em;
}

.qa-a__body p:last-child {
  margin-bottom: 0;
}

.qa-a__body a {
  color: var(--arc-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.qa-a__body a:hover {
  color: var(--arc-dark);
}

/* ----------------------------------------
   Animation
   ---------------------------------------- */
@keyframes qaSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------
   QA Group Animation
   ---------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .qa-group {
    animation: arcItemFadeIn 0.4s var(--arc-ease) backwards;
  }

  .qa-groups .qa-group:nth-child(1) { animation-delay: 0.05s; }
  .qa-groups .qa-group:nth-child(2) { animation-delay: 0.1s; }
  .qa-groups .qa-group:nth-child(3) { animation-delay: 0.15s; }
  .qa-groups .qa-group:nth-child(4) { animation-delay: 0.2s; }
  .qa-groups .qa-group:nth-child(5) { animation-delay: 0.25s; }
}

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
@media (max-width: 680px) {
  .post-type-archive-faq .filters,
  .tax-faq_topic .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .post-type-archive-faq .filters__group,
  .tax-faq_topic .filters__group {
    min-width: 100%;
  }

  .qa-q__label,
  .qa-a__label {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .qa-q__text {
    font-size: 0.9rem;
    padding-right: 32px;
  }

  .qa-q::after {
    font-size: 1.2rem;
  }
}

}
