/* ==========================================================================
   Shortcodes — FAQ & HowTo
   ========================================================================== */

/* ─────────────────────────────
   FAQ
   ───────────────────────────── */
.sc-faq {
  margin: 2rem 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  background-color: var(--color-bg-light);
  transition: background-color 0.2s ease;
}

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

.faq-question:hover {
  background-color: var(--color-main-light);
}

/* Q prefix */
.faq-question::before {
  content: 'Q';
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-sub);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
}

/* Toggle icon */
.faq-icon {
  flex-shrink: 0;
  position: relative;
  width: 20px;
  height: 20px;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: var(--color-text-light);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.faq-icon::before {
  width: 14px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.faq-icon::after {
  width: 2px;
  height: 14px;
  transform: translate(-50%, -50%);
}

/* Open state */
.faq-item.is-open .faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.faq-item.is-open .faq-question {
  background-color: var(--color-main-light);
}

/* Answer */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
  background-color: var(--color-bg);
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
  padding: 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.8;
}

.faq-item.is-open .faq-answer-inner {
  padding: 1rem 1.25rem;
}

/* A prefix on inner content */
.faq-answer-inner::before {
  content: 'A';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--color-main-dark);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.5rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.faq-answer-inner p:last-child {
  margin-bottom: 0;
}

/* ─────────────────────────────
   HowTo
   ───────────────────────────── */
.sc-howto {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--color-bg-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.howto-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.5rem;
  text-decoration: none !important;
}

.howto-description {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.howto-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: howto-counter;
}

.howto-step {
  display: flex;
  gap: 1rem;
  position: relative;
  counter-increment: howto-counter;
}

/* Vertical connector line */
.howto-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 42px;
  bottom: 0;
  width: 2px;
  background-color: var(--color-border);
}

.howto-step-marker {
  flex-shrink: 0;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  z-index: 1;
}

.howto-step-marker::after {
  content: counter(howto-counter);
}

.howto-step-body {
  flex: 1;
  padding-bottom: 1.5rem;
}

.howto-step:last-child .howto-step-body {
  padding-bottom: 0;
}

.howto-step-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0.5rem 0 0.5rem;
  text-decoration: none !important;
}

.howto-step-content {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.8;
}

.howto-step-content p:last-child {
  margin-bottom: 0;
}

/* ─────────────────────────────
   Responsive
   ───────────────────────────── */
@media (max-width: 640px) {
  .sc-howto {
    padding: 1rem;
  }

  .faq-question {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .faq-answer-inner {
    font-size: 0.9375rem;
  }
}
