/* ============================================
   防音・遮音工事業界サイト - AcoustiQ Design
   Sound wave inspired modern design
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables */
:root {
  --navy-deep: #0a1628;
  --navy-dark: #0f1f3a;
  --navy-mid: #1a3355;
  --cyan-accent: #00c2e0;
  --cyan-light: #7aeaff;
  --cyan-glow: rgba(0, 194, 224, 0.15);
  --gold-accent: #e8a838;
  --gold-light: #ffd98a;
  --bg-light: #f4f6fa;
  --bg-white: #ffffff;
  --text-dark: #1a2332;
  --text-body: #3a4a5c;
  --text-light: #6b7d92;
  --border-color: #dce3ec;
  --shadow-sm: 0 1px 3px rgba(10,22,40,0.08);
  --shadow-md: 0 4px 16px rgba(10,22,40,0.1);
  --shadow-lg: 0 8px 32px rgba(10,22,40,0.14);
  --shadow-glow: 0 0 20px rgba(0, 194, 224, 0.2);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --header-height: 64px;
  --max-width: 1200px;
  --sidebar-width: 320px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
  line-height: 1.8;
  color: var(--text-body);
  background: var(--bg-light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.75rem; border-left: 4px solid var(--cyan-accent); padding-left: 0.75rem; margin-top: 2.5rem; }
h3 { font-size: 1.35rem; margin-top: 2rem; }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1.25rem; }

a {
  color: var(--cyan-accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--cyan-light);
}

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

/* ============================================
   HEADER
   ============================================ */
header {
  background: var(--navy-deep);
  color: #fff;
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: transform var(--transition);
}

header.hidden {
  transform: translateY(-100%);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo a {
  color: #fff;
  text-decoration: none;
}
.logo a:hover {
  color: var(--cyan-light);
  text-decoration: none;
}

.logo::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cyan-accent), var(--gold-accent));
  border-radius: 8px;
  flex-shrink: 0;
}

/* Navigation */
#nav-menu ul {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

#nav-menu li a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: block;
  white-space: nowrap;
}

#nav-menu li a:hover,
#nav-menu li a.active {
  color: #fff;
  background: rgba(0, 194, 224, 0.15);
  text-decoration: none;
}

/* Hamburger */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  position: absolute;
  left: 8px;
  transition: all var(--transition);
}

.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 19px; }
.hamburger span:nth-child(3) { top: 26px; }

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 19px;
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 19px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--navy-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 22, 40, 0.35) 0%,
    rgba(10, 22, 40, 0.55) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 900px;
}

.hero h1 {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000, 0 4px 8px rgba(0,0,0,0.5);
  font-size: 2.8rem;
  margin-bottom: 1rem;
  border-left: none;
  padding-left: 0;
  margin-top: 0;
  line-height: 1.3;
}

.hero-subtitle {
  color: rgba(255,255,255,0.92);
  font-size: 1.15rem;
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  max-width: 700px;
  margin: 0 auto;
}

/* Sound wave decorative line */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--cyan-accent), var(--gold-accent), var(--cyan-accent), transparent);
  z-index: 3;
}

/* ============================================
   LAYOUT: 2-column with sidebar
   ============================================ */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.main-content {
  flex: 1;
  min-width: 0;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.main-content p {
  font-size: 1rem;
  line-height: 1.9;
}

.main-content ul, .main-content ol {
  margin: 1.25rem 0;
  padding-left: 1.75rem;
}

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

.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.main-content th, .main-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.main-content th {
  background: var(--navy-deep);
  color: #fff;
  font-weight: 600;
}

.main-content tr:nth-child(even) {
  background: var(--bg-light);
}

/* Sidebar */
.sidebar {
  flex: 0 0 var(--sidebar-width);
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

/* TOC */
.toc {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--cyan-accent);
}

.toc h3 {
  font-size: 1rem;
  color: var(--navy-deep);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-top: 0;
}

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

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

.toc a {
  color: var(--text-body);
  font-size: 0.88rem;
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border-left: 2px solid transparent;
}

.toc a:hover {
  color: var(--cyan-accent);
  background: var(--cyan-glow);
  border-left-color: var(--cyan-accent);
  text-decoration: none;
}

/* Sidebar Ad */
.sidebar-ad {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  overflow: hidden;
}

.sidebar-ad img {
  max-width: 100%;
  height: auto;
}

/* Amazon banner styling */
.amazon-banner {
  margin-bottom: 1rem;
}

.amazon-banner a {
  display: block;
  background: linear-gradient(135deg, #232f3e, #37475a);
  color: #ff9900;
  font-weight: 700;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all var(--transition);
  text-decoration: none;
}

.amazon-banner a:hover {
  background: linear-gradient(135deg, #37475a, #485769);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #ffad33;
  text-decoration: none;
}

.amazon-banner div {
  font-size: 0.95rem;
}

/* ============================================
   TOP PAGE (index.html) - No sidebar
   ============================================ */
.top-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* News Section on Top Page */
.section-block {
  padding: 3.5rem 0;
}

.section-block:nth-child(even) {
  background: var(--bg-white);
}

.section-title {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 2.5rem;
  position: relative;
  border-left: none;
  padding-left: 0;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan-accent), var(--gold-accent));
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* News Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.news-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border-color);
}

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

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

.news-card time {
  display: inline-block;
  color: var(--cyan-accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.news-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-summary {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.news-source {
  color: var(--text-light);
}

.news-link {
  color: var(--cyan-accent);
  font-weight: 600;
}
.news-link:hover {
  color: var(--cyan-light);
}

/* Content Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan-accent), var(--gold-accent));
  opacity: 0;
  transition: opacity var(--transition);
}

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

.card:hover::before {
  opacity: 1;
}

.card-content {
  padding: 1.75rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  margin-top: 0;
}

.card-description {
  color: var(--text-light);
  font-size: 0.93rem;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--cyan-accent);
  font-weight: 600;
  font-size: 0.93rem;
  transition: all var(--transition);
}

.card-link:hover {
  color: var(--cyan-light);
  gap: 0.5rem;
  text-decoration: none;
}

/* CTA Button */
.btn-primary {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--cyan-accent), #0099b8);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: #fff;
  text-decoration: none;
}

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

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--text-light);
}
.breadcrumb a:hover {
  color: var(--cyan-accent);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.7);
  margin-top: 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

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

.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  transition: color var(--transition);
}

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

.copyright {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* Footer wave decoration */
footer::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cyan-accent), var(--gold-accent), var(--cyan-accent), transparent);
}

/* ============================================
   BLOG-SPECIFIC
   ============================================ */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border-color);
}

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

.blog-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-content {
  padding: 1.25rem;
}

.blog-content h2 {
  font-size: 1.1rem;
  border-left: none;
  padding-left: 0;
  margin-top: 0;
}

.blog-content h2 a {
  color: var(--text-dark);
}
.blog-content h2 a:hover {
  color: var(--cyan-accent);
}

.blog-content time {
  display: block;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.article-summary {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: inline-block;
  color: var(--cyan-accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ============================================
   NEWS INDEX
   ============================================ */
.news-index-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.news-index-container h1 {
  text-align: center;
  margin-bottom: 2rem;
}

.news-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* ============================================
   GLOSSARY
   ============================================ */
.glossary-intro {
  margin-bottom: 2rem;
}

.page-header {
  text-align: center;
  padding: 2rem 1.25rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.page-description {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.site-navigation {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
}

.site-navigation ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  flex-wrap: wrap;
}

.site-navigation a {
  color: var(--text-body);
  font-size: 0.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.site-navigation a:hover,
.site-navigation .current a {
  background: var(--cyan-accent);
  color: #fff;
  border-color: var(--cyan-accent);
  text-decoration: none;
}

/* Glossary grid */
.glossary-grid,
.glossary-terms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0;
}

.glossary-card,
.term-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.glossary-card:hover,
.term-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--cyan-accent);
}

.glossary-card h2,
.glossary-card h3,
.term-card h2,
.term-card h3 {
  font-size: 1.1rem;
  border-left: none;
  padding-left: 0;
  margin-top: 0;
}

.glossary-card h2 a,
.glossary-card h3 a,
.term-card h2 a,
.term-card h3 a {
  color: var(--text-dark);
}

.glossary-card h2 a:hover,
.glossary-card h3 a:hover,
.term-card h2 a:hover,
.term-card h3 a:hover {
  color: var(--cyan-accent);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
}

.scroll-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .news-grid,
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  /* Hamburger show */
  .hamburger {
    display: block;
  }

  /* Mobile nav */
  #nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--navy-deep);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.1);
    max-height: 70vh;
    overflow-y: auto;
  }

  #nav-menu.active {
    display: block;
  }

  #nav-menu ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }

  #nav-menu li a {
    padding: 0.85rem 1.5rem;
    border-radius: 0;
    font-size: 0.95rem;
  }

  /* 2-column → single on mobile, sidebar above */
  .page-wrapper {
    flex-direction: column-reverse;
    padding: 1rem;
    gap: 1.25rem;
  }

  .sidebar {
    flex: 1;
    width: 100%;
    position: static;
  }

  .main-content {
    padding: 1.5rem;
    border-radius: var(--radius-sm);
  }

  /* Hero */
  .hero {
    min-height: 300px;
  }

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

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

  .hero-content {
    padding: 3rem 1rem;
  }

  /* Grids */
  .news-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .blog-list {
    grid-template-columns: 1fr;
  }

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

  .glossary-grid,
  .glossary-terms {
    grid-template-columns: 1fr;
  }

  /* General typography */
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }

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

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

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .main-content {
    padding: 1.25rem;
  }

  .card-content {
    padding: 1.25rem;
  }
}

/* ============================================
   MOBILE OVERFLOW FIX
   ============================================ */
html, body { overflow-x: hidden; }
img, video, iframe, table { max-width: 100%; }

@media (max-width: 768px) {
  h1, h2, h3 {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  p, li, td, th, span, a {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  header, footer, .sidebar, .hamburger {
    display: none !important;
  }
  .main-content {
    box-shadow: none;
    padding: 0;
  }
  .hero {
    min-height: auto;
    padding: 1rem 0;
  }
}
