/* Final responsive polish: FAQ accordions, all quiz families, and article cards. */

/* ---------- FAQ: compact when closed, natural height when opened ---------- */
.faq-page .faq-list {
  display: grid !important;
  gap: 14px !important;
}

.faq-page .faq-item {
  display: block !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #dbe4f2 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(12, 35, 76, .055) !important;
}

.faq-page .faq-item h3,
.faq-page .faq-item .faq-question {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 18px 58px 18px 20px !important;
  border: 0 !important;
  background: #fff !important;
  color: #0b1537 !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  position: relative !important;
}

.faq-page .faq-item h3::after,
.faq-page .faq-item .faq-question::after {
  content: "+" !important;
  position: absolute !important;
  right: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 30px !important;
  height: 30px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: #f0edff !important;
  color: #6336ee !important;
  font-size: 21px !important;
  line-height: 1 !important;
}

.faq-page .faq-item.is-open h3::after,
.faq-page .faq-item.open h3::after,
.faq-page .faq-item.is-open .faq-question::after,
.faq-page .faq-item.open .faq-question::after {
  content: "−" !important;
}

.faq-page .faq-item p,
.faq-page .faq-item .faq-answer {
  display: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 20px 20px !important;
  overflow: visible !important;
  color: #5e6b85 !important;
  font-size: 15.5px !important;
  line-height: 1.72 !important;
  white-space: normal !important;
}

.faq-page .faq-item.is-open p,
.faq-page .faq-item.open p,
.faq-page .faq-item.is-open .faq-answer,
.faq-page .faq-item.open .faq-answer {
  display: block !important;
}

.faq-page .faq-item.is-open h3,
.faq-page .faq-item.open h3 {
  background: linear-gradient(90deg, #f7f8ff, #f2f6ff) !important;
}

@media (max-width: 640px) {
  .faq-page .seo-section { padding: 34px 0 !important; }
  .faq-page .seo-container { width: min(100% - 24px, 1180px) !important; }
  .faq-page .faq-category-heading { align-items: flex-start !important; }
  .faq-page .faq-category-heading h2 { font-size: 1.72rem !important; line-height: 1.12 !important; }
  .faq-page .faq-item h3,
  .faq-page .faq-item .faq-question {
    padding: 16px 52px 16px 16px !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
  }
  .faq-page .faq-item h3::after,
  .faq-page .faq-item .faq-question::after {
    right: 14px !important;
    width: 28px !important;
    height: 28px !important;
  }
  .faq-page .faq-item p,
  .faq-page .faq-item .faq-answer { padding: 0 16px 17px !important; font-size: 14.5px !important; }
}

/* ---------- Quizzes: consistent cards and usable mobile layout ---------- */
body:has(#setupSection) .container,
body:has(#quizSection) .container {
  width: min(100% - 32px, 1120px) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

body:has(#setupSection) .hero-card,
body:has(#quizSection) .hero-card,
body[class*="page-free-"] .hero-card {
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
}

body:has(#setupSection) .hero-badges,
body:has(#quizSection) .hero-badges,
body[class*="page-free-"] .hero-badges {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 9px !important;
  margin-top: 18px !important;
}

body:has(#setupSection) .hero-badge,
body:has(#quizSection) .hero-badge,
body[class*="page-free-"] .hero-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 9px 13px !important;
  border-radius: 999px !important;
  line-height: 1.25 !important;
  text-align: center !important;
}

body:has(#setupSection) > .container > .card,
body:has(#quizSection) > .container > .card,
body[class*="page-free-"] > .container > .card {
  min-height: 0 !important;
  height: auto !important;
}

#quizSection .quiz-grid {
  min-width: 0 !important;
}

#quizSection .quiz-grid > .card,
#quizSection .card,
#quizOptions,
#quizOptions > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#quizQuestionText {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

#quizOptions label,
#quizOptions .option,
#quizOptions .answer-option,
#quizOptions button {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 760px) {
  body:has(#setupSection) .container,
  body:has(#quizSection) .container,
  body[class*="page-free-"] .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 12px 76px !important;
    margin: 0 !important;
  }

  body:has(#setupSection) .hero-card,
  body:has(#quizSection) .hero-card,
  body[class*="page-free-"] .hero-card {
    margin: 0 0 14px !important;
    padding: 20px 16px !important;
    border-radius: 18px !important;
  }

  body:has(#setupSection) .hero-card h1,
  body:has(#quizSection) .hero-card h1,
  body[class*="page-free-"] .hero-card h1 {
    margin-bottom: 10px !important;
    font-size: clamp(1.7rem, 8vw, 2.15rem) !important;
    line-height: 1.08 !important;
  }

  body:has(#setupSection) .hero-card p,
  body:has(#quizSection) .hero-card p,
  body[class*="page-free-"] .hero-card p {
    font-size: 15px !important;
    line-height: 1.58 !important;
  }

  body:has(#setupSection) .hero-badges,
  body:has(#quizSection) .hero-badges,
  body[class*="page-free-"] .hero-badges {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body:has(#setupSection) .hero-badge,
  body:has(#quizSection) .hero-badge,
  body[class*="page-free-"] .hero-badge {
    width: 100% !important;
    padding: 10px 8px !important;
    border-radius: 12px !important;
    font-size: 12.5px !important;
  }

  body:has(#setupSection) .hero-badge:first-child,
  body:has(#quizSection) .hero-badge:first-child,
  body[class*="page-free-"] .hero-badge:first-child,
  body:has(#setupSection) .hero-badge:last-child,
  body:has(#quizSection) .hero-badge:last-child,
  body[class*="page-free-"] .hero-badge:last-child {
    grid-column: 1 / -1 !important;
  }

  body:has(#setupSection) > .container > .card,
  body:has(#quizSection) > .container > .card,
  body[class*="page-free-"] > .container > .card,
  #setupSection,
  #quizSection .card,
  #resultSection > .card {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 0 14px !important;
    padding: 18px 15px !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
  }

  #quizSection,
  #quizSection .quiz-grid {
    width: 100% !important;
    max-width: 100% !important;
  }

  #quizSection .quiz-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  #quizQuestionText {
    font-size: 1.28rem !important;
    line-height: 1.38 !important;
    margin: 16px 0 18px !important;
  }

  #quizOptions { gap: 10px !important; }
  #quizOptions label,
  #quizOptions .option,
  #quizOptions .answer-option {
    padding: 14px 12px !important;
    border-radius: 13px !important;
    font-size: 14.5px !important;
    line-height: 1.45 !important;
  }

  #setupSection .menu-grid,
  #setupSection .top-actions,
  #quizSection .top-actions {
    width: 100% !important;
  }

  #setupSection select,
  #setupSection input,
  #quizSection input,
  #quizSection select,
  #quizSection .btn {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ---------- Article cards: tidy and stable date/read-time row ---------- */
.news-card .news-card-meta,
.news-card-meta,
.news-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  min-height: 0 !important;
  height: auto !important;
  margin-top: 18px !important;
  padding: 14px 0 0 !important;
  border: 0 !important;
  border-top: 1px solid #e3e9f2 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.news-card .news-card-meta > *,
.news-card-meta > *,
.news-meta > * {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  border: 1px solid #e0e6f0 !important;
  border-radius: 999px !important;
  background: #f7f9fc !important;
  color: #526079 !important;
  font-size: 12.5px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  .news-main { width: min(100% - 24px, 1180px) !important; padding-top: 28px !important; }
  .news-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 22px !important; }
  .news-card { width: 100% !important; min-width: 0 !important; border-radius: 16px !important; }
  .news-card-body { padding: 18px 16px !important; }
  .news-card h2 { font-size: 1.42rem !important; line-height: 1.16 !important; }
  .news-card p { font-size: 15px !important; line-height: 1.6 !important; }
  .news-card .news-card-meta,
  .news-card-meta,
  .news-meta { margin-top: 15px !important; padding-top: 12px !important; }
}

/* ---------- Definitive FAQ accordion sizing fix ---------- */
body.faq-page .faq-list {
  grid-auto-rows: max-content !important;
  align-items: start !important;
  align-content: start !important;
}

body.faq-page .faq-list > .faq-item {
  align-self: start !important;
  min-block-size: 0 !important;
  block-size: auto !important;
  max-block-size: none !important;
}

body.faq-page .faq-list > .faq-item:not(.is-open) > p,
body.faq-page .faq-list > .faq-item:not(.open) > .faq-answer {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  border: 0 !important;
}

body.faq-page .faq-list > .faq-item > h3,
body.faq-page .faq-list > .faq-item > .faq-question {
  min-height: 58px !important;
  height: auto !important;
  box-sizing: border-box !important;
}

body.faq-page .faq-list > .faq-item.is-open > p,
body.faq-page .faq-list > .faq-item.open > .faq-answer {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  padding: 2px 20px 20px !important;
}

/* ---------- Clean article metadata without decorative dot pills ---------- */
.news-feature-card .news-meta {
  column-gap: 8px !important;
  row-gap: 8px !important;
}

.news-feature-card .news-meta > * {
  padding: 7px 11px !important;
}

@media (max-width: 640px) {
  body.faq-page .faq-list > .faq-item > h3,
  body.faq-page .faq-list > .faq-item > .faq-question {
    min-height: 54px !important;
  }
  body.faq-page .faq-list > .faq-item.is-open > p,
  body.faq-page .faq-list > .faq-item.open > .faq-answer {
    padding: 2px 16px 17px !important;
  }
}
