:root {
  --link: #3366cc;
  --link-visited: #795cb2;
  --border: #a2a9b1;
  --bg: #ffffff;
  --bg-page: #f6f6f6;
  --bg-infobox: #f8f9fa;
  --text: #202122;
  --muted: #54595d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Linux Libertine", "Times New Roman", serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
}

.masthead {
  background: #1a2a44;
  color: #fff;
  padding: 18px 28px;
}
.masthead .site-title {
  font-size: 1.1em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 0 0 4px 0;
}
.masthead h1 {
  margin: 0;
  font-size: 2em;
  font-weight: normal;
}
.masthead .tagline {
  margin: 6px 0 0 0;
  font-style: italic;
  opacity: 0.85;
  font-size: 0.95em;
}

.layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

nav.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #eaecf0;
  border-right: 1px solid var(--border);
  min-height: 100vh;
  padding: 20px 14px;
  font-family: Arial, sans-serif;
  font-size: 0.92em;
}
nav.sidebar h2 {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 18px 0 8px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
nav.sidebar h2:first-child { margin-top: 0; }
nav.sidebar ul { list-style: none; margin: 0; padding: 0; }
nav.sidebar li { margin: 3px 0; }
nav.sidebar a { color: var(--link); text-decoration: none; display: block; padding: 3px 6px; border-radius: 3px; }
nav.sidebar a:hover { background: #dce0e8; text-decoration: underline; }
nav.sidebar a.current { font-weight: bold; background: #dce6f5; }

main {
  flex: 1;
  background: var(--bg);
  padding: 28px 40px 60px 40px;
  min-height: 100vh;
  border-right: 1px solid var(--border);
}

h1.page-title {
  font-size: 2.1em;
  font-weight: normal;
  border-bottom: 3px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.subtitle { color: var(--muted); font-style: italic; margin-bottom: 20px; }

main h2 {
  font-size: 1.5em;
  font-weight: normal;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-top: 36px;
}
main h3 {
  font-size: 1.15em;
  font-weight: bold;
  margin-top: 22px;
}

a { color: var(--link); }
a:visited { color: var(--link-visited); }

.infobox {
  float: right;
  width: 300px;
  margin: 0 0 20px 24px;
  border: 1px solid var(--border);
  background: var(--bg-infobox);
  font-family: Arial, sans-serif;
  font-size: 0.88em;
}
.infobox .infobox-title {
  background: #1a2a44;
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 1.15em;
  font-family: Georgia, serif;
}
.infobox .infobox-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: repeating-linear-gradient(45deg, #e2e5e9, #e2e5e9 10px, #eceef1 10px, #eceef1 20px);
  color: var(--muted);
  text-align: center;
  padding: 10px;
}
.infobox table { width: 100%; border-collapse: collapse; }
.infobox td, .infobox th {
  padding: 6px 8px;
  vertical-align: top;
  border-top: 1px solid #eee;
}
.infobox th { text-align: left; color: var(--muted); font-weight: normal; width: 38%; }

.photo-frame {
  display: inline-block;
  width: 46%;
  vertical-align: top;
  box-sizing: border-box;
  margin: 0 2% 18px 0;
}
.photo-link {
  display: block;
  cursor: zoom-in;
}
.wiki-photo {
  max-width: 100%;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 3px;
  display: block;
}
.photo-caption {
  font-family: Arial, sans-serif;
  font-size: 0.82em;
  color: var(--muted);
  margin: 6px 0 0 0;
}
@media (max-width: 640px) {
  .photo-frame {
    width: 100%;
    margin-right: 0;
  }
}

.media-placeholder {
  border: 2px dashed var(--border);
  background: #fafafa;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.85em;
  padding: 14px;
  text-align: center;
  margin: 14px 0;
  border-radius: 4px;
}

table.wiki-table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-family: Arial, sans-serif;
  font-size: 0.92em;
}
table.wiki-table th, table.wiki-table td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
}
table.wiki-table th { background: #eaecf0; }
table.wiki-table tr:nth-child(even) { background: #f8f9fa; }

.toc {
  background: var(--bg-infobox);
  border: 1px solid var(--border);
  display: inline-block;
  padding: 14px 24px;
  margin: 12px 0 24px 0;
  font-family: Arial, sans-serif;
  font-size: 0.9em;
}
.toc-title { font-weight: bold; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 20px; }

.stub-note {
  background: #fef6e7;
  border: 1px solid #e6d29e;
  padding: 10px 14px;
  font-family: Arial, sans-serif;
  font-size: 0.85em;
  margin: 16px 0;
  color: #6b5219;
}

.quote {
  border-left: 3px solid var(--border);
  padding-left: 14px;
  color: var(--muted);
  font-style: italic;
  margin: 16px 0;
}

footer.wiki-footer {
  clear: both;
  font-family: Arial, sans-serif;
  font-size: 0.8em;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 14px;
}

.clear { clear: both; }
