/* Red Book of Westmarch — MediaWiki theme overlay */

/* Parchment background + noise */
body {
  background-color: #f3ead3 !important;
  background-image:
    radial-gradient(ellipse at top, rgba(255,250,235,0.6), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(180,150,90,0.18), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0 0.25 0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>") !important;
  font-family: 'EB Garamond', Georgia, serif !important;
  color: #3a2c1a !important;
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
}

/* Content area — book page frame */
#content, .vector-body {
  background: linear-gradient(180deg, #faf3e0, #f1e6c8) !important;
  border: 1px solid #c9b487 !important;
  border-radius: 6px !important;
  box-shadow: 0 0 0 1px #c9b487, 0 18px 50px -20px rgba(58,44,26,0.18) !important;
  margin: 2rem auto !important;
  max-width: 850px !important;
  padding: 2rem 2.5rem !important;
  position: relative !important;
}

/* Gold rules at top/bottom of content */
#content::before, #content::after {
  content: ""; position: absolute; left: 20px; right: 20px; height: 2px;
  background: linear-gradient(90deg, transparent, #6f5316, transparent);
}
#content::before { top: 14px; }
#content::after { bottom: 14px; }

/* Headings */
h1, .firstHeading, .mw-first-heading {
  font-family: 'Cinzel', serif !important;
  font-weight: 600 !important;
  color: #3a2c1a !important;
  letter-spacing: 0.02em !important;
  border-bottom: 1px solid #c9b487 !important;
}

h2, h3, h4 {
  font-family: 'Cinzel', serif !important;
  font-weight: 600 !important;
  color: #3a2c1a !important;
}

h2 { border-bottom: 1px solid #c9b487 !important; }
h3 { color: #5a4410 !important; }

/* Links */
a, a:visited, a.external, a.extiw {
  color: #7a1f1f !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(122,31,31,0.35) !important;
}
a:hover { border-bottom-color: #7a1f1f !important; }

/* Body text */
.mw-body-content, #bodyContent, #mw-content-text {
  font-family: 'EB Garamond', Georgia, serif !important;
  font-size: 1.1rem !important;
  line-height: 1.7 !important;
  color: #3a2c1a !important;
}

/* Paragraphs */
.mw-body-content p {
  margin: 0 0 1em !important;
  text-indent: 1.4em !important;
}
.mw-body-content p:first-child { text-indent: 0 !important; }

/* Drop cap on first paragraph of article body */
.mw-body-content .mw-parser-output > p:first-of-type::first-letter {
  font-family: 'Cinzel', serif !important;
  font-weight: 700 !important;
  float: left !important;
  font-size: 4.2rem !important;
  line-height: 0.85 !important;
  padding: 0.1em 0.12em 0 0 !important;
  background: linear-gradient(135deg, #b08a2e, #6f5316) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* Sidebar / navigation */
.vector-header, .mw-sidebar, .vector-toc {
  background: rgba(243,234,211,0.9) !important;
  border: 1px solid #c9b487 !important;
  border-radius: 3px !important;
}

.vector-menu-heading, .vector-menu-heading-label {
  font-family: 'EB Garamond', serif !important;
  font-variant: small-caps !important;
  letter-spacing: 0.12em !important;
  color: #5a4410 !important;
}

.vector-menu-content a, .vector-tab a, .vector-menu-tabs a {
  color: #5a4a32 !important;
  font-family: 'EB Garamond', serif !important;
  font-variant: small-caps !important;
  letter-spacing: 0.08em !important;
  border: none !important;
}
.vector-menu-content a:hover, .vector-tab a:hover, .vector-menu-tabs a:hover {
  color: #7a1f1f !important;
}

/* Top header bar */
.mw-header, .vector-header-end {
  background: transparent !important;
  border: none !important;
}

/* Site title (logo area) */
.mw-logo-wordmark, p.wiki-title {
  font-family: 'Cinzel', serif !important;
  font-weight: 700 !important;
  color: #3a2c1a !important;
  letter-spacing: 0.06em !important;
}

/* Search input */
#searchInput, .vector-search-box input {
  font-family: 'EB Garamond', serif !important;
  background: rgba(255,250,235,0.8) !important;
  border: 1px solid #c9b487 !important;
  border-radius: 3px !important;
  color: #3a2c1a !important;
}
#searchInput:focus { outline: 2px solid #6f5316 !important; border-color: #6f5316 !important; }

/* Footer */
#footer, .mw-footer {
  background: transparent !important;
  border-top: 1px solid #c9b487 !important;
  font-family: 'IM Fell English', serif !important;
  font-style: italic !important;
  color: #5a4a32 !important;
}

/* Page tabs */
.vector-menu-tabs, .vector-menu-tabs-echo {
  background: transparent !important;
}
.vector-menu-tabs li {
  background: transparent !important;
}
.vector-menu-tabs .selected a, .vector-menu-tabs .selected a:visited {
  color: #7a1f1f !important;
  border-bottom: 2px solid #6f5316 !important;
}

/* Table of contents */
.vector-toc, #toc {
  background: rgba(180,150,90,0.10) !important;
  border: 1px solid #c9b487 !important;
  border-radius: 3px !important;
  padding: 1rem 1.4rem !important;
  font-size: 0.95rem !important;
}
.vector-toc h2, #toc h2 {
  font-family: 'EB Garamond', serif !important;
  font-variant: small-caps !important;
  letter-spacing: 0.12em !important;
  color: #5a4410 !important;
  font-size: 1rem !important;
  border: none !important;
}

/* Edit section links */
.mw-editsection { font-size: 0.8rem !important; opacity: 0.6; }
.mw-editsection a { border: none !important; color: #5a4a32 !important; }

/* Code blocks */
pre, code, tt {
  background: rgba(180,150,90,0.10) !important;
  border: 1px solid #c9b487 !important;
  border-radius: 3px !important;
  font-family: 'Courier New', monospace !important;
  color: #3a2c1a !important;
}

/* Tables */
table.wikitable {
  background: rgba(255,250,235,0.8) !important;
  border: 1px solid #c9b487 !important;
}
table.wikitable th {
  background: rgba(180,150,90,0.15) !important;
  font-family: 'Cinzel', serif !important;
  color: #3a2c1a !important;
}
table.wikitable td { border: 1px solid #c9b487 !important; }

/* Thumbnail images */
.thumb, .thumbinner {
  background: rgba(255,250,235,0.9) !important;
  border: 1px solid #c9b487 !important;
  border-radius: 3px !important;
  padding: 0.5rem !important;
}
.thumbcaption {
  font-family: 'IM Fell English', serif !important;
  font-style: italic !important;
  color: #5a4a32 !important;
  font-size: 0.9rem !important;
}

/* Category links */
.catlinks {
  background: rgba(180,150,90,0.10) !important;
  border: 1px solid #c9b487 !important;
  border-radius: 3px !important;
}
.catlinks a { border: none !important; }

/* "This wiki is read-only" notice */
.mw-read-only-warning, .mw-readonly-warning {
  background: rgba(122,31,31,0.08) !important;
  border: 1px solid #7a1f1f !important;
  border-radius: 3px !important;
  font-family: 'IM Fell English', serif !important;
  font-style: italic !important;
  color: #7a1f1f !important;
}

/* Focus visible */
:focus-visible { outline: 2px solid #b08a2e !important; outline-offset: 2px !important; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Responsive */
@media (max-width: 640px) {
  #content, .vector-body {
    margin: 0.5rem 0 !important;
    padding: 1.25rem !important;
    border-radius: 0 !important;
    max-width: 100% !important;
  }
  .firstHeading, h1 { font-size: 1.5rem !important; }
  .mw-body-content { font-size: 1rem !important; }
}
