/* ========================================
   マルチモーダルAIビジネス - スタイルシート
   カラースキーム: 青系 (#0066cc)
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}

/* ========================================
   ヘッダー
   ======================================== */

header {
  background-color: #0066cc;
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.logo a:hover {
  opacity: 0.8;
}

/* ========================================
   ナビゲーション
   ======================================== */

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease;
  position: relative;
}

nav a:hover,
nav a.active {
  opacity: 0.8;
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: white;
}

/* ========================================
   ハンバーガーメニュー
   ======================================== */

.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   メインコンテンツ
   ======================================== */

main {
  min-height: calc(100vh - 200px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}

.main-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.main-content h2 {
  color: #0066cc;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.8rem;
  border-bottom: 3px solid #0066cc;
  padding-bottom: 0.5rem;
}

.main-content h2:first-child {
  margin-top: 0;
}

.main-content h3 {
  color: #0052a3;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

.main-content p {
  margin-bottom: 1rem;
  text-align: justify;
}

.main-content strong {
  color: #0066cc;
  font-weight: 600;
}

/* ========================================
   ヒーロー セクション
   ======================================== */

.hero {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  padding: 4rem 1rem;
  text-align: center;
  margin-bottom: 2rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: bold;
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.95;
}

/* ========================================
   コンテンツ セクション
   ======================================== */

.content-section {
  padding: 2rem 0;
}

/* ========================================
   サイドバー
   ======================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ad-space {
  background-color: #e6f0ff;
  border: 2px dashed #0066cc;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: #0066cc;
  font-weight: 500;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc {
  background-color: white;
  border-left: 4px solid #0066cc;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toc h3 {
  color: #0066cc;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.toc ul {
  list-style: none;
}

.toc li {
  margin-bottom: 0.8rem;
}

.toc a {
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: block;
  padding: 0.5rem;
  border-radius: 4px;
}

.toc a:hover {
  background-color: #e6f0ff;
  padding-left: 1rem;
}

/* ========================================
   フッター
   ======================================== */

footer {
  background-color: #333;
  color: white;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.footer-links {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #0066cc;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.copyright {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ========================================
   レスポンシブ デザイン
   ======================================== */

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: #0066cc;
    padding: 1rem;
    flex-direction: column;
  }

  nav.active {
    display: flex;
  }

  nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  nav a.active::after {
    display: none;
  }

  .container {
    grid-template-columns: 1fr;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .main-content {
    padding: 1.5rem;
  }

  .main-content h2 {
    font-size: 1.5rem;
  }

  .main-content h3 {
    font-size: 1.1rem;
  }

  .footer-links {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 0.5rem;
  }

  .logo a {
    font-size: 1.2rem;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .main-content {
    padding: 1rem;
  }

  .main-content h2 {
    font-size: 1.3rem;
  }

  .main-content h3 {
    font-size: 1rem;
  }

  .main-content p {
    font-size: 0.95rem;
  }

  .ad-space {
    padding: 1rem;
    min-height: 150px;
  }

  .toc {
    padding: 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}


/* === Mobile fix v3 (auto-injected) === */
html, body { overflow-x: hidden; }
img, video, iframe, table { max-width: 100%; }

@media (max-width: 768px) {
  /* ヒーローテキストがviewportからはみ出さないようにする */
  h1, h2, h3 {
    font-size: clamp(1.3rem, 5vw, 2.5rem) !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  p, li, td, th, span, a {
    overflow-wrap: break-word;
    word-break: break-word;
  }
  /* 全要素の幅を100vw以内に */
  .container, main, section, article, header, footer, nav,
  [class*="container"], [class*="wrapper"], [class*="content"] {
    max-width: 100vw;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}
/* === End Mobile fix v3 === */
