/* =================================================================
   レスポンシブデザイン最適化CSS
   全デバイス対応（320px〜）の完璧なレスポンシブ対応
   ================================================================= */

/* =================================================================
   基本レスポンシブ設定
   ================================================================= */

/* 画像の基本レスポンシブ対応 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ボックスサイジングの統一 */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 横スクロール防止 */
html, body {
  overflow-x: hidden;
}

/* =================================================================
   文字サイズの最適化（clamp関数）
   ================================================================= */

/* ヒーローセクション */
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero p {
  font-size: clamp(0.9rem, 1.5vw, 1.25rem);
  line-height: 1.6;
}

/* セクションタイトル */
.section-title {
  font-size: clamp(1.3rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

/* 通常テキスト */
p, li {
  font-size: clamp(0.875rem, 1vw, 1rem);
  line-height: 1.6;
}

/* =================================================================
   大画面対応（1920px以上）
   ================================================================= */
@media (min-width: 1920px) {
  .section-container,
  .header-container {
    max-width: 1400px;
  }
  
  .hero h1 {
    font-size: 4rem;
  }
  
  .section-title {
    font-size: 3rem;
  }
}

/* =================================================================
   デスクトップ（1024px〜1919px）
   ================================================================= */
@media (max-width: 1024px) {
  /* グリッドレイアウトの調整 */
  .strength-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* =================================================================
   タブレット（768px〜1023px）
   ================================================================= */
@media (max-width: 1023px) and (min-width: 768px) {
  /* タブレット専用の調整 */
  .section {
    padding: 60px 0;
  }
  
  .hero {
    padding: 80px 0;
  }
  
  /* ボタンサイズの調整 */
  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}

/* =================================================================
   モバイル大（481px〜767px）
   ================================================================= */
@media (max-width: 767px) {
  /* ヘッダーの調整 */
  .header-container {
    height: 60px;
    padding: 0 20px;
  }

  .logo img {
    height: 40px;
  }

  /* メインコンテンツの調整 */
  main {
    margin-top: 60px;
  }

  /* セクションの余白調整 */
  .section {
    padding: 40px 0;
  }

  .hero {
    padding: 50px 0;
  }

  /* すべてのコンテナに最大幅設定 */
  .section-container,
  .hero-content,
  .footer-content {
    max-width: 100%;
    padding: 0 20px;
  }

  /* テキストのはみ出し防止 */
  p, li, span, div, h1, h2, h3, h4, h5, h6, a {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
  
  /* グリッドを1列に */
  .stats-grid,
  .strength-grid,
  .quality-grid,
  .company-info-grid,
  .service-grid,
  .testimonials-grid,
  .news-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* カードのパディング調整 */
  .stat-item,
  .strength-item,
  .quality-item,
  .info-card {
    padding: 1.5rem;
  }
  
  /* ニュースアイテムの調整 */
  .news-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .news-date {
    min-width: auto;
  }
  
  /* フッターの調整 */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }
  
  /* モバイルナビゲーション */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
  }
  
  nav.active {
    right: 0;
  }
  
  nav ul {
    flex-direction: column;
    padding: 80px 30px;
    gap: 1.5rem;
    align-items: flex-start;
  }
  
  .hamburger {
    display: flex;
    position: relative;
    z-index: 1001;
  }
  
  /* ボタンの調整 */
  .btn-group {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    max-width: none;
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

/* =================================================================
   モバイル小（320px〜480px）
   ================================================================= */
@media (max-width: 480px) {
  /* さらに小さい画面用の調整 */
  .header-container {
    padding: 0 15px;
  }

  .section-container {
    padding: 0 15px;
  }

  .hero-content {
    padding: 0 15px;
  }

  /* 文字サイズの微調整 */
  .hero h1 {
    font-size: 1.5rem !important;
    word-break: keep-all;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .hero p {
    font-size: 0.875rem !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .section-title {
    font-size: 1.25rem !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* すべてのテキスト要素のはみ出し防止 */
  p, li, span, div, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }

  /* 長い単語の改行 */
  .section-description, .product-details p, .testimonial-content p {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  /* カードの最小化 */
  .stat-item,
  .strength-item,
  .quality-item {
    padding: 1rem;
  }
  
  /* 統計数値の調整 */
  .stat-number {
    font-size: 1.5rem;
  }
  
  /* FAQの調整 */
  .faq-question {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .faq-answer {
    padding: 1rem;
    font-size: 0.875rem;
  }
  
  /* テーブルのレスポンシブ対応 */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    min-width: 100%;
    font-size: 0.875rem;
  }
  
  /* フォームの調整 */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px; /* iOSのズーム防止 */
  }
}

/* =================================================================
   極小画面対応（320px以下）
   ================================================================= */
@media (max-width: 320px) {
  .container {
    padding: 0 10px;
  }
  
  .hero h1 {
    font-size: 1.25rem !important;
  }
  
  .section-title {
    font-size: 1.1rem !important;
  }
  
  .btn {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}

/* =================================================================
   ランドスケープモード対応
   ================================================================= */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 30px 0;
  }
  
  .section {
    padding: 30px 0;
  }
  
  nav ul {
    padding: 60px 30px;
  }
}

/* =================================================================
   アニメーションの最適化（モバイル）
   ================================================================= */
@media (max-width: 768px) {
  /* モバイルでアニメーションを軽量化 */
  .animate-on-scroll {
    animation-duration: 0.3s;
  }
  
  /* パララックス効果を無効化 */
  .parallax {
    background-attachment: scroll;
  }
  
  /* カスタムカーソルを非表示 */
  .cursor,
  .cursor-follower {
    display: none;
  }
}

/* =================================================================
   印刷対応
   ================================================================= */
@media print {
  header,
  footer,
  .hamburger,
  .btn,
  .scroll-to-top {
    display: none !important;
  }
  
  main {
    margin-top: 0;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* =================================================================
   アクセシビリティ向上
   ================================================================= */

/* フォーカス状態の改善 */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* スキップリンク */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* =================================================================
   Googleマップのレスポンシブ対応
   ================================================================= */

.access-map-section {
  margin-top: 2rem;
}

.map-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
  width: 100%;
  height: 300px;
  border: 0;
}

.access-info {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.access-info p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* タブレット対応 */
@media (max-width: 1023px) and (min-width: 768px) {
  .map-container iframe {
    height: 250px;
  }
}

/* モバイル対応 */
@media (max-width: 767px) {
  .access-map-section {
    margin-top: 1.5rem;
  }
  
  .map-container iframe {
    height: 200px;
  }
  
  .access-info {
    padding: 0.75rem;
  }
  
  .access-info p {
    font-size: 0.8rem;
  }
}

/* 極小画面対応 */
@media (max-width: 480px) {
  .map-container iframe {
    height: 180px;
  }
}

/* =================================================================
   アクセスマップページ用のスタイル（about.html）
   ================================================================= */

.access-map-content {
  margin-top: 2rem;
}

.map-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.company-address-detail h3,
.company-address-detail h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.address-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary-color);
}

.address-card p {
  margin: 0;
  font-weight: 500;
  line-height: 1.6;
}

.access-details ul {
  list-style: none;
  padding: 0;
}

.access-details li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.access-details li:last-child {
  border-bottom: none;
}

/* タブレット対応 */
@media (max-width: 1023px) and (min-width: 768px) {
  .map-info {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .map-container iframe {
    height: 350px;
  }
}

/* モバイル対応 */
@media (max-width: 767px) {
  .map-info {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .address-card {
    padding: 1rem;
  }
  
  .map-container iframe {
    height: 250px;
  }
}

/* 極小画面対応 */
@media (max-width: 480px) {
  .access-map-content {
    margin-top: 1rem;
  }
  
  .address-card {
    padding: 0.75rem;
  }
  
  .map-container iframe {
    height: 200px;
  }
}

/* =================================================================
   パフォーマンス最適化
   ================================================================= */

/* 画像の遅延読み込み */
img[loading="lazy"] {
  background-color: #f0f0f0;
}

/* フォントの最適化 */
@media (max-width: 768px) {
  body {
    font-weight: 400; /* モバイルで太字を減らす */
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-weight: 600; /* 見出しも軽量化 */
  }
}