/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Bicycle Mobility Theme */
  --primary-color: #2563eb;
  --secondary-color: #0f172a;
  --accent-color: #f59e0b;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--accent-color);
}

/* Navigation */
.main-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: var(--transition);
}

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

.nav-logo {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

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

.nav-menu li a {
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-menu li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.nav-menu li a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 70px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(37, 99, 235, 0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--bg-white);
  max-width: 900px;
  padding: 2rem;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.title-main {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.title-sub {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  opacity: 0.95;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.8;
  margin-bottom: 3rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--accent-color);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stat-label {
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.5rem;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--bg-white);
  opacity: 0.7;
  animation: bounce 2s infinite;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  margin-top: 0.5rem;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* Section Styles */
.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* Overview Section */
.overview-section {
  background: var(--bg-light);
}

.overview-content {
  max-width: 900px;
  margin: 0 auto 3rem;
}

.lead-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.8;
}

.key-topics {
  margin-top: 4rem;
}

.key-topics h3 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.topic-card {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.topic-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.topic-card h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* News Section */
.news-section {
  background: var(--bg-white);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 3rem;
}

.news-card {
  background: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.news-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
  transform: scale(1.05);
}

.news-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.news-date, .news-source {
  display: inline-block;
}

.news-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.news-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.news-link {
  color: var(--primary-color);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  margin-top: auto;
}

.news-link:hover {
  color: var(--accent-color);
}

.news-cta {
  text-align: center;
  margin-top: 2rem;
}

.btn-primary {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--gradient-primary);
  color: var(--bg-white);
  font-weight: 600;
  border-radius: 50px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--bg-white);
}

/* Footer */
.main-footer {
  background: var(--gradient-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-title {
  color: var(--bg-white);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--bg-white);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Page Content Layout (2-Column) */
.page-content {
  padding: 3rem 0;
  background: var(--bg-light);
  margin-top: 70px;
}

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

.main-article {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.content-section {
  margin-bottom: 3rem;
}

.content-section h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-color);
}

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

.content-section p {
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

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

.content-section li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
}

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

.sidebar-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--bg-light);
  padding-bottom: 0.5rem;
}

.toc-list, .related-links {
  list-style: none;
}

.toc-list li, .related-links li {
  margin-bottom: 0.75rem;
}

.toc-list a, .related-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  padding: 0.5rem;
  border-radius: 6px;
  transition: var(--transition);
}

.toc-list a:hover, .related-links a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
  padding-left: 1rem;
}

.ad-space {
  text-align: center;
}

.ad-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.ad-placeholder {
  width: 100%;
  height: 250px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.ad-placeholder::before {
  content: '広告エリア';
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-white);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }

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

  .nav-toggle {
    display: flex;
  }

  .hero {
    margin-top: 60px;
  }

  .hero-stats {
    gap: 1.5rem;
  }

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

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

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

  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
  }

  .main-article {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0.75rem 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero-stats {
    flex-direction: column;
    gap: 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 === */
