/* ==========================================================================
   PEPTID-WIKI - WIKIPEDIA.ORG MEDIAWIKI DESIGN SYSTEM
   Authentic Wikipedia Light Theme, Infoboxes, TOC, Sidebar & Typography
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Georgia:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --wiki-bg: #ffffff;
  --wiki-surface: #f8f9fa;
  --wiki-border: #a2a9b1;
  --wiki-border-light: #eaecf0;
  
  --wiki-text: #202122;
  --wiki-text-muted: #54595d;
  --wiki-link: #3366cc;
  --wiki-link-hover: #0645ad;
  --wiki-link-red: #ba0000;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Lato, Helvetica, Arial, sans-serif;
  --font-serif: 'Georgia', 'Linux Libertine', 'Times New Roman', serif;
}

/* Reset & Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  background-color: var(--wiki-surface);
}

body {
  background-color: var(--wiki-bg);
  color: var(--wiki-text);
  font-family: var(--font-sans);
  font-size: 0.875rem; /* 14px Wikipedia standard */
  line-height: 1.6;
  min-height: 100dvh;
}

a {
  color: var(--wiki-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--wiki-link-hover);
}

/* Top Header Bar */
.wiki-header {
  height: 50px;
  background: var(--wiki-bg);
  border-bottom: 1px solid var(--wiki-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.globe-icon {
  width: 32px;
  height: 32px;
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wiki-text-muted);
  font-family: var(--font-serif);
  font-weight: bold;
  font-size: 1rem;
}

.brand-text-main {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--wiki-text);
  font-weight: normal;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--wiki-text-muted);
}

/* Header Search */
.wiki-search-box {
  position: relative;
  width: 340px;
}

.wiki-search-input {
  width: 100%;
  padding: 0.4rem 0.6rem 0.4rem 2rem;
  border: 1px solid var(--wiki-border);
  border-radius: 2px;
  font-size: 0.85rem;
  outline: none;
  background: var(--wiki-surface);
}

.wiki-search-input:focus {
  background: #fff;
  border-color: var(--wiki-link);
}

.search-icon-fixed {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--wiki-text-muted);
}

/* Page Layout (Sidebar + Main Article) */
.wiki-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
}

/* Left Sidebar Navigation (#mw-panel) */
.wiki-sidebar {
  width: 175px;
  flex-shrink: 0;
  padding: 1.25rem 0.75rem;
  background: var(--wiki-surface);
  border-right: 1px solid var(--wiki-border-light);
  font-size: 0.8rem;
}

.sidebar-group {
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--wiki-text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--wiki-border-light);
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  margin-bottom: 0.35rem;
}

.sidebar-list a {
  color: var(--wiki-link);
}

/* Main Article Content Container (#content) */
.wiki-content {
  flex-grow: 1;
  background: var(--wiki-bg);
  padding: 1.5rem 2.5rem 3rem 2.5rem;
  min-width: 0;
}

/* Top Article Tabs Strip */
.article-tabs {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--wiki-border);
  margin-bottom: 1.25rem;
}

.tab-group {
  display: flex;
  gap: 0.25rem;
}

.tab-item {
  padding: 0.4rem 0.8rem;
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-border-light);
  border-bottom: none;
  font-size: 0.8rem;
  color: var(--wiki-link);
  cursor: pointer;
}

.tab-item.active {
  background: var(--wiki-bg);
  border-color: var(--wiki-border);
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
  color: var(--wiki-text);
  font-weight: bold;
}

/* Heading 1 (#firstHeading) */
.first-heading {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: normal;
  line-height: 1.2;
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 0.3rem;
  margin-bottom: 0.3rem;
}

.site-sub {
  font-size: 0.8rem;
  color: var(--wiki-text-muted);
  margin-bottom: 1.25rem;
}

/* Classic Wikipedia Floating Infobox Table */
.infobox {
  float: right;
  clear: right;
  width: 310px;
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-border);
  border-collapse: collapse;
  margin: 0 0 1rem 1.25rem;
  font-size: 0.82rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.infobox th, .infobox td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--wiki-border-light);
  vertical-align: top;
}

.infobox-title {
  background: #eaecf0;
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  padding: 0.6rem;
  font-family: var(--font-sans);
}

.infobox-image-box {
  text-align: center;
  background: #fff;
  padding: 1rem;
}

.infobox-section-header {
  background: #f2f2f2;
  font-weight: bold;
  text-align: center;
  font-size: 0.8rem;
  color: var(--wiki-text-muted);
}

.infobox label {
  font-weight: bold;
  color: var(--wiki-text-muted);
}

/* Table of Contents Box (#toc) */
.toc {
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-border);
  padding: 0.75rem 1.25rem;
  display: table;
  margin: 1.25rem 0 1.5rem 0;
  font-size: 0.82rem;
}

.toc-title {
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
}

.toc-toggle {
  font-weight: normal;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  color: var(--wiki-link);
  cursor: pointer;
}

.toc-list {
  list-style: none;
}

.toc-list li {
  margin-bottom: 0.25rem;
}

.toc-number {
  color: var(--wiki-text-muted);
  margin-right: 0.3rem;
}

/* Article Body Typography */
.article-body p {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.1rem;
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: normal;
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 0.2rem;
  margin: 2rem 0 0.8rem 0;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 1.5rem 0 0.6rem 0;
}

/* Reference Footnotes */
.ref-num {
  font-size: 0.75rem;
  vertical-align: super;
  line-height: 0;
  padding: 0 0.1rem;
}

.references-list {
  font-size: 0.8rem;
  color: var(--wiki-text-muted);
  padding-left: 1.25rem;
  margin-bottom: 2rem;
}

.references-list li {
  margin-bottom: 0.4rem;
}

/* Categories Bar (.catlinks) */
.catlinks {
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-border);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  margin-top: 2.5rem;
}

.catlinks-title {
  font-weight: bold;
  color: var(--wiki-text-muted);
  margin-right: 0.5rem;
}

/* SPPS Interactive Diagram in Article */
.wiki-diagram-box {
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-border);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

/* Footer */
.wiki-footer {
  background: var(--wiki-surface);
  border-top: 1px solid var(--wiki-border-light);
  padding: 2rem 0;
  font-size: 0.75rem;
  color: var(--wiki-text-muted);
  text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
  .wiki-sidebar {
    display: none;
  }
  .infobox {
    float: none;
    width: 100%;
    margin: 1rem 0;
  }
  .wiki-content {
    padding: 1.25rem;
  }
}
