/* ========================================
   Manuscript Theme — Ancient parchment and handwriting
   Activated by html.theme-manuscript
   ======================================== */

.theme-manuscript {
  --bg-primary: #f0e6d3;
  --bg-secondary: #e5d9c3;
  --bg-card: #f0e6d3;
  --text-primary: #3a2a1a;
  --text-secondary: #5a4a3a;
  --text-body: #4a3a2a;
  --text-muted: #8a7a6a;
  --accent: #8b2500;
  --accent-hover: #a53000;
  --border: #c4b49a;
  --border-accent: #8b2500;
  --font-display: 'Long Cang', 'Caveat', cursive;
  --font-body: 'Noto Serif SC', 'Georgia', 'Times New Roman', serif;
  --font-code: 'Courier New', monospace;
  --font-size-hero: 3.5rem;
  --font-size-xl: 2.5rem;
  --font-weight-bold: 700;
  --line-height-body: 1.8;
  --radius: 0;
}

/* Parchment texture */
.theme-manuscript body {
  background-image: url("data:image/svg+xml,%3Csvg width='300' height='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='parchment'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23parchment)' opacity='0.05'/%3E%3C/svg%3E");
}

/* Aged edge vignette */
.theme-manuscript body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(139, 37, 0, 0.05) 100%);
}

.theme-manuscript .site-nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.theme-manuscript .nav-prompt { display: none; }
.theme-manuscript .nav-site-title { display: inline; }

.theme-manuscript .nav-home {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  color: var(--text-primary);
  font-weight: 700;
}

.theme-manuscript .nav-home:hover { color: var(--accent); }

.theme-manuscript .nav-link {
  font-family: var(--font-body);
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.03em;
  border-bottom: none;
  font-style: italic;
}

.theme-manuscript .nav-link::before { content: none; }
.theme-manuscript .nav-link:hover,
.theme-manuscript .nav-link.active {
  color: var(--accent);
  border-bottom: none;
}

.theme-manuscript .hero-ascii { display: none; }
.theme-manuscript .hero-text { display: inline; }
.theme-manuscript .hero-cursor { display: none; }

.theme-manuscript .hero {
  text-align: center;
}

.theme-manuscript .hero-title {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  color: var(--text-primary);
}

.theme-manuscript .hero-tagline {
  font-style: italic;
  color: var(--text-muted);
  animation: none;
  white-space: normal;
  overflow: visible;
}

/* Red annotation style section titles */
.theme-manuscript .section-title {
  font-family: 'Caveat', cursive;
  color: var(--accent);
  border-bottom: none;
  font-size: var(--font-size-xl);
  position: relative;
  display: inline-block;
}

.theme-manuscript .section-title::before { content: none; }

.theme-manuscript .section-title::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: var(--accent);
  margin-top: 2px;
  opacity: 0.5;
}

.theme-manuscript .post-item { border-bottom: 1px solid var(--border); }
.theme-manuscript .post-item::before { content: none; }
.theme-manuscript .post-item a::after { content: none; }
.theme-manuscript .post-item a { color: var(--text-primary); }
.theme-manuscript .post-item a:hover { color: var(--accent); }

/* Margin annotation style for dates */
.theme-manuscript .post-item time {
  font-family: 'Caveat', cursive;
  color: var(--accent);
  font-size: 1rem;
  opacity: 0.7;
}

.theme-manuscript .card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
}

.theme-manuscript .card:hover { border-color: var(--accent); transform: none; }
.theme-manuscript .card-title { font-family: 'Caveat', cursive; font-size: 1.5rem; }

.theme-manuscript .story-link {
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
}

.theme-manuscript .story-link::before { content: none; }

/* Wax seal decoration */
.theme-manuscript .story-link::after {
  content: '印';
  position: absolute;
  bottom: var(--spacing-md);
  right: var(--spacing-lg);
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #f0e6d3;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  transform: rotate(-15deg);
  opacity: 0.7;
}

.theme-manuscript .story-link h2 {
  font-family: 'Caveat', cursive;
  font-size: 3rem;
  color: var(--text-primary);
}

.theme-manuscript .story-link:hover { background: var(--bg-secondary); transform: none; }
.theme-manuscript .story-link:hover h2 { color: var(--accent); }

.theme-manuscript .story-label { display: none; }
.theme-manuscript .story-enter { font-family: 'Caveat', cursive; color: var(--accent); font-size: 1.25rem; display: block; margin-top: var(--spacing-md); }

.theme-manuscript .story-title { font-family: 'Caveat', cursive; color: var(--accent); border-bottom: none; }
.theme-manuscript .story-section-card { border-color: var(--border); }
.theme-manuscript .story-section-card:hover { border-color: var(--accent); }
.theme-manuscript .story-section-card .card-title { font-family: 'Caveat', cursive; }
.theme-manuscript .chapter-label { font-family: 'Caveat', cursive; color: var(--accent); font-size: 1.25rem; }
.theme-manuscript .chapter-item::before { content: none; }

.theme-manuscript .character-card { border: 1px solid var(--border); }
.theme-manuscript .character-card:hover { border-color: var(--accent); }
.theme-manuscript .character-name { font-family: 'Caveat', cursive; color: var(--text-primary); font-size: 1.25rem; }
.theme-manuscript .character-name::before { content: none; }
.theme-manuscript .character-img { filter: sepia(30%); transition: filter 0.3s; }
.theme-manuscript .character-card:hover .character-img { filter: sepia(10%); }
.theme-manuscript .character-placeholder { background: linear-gradient(135deg, var(--bg-secondary), var(--border)); color: var(--accent); font-family: 'Caveat', cursive; font-size: 3rem; }

.theme-manuscript .article-title { font-family: 'Caveat', cursive; text-align: center; font-size: 3rem; }
.theme-manuscript .article-meta { justify-content: center; font-style: italic; }

.theme-manuscript .article-content > p:first-of-type::first-letter {
  float: left;
  font-family: 'Georgia', serif;
  font-size: 4rem;
  line-height: 0.8;
  padding: 0.05em 0.1em 0 0;
  color: var(--accent);
}

.theme-manuscript .article-content blockquote {
  border-left: 2px solid var(--accent);
  font-style: italic;
}

.theme-manuscript .article-content pre {
  background: #3a2a1a;
  color: #d4c4a4;
  border: none;
}

.theme-manuscript .article-content a { color: var(--accent); }

.theme-manuscript .theme-toggle { background: var(--bg-secondary); border: 1px solid var(--border); }
.theme-manuscript .theme-dropdown { background: var(--bg-primary); border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

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

.theme-manuscript .site-footer { border-top: 1px solid var(--border); }
.theme-manuscript .toc { border: 1px solid var(--border); background: var(--bg-secondary); }

@media (max-width: 640px) {
  .theme-manuscript {
    --font-size-hero: 2.5rem;
    --font-size-xl: 1.75rem;
  }
  .theme-manuscript .story-link h2 { font-size: 2rem; }
  .theme-manuscript .story-link::after { display: none; }
}
