/* ===========================================================
   No Citations Needed..
   A Timeless-skin-inspired theme: light blue-grey sidebar,
   near-white article pages, a thin colour accent for a bit of
   fun against an otherwise plain, professional, library feel.
   =========================================================== */

:root {
  --bg-sidebar: #eaf1f8;
  --bg-content: #ffffff;
  --bg-paper: #f8f9fa;     /* photo mats + infobox background, wikipedia-grey */

  --ink: #202122;
  --ink-muted: #54595d;
  --border: #c8ccd1;
  --border-soft: #dde3ea;

  --accent: #2f6ea8;       /* the "fun" colour accent */
  --accent-light: #d9ebfa;
  --accent-dark: #1d4a75;

  /* classic wikipedia link colours */
  --wiki-link: #0645ad;
  --wiki-link-visited: #795cb2;

  --sidebar-width: 250px;
  --content-max: 850px;

  --font-heading: "Linux Libertine", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans Pro", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-content);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

/* ---------- layout shell ---------- */

.wiki-layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* ---------- sidebar ---------- */

.sidebar, .sidebar-right {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1.1rem;
}

.sidebar { border-right: 1px solid var(--border-soft); z-index: 40; }
.sidebar-right { border-left: 1px solid var(--border-soft); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 3px solid var(--accent);
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
}

.sidebar-logo img { width: 40px; height: 40px; flex-shrink: 0; }

.sidebar-logo span {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.sidebar-nav h2, .sidebar-right h2 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--accent);
}

.sidebar-search { position: relative; margin-bottom: 1.1rem; }

.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: #ffffff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
}

.sidebar-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(30, 40, 60, 0.12);
  max-height: 260px;
  overflow-y: auto;
  display: none;
  z-index: 55;
}

.search-results.open { display: block; }

.search-results a {
  display: block;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-soft);
}

.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--accent-light); text-decoration: none; }

.search-results .search-empty {
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.sidebar-nav ul, .sidebar-right ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li, .sidebar-right li { margin-bottom: 0.15rem; }

.sidebar-nav a, .sidebar-right a {
  display: block;
  padding: 0.4rem 0.35rem;
  font-size: 0.94rem;
}

.sidebar-nav a:hover, .sidebar-right a:hover { background: var(--accent-light); text-decoration: none; }

.lang-hint {
  margin: 0.9rem 0 0;
  font-size: 0.76rem;
  font-style: italic;
  color: var(--ink-muted);
}

/* ---------- mobile off-canvas toggle ---------- */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 60;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 45, 0.35);
  z-index: 30;
}

/* ---------- content ---------- */

.content {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 3rem 4rem;
  border-top: 4px solid var(--accent);
}

.page-title {
  font-size: 2.1rem;
  margin: 0 0 0.3rem;
}

.page-byline {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.page-content h2 {
  font-size: 1.4rem;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0.3rem;
  margin-top: 2rem;
}

.page-content p { margin: 0 0 1rem; }

.page-content .stub-notice {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}

/* ---------- infobox: paper card, receipt-style dotted rules ---------- */

.infobox {
  float: right;
  width: 260px;
  margin: 0 0 1rem 1.75rem;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  overflow: hidden;
  font-size: 0.87rem;
}

.infobox h2 {
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 1.05rem;
  text-align: center;
  border-bottom: 2px solid var(--accent);
}

.infobox .photo-frame { margin: 0.6rem auto 0; }

.infobox table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }

.infobox th, .infobox td {
  text-align: left;
  padding: 0.4rem 0.75rem;
  border-top: 1px dotted var(--border);
  vertical-align: top;
}

.infobox tr:first-child th, .infobox tr:first-child td { border-top: none; }

.infobox th {
  width: 40%;
  color: var(--ink-muted);
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.infobox-caption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
  padding: 0.3rem 0.75rem 0.7rem;
}

/* ---------- photo-frame: paper mat + polaroid-style corner mounts ---------- */

.photo-frame {
  position: relative;
  display: block;
  width: calc(100% - 1.2rem);
  margin: 0 auto;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
}

.photo-frame img {
  display: block;
  width: 100%;
}

.photo-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.photo-corner.tl { top: 6px; left: 6px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.photo-corner.tr { top: 6px; right: 6px; clip-path: polygon(100% 0, 100% 100%, 0 0); }
.photo-corner.bl { bottom: 6px; left: 6px; clip-path: polygon(0 100%, 0 0, 100% 100%); }
.photo-corner.br { bottom: 6px; right: 6px; clip-path: polygon(100% 100%, 0 100%, 100% 0); }

/* ---------- categories ---------- */

.page-categories {
  clear: both;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.category-tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  margin: 0 0.4rem 0.4rem 0;
  background: var(--accent-light);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--accent-dark);
}

.category-tag:hover { text-decoration: none; background: #c9e2f6; }

/* ---------- contents page (grouped listing) ---------- */

.listing-group h2 { margin-top: 2rem; }
.listing-group ul { padding-left: 1.2rem; }
.listing-group li { margin-bottom: 0.3rem; }

/* ---------- responsive ---------- */

@media (max-width: 840px) {
  .sidebar-toggle { display: block; }

  .wiki-layout { flex-direction: column; }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    transition: left 0.22s ease;
  }

  .sidebar.open { left: 0; }

  .sidebar-overlay.open { display: block; }

  .sidebar-right {
    position: static;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 3px solid var(--accent);
    padding: 1.25rem 1.5rem;
  }

  .sidebar-right h2 { text-align: center; }

  .sidebar-right ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1rem;
  }

  .sidebar-right li { margin-bottom: 0; }

  .lang-hint { text-align: center; }

  .content-inner { padding: 4.5rem 1.25rem 3rem; }

  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 1.25rem;
  }
}
