@layer base, layout, components, utilities, pages;

/**
 * QA (よくある質問) - Page Styles
 *
 * Archive styles are handled by core-archive.css
 * This file contains single page and accordion-specific styles
 */

@layer pages {

  /* ==========================================================================
     ARCHIVE PAGE - QA Specific Components
     ========================================================================== */

  /* --------------------------------------------------------------------------
     QA Group (Topic Section)
     -------------------------------------------------------------------------- */

  .qa-group {
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .qa-group.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

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

  .qa-group__head {
    font-family: 'Zen Kaku Gothic New', var(--font-sans, system-ui, sans-serif);
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
  }

  /* --------------------------------------------------------------------------
     QA List
     -------------------------------------------------------------------------- */

  .qa-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .qa-item {
    margin-bottom: 12px;
  }

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

  /* --------------------------------------------------------------------------
     QA Accordion
     -------------------------------------------------------------------------- */

  .qa-accordion {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .qa-accordion:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  }

  .qa-accordion[open] {
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1);
  }

  /* Question (Summary) */
  .qa-q {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s ease;
  }

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

  .qa-q:hover {
    background: rgba(59, 130, 246, 0.03);
  }

  .qa-q__label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    font-family: 'Outfit', var(--font-sans, system-ui, sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 8px;
  }

  .qa-q__text {
    flex: 1;
    font-family: 'Zen Kaku Gothic New', var(--font-sans, system-ui, sans-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
    color: #0f172a;
    padding-top: 4px;
  }

  .qa-q__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                color 0.2s ease;
  }

  .qa-accordion[open] .qa-q__icon {
    transform: rotate(180deg);
    color: #3b82f6;
  }

  /* Answer */
  .qa-a {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 0 24px 24px;
    padding-left: 72px;
  }

  .qa-a__label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    font-family: 'Outfit', var(--font-sans, system-ui, sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 8px;
  }

  .qa-a__body {
    font-family: 'Zen Kaku Gothic New', var(--font-sans, system-ui, sans-serif);
    font-size: 15px;
    line-height: 1.9;
    color: #334155;
    padding-top: 4px;
  }

  .qa-a__body p {
    margin: 0 0 16px;
  }

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

  .qa-a__body ul,
  .qa-a__body ol {
    margin: 0 0 16px;
    padding-left: 1.5em;
  }

  .qa-a__body li {
    margin-bottom: 8px;
  }

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

  /* --------------------------------------------------------------------------
     Toggle All Buttons (in archive-filters)
     -------------------------------------------------------------------------- */

  .qa-toggle-all {
    font-family: 'Zen Kaku Gothic New', var(--font-sans, system-ui, sans-serif);
  }

  /* --------------------------------------------------------------------------
     QA Empty
     -------------------------------------------------------------------------- */

  .qa-empty {
    padding: 48px 0;
    text-align: center;
  }

  .qa-empty p {
    font-family: 'Zen Kaku Gothic New', var(--font-sans, system-ui, sans-serif);
    font-size: 16px;
    color: #64748b;
    margin: 0;
  }

  /* --------------------------------------------------------------------------
     Archive Responsive
     -------------------------------------------------------------------------- */

  @media (max-width: 768px) {
    .qa-group__head {
      font-size: 18px;
    }

    .qa-q {
      padding: 16px 20px;
      gap: 12px;
    }

    .qa-q__label {
      width: 28px;
      height: 28px;
      font-size: 14px;
    }

    .qa-q__text {
      font-size: 14px;
    }

    .qa-q__icon {
      width: 28px;
      height: 28px;
    }

    .qa-a {
      padding: 0 20px 20px;
      padding-left: 60px;
    }

    .qa-a__label {
      width: 28px;
      height: 28px;
      font-size: 14px;
    }

    .qa-a__body {
      font-size: 14px;
    }
  }

  /* ==========================================================================
     SINGLE PAGE
     ========================================================================== */

  .single-qa {
    background: #f8fafc;
  }

  .single-qa .section {
    padding: 56px 0;
    background: #fff;
  }

  .single-qa .section__head {
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 0 32px;
  }

  .single-qa .section__title {
    font-family: 'Zen Kaku Gothic New', var(--font-sans, system-ui, sans-serif);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    color: #0f172a;
    margin: 0;
  }

  .single-qa .entry-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 32px;
  }

  .single-qa .entry-content p {
    font-family: 'Zen Kaku Gothic New', var(--font-sans, system-ui, sans-serif);
    font-size: 16px;
    line-height: 1.9;
    color: #334155;
    margin: 0 0 20px;
  }

  @media (max-width: 600px) {
    .single-qa .section {
      padding: 40px 0;
    }

    .single-qa .section__head {
      padding: 0 20px;
    }

    .single-qa .section__title {
      font-size: 22px;
    }

    .single-qa .entry-content {
      padding: 0 20px;
    }

    .single-qa .entry-content p {
      font-size: 15px;
    }
  }
}
