/* ==========================================================================
   responsive.css — mobile first overrides
   ========================================================================== */

/* ---------- Tablet & under (1024px) ---------- */
@media (max-width: 1024px) {
  .site-footer-inner {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .site-footer-col-news { display: none; }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Tablet (768px) ---------- */
@media (max-width: 768px) {
  .pc-only { display: none; }
  .sp-only { display: inline; }

  body { padding-bottom: 72px; }

  /* ----- Header ----- */
  .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #fff;
  }

  .site-header-inner {
    height: 60px;
  }

  .site-logo {
    font-size: 15px;
  }

  .site-logo-mark {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .site-nav {
    position: fixed;
    inset: 60px 0 0 0;
    z-index: 79;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: flex-start;
    padding: 32px 24px;
    transform: translateX(100%);
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    align-items: stretch;
    gap: 0;
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .site-nav-list {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  .site-nav-list li {
    border-bottom: 1px solid var(--color-border-soft);
  }

  .site-nav-list a {
    display: block;
    padding: 18px 4px;
    font-size: 16px;
  }

  .site-nav-list a.is-current::after { display: none; }

  .header-cta {
    margin-top: var(--space-md);
    padding: 14px 22px;
    width: 100%;
  }

  .hamburger {
    display: inline-flex;
    z-index: 81;
  }

  /* ----- Hero ----- */
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
    padding-block: var(--space-lg) var(--space-lg);
  }

  .hero-visual {
    aspect-ratio: 5 / 4;
    order: -1;
  }

  .hero-visual-badge {
    left: 16px;
    right: 16px;
    bottom: 16px;
    padding: 14px 16px;
  }

  .hero-visual-badge-num {
    font-size: 24px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 1.4rem + 2vw, 2.4rem);
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-meta {
    gap: 12px;
  }

  /* ----- Sections ----- */
  .section-title {
    font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  }

  .section-header { text-align: left; }

  .section-lead { font-size: var(--text-base); }

  /* ----- Service / Strength cards ----- */
  /* minmax(0, 1fr) で min-content によるトラック拡大を防ぐ
     (1fr = minmax(auto, 1fr) は長文CJK+keep-allと相性が悪く右オーバーフローする) */
  .service-list,
  .strengths-list,
  .voice-list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* スマホ時は内側余白を縮小して、本文の改行余地を確保 */
  .service-card,
  .strength-card {
    padding: var(--space-md);
  }

  .strength-card-num {
    width: 44px;
    height: 44px;
    font-size: 17px;
    top: -16px;
  }

  /* ----- CTA band ----- */
  .cta-band {
    padding: var(--space-lg) 20px;
    border-radius: var(--radius-md);
  }

  .cta-band-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cta-band-buttons .btn { width: 100%; }

  /* ----- News ----- */
  .news-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 16px 0;
  }

  .news-item-tag {
    justify-self: flex-start;
  }

  /* ----- Page header ----- */
  .page-header-title {
    font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.4rem);
  }

  /* ----- Service detail ----- */
  .service-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
    padding-block: var(--space-lg);
  }

  .service-detail:nth-child(even) .service-detail-visual { order: 0; }

  /* ----- Flow ----- */
  .flow-step {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 20px;
  }

  /* スマホでは flow-step-body の keep-all を解除して自然折り返しに切替。
     narrowカードで「。」が孤立行になる現象を回避。PCは keep-all のまま。 */
  .flow-step-body {
    word-break: normal;
    overflow-wrap: break-word;
    line-break: strict;
    text-wrap: pretty;
  }

  .flow-step::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .flow-step-num {
    padding: 10px 16px;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    width: fit-content;
  }

  .flow-step-num strong {
    display: inline-block;
    margin-top: 0;
    font-size: 22px;
  }

  /* ----- Company table ----- */
  .company-table th,
  .company-table td {
    padding: 14px 16px;
    font-size: 14px;
  }

  .company-table th {
    width: 35%;
  }

  /* ----- Mission ----- */
  .mission-title {
    font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
  }

  /* スマホでは mission-body の keep-all を解除して自然折り返しに切替。
     narrowコンテナで「、」が overflow-wrap により行頭に来てしまうのを回避。
     PCは keep-all のまま（変更しない）。 */
  .mission-body {
    word-break: normal;
    overflow-wrap: break-word;
    line-break: strict;
    text-wrap: pretty;
  }

  /* ----- Form ----- */
  .contact-form,
  .contact-card {
    padding: var(--space-md);
  }

  /* ----- Footer ----- */
  .site-footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
  }

  .site-footer-col-news { display: block; }

  .site-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  /* ----- Mobile fixed bar ----- */
  .mobile-cta-bar { display: flex; }

  /* ----- Price table（スマホはカード型に再構築） ----- */
  .price-table {
    display: block;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .price-table thead { display: none; }

  .price-table tbody {
    display: block;
  }

  .price-table tbody tr {
    display: block;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .price-table tbody tr:last-child { margin-bottom: 0; }

  .price-table tbody th {
    display: block;
    width: 100%;
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-soft);
  }

  .price-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border-soft);
  }

  .price-table tbody td:last-child { border-bottom: 0; }

  /* data-label属性をラベルとして表示 */
  .price-table tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-soft);
  }
}

/* ---------- Small phones (480px) ---------- */
@media (max-width: 480px) {
  .container, .container-narrow {
    width: calc(100% - 24px);
  }

  .hero-inner {
    padding-block: var(--space-md) var(--space-lg);
  }

  .voice-card::before { font-size: 64px; }

  .form-radio-group {
    flex-direction: column;
  }

  .form-radio { width: 100%; }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .mobile-cta-bar,
  .back-to-top,
  .cta-band {
    display: none !important;
  }

  body { background: #fff; color: #000; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   日本語折り返し品質（全幅）
   - 本文は pretty で 1 行末の孤立文字を回避
   - 見出しは balance で行ごとの長さを揃える
   - line-break: strict で句読点・括弧の禁則を強める
   ========================================================================== */
.hero-lead,
.section-lead,
.page-header-lead,
.mission-body,
.cta-band-lead,
.service-card-body,
.strength-card-body,
.voice-card-body,
.contact-card-body,
.news-item-title {
  text-wrap: pretty;
  line-break: strict;
}

.hero-title,
.page-header-title,
.section-title,
.mission-title,
.cta-band-title,
.service-card-title,
.strength-card-title,
.voice-card-title,
.contact-card-title {
  text-wrap: balance;
  line-break: strict;
}

/* ==========================================================================
   スマホ向け本文の読みやすさ調整
   ========================================================================== */
@media (max-width: 768px) {
  .hero-lead,
  .page-header-lead,
  .section-lead,
  .mission-body,
  .cta-band-lead,
  .service-card-body,
  .strength-card-body,
  .voice-card-body,
  .contact-card-body {
    font-size: 15px;
    line-height: 1.9;
  }

  /* セクションヘッダーのテキスト左寄せ時、行頭インデントを揃える */
  .section-header .section-lead { max-width: 100%; }

  /* 段落 <br><br> 区切りの余白を確保 */
  .mission-body br + br { line-height: 0.6; }

  /* テーブルセル内改行の行間 */
  .company-table td { line-height: 1.85; }

  /* 表内ラベルの英字を見切れさせない */
  .company-table th { white-space: normal; }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(1.6rem, 1.2rem + 2vw, 2rem);
    line-height: 1.45;
  }

  .mission-title,
  .page-header-title {
    line-height: 1.5;
  }

  /* バッジ等の小さな囲みは詰める */
  .hero-visual-badge { padding: 12px 14px; }
}
