.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1em 0;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.md-content img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Page headings */
.md-typeset h1 {
  color: var(--md-primary-fg-color);
  font-weight: 700;
}

.md-typeset h2 {
  color: var(--md-primary-fg-color);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2 {
  color: color-mix(in srgb, var(--md-primary-fg-color) 70%, white);
}

/* Center the table wrapper */
.md-typeset__scrollwrap {
  display: flex;
  justify-content: center;
}

/* Table styling */
.md-typeset table:not([class]) {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: auto;
}

.md-typeset table:not([class]) thead th {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border: none;
}

.md-typeset table:not([class]) tbody tr {
  transition: background-color 0.15s ease;
}

.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: var(--md-default-fg-color--lightest);
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: color-mix(in srgb, var(--md-primary-fg-color) 12%, transparent);
}

.md-typeset table:not([class]) tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset table:not([class]) tbody tr:last-child td {
  border-bottom: none;
}

/* Keep table images inline-sized, not full-width */
.md-typeset table:not([class]) img {
  display: inline-block;
  margin: 0 auto;
  max-height: 48px;
  width: auto;
}

/* Large tooltip images in tables */
.md-typeset table:not([class]) td img.tooltip-img {
  max-height: none;
  width: 300px;
}

/* Smaller tooltip images for recipe/resource tables */
.md-typeset table:not([class]) td img.tooltip-img-sm {
  max-height: none;
  width: 150px;
}

/* Sortable table header indicators */
th[role=columnheader]:not(.no-sort) {
  cursor: pointer;
  user-select: none;
}

th[role=columnheader]:not(.no-sort)::after {
  content: "\25B4\25BE";
  font-size: 0.65em;
  margin-left: 6px;
  opacity: 0.4;
}

th[aria-sort=ascending]::after {
  content: "\25B4" !important;
  opacity: 1 !important;
}

th[aria-sort=descending]::after {
  content: "\25BE" !important;
  opacity: 1 !important;
}

/* Table search input */
.table-search-input {
  display: block;
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 6px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.table-search-input:focus {
  border-color: var(--md-primary-fg-color);
}

/* Remove extra spacing between image and caption in figures */
.md-typeset figure img {
  margin-bottom: 0;
}
.md-typeset figure p {
  margin: 0;
}

/* Nav section titles - give top-level category labels a subtle theme color accent */
.md-nav--primary > .md-nav__list > .md-nav__item--nested > .md-nav__link {
  color: var(--md-primary-fg-color) !important;
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-nav--primary > .md-nav__list > .md-nav__item--nested > .md-nav__link {
  color: color-mix(in srgb, var(--md-primary-fg-color) 70%, white) !important;
}

/* Site title in sidebar nav panel */
.md-nav--primary .md-nav__title {
  color: var(--md-primary-fg-color) !important;
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-nav--primary .md-nav__title {
  color: color-mix(in srgb, var(--md-primary-fg-color) 70%, white) !important;
}
