/* Shared, readable table treatment for Builelib documentation. */

.md-typeset table:not([class]) {
  table-layout: auto;
  background: #ffffff;
  border-color: var(--builelib-line, #d7e3ee);
}

/* Specialized wide tables keep their own compact column sizing, but share
   the same surface, borders, row states, and rounded outline as normal
   input/output tables. */
.md-typeset table.climate-table,
.md-typeset table.calendar-table-narrow,
.md-typeset table.workload-table {
  overflow: hidden;
  background: #ffffff;
  border-color: var(--builelib-line, #d7e3ee);
  border-radius: 0.55rem;
  box-shadow: none;
}

.md-typeset table.climate-table th,
.md-typeset table.climate-table td,
.md-typeset table.calendar-table-narrow th,
.md-typeset table.calendar-table-narrow td,
.md-typeset table.workload-table th,
.md-typeset table.workload-table td {
  border-color: var(--builelib-line, #d7e3ee);
}

.md-typeset table.climate-table thead th,
.md-typeset table.calendar-table-narrow thead th,
.md-typeset table.workload-table thead th {
  border-bottom: 2px solid var(--builelib-brand, #006b9b);
}

.md-typeset table.climate-table th + th,
.md-typeset table.climate-table td + td,
.md-typeset table.calendar-table-narrow th + th,
.md-typeset table.calendar-table-narrow td + td,
.md-typeset table.workload-table th + th,
.md-typeset table.workload-table td + td {
  border-left-width: 1px;
}

.md-typeset table.climate-table tbody tr:nth-child(even) td,
.md-typeset table.calendar-table-narrow tbody tr:nth-child(even) td,
.md-typeset table.workload-table tbody tr:nth-child(even) td {
  background-color: #f8fbfd;
}

.md-typeset table.climate-table tbody tr:hover td,
.md-typeset table.calendar-table-narrow tbody tr:hover td,
.md-typeset table.workload-table tbody tr:hover td {
  background-color: #edf7fb;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.65rem 0.75rem;
  line-height: 1.65;
  border-color: var(--builelib-line, #d7e3ee);
}

.md-typeset table thead th {
  color: var(--builelib-brand-dark, #00577f);
  background: linear-gradient(180deg, #eef8fc 0%, #e6f3f8 100%) !important;
  border-bottom: 2px solid var(--builelib-brand, #006b9b);
  font-weight: 700;
  text-align: left;
}

.md-typeset table:not([class]) th + th,
.md-typeset table:not([class]) td + td {
  border-left-width: 1px;
}

.md-typeset table:not([class]) tbody tr:nth-child(even) td {
  background-color: #f8fbfd;
}

.md-typeset table:not([class]) tbody tr:hover td {
  background-color: #edf7fb;
}

/* Input/output tables use four semantic columns. Keep symbols and units
   compact while reserving most of the width for explanatory text. */
.md-typeset table:not([class]):has(thead tr > :nth-child(4):last-child) tr > :nth-child(1) {
  width: 22%;
}

.md-typeset table:not([class]):has(thead tr > :nth-child(4):last-child) tr > :nth-child(2) {
  width: 35%;
}

.md-typeset table:not([class]):has(thead tr > :nth-child(4):last-child) tr > :nth-child(3) {
  width: 11%;
}

.md-typeset table:not([class]):has(thead tr > :nth-child(4):last-child) tr > :nth-child(4) {
  width: 32%;
}

.md-typeset table caption {
  color: var(--builelib-ink, #10243a);
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .md-typeset table:not([class]) th,
  .md-typeset table:not([class]) td {
    padding: 0.5rem 0.55rem;
  }
}
