/* ============================================
   Niche Collecting - Midnight Cabinet Design
   A dark, museum-like aesthetic with gold accents
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+JP:wght@300;400;500;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette - Midnight Cabinet */
  --midnight: #0d1117;
  --cabinet: #161b22;
  --shelf: #1c2333;
  --glass: #21283b;
  --velvet: #2d1b4e;
  --gold: #d4a853;
  --gold-light: #e8c777;
  --gold-dim: #a07d3a;
  --brass: #b8933e;
  --pearl: #e8e4dd;
  --ivory: #f5f1ea;
  --smoke: #8b949e;
  --mist: #c9d1d9;
  --text-primary: #ecf0f4;
  --text-secondary: #a0aab5;
  --text-muted: #6e7a88;
  --accent-teal: #3fb5a3;
  --accent-rose: #d4637a;
  --surface: var(--cabinet);
  --surface-elevated: var(--shelf);
  --border: rgba(212,168,83,0.15);
  --border-strong: rgba(212,168,83,0.35);
  --glow: rgba(212,168,83,0.08);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-heading: 'Outfit', 'Noto Sans JP', sans-serif;
  --font-body: 'Noto Sans JP', -apple-system, sans-serif;

  /* Spacing */
  --section-gap: 5rem;
  --container-width: 1200px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
  --radius-sm: 8px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  line-height: 1.85;
  color: var(--text-primary);
  background: var(--midnight);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

/* ── Container ── */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
.header.scrolled {
  background: rgba(13,17,23,0.97);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.header-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.site-logo a { color: inherit; }
.site-logo .icon { margin-right: 0.4rem; font-size: 1.3rem; }

/* Navigation */
.nav { display: flex; align-items: center; }
.nav-list { display: flex; list-style: none; gap: 0; flex-wrap: wrap; }
.nav-list li { position: relative; }
.nav-list a {
  display: block;
  padding: 0.5rem 0.7rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-list a:hover,
.nav-list a.active {
  color: var(--gold);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  transition: all 0.3s;
  border-radius: 2px;
}
.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  transition: all 0.3s;
  border-radius: 2px;
}
.hamburger.active span { opacity: 0; }
.hamburger.active::before { transform: translateY(7px) rotate(45deg); }
.hamburger.active::after { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero Section ── */
.hero {
  position: relative;
  height: 75vh;
  min-height: 500px;
  max-height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13,17,23,0.3) 0%,
    rgba(13,17,23,0.5) 50%,
    rgba(13,17,23,0.9) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 0 2rem;
}
.hero h1 {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  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);
  margin-bottom: 1rem;
  line-height: 1.3;
}
.hero p {
  font-size: 1.15rem;
  color: var(--pearl);
  margin-bottom: 2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.hero-cta {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background: linear-gradient(135deg, var(--gold), var(--brass));
  color: var(--midnight) !important;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50px;
  letter-spacing: 0.05em;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(212,168,83,0.3);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212,168,83,0.45);
  color: var(--midnight) !important;
}

/* ── Section Common ── */
section {
  padding: var(--section-gap) 0;
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
  padding: 0.3rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 50px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.8rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}
.stat-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 0 30px var(--glow);
  transform: translateY(-3px);
}
.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── Feature Cards ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.8rem;
}
.feature-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.feature-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.7rem;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
}
.feature-card .read-more {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}
.feature-card .read-more:hover { color: var(--gold-light); }

/* ── News Section ── */
.news-section {
  background: var(--cabinet);
  padding: var(--section-gap) 0;
}
.news-list {
  list-style: none;
  max-width: 900px;
  margin: 0 auto;
}
.news-item {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.news-item:hover {
  background: var(--glow);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 100px;
}
.news-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}
.news-title a { color: var(--text-primary); }
.news-title a:hover { color: var(--gold); }
.news-more {
  text-align: center;
  margin-top: 2rem;
}
.news-more a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold);
  border: 1px solid var(--border-strong);
  padding: 0.6rem 1.8rem;
  border-radius: 50px;
  transition: all var(--transition);
}
.news-more a:hover {
  background: rgba(212,168,83,0.1);
  border-color: var(--gold);
}

/* ── Topics Grid (for page links) ── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.topic-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  color: var(--text-primary);
}
.topic-card:hover {
  border-color: var(--gold-dim);
  background: var(--glass);
  color: var(--gold-light);
  transform: translateX(4px);
}
.topic-card .topic-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-dim);
  min-width: 2.5rem;
}
.topic-card .topic-name {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ── Main Content (article pages) ── */
.main-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 0;
}
.main-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}
.main-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.main-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 0.8rem;
}
.main-content p {
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.9;
}
.main-content ul,
.main-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}
.main-content li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}
.main-content blockquote {
  border-left: 3px solid var(--gold);
  background: var(--surface-elevated);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.main-content th {
  background: var(--surface-elevated);
  color: var(--gold);
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-strong);
}
.main-content td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.main-content tr:hover td {
  background: var(--glow);
}

/* ── Two Column Layout ── */
.two-column {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
}
.two-column .main-content {
  max-width: none;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
}
.sidebar-widget {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.sidebar-widget h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sidebar-widget ul {
  list-style: none;
}
.sidebar-widget li {
  margin-bottom: 0.5rem;
}
.sidebar-widget li a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition);
  display: block;
  padding: 0.3rem 0;
}
.sidebar-widget li a:hover { color: var(--gold); }

.sidebar-banner {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
  margin-bottom: 1.5rem;
}
.sidebar-banner:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.sidebar-banner img {
  width: 100%;
  height: auto;
}

/* ── Blog Cards ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.blog-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.blog-card-body {
  padding: 1.5rem;
}
.blog-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.blog-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.blog-card h3 a { color: inherit; }
.blog-card h3 a:hover { color: var(--gold); }
.blog-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Glossary ── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}
.glossary-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  transition: all var(--transition);
}
.glossary-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}
.glossary-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.glossary-card h3 a { color: inherit; }
.glossary-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.pagination a:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--glow);
}
.pagination .current {
  background: var(--gold);
  color: var(--midnight);
  border-color: var(--gold);
  font-weight: 700;
}

/* ── Footer ── */
.footer {
  background: var(--midnight);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}
.footer-grid {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
}
.footer-col h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom {
  max-width: var(--container-width);
  margin: 3rem auto 0;
  padding: 1.5rem 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Breadcrumb ── */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { margin: 0 0.4rem; }

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--midnight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  border: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 999;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(212,168,83,0.4);
}

/* ── Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .two-column {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: 3rem;
  }
  .header-container { height: 60px; }
  .hamburger { display: flex; }
  .nav-list {
    position: fixed;
    top: 0; right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--cabinet);
    flex-direction: column;
    padding: 80px 2rem 2rem;
    border-left: 1px solid var(--border);
    transition: right 0.4s ease;
    overflow-y: auto;
    z-index: 1000;
  }
  .nav-list.active { right: 0; }
  .nav-list a {
    padding: 0.8rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
  }
  .hero {
    height: 60vh;
    min-height: 400px;
  }
  .hero h1 { font-size: 1.8rem; }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .topics-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .container { padding: 0 1.2rem; }
  .main-content h1 { font-size: 1.4rem; }
  .main-content h2 { font-size: 1.2rem; }
  .news-item {
    flex-direction: column;
    gap: 0.3rem;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero { height: 50vh; min-height: 350px; }
}

/* ── Mobile Overlay ── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}
.mobile-overlay.active {
  display: block;
}

/* ── Print ── */
@media print {
  .header, .footer, .hamburger, .back-to-top, .sidebar { display: none; }
  body { background: #fff; color: #000; }
  .main-content { max-width: 100%; }
}

/* ── Overflow fix ── */
.main-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.main-content iframe {
  max-width: 100%;
}
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}
