a:hover {
    text-decoration: underline
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
    height: 1.8rem;
    width: auto;
}

.mermaid {
    text-align: center;
 }

/* Hide Jupyter notebook execution numbers */
.jp-InputPrompt,
.jp-OutputPrompt {
    display: none !important;
}

/* Hide In/Out prompts in code cells */
div.highlight pre span.gp {
    display: none !important;
}

/* fix some horrible jupyter cell margins */
.jp-Cell h1 {
    margin-bottom: 10px;
}

.jp-Cell h2 {
    margin-top: 20px;
    margin-bottom: 5px;
}

.jp-Cell p {
    margin-top: 5px;
    margin-bottom: 5px;
}

.tabbed-content {
    /* background-color: rgb(255, 252, 252); */
    /* border: 1px solid #edecec; */
    border-radius: 1%;
    padding: 0.5rem;
}


.md-grid {
    max-width: 95%;
}

.md-sidebar--secondary {
    min-width: 30%;
  }

/* .md-content {
    max-width: 50%;
}

.md-sidebar {
    max-width: 100%;
} */

/* .md-typeset h1 {
    font-size: 3em;
}


.md-typeset h2 {
    font-size: 2em;
}


.md-typeset h3 {
    font-size: 1.5em;
} */

/* .md-typeset p {
    font-size: 1em;
} */

/* --- OWID: code to allow expanding and collapsing code blocks --- */

.md-typeset .jp-Cell-inputWrapper {
  display: block !important;        /* drop the grid that reserves a left column */
}

.md-typeset .jp-Collapser,
.md-typeset .jp-InputPrompt {
  display: none !important;         /* hide collapser + prompt elements */
}

.md-typeset .jp-InputArea {
  margin-left: 0 !important;        /* ensure code starts flush with content */
}

/* (nbsphinx/legacy structure fallback, harmless if unused) */
.md-typeset .nbinput .prompt { display: none !important; }
.md-typeset .nbinput .input_area { margin-left: 0 !important; }

/* --- OWID: tidy notebook code toggles ------------------------ */
.md-typeset .owid-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  margin: .25rem 0 .5rem;
  color: var(--md-default-fg-color--light);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: 0.8em;
}

.md-typeset .owid-toggle-btn::before {
  content: "▸";
  display: inline-block;
  font-size: 1.15em;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .15s ease-in-out;
}

.md-typeset .owid-toggle-btn[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.md-typeset .owid-collapsed {
  display: none !important;
}

.md-typeset .celltoolbar {
  display: none !important;
}

.cell-tag,
.jp-Tag {
  display: none !important;
}

/* Optional: accessibility nicety */
@media (prefers-reduced-motion: reduce) {
  .md-typeset .owid-toggle-btn::before {
    transition: none;
  }
}

/* --- CSV Data Table ------------------------------------------------ */

.csv-table {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.csv-table-scroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--md-typeset-table-color);
  border-radius: 0.2rem;
}

.csv-table-scroll table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  width: max-content;
  font-size: 0.64rem;
}

.csv-table-scroll th,
.csv-table-scroll td {
  padding: 0.5em 0.9em;
  border-bottom: 1px solid var(--md-typeset-table-color);
  text-align: left;
  white-space: nowrap;
}

/* No double border at table bottom (wrapper already has border) */
.csv-table-scroll tbody tr:last-child td {
  border-bottom: none;
}

/* All cells get an opaque background (needed for sticky positioning) */
.csv-table-scroll td {
  background: var(--md-default-bg-color);
}

.csv-table-scroll tbody tr:nth-child(even) td {
  background: var(--md-code-bg-color);
}

/* Header */
.csv-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--md-default-bg-color);
  font-weight: 700;
  border-bottom: 2px solid var(--md-typeset-table-color);
}

/* Sticky first column with border + shadow separator */
.csv-table-scroll td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  font-weight: 500;
  border-right: 1px solid var(--md-typeset-table-color);
  box-shadow: 6px 0 8px -3px rgba(0, 0, 0, 0.15);
}

.csv-table-scroll th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  border-right: 1px solid var(--md-typeset-table-color);
  box-shadow: 6px 0 8px -3px rgba(0, 0, 0, 0.15);
}

/* Peek column: first detail column shown truncated + faded */
.csv-table-scroll .detail-col-peek {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--md-default-fg-color--lighter);
  padding-right: 3.5em;
}

.csv-table-scroll table.show-details .detail-col-peek {
  max-width: 420px;
  overflow: visible;
  white-space: normal;
  color: inherit;
  padding-right: 0.9em;
}

/* Other detail columns: fully hidden until expanded */
.csv-table-scroll .detail-col {
  display: none;
  white-space: normal;
  min-width: 200px;
  max-width: 420px;
}

.csv-table-scroll table.show-details .detail-col {
  display: table-cell;
}

/* Right fade overlay — column toggle */
.csv-table-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52px;
  background: linear-gradient(to right, transparent, var(--md-default-bg-color) 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  transition: width 0.15s;
}

.csv-table-fade:hover {
  width: 64px;
}

.csv-table-fade .csv-fade-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--md-default-bg-color);
  border: 1.5px solid var(--md-primary-fg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--md-primary-fg-color);
  transition: background 0.15s, color 0.15s;
}

.csv-table-fade:hover .csv-fade-icon {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

/* When columns are expanded */
.csv-table.details-visible .csv-table-fade {
  width: 28px;
  background: none;
}

.csv-table.details-visible .csv-table-fade .csv-fade-icon {
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  border-width: 1px;
}

/* Bottom fade — decorative scroll hint, non-interactive */
.csv-table-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--md-default-bg-color));
  pointer-events: none;
  z-index: 4;
  border-radius: 0 0 0.2rem 0.2rem;
  transition: opacity 0.15s;
}
