/* =============================================
   World Encyclopedia — Dynamic Article Style
   Dark/gold palette matching index.html
   ============================================= */
:root {
  --bg-deep: #0c0e14;
  --bg-card: #141721;
  --bg-card-hover: #1a1e2d;
  --cream: #f0ece2;
  --gold: #d4a574;
  --gold-dark: #b8925e;
  --red: #c44536;
  --text-primary: #e8e4dc;
  --text-secondary: #9a9590;
  --text-muted: rgba(240,236,226,0.35);
  --border: rgba(212,165,116,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Serif JP', 'Cormorant Garamond', serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.8;
}

/* NAV */
.article-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12,14,20,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.article-nav-inner {
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
}
.article-nav a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.85rem; transition: color 0.2s;
}
.article-nav a:hover { color: var(--gold); }
.article-nav .nav-site {
  font-weight: 600; color: var(--cream); letter-spacing: 0.05em;
}

/* ARTICLE CONTAINER */
.article-container {
  max-width: 860px; margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* META */
.article-meta {
  display: flex; gap: 1.2rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text-secondary);
  margin-bottom: 2rem; letter-spacing: 0.05em;
}
.article-meta span { display: flex; align-items: center; gap: 0.3rem; }

/* TITLE */
.article-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400; color: var(--cream);
  margin-bottom: 1rem; line-height: 1.3;
  letter-spacing: 0.02em;
}

/* DESCRIPTION */
.article-desc {
  font-size: 1.05rem; color: var(--text-secondary);
  margin-bottom: 2.5rem; padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  font-weight: 300; line-height: 1.8;
}

/* CONTENT */
.article-content h2 {
  font-size: 1.5rem; color: var(--gold);
  margin: 2.5rem 0 1rem; font-weight: 500;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.article-content h3 {
  font-size: 1.2rem; color: var(--cream);
  margin: 2rem 0 0.8rem; font-weight: 500;
}
.article-content p {
  margin-bottom: 1.2rem; font-weight: 300;
}
.article-content ul, .article-content ol {
  margin: 0.8rem 0 1.2rem 1.5rem;
}
.article-content li { margin-bottom: 0.4rem; font-weight: 300; }
.article-content strong { color: var(--cream); font-weight: 600; }
.article-content a {
  color: var(--gold); text-decoration: underline;
  text-underline-offset: 3px;
}
.article-content blockquote {
  border-left: 3px solid var(--gold-dark);
  padding: 1rem 1.5rem; margin: 1.5rem 0;
  background: var(--bg-card); border-radius: 0 6px 6px 0;
  font-style: italic; color: var(--text-secondary);
}

/* FAQ */
.faq-section { margin-top: 3rem; }
.faq-section h2 {
  font-size: 1.4rem; color: var(--gold);
  margin-bottom: 1.5rem;
}
.faq-item {
  border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 0.8rem; overflow: hidden;
}
.faq-q {
  width: 100%; padding: 1rem 1.4rem;
  background: var(--bg-card); border: none; color: var(--cream);
  font-size: 0.95rem; font-family: inherit;
  cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; text-align: left;
}
.faq-q:hover { background: var(--bg-card-hover); }
.faq-q .toggle { color: var(--gold); font-size: 1.2rem; flex-shrink: 0; }
.faq-a {
  padding: 0 1.4rem; max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7;
}
.faq-item.open .faq-a {
  max-height: 300px; padding: 1rem 1.4rem;
}
.faq-item.open .toggle { transform: rotate(45deg); }

/* CONTEXTUAL LINKS */
.contextual-links {
  margin-top: 2.5rem; padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-card), rgba(212,165,116,0.05));
  border: 1px solid var(--border); border-radius: 8px;
}
.contextual-links h4 {
  font-size: 0.9rem; color: var(--gold); margin-bottom: 1rem;
}
.contextual-links ul { list-style: none; padding: 0; }
.contextual-links li {
  margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-secondary);
}
.contextual-links a { color: var(--gold); text-decoration: none; }
.contextual-links a:hover { text-decoration: underline; }

/* SPIDER WEB ECOSYSTEM */
.ecosystem-footer {
  margin-top: 3rem; padding: 2rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px;
}
.ecosystem-footer h3 {
  font-size: 0.85rem; color: var(--gold);
  letter-spacing: 0.1em; margin-bottom: 1rem;
}
.ecosystem-links {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
}
.ecosystem-links a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.78rem; padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 3px;
  transition: all 0.2s;
}
.ecosystem-links a:hover {
  border-color: var(--gold); color: var(--gold);
}

/* ARTICLE FOOTER */
.article-footer {
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.article-footer p {
  font-size: 0.78rem; color: var(--text-muted);
}
.article-footer a { color: var(--gold-dark); text-decoration: none; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .article-container { padding: 2rem 1.2rem 3rem; }
  .article-nav-inner { padding: 0 0.5rem; }
}
