/* ============================================================
   SECTION: FAQ (よくあるご質問)
   ============================================================ */

.faq {
  position: relative;
  background-color: var(--color-bg); /* Nền sáng nhạt */
  padding: 80px 0;
  overflow: clip;
  z-index: 1;
}

/* Background vertical decorative image "faq_deco" */
.faq__deco {
  position: absolute;
  right: 0;
  top: 0;
  width: 100px;
  height: 182px;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.faq.is-active .faq__deco {
  opacity: 0.8 !important;
}

@media (min-width: 1024px) {
  .faq__deco {
    width: 170px;
    height: 332px;
    z-index: 2;
  }
}

@media (min-width: 1024px) {
  .faq {
    padding: 120px 0;
  }
}

/* Inner Container */
.faq__inner {
  position: relative;
  z-index: 3;
}

/* Header */
.faq__header {
  text-align: left;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.faq.is-active .faq__header {
  opacity: 1;
  transform: translateY(0);
}

.faq__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 24px;
  color: var(--color-navy-deep);
  line-height: 1.4;
  margin: 0 0 16px;
  letter-spacing: 0.03em;
}

.faq__divider {
  display: block;
  width: 60px;
  height: 2px;
  background-color: var(--color-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.4s;
}

.faq.is-active .faq__divider {
  transform: scaleX(1);
}

@media (min-width: 1024px) {
  .faq__header {
    margin-bottom: 56px;
  }
  .faq__title {
    font-size: 38px;
  }
}

/* FAQ Accordion List */
.faq__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.0s cubic-bezier(0.25, 1, 0.5, 1) 0.2s, transform 1.0s cubic-bezier(0.25, 1, 0.5, 1) 0.2s;
}

.faq.is-active .faq__list {
  opacity: 1;
  transform: translateY(0);
}

/* FAQ Item */
.faq__item {
  background-color: var(--color-white);
  border: 1px solid rgba(8, 0, 82, 0.06);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 80, 0.02);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.faq__item:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 80, 0.05);
  border-color: rgba(8, 0, 82, 0.12);
}

/* Item Header (Button) */
.faq__item-header {
  display: flex;
  width: 100%;
  align-items: center;
  background: none;
  border: none;
  padding: 20px 24px;
  cursor: pointer;
  text-align: left;
  color: var(--color-navy-deep);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  transition: color 0.3s ease;
}

@media (min-width: 1024px) {
  .faq__item-header {
    padding: 24px 32px;
    font-size: 17px;
  }
}

.faq__question-num {
  color: var(--color-orange);
  margin-right: 8px;
  font-weight: 700;
  font-size: 1.1em;
}

.faq__question-text {
  flex-grow: 1;
  letter-spacing: 0.02em;
}

/* Custom CSS Vector Toggle Icon (+ and -) */
.faq__toggle-icon {
  position: relative;
  width: 16px;
  height: 16px;
  margin-left: 16px;
  flex-shrink: 0;
}

/* Horizontal line of + and - */
.faq__toggle-icon::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 16px;
  height: 2px;
  background-color: var(--color-navy);
  border-radius: 1px;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Vertical line of + */
.faq__toggle-icon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 7px;
  width: 2px;
  height: 16px;
  background-color: var(--color-navy);
  border-radius: 1px;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

/* Transition to minus (-) when active */
.faq__item.is-open .faq__toggle-icon::before {
  transform: rotate(180deg); /* Smooth rotation of the minus line */
}

.faq__item.is-open .faq__toggle-icon::after {
  transform: rotate(90deg) scale(0); /* Rotates and vanishes */
  opacity: 0;
}

/* Accordion Smooth Height Transition via CSS Grid */
.faq__answer-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
}

.faq__item.is-open .faq__answer-wrapper {
  grid-template-rows: 1fr;
}

.faq__answer-inner {
  min-height: 0; /* Required for CSS grid row height animation to function */
}

.faq__answer-content {
  padding: 0 24px 20px;
  display: flex;
  align-items: flex-start;
  border-top: 1px dashed rgba(8, 0, 82, 0.05);
  margin-top: 0;
  padding-top: 16px;
}

@media (min-width: 1024px) {
  .faq__answer-content {
    padding: 0 32px 24px;
    padding-top: 20px;
  }
}

.faq__answer-num {
  color: #2a75d3; /* Chữ A màu xanh biển sáng */
  font-weight: 700;
  font-size: 1.1em;
  margin-right: 8px;
}

.faq__answer-text {
  flex-grow: 1;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
  margin: 0;
  letter-spacing: 0.01em;
}

@media (min-width: 1024px) {
  .faq__answer-text {
    font-size: 15px;
  }
}

/* Answer Links */
.faq__link {
  color: #747474;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.faq__link:hover {
  color: #102a7e;
  text-decoration: none;
}

.faq__link--underline {
  text-decoration: underline;
}
