/* ========================================
   産業特化型トレーニングコースサイト
   オリジナルデザイン - モダンで洗練されたスタイル
   ======================================== */

/* ===== カラーパレットとベース設定 ===== */
:root {
  /* メインカラー: 深い青と明るいアクセント */
  --primary-color: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --accent-color: #f59e0b;
  --accent-light: #fbbf24;

  /* テキストカラー */
  --text-dark: #1f2937;
  --text-medium: #4b5563;
  --text-light: #6b7280;
  --text-white: #ffffff;

  /* 背景カラー */
  --bg-white: #ffffff;
  --bg-light: #f9fafb;
  --bg-secondary: #f3f4f6;
  --bg-dark: #111827;

  /* ボーダー・シャドウ */
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);

  /* その他 */
  --border-radius: 12px;
  --transition: all 0.3s ease;
  --max-width: 1280px;
}

/* ===== リセット & ベーススタイル ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', 'Meiryo', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
  background-color: var(--bg-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== ヘッダー ===== */
.header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  color: var(--text-white);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 800;
}

.logo span {
  color: var(--accent-light);
  font-weight: 300;
  font-size: 0.9rem;
  display: block;
  margin-top: 0.25rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  max-width: 900px;
  justify-content: center;
}

.nav-item a {
  color: var(--text-white);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-item a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

/* ハンバーガーメニュー */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-white);
  cursor: pointer;
  padding: 0.5rem;
}

/* ===== ヒーローセクション ===== */
.hero {
  position: relative;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-white);
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-white);
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.5);
}

.cta-button {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--text-white);
  padding: 1rem 2.5rem;
  border-radius: var(--border-radius);
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.cta-button:hover {
  background-color: var(--accent-light);
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

/* ===== メインコンテンツエリア ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  flex: 1;
}

.page-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

/* ===== メインコンテンツ ===== */
.main-content {
  background-color: var(--bg-white);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

.main-content h2 {
  color: var(--primary-color);
  border-left: 5px solid var(--accent-color);
  padding-left: 1rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.main-content h3 {
  color: var(--primary-dark);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.main-content ul, .main-content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.main-content li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.main-content strong {
  color: var(--primary-color);
  font-weight: 700;
}

/* ===== サイドバー ===== */
.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background-color: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-color);
}

.toc ul {
  list-style: none;
  margin: 0;
}

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

.toc a {
  color: var(--text-medium);
  font-size: 0.95rem;
  display: block;
  padding: 0.5rem 0;
  transition: var(--transition);
}

.toc a:hover {
  color: var(--primary-color);
  padding-left: 0.5rem;
  text-decoration: none;
}

.related-articles ul {
  list-style: none;
  margin: 0;
}

.related-articles li {
  margin-bottom: 1rem;
}

.related-articles a {
  color: var(--primary-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-articles a:before {
  content: "→";
  color: var(--accent-color);
  font-weight: 700;
}

.ad-space {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: center;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ===== セクション（トップページ用） ===== */
.intro-section, .news-section, .features-section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.25rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent-color));
  border-radius: 2px;
}

/* ===== ニュースリスト ===== */
.news-list {
  background-color: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

.news-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover {
  background-color: var(--bg-light);
  padding-left: 2rem;
}

.news-item time {
  display: inline-block;
  background-color: var(--accent-light);
  color: var(--text-white);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.news-item h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.news-item p {
  color: var(--text-medium);
  line-height: 1.7;
  margin-bottom: 0;
}

/* ===== フィーチャーカード ===== */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background-color: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--text-medium);
  line-height: 1.7;
}

/* ===== フッター ===== */
.footer {
  background-color: var(--bg-dark);
  color: var(--text-white);
  margin-top: auto;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  color: var(--accent-light);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.75rem;
}

.footer-section a {
  color: var(--text-white);
  opacity: 0.85;
  transition: var(--transition);
}

.footer-section a:hover {
  opacity: 1;
  color: var(--accent-light);
  text-decoration: none;
}

.footer-bottom {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.9rem;
}

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

/* タブレット */
@media (max-width: 991px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .main-content {
    padding: 2rem;
  }
}

/* モバイル */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
    flex-wrap: wrap;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 1rem;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-item a {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    height: 400px;
  }

  .hero h1 {
    font-size: 2rem;
  }

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

  .container {
    padding: 2rem 1rem;
  }

  .main-content {
    padding: 1.5rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.35rem; }

  .feature-cards {
    grid-template-columns: 1fr;
  }

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

  .footer-content {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }
}

/* 小型モバイル */
@media (max-width: 480px) {
  .logo h1 {
    font-size: 1.2rem;
  }

  .hero {
    height: 350px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .cta-button {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }

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

/* ===== ユーティリティクラス ===== */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ===== アニメーション ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ===== サブページ用スタイル ===== */
.hero-sub {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-white);
  overflow: hidden;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

.article-content {
  width: 100%;
}

.table-of-contents {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

.table-of-contents h2 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-left: none;
  padding-left: 0;
}

.table-of-contents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.table-of-contents li {
  margin-bottom: 0.5rem;
}

.table-of-contents a {
  color: var(--text-medium);
  font-size: 0.95rem;
  transition: var(--transition);
}

.table-of-contents a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.sidebar-toc {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-toc li {
  margin-bottom: 0.5rem;
}

.sidebar-toc a {
  color: var(--text-medium);
  font-size: 0.9rem;
  transition: var(--transition);
  display: block;
}

.sidebar-toc a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-links li {
  margin-bottom: 0.75rem;
}

.sidebar-links a {
  color: var(--primary-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.sidebar-links a:before {
  content: "→";
  color: var(--accent-color);
  font-weight: 700;
}

.sidebar-links a:hover {
  color: var(--primary-light);
  text-decoration: none;
}

.ad-widget {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--border-radius);
}

.ad-widget h3 {
  margin-bottom: 1rem;
}

.ad-banner {
  margin: 2rem 0;
}

/* レスポンシブ対応 */
@media (max-width: 991px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-sub {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .hero-sub {
    height: 300px;
  }

  .table-of-contents {
    padding: 1rem;
  }
}



/* === 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 === */
