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

/* Page: /company/ - 会社情報ページ固有スタイル */

@layer pages {

  /* ========================================
     イントロセクション 署名スタイル
     ======================================== */

  .content-section__signature {
    margin-top: 2rem;
    font-weight: 600;
    color: var(--color-text-strong);
  }

  /* ========================================
     沿革セクション タイムライン
     ui.css の古い .timeline スタイルを上書きし、
     components-subpage.css のスタイルを適用
     ======================================== */

  /* 沿革セクション背景調整 */
  #history.content-section--gray {
    background: var(--subpage-surface, #f8fafc);
  }

  /* ui.css の .timeline を完全に上書き */
  #history .timeline {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 960px;
    position: relative;
    border-left: none; /* ui.css のボーダーを消す */
  }

  /* タイムラインの縦線 */
  #history .timeline::before {
    content: '';
    position: absolute;
    left: 32px;
    top: 48px;
    bottom: 48px;
    width: 2px;
    background: linear-gradient(
      180deg,
      var(--subpage-accent, #1e40af) 0%,
      var(--subpage-accent-light, #3b82f6) 50%,
      var(--subpage-warm, #b91c1c) 100%
    );
  }

  /* 各アイテム */
  #history .timeline__item {
    position: relative;
    padding: clamp(28px, 4vw, 36px) clamp(28px, 4vw, 36px) clamp(28px, 4vw, 36px) clamp(80px, 12vw, 110px);
    background: transparent;
    transition: all 0.4s ease;
    border-radius: 12px;
    display: block; /* ui.css の grid を上書き */
    grid-template-columns: none; /* ui.css の grid を上書き */
  }

  #history .timeline__item:hover {
    background: rgba(30, 64, 175, 0.03);
  }

  /* ui.css の li::before を消す */
  #history .timeline__item::before {
    display: none;
  }

  /* 番号バッジ */
  #history .timeline__index {
    position: absolute;
    left: 8px;
    top: clamp(28px, 4vw, 36px);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--subpage-accent, #1e40af);
    color: #ffffff;
    font-family: var(--font-display-en, 'Bebas Neue', sans-serif);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.02em;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow:
      0 4px 12px rgba(30, 64, 175, 0.25),
      0 0 0 4px rgba(30, 64, 175, 0.1);
    z-index: 1;
    transition: all 0.4s ease;
  }

  #history .timeline__item:hover .timeline__index {
    background: var(--subpage-warm, #b91c1c);
    box-shadow:
      0 6px 16px rgba(185, 28, 28, 0.3),
      0 0 0 4px rgba(185, 28, 28, 0.15);
    transform: scale(1.1);
  }

  /* コンテンツボディ */
  #history .timeline__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* 年月タイトル */
  #history .timeline__title {
    margin: 0;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 800;
    line-height: 1.35;
    color: var(--subpage-accent, #1e40af);
    font-family: var(--font-serif, serif);
    letter-spacing: 0.02em;
  }

  /* 説明文 */
  #history .timeline__text {
    margin: 0;
    font-size: clamp(0.92rem, 1.4vw, 1.02rem);
    line-height: 1.85;
    color: var(--color-text-subtle, #64748b);
  }

  /* レスポンシブ: 640px以上 */
  @media (min-width: 640px) {
    #history .timeline::before {
      left: 40px;
    }

    #history .timeline__item {
      padding-left: clamp(100px, 14vw, 130px);
    }

    #history .timeline__index {
      width: 64px;
      height: 64px;
      font-size: 24px;
    }
  }

  /* ========================================
     アクセスセクション 地図スタイル
     ======================================== */

  .access-map-wrapper {
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }

  .access-map-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  }

  .access-map-container iframe {
    border: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* ========================================
     レスポンシブ調整（モバイル）
     ======================================== */

  @media (max-width: 768px) {
    #history .timeline__item {
      padding: 24px 16px 24px 70px;
    }

    #history .timeline::before {
      left: 24px;
    }

    #history .timeline__index {
      left: 4px;
      width: 40px;
      height: 40px;
      font-size: 16px;
    }

    #history .timeline__title {
      font-size: 1rem;
    }

    #history .timeline__text {
      font-size: 0.9rem;
    }
  }
}
