@font-face {
  font-family: 'Linux Libertine';
  src: url('https://upload.wikimedia.org/wikipedia/commons/4/4c/Linux_Libertine_Fonts.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f8f9fa;
  color: #202122;
}

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

table {
  border-collapse: collapse;
}

a {
  color: blue;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

body.index {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

body.article {
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.6;
}

h1,
h2,
h3,
.panel h2 {
  font-weight: normal;
}

h1 {
  font-size: 32px;
  margin: 0 0 12px;
  border-bottom: 1px solid #a2a9b1;
}

h2 {
  font-size: 22px;
  margin-top: 32px;
  border-bottom: 1px solid #a2a9b1;
}

h3 {
  font-size: 18px;
  margin-top: 24px;
}

.header,
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #a2a9b1;
}

.header {
  padding: 18px 16px 20px;
  text-align: center;
}

.header p {
  margin: 6px 0 0;
  color: #54595d;
  font-size: 13px;
}

.topbar {
  padding: 6px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar img {
  height: 30px;
  cursor: pointer;
}

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo img {
  width: 270px;
  max-width: 90%;
  cursor: pointer;
}

.search-bar {
  margin-top: 14px;
}

.search-bar input,
.search-bar button {
  font-size: 13px;
  padding: 7px 8px;
}

.search-bar input {
  width: 320px;
  max-width: 90%;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
}

.search-bar button {
  margin-left: 6px;
  cursor: pointer;
}

.main {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 16px;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  background: #ffffff;
}

.panel {
  background: #ffffff;
  border: 1px solid #a2a9b1;
  padding: 12px;
}

.panel h2 {
  font-size: 18px;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #a2a9b1;
}

.articles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
}

.articles-list li {
  padding: 5px 0;
  border-bottom: 1px solid #eaecf0;
  font-size: 14px;
}

.tagline {
  font-size: 13px;
  color: #54595d;
  margin-bottom: 16px;
}

.page > p,
.page > ul,
.page > ol {
  margin: 0.5em 0 1em;
}

.page ul,
.page ol {
  padding-left: 1.6em;
}

.page li {
  margin: 0.3em 0;
}

h2 + p,
h3 + p {
  margin-top: 0.4em;
}

.infobox,
.toc,
.thumb {
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
}

.infobox,
.thumb {
  float: right;
  clear: right;
  margin: 0 0 20px 24px;
}

.infobox {
  width: 270px;
  font-size: 13px;
  line-height: 1.4;
}

.infobox th {
  background: #eaecf0;
  text-align: center;
  padding: 6px;
  font-weight: bold;
}

.infobox td {
  padding: 6px;
  border-top: 1px solid #a2a9b1;
  vertical-align: top;
}

.toc {
  width: 270px;
  padding: 8px;
  font-size: 13px;
  margin: 20px 0;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc li {
  padding-left: 1.2em;
  text-indent: -1.2em;
  line-height: 1.4;
}

.toc li ul {
  margin-top: 2px;
}

.toc summary {
  font-weight: bold;
  cursor: pointer;
  list-style: none;
}

.toc details > summary::-webkit-details-marker {
  display: none;
}

.toc details[open] summary {
  margin-bottom: 6px;
}

.thumb {
  width: 220px;
  padding: 3px;
  font-size: 12px;
}

.thumb.large {
  width: 260px;
}

.thumb img {
  width: 100%;
  cursor: pointer;
}

.thumb .caption {
  padding: 6px 4px 2px;
  line-height: 1.4;
}

.infobox + p,
.thumb + p {
  margin-top: 0;
}

.search-results,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-results {
  background: rgba(0, 0, 0, 0.55);
}

.search-results.hidden {
  display: none;
}

.search-results-box {
  background: #ffffff;
  width: 92%;
  max-width: 640px;
  max-height: 85%;
  border: 1px solid #a2a9b1;
  display: flex;
  flex-direction: column;
}

.search-results-header {
  padding: 8px 12px;
  border-bottom: 1px solid #a2a9b1;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#resultsList {
  padding: 8px 12px;
  overflow-y: auto;
  font-size: 14px;
}

.lightbox {
  background: rgba(0, 0, 0, 0.85);
  display: none;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
}

footer,
.footer {
  text-align: center;
  font-size: 12px;
  color: #54595d;
}

.footer {
  clear: both;
  border-top: 1px solid #a2a9b1;
  margin-top: 48px;
  padding-top: 16px;
}

.footer a {
  color: #0645ad;
}

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

.footer li {
  display: inline-block;
  margin: 0 10px 6px 0;
}

.clear {
  clear: both;
}

@media (max-width: 800px) {
  .main {
    grid-template-columns: 1fr;
  }

  .infobox,
  .toc,
  .thumb {
    float: none;
    width: 100%;
    margin: 0 0 20px;
  }

  .page {
    padding: 16px;
  }

  .footer li {
    display: block;
    margin: 6px 0;
  }
}

.article-preview {
  position: absolute;
  display: none;
  max-width: 340px;
  background: #ffffff;
  border: 1px solid #a2a9b1;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  z-index: 1000;
  pointer-events: none;
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
}

.article-preview img {
  float: right;
  max-width: 120px;
  margin: 0 0 6px 10px;
}

.preview-title {
  font-size: 16px;
  margin-bottom: 4px;
}

.preview-excerpt {
  margin: 0;
  color: #202122;
}
