@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;600;700&display=swap');

:root {
  --color-primary: #1a1a2e;
  --color-secondary: #16213e;
  --color-accent: #c9a96e;
  --color-accent-light: #dfc397;
  --color-accent-dark: #a88a4e;
  --color-bg: #f8f6f3;
  --color-bg-white: #ffffff;
  --color-bg-card: #ffffff;
  --color-text: #2d2d2d;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-border: #e8e4df;
  --color-border-light: #f0ece7;
  --font-body: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-heading: 'Noto Serif JP', 'Yu Mincho', serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --max-width-wide: 1400px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.4;
  color: var(--color-primary);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== HEADER ========== */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-primary);
  font-weight: 700;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  white-space: nowrap;
}

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

.header-cta {
  background: var(--color-accent) !important;
  color: var(--color-primary) !important;
  padding: 8px 20px !important;
  border-radius: 4px;
  font-weight: 700 !important;
  transition: background 0.2s !important;
}

.header-cta:hover {
  background: var(--color-accent-light) !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-primary);
  z-index: 999;
  padding: 24px;
  overflow-y: auto;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav a {
  display: block;
  color: rgba(255,255,255,0.9);
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 16px;
}

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

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, #0f3460 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.12) 0%, transparent 70%);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px 90px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(201,169,110,0.15);
  border: 1px solid rgba(201,169,110,0.3);
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 24px;
  letter-spacing: 0.08em;
}

.hero h1 {
  color: #fff;
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.hero h1 .accent {
  color: var(--color-accent);
}

.hero p {
  color: rgba(255,255,255,0.75);
  font-size: 17px;
  line-height: 1.8;
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-accent-light);
  color: var(--color-primary);
  box-shadow: 0 4px 15px rgba(201,169,110,0.4);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ========== SECTIONS ========== */
.section {
  padding: 72px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 30px;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--color-accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

.section-title p {
  color: var(--color-text-light);
  font-size: 15px;
}

.section-alt {
  background: var(--color-bg-white);
}

/* ========== CATEGORY GRID ========== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.category-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card:hover::before {
  transform: scaleX(1);
}

.category-card h3 {
  font-size: 17px;
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 8px;
}

.category-card .count {
  font-size: 13px;
  color: var(--color-text-muted);
}

.category-card .arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.category-card:hover .arrow {
  opacity: 1;
}

/* ========== ARTICLE CARDS ========== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.article-card {
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

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

.article-card-thumb {
  height: 200px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.article-card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-accent);
}

.article-card-thumb .thumb-text {
  color: rgba(255,255,255,0.9);
  font-family: var(--font-heading);
  font-size: 18px;
  text-align: center;
  padding: 16px;
  line-height: 1.5;
}

.article-card-body {
  padding: 20px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent-dark);
  background: rgba(201,169,110,0.1);
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.article-card h3 {
  font-size: 16px;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card h3 a {
  color: var(--color-text);
}

.article-card h3 a:hover {
  color: var(--color-accent-dark);
}

.article-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ========== ARTICLE PAGE ========== */
.article-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.article-main {
  min-width: 0;
}

.article-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  margin-bottom: 24px;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

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

.breadcrumb span {
  margin: 0 6px;
}

/* Article Header */
.article-header {
  margin-bottom: 36px;
}

.article-header .category-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-dark);
  background: rgba(201,169,110,0.12);
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 14px;
}

.article-header h1 {
  font-size: 30px;
  line-height: 1.45;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Article Body */
.article-body {
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  padding: 40px 48px;
  box-shadow: var(--shadow-sm);
  line-height: 1.9;
}

.article-body h1 {
  font-size: 26px;
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--color-accent);
}

.article-body h2 {
  font-size: 22px;
  margin: 48px 0 20px;
  padding: 12px 0 8px;
  border-bottom: 2px solid var(--color-border);
  position: relative;
}

.article-body h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--color-accent);
}

.article-body h3 {
  font-size: 18px;
  margin: 36px 0 16px;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--color-secondary);
}

.article-body h4 {
  font-size: 16px;
  margin: 28px 0 12px;
  font-family: var(--font-body);
  font-weight: 700;
}

.article-body p {
  margin-bottom: 18px;
}

.article-body ul, .article-body ol {
  margin: 0 0 18px 20px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body strong {
  color: var(--color-primary);
  font-weight: 700;
}

.article-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--color-bg);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-light);
  font-size: 15px;
}

.article-body hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 36px 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.article-body th, .article-body td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
}

.article-body th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-family: var(--font-body);
}

.article-body td {
  background: var(--color-bg-white);
}

.article-body .headerlink {
  display: none;
}

/* TOC Sidebar */
.toc-widget {
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.toc-widget h4 {
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-accent);
  color: var(--color-primary);
}

.toc-widget .toc {
  font-size: 13px;
  line-height: 1.6;
}

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

.toc-widget .toc > ul > li > a {
  font-weight: 600;
  display: block;
  padding: 4px 0;
}

.toc-widget .toc li a {
  color: var(--color-text-light);
  display: block;
  padding: 3px 0;
  transition: color 0.15s;
}

.toc-widget .toc li a:hover {
  color: var(--color-accent-dark);
}

.toc-widget .toc ul ul {
  padding-left: 14px;
  margin: 2px 0;
}

.toc-widget .toc ul ul ul {
  padding-left: 14px;
}

/* Related Articles */
.related-section {
  margin-top: 48px;
}

.related-section h3 {
  font-size: 20px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-accent);
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.related-item {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: all 0.2s;
}

.related-item:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.related-item a {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.5;
  display: block;
}

.related-item a:hover {
  color: var(--color-accent-dark);
}

.related-item .keyword {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ========== CATEGORY PAGE ========== */
.category-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  padding: 48px 24px;
  text-align: center;
}

.category-hero h1 {
  color: #fff;
  font-size: 32px;
  margin-bottom: 12px;
}

.category-hero p {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
}

.category-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.category-articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.7);
  padding: 56px 0 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand .logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-primary);
  font-weight: 700;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

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

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  transition: color 0.2s;
}

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

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ========== MOBILE TOC TOGGLE ========== */
.toc-mobile-toggle {
  display: none;
  width: 100%;
  background: var(--color-accent);
  color: var(--color-primary);
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .article-page {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
    max-height: none;
    order: -1;
  }

  .toc-widget {
    display: none;
  }

  .toc-widget.active {
    display: block;
  }

  .toc-mobile-toggle {
    display: block;
  }

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

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero-inner {
    padding: 56px 20px 64px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    font-size: 15px;
  }

  .section {
    padding: 48px 0;
  }

  .section-title h2 {
    font-size: 24px;
  }

  .article-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .article-body {
    padding: 24px 20px;
  }

  .article-header h1 {
    font-size: 22px;
  }

  .category-articles {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .container, .container-wide {
    padding: 0 16px;
  }

  .hero-inner {
    padding: 40px 16px 48px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .article-body {
    padding: 20px 16px;
  }

  .article-body h2 {
    font-size: 19px;
  }

  .article-body h3 {
    font-size: 16px;
  }
}

/* ========== UTILITIES ========== */
.text-accent {
  color: var(--color-accent);
}

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Scroll to top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: var(--color-accent);
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  font-size: 20px;
  z-index: 100;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* Stats row */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 32px;
  flex-wrap: wrap;
}

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

.stat-item .number {
  display: block;
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-accent);
}

.stat-item .label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

/* Category page list */
.category-list-page {
  list-style: none;
}

.category-list-page li {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

.category-list-page li:last-child {
  border-bottom: none;
}

.category-list-page a {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-list-page a:hover {
  color: var(--color-accent-dark);
}

.category-list-page .arrow {
  color: var(--color-accent);
  transition: transform 0.2s;
}

.category-list-page a:hover .arrow {
  transform: translateX(4px);
}
