/* ============================================
   S01_PROBLEM.CSS
   Section 01: Problem
   ============================================ */

/* --------------------------------------------
   1. Section Base
   -------------------------------------------- */
.problem {
  background-color: var(--color-bg-white);
  position: relative;
  overflow: hidden;
}

.problem::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: radial-gradient(
    ellipse 80% 60% at 100% 30%,
    var(--color-primary-pale) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.problem .container {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------
   2. Header
   -------------------------------------------- */
.problem__header {
  max-width: 640px;
  margin-bottom: var(--space-16);
}

.problem__heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.problem__heading-em {
  font-style: normal;
  color: var(--color-primary);
  position: relative;
  display: inline-block;
}

.problem__heading-em::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--color-accent),
    transparent
  );
}

.problem__lead {
  color: var(--color-text-secondary);
  font-size: var(--text-md);
  line-height: var(--leading-loose);
}

/* --------------------------------------------
   3. Unease Cards（3つの違和感）
   -------------------------------------------- */
.problem__unease {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.problem__unease-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--color-border);
  transition: border-color var(--transition-base),
              transform var(--transition-base);
}

.problem__unease-card:hover {
  border-left-color: var(--color-accent);
  transform: translateX(4px);
}

.problem__unease-num {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: var(--tracking-wide);
  flex-shrink: 0;
  padding-top: 2px;
}

.problem__unease-text {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
}

.problem__unease-text strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* --------------------------------------------
   4. Core Message
   -------------------------------------------- */
.problem__core {
  text-align: center;
  margin-bottom: var(--space-16);
  padding: var(--space-8) 0;
}

.problem__core-text {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-wide);
  position: relative;
  display: inline-block;
}

.problem__core-text::before,
.problem__core-text::after {
  content: '—';
  color: var(--color-accent);
  margin-inline: var(--space-4);
  opacity: 0.6;
}

/* --------------------------------------------
   5. Voice Block（患者の声）
   -------------------------------------------- */
.problem__voice-block {
  background: var(--color-bg-light);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  margin-bottom: var(--space-20);
}

.problem__voice-intro {
  text-align: center;
  margin-bottom: var(--space-8);
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: var(--leading-loose);
}

.problem__voices {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.problem__voice-bubble {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  font-style: italic;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
  animation: bubbleFloat 4s ease-in-out infinite;
}

.problem__voice:nth-child(2) .problem__voice-bubble {
  animation-delay: 0.8s;
}
.problem__voice:nth-child(3) .problem__voice-bubble {
  animation-delay: 1.6s;
}

.problem__voice-bubble:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.problem__voice-comment {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-8);
}

.problem__voice-comment-inner {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  max-width: 600px;
  margin-inline: auto;
}

.problem__voice-comment-icon {
  color: var(--color-accent);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1;
  flex-shrink: 0;
}

.problem__voice-comment p {
  font-size: var(--text-md);
  line-height: var(--leading-loose);
  color: var(--color-text-secondary);
}

.problem__voice-comment strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* --------------------------------------------
   6. Walls（3つの壁）
   -------------------------------------------- */
.problem__walls {
  margin-bottom: var(--space-20);
}

.problem__walls-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.problem__walls-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
}

.problem__walls-heading em {
  font-style: normal;
  color: var(--color-primary);
}

.problem__walls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

/* カードフリップ */
.problem__wall-card {
  perspective: 1000px;
  height: 280px;
  cursor: pointer;
}

.problem__wall-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.problem__wall-card:hover .problem__wall-card-inner {
  transform: rotateY(180deg);
}

.problem__wall-front,
.problem__wall-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
}

.problem__wall-front {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  gap: var(--space-4);
}

.problem__wall-back {
  background: var(--color-primary);
  transform: rotateY(180deg);
  justify-content: center;
  align-items: center;
  text-align: center;
}

.problem__wall-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-pale);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.problem__wall-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
}

.problem__wall-desc {
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  color: var(--color-text-secondary);
  flex: 1;
}

.problem__wall-back-text {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--color-text-inverse);
  line-height: var(--leading-loose);
}

/* タッチデバイス用（タップでフリップ） */
.problem__wall-card.is-flipped .problem__wall-card-inner {
  transform: rotateY(180deg);
}

/* --------------------------------------------
   7. Bottom Message
   -------------------------------------------- */
.problem__bottom {
  margin-bottom: var(--space-12);
}

.problem__bottom-inner {
  background: linear-gradient(
    135deg,
    var(--color-bg-dark) 0%,
    var(--color-primary-light) 100%
  );
  border-radius: var(--radius-xl);
  padding: var(--space-16) var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.problem__bottom-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 80% at 80% 20%,
    rgba(200, 146, 42, 0.1) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.problem__bottom-label {
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wider);
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--space-4);
}

.problem__bottom-text {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--color-text-inverse);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
}

.problem__bottom-text strong {
  color: var(--color-accent-light);
}

.problem__bottom-sub {
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.problem__bottom-sub strong {
  color: rgba(255,255,255,0.9);
}

.problem__bottom-bridge {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--color-accent-light);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
}

/* --------------------------------------------
   8. CTA
   -------------------------------------------- */
.problem__cta {
  text-align: center;
}

/* --------------------------------------------
   9. Keyframes
   -------------------------------------------- */
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

/* --------------------------------------------
   10. Responsive
   -------------------------------------------- */
@media (max-width: 767px) {
  .problem__unease {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .problem__voice-block {
    padding: var(--space-8) var(--space-5);
  }

  .problem__voices {
    flex-direction: column;
    align-items: center;
  }

  .problem__walls-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .problem__wall-card {
    height: auto;
    perspective: none;
  }

  .problem__wall-card-inner {
    transform-style: flat;
    transition: none;
  }

  .problem__wall-front {
    position: relative;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
  }

  .problem__wall-back {
    display: none;
  }

  .problem__bottom-inner {
    padding: var(--space-10) var(--space-6);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .problem__unease {
    grid-template-columns: 1fr;
  }

  .problem__walls-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .problem__wall-card {
    height: auto;
  }

  .problem__wall-card-inner {
    display: contents;
  }

  .problem__wall-front {
    position: relative;
  }

  .problem__wall-back {
    display: none;
  }
}
