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

/**
 * LP (課題解決事例) - Page Styles
 *
 * Archive styles are handled by core-archive.css
 * Hero styles are handled by single-hero.css
 * Common content styles are handled by single-content.css
 * This file contains LP-specific styles (case layout, before/after)
 */

@layer pages {

  /* --------------------------------------------------------------------------
     LP Case Layout (from meta fields)
     -------------------------------------------------------------------------- */

  .lp-case {
    background: var(--sc-color-bg, #fafafa);
    padding: 0 0 80px;
  }

  .lp-case .header {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 40px 32px;
  }

  .lp-case .header h1 {
    font-family: 'Zen Kaku Gothic New', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
  }

  .lp-case .section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 40px 48px;
  }

  .lp-case .section h2 {
    font-family: 'Zen Kaku Gothic New', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
  }

  .lp-case .section p {
    font-family: 'Zen Kaku Gothic New', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.9;
    color: #525252;
    margin: 0 0 1em;
  }

  .lp-case .section p:last-child {
    margin-bottom: 0;
  }

  .lp-case .panel {
    background: #fff;
    padding: 32px 40px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
  }

  .lp-case .container {
    max-width: 1080px;
    margin: 0 auto;
  }

  /* Before/After Slider */
  .lp-case .ba {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
  }

  .lp-case .ba img {
    display: block;
    width: 100%;
    height: auto;
  }

  .lp-case .ba .after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(0 0 0 50%);
  }

  .lp-case .ba input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
  }

  .lp-case .ba .knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 5;
  }

  .lp-case .ba .handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #fff;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 4;
  }

  /* Before/After Labels */
  .lp-case .ba__label {
    position: absolute;
    top: 12px;
    padding: 5px 14px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    border-radius: 100px;
    pointer-events: none;
    z-index: 3;
  }

  .lp-case .ba__label--before {
    left: 12px;
    background: #1a1a1a;
  }

  .lp-case .ba__label--after {
    right: 12px;
    background: #1a1a1a;
  }

  .lp-case .lp-caption {
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
  }

  .lp-case .lp-caption p {
    margin: 0 0 8px;
    font-size: 14px;
  }

  /* Split caption (Before left, After right) */
  .lp-case .lp-caption--split {
    display: flex;
    gap: 20px;
  }

  .lp-case .lp-caption--split p {
    flex: 1;
    margin: 0;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 4px;
  }

  .lp-case .lp-caption__label {
    display: block;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
  }

  .lp-case .mt12 {
    margin-top: 12px;
  }

  .lp-case .mt16 {
    margin-top: 16px;
  }

  .lp-case .hero-figure {
    margin: 0;
  }

  .lp-case .hero-figure img {
    width: 100%;
    height: auto;
    border-radius: 4px;
  }

  /* LP Case Responsive */
  @media (max-width: 900px) {
    .lp-case .header {
      padding: 40px 28px 24px;
    }

    .lp-case .section {
      padding: 0 28px 40px;
    }

    .lp-case .panel {
      padding: 24px 28px;
    }
  }

  @media (max-width: 600px) {
    .lp-case {
      padding-bottom: 56px;
    }

    .lp-case .header {
      padding: 32px 20px 20px;
    }

    .lp-case .header h1 {
      font-size: 22px;
    }

    .lp-case .section {
      padding: 0 20px 32px;
    }

    .lp-case .section h2 {
      font-size: 18px;
    }

    .lp-case .panel {
      padding: 20px;
    }

    .lp-case .ba .knob {
      width: 36px;
      height: 36px;
      font-size: 14px;
    }

    .lp-case .ba__label {
      top: 10px;
      padding: 4px 10px;
      font-size: 10px;
    }

    .lp-case .ba__label--before {
      left: 10px;
    }

    .lp-case .ba__label--after {
      right: 10px;
    }

    .lp-case .lp-caption--split {
      flex-direction: column;
      gap: 12px;
    }

    .lp-case .lp-caption--split p {
      padding: 12px 14px;
    }
  }
}
