/* coolAId — Compact Hacker-News-inspired study portal stylesheet */

* {
  box-sizing: border-box;
}

body {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 10pt;
  background: #ffffff;
  margin: 8px;
  color: #111;
  line-height: 1.58;
}

.wrap {
  width: min(94%, 980px);
  margin: 0 auto;
  background: #f6f6ef;
}

/* Header bar */
.header {
  background: #ff6600;
  padding: 6px 10px;
  font-weight: bold;
  color: #000;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.header .brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #000;
  text-decoration: none;
  font-weight: bold;
  font-size: 10pt;
}

.header .brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #fff;
  color: #fff;
  font-size: 9pt;
  line-height: 1;
}

.header nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9pt;
  font-weight: normal;
}

.header nav a {
  color: #000;
  text-decoration: none;
}

.header nav a:hover,
.header nav a.active {
  text-decoration: underline;
}

.header nav a.active {
  font-weight: bold;
}

/* Main content */
.content {
  padding: 14px 16px 24px;
}

h1 {
  font-size: 13pt;
  margin: 0 0 8px;
  color: #000;
  line-height: 1.3;
}

h2 {
  font-size: 11pt;
  margin: 18px 0 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid #dcdcd0;
  color: #000;
}

h3 {
  font-size: 10pt;
  margin: 14px 0 6px;
  color: #222;
}

p {
  margin: 0 0 10px;
}

ul,
ol {
  margin: 4px 0 10px 20px;
  padding: 0;
}

li {
  margin-bottom: 5px;
}

a {
  color: #000;
}

a:hover {
  color: #ff6600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 8.8pt;
  background: #ecece2;
  padding: 1px 4px;
  border-radius: 3px;
}

pre {
  background: #ecece2;
  border: 1px solid #dcdcd0;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 3px;
  margin: 8px 0 12px;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  background: #fff;
  border-left: 3px solid #ff6600;
  color: #333;
}

blockquote p:last-child {
  margin-bottom: 0;
}

.intro {
  color: #555;
  margin: 0 0 14px;
}

/* HN-style index table */
table.hn-list {
  width: 100%;
  border-collapse: collapse;
}

table.hn-list .section-head {
  font-size: 9pt;
  font-weight: bold;
  color: #ff6600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 0 6px;
}

table.hn-list tr:first-child .section-head {
  padding-top: 2px;
}

table.hn-list .rank {
  color: #828282;
  padding-right: 8px;
  width: 24px;
  text-align: right;
  vertical-align: top;
}

table.hn-list .titleline a {
  color: #000;
  text-decoration: none;
  font-weight: bold;
}

table.hn-list .titleline a:hover {
  text-decoration: underline;
  color: #ff6600;
}

table.hn-list .subtext {
  font-size: 8.2pt;
  color: #666;
  padding-bottom: 9px;
}

/* Cards (glossary + chapter sections) */
.card {
  background: #fff;
  border: 1px solid #e2e2d6;
  padding: 11px 13px;
  margin-bottom: 10px;
  border-radius: 3px;
}

.card h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.label {
  font-size: 7.8pt;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ff6600;
  margin-bottom: 4px;
}

/* Chips for cross-linking glossary terms & chapters */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.chip {
  display: inline-block;
  font-size: 8.2pt;
  background: #fff;
  border: 1px solid #d8d8cc;
  padding: 2px 7px;
  border-radius: 3px;
  text-decoration: none;
  color: #222;
}

.chip:hover {
  border-color: #ff6600;
  color: #ff6600;
}

.chip-section {
  background: #ecece2;
  color: #555;
  border-color: #dcdcd0;
}

/* Search input */
input.filter {
  width: 100%;
  max-width: 400px;
  padding: 6px 9px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 9.5pt;
  background: #fff;
  border-radius: 2px;
}

.filter-meta {
  font-size: 8.2pt;
  color: #666;
  margin: -4px 0 12px;
}

/* Glossary definition list */
dl.glossary-list {
  margin: 0;
}

.entry {
  margin-bottom: 9px;
}

.entry dt {
  font-weight: bold;
  display: inline;
}

.entry dt a {
  color: #000;
  text-decoration: none;
  border-bottom: 1px dotted #999;
}

.entry dt a:hover {
  color: #ff6600;
  border-bottom-color: #ff6600;
}

.entry dd {
  display: inline;
  margin: 0;
  color: #222;
}

.entry dd::before {
  content: ": ";
  font-weight: bold;
}

/* Data tables inside chapters */
table.data,
.chapter-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 9pt;
  background: #fff;
}

table.data th,
table.data td,
.chapter-body table th,
.chapter-body table td {
  border: 1px solid #e2e2d6;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

table.data th,
.chapter-body table th {
  background: #f6f6ef;
  font-weight: bold;
}

/* Prev / Next navigation */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #dcdcd0;
  font-size: 9pt;
}

.pager a {
  color: #333;
  text-decoration: none;
}

.pager a:hover {
  text-decoration: underline;
  color: #ff6600;
}

/* Footer */
.foot {
  font-size: 8pt;
  color: #828282;
  padding: 10px 16px;
  border-top: 1px solid #dcdcd0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.foot a {
  color: #666;
}

/* Chapter body typography */
.chapter-body h2 {
  margin-top: 22px;
}

.chapter-body .callout {
  background: #fff;
  border: 1px solid #e2e2d6;
  border-left: 3px solid #ff6600;
  padding: 10px 12px;
  margin: 12px 0;
  border-radius: 3px;
}

@media (max-width: 640px) {
  body {
    margin: 4px;
    font-size: 9.5pt;
  }
  .wrap {
    width: 100%;
  }
  .content {
    padding: 12px;
  }
  .pager {
    flex-direction: column;
  }
}
