/* Luxury Foreign Cars Website - Premium Design */

:root {
  --primary-color: #1a1a2e;
  --secondary-color: #16213e;
  --accent-gold: #d4af37;
  --accent-silver: #c0c0c0;
  --text-light: #ffffff;
  --text-dark: #1a1a2e;
  --text-gray: #6b7280;
  --bg-light: #f8f9fa;
  --bg-dark: #0f0f1e;
  --gradient-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  --transition: all 0.3s ease;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
  color: var(--text-dark);
  background-color: var(--bg-light);
  font-size: 16px;
}

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

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

p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

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

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

/* Header */
header {
  background: var(--gradient-primary);
  color: var(--text-light);
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

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

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-decoration: none;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  color: var(--text-light);
}

.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 {
  font-weight: 500;
  color: var(--text-light);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-item a:hover,
.nav-item a.active {
  background: var(--accent-gold);
  color: var(--text-dark);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-light);
  margin: 3px 0;
  transition: var(--transition);
  border-radius: 3px;
}

/* Hero Section */
.hero {
  position: relative;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.85), rgba(22, 33, 62, 0.7));
  z-index: -1;
}

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

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  animation: fadeInUp 1s ease;
}

.hero p {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  color: var(--bg-light);
  animation: fadeInUp 1.2s ease;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--gradient-gold);
  color: var(--text-dark);
  font-weight: 700;
  border-radius: 50px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  animation: fadeInUp 1.4s ease;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(212, 175, 55, 0.4);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Section */
.section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  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: var(--gradient-gold);
  border-radius: 2px;
}

/* 2-Column Layout (Main Content + Sidebar) */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  margin-top: 2rem;
}

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

.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

/* Table of Contents */
.toc {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.toc h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--accent-gold);
  padding-bottom: 0.75rem;
}

.toc ul {
  list-style: none;
}

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

.toc a {
  color: var(--text-gray);
  font-size: 0.95rem;
  padding: 0.5rem;
  display: block;
  border-radius: 8px;
  transition: var(--transition);
}

.toc a:hover {
  background: var(--bg-light);
  color: var(--accent-gold);
  padding-left: 1rem;
}

/* Related Links */
.related-links {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.related-links h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--accent-gold);
  padding-bottom: 0.75rem;
}

.related-links ul {
  list-style: none;
}

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

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

.related-links a:hover {
  color: var(--accent-silver);
  transform: translateX(5px);
}

/* Ad Space */
.ad-space {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* News Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.news-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

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

.news-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.news-card-content {
  padding: 2rem;
}

.news-date {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

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

.news-card p {
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.read-more {
  color: var(--accent-gold);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.read-more:hover {
  gap: 1rem;
}

/* Feature Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition);
  border: 2px solid transparent;
}

.feature-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}

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

/* Image with Caption */
.content-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: var(--shadow-md);
}

.image-caption {
  text-align: center;
  color: var(--text-gray);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 0.75rem;
}

/* Lists */
ul, ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--accent-gold);
  padding: 1.5rem 2rem;
  background: var(--bg-light);
  margin: 2rem 0;
  border-radius: 8px;
  font-style: italic;
  color: var(--text-gray);
}

/* Footer */
footer {
  background: var(--gradient-primary);
  color: var(--text-light);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-links a {
  color: var(--text-light);
  font-size: 0.95rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

.footer-copyright {
  text-align: center;
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

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

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

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--secondary-color);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
  }

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

  .nav-item {
    width: 100%;
    text-align: center;
  }

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

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

  .section-title {
    font-size: 2rem;
  }

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

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

  .container {
    padding: 2rem 1rem;
  }

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

@media (max-width: 480px) {
  .hero {
    height: 500px;
  }

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

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

  .cta-button {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
  }

  .logo {
    font-size: 1.4rem;
  }
}



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