/* ==========================================================================
   Market Info - shared stylesheet
   Every page links this file. Change the look here once and all pages follow.
   Style: white background, black Arial text, bold where needed.
   ========================================================================== */

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* ---------- Return arrow (size and margins set in kb_config.js) ---------- */
.return-arrow {
  position: fixed;
  top: var(--ra-top, 18pt);
  left: var(--ra-left, 18pt);
  width: var(--ra-size, 48px);
  height: var(--ra-size, 48px);
  z-index: 100;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.return-arrow:hover,
.return-arrow:focus-visible { transform: scale(1.08); }
.return-arrow img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Top arrow (added by kb_common.js; size and margins in kb_config.js) ---------- */
.top-arrow {
  position: fixed;
  top: var(--ta-top, 18pt);
  right: var(--ta-right, 18pt);
  width: var(--ta-size, 48px);
  height: var(--ta-size, 48px);
  z-index: 100;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.top-arrow:hover,
.top-arrow:focus-visible { transform: scale(1.08); }
.top-arrow img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Page header ---------- */
header {
  border-bottom: 3px solid #000000;
  padding-bottom: 20px;
  margin-bottom: 32px;
}
header h1 {
  margin: 0 0 8px;
  font-size: 36px;
  font-weight: bold;
  letter-spacing: 0.5px;
}
header p {
  margin: 0;
  font-size: 18px;
}

/* ---------- Headings and text ---------- */
h2 {
  font-size: 24px;
  font-weight: bold;
  margin: 48px 0 20px;
}
.intro { margin: 0 0 24px; max-width: 820px; }
.note {
  margin: 14px 0 0;
  font-size: 14px;
  font-style: italic;
}
.asof { font-weight: normal; font-size: 16px; }

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.card {
  border: 1px solid #cccccc;
  border-top: 4px solid #000000;
  border-radius: 6px;
  padding: 24px;
  background: #ffffff;
}
.card .photo {
  margin: -8px -8px 16px;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
}
.card .photo img {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  margin: 0 auto;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: bold;
}
.card .class {
  margin: 0 0 18px;
  font-style: italic;
}
.card dl { margin: 0; }
.card dt {
  font-weight: bold;
  margin-top: 12px;
}
.card dd { margin: 4px 0 0; }
.card .desc { margin: 0; }
.card h3 + .stats { margin-top: 14px; }
.card ul { margin: 6px 0 0; padding-left: 20px; }
.card li { margin-bottom: 4px; }

/* ---------- Full-width row cards: <div class="rows"><article class="card row-card"> ----------
   One header line (name + facts in aligned columns) and at most 2 text lines.
   Extra details go in <div class="more">. kb_common.js adds the expand icon
   when a card has hidden content; expanded cards show everything. */
.rows {
  display: grid;
  gap: 12px;
}
.card.row-card {
  position: relative;
  padding: 12px 54px 14px 22px;
}
.row-head {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) repeat(3, minmax(0, 1fr));
  gap: 2px 22px;
  align-items: baseline;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid #e0e0e0;
}
.row-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}
.row-head h3,
.fact {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fact .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}
.fact .value {
  font-size: 15px;
  font-weight: bold;
}
.row-card .desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.row-card .more { display: none; }
.row-card dt { margin-top: 10px; }

/* Expanded card: full facts, full text, extra details */
.row-card.expanded .row-head h3,
.row-card.expanded .fact { white-space: normal; }
.row-card.expanded .desc {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: none;
}
.row-card.expanded .more { display: block; }

/* Expand icon (top-right corner) */
.expand-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1.5px solid #000000;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.expand-btn:hover,
.expand-btn:focus-visible { background: #f0f0f0; }
.expand-btn[hidden] { display: none; }
.expand-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}
.row-card.expanded .expand-btn svg { transform: rotate(180deg); }

/* ---------- Title boxes: <article class="card row-card title-box"> ----------
   Thin border, one line (title + origin date), expand icon on the right side.
   All text goes in <div class="more"> and shows when the box is expanded. */
.card.row-card.title-box {
  border: 1px solid #b0b0b0;
  border-radius: 6px;
  padding: 10px 54px 10px 20px;
}
.title-line {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 4px 24px;
  align-items: baseline;
  cursor: pointer;
}
.title-line h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}
.title-line h3,
.origin {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.origin .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}
.origin .value { font-size: 15px; font-weight: bold; }
.title-box.expanded .title-line h3,
.title-box.expanded .origin { white-space: normal; }
.title-box .more p { margin: 0; }
.title-box.expanded .more {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}
.title-box .expand-btn { top: 10px; }

/* Timeline list inside a box: <dl class="tl-list"><dt>date</dt><dd>event</dd> */
.card dl.tl-list {
  display: grid;
  grid-template-columns: minmax(150px, max-content) minmax(0, 1fr);
  margin: 0;
}
.tl-list dt,
.tl-list dd {
  margin: 0;
  padding: 7px 0;
  border-top: 1px solid #eeeeee;
}
.tl-list dt:first-of-type,
.tl-list dt:first-of-type + dd { border-top: 0; padding-top: 0; }
.tl-list dt { font-weight: bold; padding-right: 24px; white-space: nowrap; }
.tl-link { margin: 10px 0 0; font-size: 14px; }
.tl-list ul.steps { margin: 0; padding-left: 20px; }
.tl-list ul.steps li { margin-bottom: 2px; }

/* Small inline table inside a box (e.g. a °C / °F quick reference) */
table.mini-table { width: auto; font-size: 15px; }
.mini-table td {
  padding: 3px 14px;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
}
.mini-table td:first-child { text-align: left; padding-left: 0; }

/* Intro line with an "Expand all" button on the right */
.intro-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.intro-bar .intro { margin: 0; }
.expand-all {
  flex: none;
  border: 1px solid #000000;
  border-radius: 14px;
  padding: 3px 14px;
  background: #ffffff;
  color: #000000;
  font: bold 14px Arial, Helvetica, sans-serif;
  cursor: pointer;
}
.expand-all:hover,
.expand-all:focus-visible { background: #f0f0f0; }
.expand-all[hidden] { display: none; }
/* Added by kb_common.js: right end of the section links, or its own bar under the header */
.section-nav .expand-all { margin-left: auto; }
.expand-all-bar {
  display: flex;
  justify-content: flex-end;
  margin: -12px 0 12px;
}

/* ---------- Large images: <figure class="figure"> (add "wide" to go past the page width) ---------- */
.figure { margin: 0; }
.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #cccccc;
  border-radius: 6px;
}
.figure a { display: block; cursor: zoom-in; }
.figure.wide {
  position: relative;
  left: 50%;
  width: calc(min(100vw, 1800px) - 48px);
  transform: translateX(-50%);
}

/* ---------- Section navigation, cross-links ---------- */
html { scroll-behavior: smooth; }
h2[id] { scroll-margin-top: 20px; }
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: -12px 0 8px;
}
.section-nav a {
  border: 1px solid #000000;
  border-radius: 14px;
  padding: 3px 14px;
  color: #000000;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.15s ease;
}
.section-nav a:hover,
.section-nav a:focus-visible { background: #f0f0f0; }
.xref {
  color: #000000;
  font-weight: bold;
  text-decoration: underline;
  white-space: nowrap;
}

/* ---------- Timeline: <div class="timeline"><div class="era"> ---------- */
.timeline {
  border-left: 3px solid #000000;
  margin-left: 6px;
  padding-left: 24px;
}
.era { position: relative; }
.era + .era { margin-top: 26px; }
.era-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: bold;
}
.era-title::before {
  content: "";
  position: absolute;
  left: -36px;  /* centered on the 3px timeline line */
  top: 3px;
  width: 15px;
  height: 15px;
  border: 3px solid #000000;
  border-radius: 50%;
  background: #ffffff;
}
.era-dates {
  font-size: 15px;
  font-weight: normal;
  margin-left: 8px;
}

/* ---------- Compact cards (short title + text) ---------- */
.card.compact { padding: 16px 22px; }
.card.compact h3 { font-size: 18px; margin-bottom: 6px; }

/* ---------- Stat boxes ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stats.two { grid-template-columns: repeat(2, 1fr); }
.stat {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 10px 12px;
}
.stat .label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat .value {
  display: block;
  font-size: 15px;
  font-weight: bold;
  margin-top: 2px;
}

/* ---------- Tables ---------- */
.table-title {
  font-size: 18px;
  font-weight: bold;
  margin: 36px 0 12px;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #dddddd;
  white-space: nowrap;
}
thead th {
  border-bottom: 2px solid #000000;
  font-weight: bold;
}
tbody td:first-child { font-weight: bold; }
/* Tables with long text: <div class="table-wrap wrap"> lets cells wrap */
.wrap td { white-space: normal; vertical-align: top; }
.wrap td:first-child { min-width: 170px; }
.wrap td:last-child { min-width: 320px; }
.wrap td.nowrap { white-space: nowrap; }
tbody tr:nth-child(even) { background: #f7f7f7; }
.status {
  display: inline-block;
  border: 1px solid #000000;
  border-radius: 10px;
  padding: 1px 10px;
  font-size: 13px;
  font-weight: bold;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid #cccccc;
  font-size: 13px;
}

/* ---------- Home page (index.html, <body class="home">) ---------- */
.home header { text-align: center; }
.home header h1 {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 20pt;
  font-weight: 900;
}
.home header p { font-size: 16px; }
.home footer { text-align: center; }
.letter {
  font-size: 22px;
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cccccc;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.entry a {
  display: block;
  border: 1px solid #cccccc;
  border-left: 4px solid #000000;
  border-radius: 6px;
  padding: 18px 22px;
  color: #000000;
  text-decoration: none;
  background: #ffffff;
  transition: background 0.15s ease;
}
.entry a:hover,
.entry a:focus-visible { background: #f7f7f7; }
/* Entry: name, description and "Added" date on one single line */
.entry a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 20px;
  align-items: baseline;
  padding: 12px 22px;
}
.entry .name {
  font-size: 19px;
  font-weight: bold;
  white-space: nowrap;
}
.entry .desc {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry .date {
  font-size: 13px;
  white-space: nowrap;
}

/* ---------- Phone screens ---------- */
@media (max-width: 760px) {
  .page { padding: 32px 16px 48px; }
  header h1 { font-size: 28px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row-head { grid-template-columns: 1fr 1fr; }
  .row-head h3 { grid-column: 1 / -1; margin-bottom: 4px; }
  .title-line { grid-template-columns: 1fr; }
  .card dl.tl-list { grid-template-columns: 1fr; }
  .tl-list dd { border-top: 0; padding-top: 0; }
  .tl-list dt { white-space: normal; }
  .intro-bar { flex-direction: column; }
  .entry a { grid-template-columns: minmax(0, 1fr) auto; }
  .entry .name { grid-column: 1 / -1; }
}
