:root {
  --page: #f8f9fa;
  --paper: #ffffff;
  --ink: #202122;
  --muted: #54595d;
  --line: #a2a9b1;
  --soft-line: #d8dde3;
  --panel: #f8f9fa;
  --panel-strong: #eaecf0;
  --link: #0645ad;
  --visited: #0b0080;
  --accent: #8a3a2b;
  --accent-2: #2f6f5e;
  --accent-3: #946f18;
  --focus: #36c;
  --shadow: 0 1px 2px rgba(32, 33, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(51, 102, 204, 0.45);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 8px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  transform: translateY(-140%);
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--soft-line);
  background: #f6f6f6;
  padding: 18px 16px;
}

.sidebar-inner {
  position: sticky;
  top: 18px;
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft-line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 11px, rgba(32, 33, 34, 0.12) 11px 13px, transparent 13px),
    repeating-linear-gradient(0deg, #202122 0 6px, #f8f9fa 6px 12px);
  border-radius: 50%;
}

.brand-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.nav-block {
  margin-top: 18px;
}

.nav-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--link);
  overflow-wrap: anywhere;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: var(--panel-strong);
  text-decoration: none;
}

.nav-list a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  background: var(--panel-strong);
}

.main-wrap {
  min-width: 0;
}

.top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 28px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
}

.top-line span {
  overflow-wrap: anywhere;
}

.article {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 34px 48px;
  background: var(--paper);
}

.article-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.article-eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 46px);
}

h2 {
  clear: both;
  margin: 34px 0 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 28px;
}

h3 {
  margin: 24px 0 8px;
  font-size: 21px;
}

p {
  margin: 0 0 14px;
}

.lead {
  font-size: 18px;
}

.note {
  border-left: 4px solid var(--accent-2);
  background: #f4faf8;
  padding: 12px 14px;
  margin: 18px 0;
}

.warning {
  border-left-color: var(--accent);
  background: #fff8f5;
}

.minor {
  color: var(--muted);
  font-size: 13px;
}

.infobox {
  float: right;
  width: min(330px, 42%);
  margin: 0 0 18px 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
}

.infobox-title {
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  background: var(--panel-strong);
}

.infobox img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--soft-line);
}

.caption {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.infobox dl,
.fact-table dl {
  margin: 0;
}

.infobox-row {
  display: grid;
  grid-template-columns: 42% 58%;
  border-top: 1px solid var(--soft-line);
}

.infobox dt,
.infobox dd {
  margin: 0;
  padding: 8px 10px;
}

.infobox dt {
  font-weight: 700;
  background: #f1f3f5;
}

.toc {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 16px;
  margin: 18px 0 22px;
}

.toc-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.toc ol {
  margin: 0;
  padding-left: 22px;
}

.toc li {
  margin: 3px 0;
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.wiki-panel {
  border: 1px solid var(--soft-line);
  background: var(--panel);
  padding: 14px 16px;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.wiki-panel h3:first-child,
.wiki-panel p:first-child {
  margin-top: 0;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}

.article-table th,
.article-table td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
}

.article-table th {
  background: var(--panel-strong);
  text-align: left;
}

.article-table caption {
  caption-side: bottom;
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.source-list,
.plain-list {
  margin: 0 0 16px;
  padding-left: 22px;
}

.source-list li,
.plain-list li {
  margin: 6px 0;
}

.source-list li:target,
.footnotes li:target {
  background: #fff3cd;
  outline: 2px solid #f2c94c;
}

.footnotes {
  clear: both;
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding-top: 14px;
  font-size: 13px;
}

.footnotes ol {
  padding-left: 22px;
}

.footnotes li {
  margin: 8px 0;
  padding: 3px 5px;
}

.backref {
  font-size: 12px;
}

.hero-media {
  width: min(760px, 100%);
  margin: 18px auto 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: clamp(220px, 34vw, 340px);
  object-fit: cover;
  background: var(--panel);
}

.hero-media figcaption,
.inline-media figcaption,
.poster-media figcaption {
  border-top: 1px solid var(--soft-line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  text-align: center;
}

.media-caption {
  color: var(--muted) !important;
  text-align: center !important;
}

.inline-media,
.poster-media {
  float: right;
  width: min(260px, 38%);
  margin: 4px 0 16px 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inline-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.poster-media {
  width: min(280px, 40%);
}

.poster-media img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f4f1ea;
}

.markdown-body::after {
  content: "";
  display: block;
  clear: both;
}

.period-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  margin: 18px 0;
}

.period-strip a {
  min-height: 86px;
  padding: 12px;
  border-right: 1px solid var(--soft-line);
  color: var(--ink);
  background: var(--panel);
}

.period-strip a:last-child {
  border-right: 0;
}

.period-strip strong {
  display: block;
  color: var(--accent);
}

.period-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.filter-button,
.quiz-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 4px;
  padding: 7px 11px;
}

.filter-button[aria-pressed="true"],
.quiz-button.correct {
  border-color: var(--accent-2);
  background: #e7f4ef;
  color: #134c3f;
}

.quiz-button.wrong {
  border-color: var(--accent);
  background: #fff0eb;
  color: #6d281d;
}

.timeline {
  position: relative;
  margin: 22px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 98px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--soft-line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 42px;
  position: relative;
  margin: 0 0 18px;
}

.timeline-year {
  color: var(--accent);
  font-weight: 700;
  text-align: right;
}

.timeline-card {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  border-radius: 4px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: 92px;
  top: 10px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  padding: 1px 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.tag.control {
  border-color: #d6b5ab;
  color: #7a3326;
  background: #fff5f2;
}

.tag.film {
  border-color: #b8c6df;
  color: #244e85;
  background: #f2f6ff;
}

.tag.society {
  border-color: #afd0c2;
  color: #225d4b;
  background: #f1faf6;
}

.tag.world {
  border-color: #d8c58d;
  color: #735510;
  background: #fff9e6;
}

.director-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.director-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  padding: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.director-card img {
  width: 128px;
  height: 168px;
  object-fit: cover;
  border: 1px solid var(--soft-line);
  background: var(--panel-strong);
}

.director-placeholder {
  display: grid;
  place-items: center;
  width: 128px;
  height: 168px;
  border: 1px solid var(--soft-line);
  background:
    linear-gradient(90deg, transparent 18px, rgba(255, 255, 255, 0.12) 18px 23px, transparent 23px),
    repeating-linear-gradient(0deg, #202122 0 12px, #4f555b 12px 24px);
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  text-align: center;
  padding: 8px;
}

.director-card h3 {
  margin-top: 0;
}

.director-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  margin: 18px 0;
}

.compare-section {
  padding: 14px 16px;
  min-width: 0;
}

.compare-section + .compare-section {
  border-left: 1px solid var(--line);
}

.compare-section h3 {
  margin-top: 0;
}

.quote-toggle {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 8px 0;
}

.quote-panel {
  border-left: 4px solid var(--accent-3);
  background: #fffaf0;
  padding: 10px 12px;
  margin: 6px 0 16px;
}

.quiz {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 16px;
  margin: 18px 0;
  border-radius: 4px;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.quiz-result {
  min-height: 26px;
  margin: 8px 0 0;
  font-weight: 700;
}

.search-box {
  width: min(420px, 100%);
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 8px 0 16px;
}

.source-card {
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--paper);
  padding: 12px 14px;
  margin: 10px 0;
}

.source-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.source-kind {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.criteria-meter {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.criteria-row {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 72px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  padding: 10px 12px;
  background: var(--panel);
}

.meter {
  height: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.meter span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-2), #76a58f);
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 34px 38px;
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--soft-line);
  font-size: 13px;
}

.hidden,
[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .sidebar-inner {
    position: static;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .nav-list a {
    padding: 7px 9px;
  }

  .article {
    padding: 22px 22px 42px;
  }

  .top-line {
    padding: 0 22px;
  }

  .period-strip,
  .columns,
  .director-grid,
  .compare {
    grid-template-columns: 1fr;
  }

  .period-strip a,
  .compare-section + .compare-section {
    border-right: 0;
    border-left: 0;
    border-top: 1px solid var(--soft-line);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .article {
    padding: 18px 14px 36px;
  }

  .top-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 9px 14px;
  }

  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 18px;
  }

  .inline-media,
  .poster-media {
    float: none;
    width: min(280px, 100%);
    margin: 14px auto 18px;
  }

  .timeline::before {
    left: 22px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-left: 48px;
  }

  .timeline-year {
    text-align: left;
  }

  .timeline-card::before {
    left: 15px;
  }

  .director-card {
    grid-template-columns: 1fr;
  }

  .director-card img {
    width: 100%;
    height: 230px;
  }

  .director-placeholder {
    width: 100%;
    height: 230px;
  }

.criteria-row {
    grid-template-columns: 1fr;
  }
}

.doc-space {
  height: 10px;
}
