/* ============================================
   KimetsuCraft Wiki — Custom Theme
   ============================================ */

/* --- Thematic particle canvas --- */
.kc-particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Lift content above the particle canvas (desktop only — particles are
   disabled on mobile, and this z-index would otherwise trap drawer clicks). */
@media screen and (min-width: 60em) {
  .md-main {
    position: relative;
    z-index: 1;
  }
}

/* --- Custom Scrollbar (Kimetsu red) --- */
html {
  scrollbar-color: #922b21 #16162a;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #16162a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c0392b 0%, #922b21 100%);
  border-radius: 6px;
  border: 2px solid #16162a;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
}

[data-md-color-scheme="default"] html {
  scrollbar-color: #c0392b #f0f0f3;
}

[data-md-color-scheme="default"] ::-webkit-scrollbar-track {
  background: #f0f0f3;
}

[data-md-color-scheme="default"] ::-webkit-scrollbar-thumb {
  border-color: #f0f0f3;
}

/* --- Scroll reveal (used by extra.js) --- */
.technique-card,
.stat-card,
.mark-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.technique-card.kc-revealed,
.stat-card.kc-revealed,
.mark-card.kc-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .technique-card,
  .stat-card,
  .mark-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Color Palette --- */
:root {
  /* Demon Slayer red — used for headers, links, accents */
  --kc-red: #c0392b;
  --kc-red-light: #e74c3c;
  --kc-red-dark: #922b21;

  /* Wisteria purple — secondary accent */
  --kc-wisteria: #8e44ad;
  --kc-wisteria-light: #a569bd;

  /* Flame orange */
  --kc-flame: #e67e22;
  --kc-flame-light: #f39c12;

  /* Water blue */
  --kc-water: #2e86c1;
  --kc-water-light: #5dade2;

  /* Nichirin gold */
  --kc-gold: #d4ac0d;

  --kc-page-gutter: 0.85rem;
}

/* --- Layout Width --- */
.md-header__inner,
.md-tabs__inner,
.md-main__inner {
  box-sizing: border-box;
  padding-left: var(--kc-page-gutter);
  padding-right: var(--kc-page-gutter);
}

.md-sidebar__scrollwrap {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

@media screen and (min-width: 76.25em) {
  .md-grid {
    max-width: 82rem;
  }

  [dir="ltr"] .md-sidebar--primary {
    margin-right: -0.8rem;
  }

  [dir="ltr"] .md-sidebar--secondary {
    margin-left: -0.8rem;
  }

  [dir="rtl"] .md-sidebar--primary {
    margin-left: -0.8rem;
  }

  [dir="rtl"] .md-sidebar--secondary {
    margin-right: -0.8rem;
  }

  [dir="ltr"] .md-sidebar--primary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-left: 0.8rem;
  }

  [dir="ltr"] .md-sidebar--secondary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-right: 0.8rem;
  }

  [dir="rtl"] .md-sidebar--primary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-right: 0.8rem;
  }

  [dir="rtl"] .md-sidebar--secondary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-left: 0.8rem;
  }
}

@media screen and (min-width: 120em) {
  .md-grid {
    max-width: 88rem;
  }
}

/* --- Material Theme Overrides (Dark / Slate) --- */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: var(--kc-red);
  --md-primary-fg-color--light: var(--kc-red-light);
  --md-primary-fg-color--dark: var(--kc-red-dark);
  --md-accent-fg-color: var(--kc-flame);
  --md-default-bg-color: #1a1a2e;
  --md-default-bg-color--light: #1f1f38;
  --md-default-fg-color--light: #b0b0c0;
  --md-typeset-a-color: var(--kc-red-light);
  --md-code-bg-color: #16162a;
}

/* --- Material Theme Overrides (Light) --- */
[data-md-color-scheme="default"] {
  --md-primary-fg-color: var(--kc-red);
  --md-primary-fg-color--light: var(--kc-red-light);
  --md-primary-fg-color--dark: var(--kc-red-dark);
  --md-accent-fg-color: var(--kc-flame);
  --md-typeset-a-color: var(--kc-red-dark);
}

/* --- Header: solid red --- */
.md-header {
  background: var(--kc-red-dark);
  box-shadow: none;
}

[data-md-color-scheme="default"] .md-header {
  background: var(--kc-red);
}

/* Hide the original palette toggle (we re-insert it after the nav) */
.md-header__option {
  display: none;
}

/* Remove the gap MkDocs reserves for the now-hidden tabs bar.
   Only applies on desktop, where JS hides .md-tabs and injects inline nav.
   On mobile, Material shows .md-tabs/drawer natively and needs the space. */
@media screen and (min-width: 60em) {
  .md-container {
    padding-top: 0 !important;
  }

  .md-main {
    margin-top: 0 !important;
  }

  /* Offsets the hidden tabs bar that MkDocs still reserves space for. */
  .md-header ~ .md-container {
    margin-top: -2.0rem;
  }
}

/* --- Header inner: logo | title | nav (flex:1, centered) | palette | search --- */
.md-header__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Inline nav (injected by extra.js) --- */
#kc-inline-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  justify-content: center;
}

.kc-nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.kc-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.kc-nav-link--active {
  color: #fff;
  font-weight: 700;
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
}

/* Palette toggle re-inserted by JS */
#kc-palette-toggle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Shrink title on narrow screens so nav links fit */
@media screen and (max-width: 76.25em) {
  .md-header__title {
    font-size: 0.8rem;
  }
  .kc-nav-link {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}


.kc-grid-small {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.kc-grid-small img {
  width: 70%;
  border-radius: 6px;
  border: none;
  display: block;
}

@media screen and (max-width: 600px) {
  .kc-grid-small {
    flex-direction: column;
    align-items: center;
  }
  .kc-grid-small img {
    width: 80%;
  }
}

img.kc-screenshot {
  width: 80% !important;
  max-width: 80% !important;
  border-radius: 6px;
  border: none;
  display: block;
  margin: 1.25rem auto;
}

.rank-icon {
  height: 68px;
  width: auto;
  vertical-align: middle;
  image-rendering: pixelated;
}

/* --- Stat Cards (for Stats page) --- */
.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  border-left: 4px solid var(--md-default-fg-color--lightest);
  background: var(--md-code-bg-color);
}

.stat-card > p:first-child {
  margin: 0;
  flex-shrink: 0;
  line-height: 0;
}

.stat-card img {
  height: 50px;
  width: auto;
  image-rendering: pixelated;
}

.stat-card-body {
  flex: 1;
  min-width: 0;
}

.stat-card-body .stat-name {
  font-size: 1.1em;
  font-weight: 700;
  margin: 0;
}

.stat-card-body .stat-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px 0;
}

.stat-card-body .stat-desc,
.stat-card-body .stat-desc p {
  margin: 0;
  font-size: 0.92em;
  opacity: 0.88;
}

/* Stat card color variants */
.stat-card.dexterity { border-left-color: var(--kc-flame); }
.stat-card.dexterity .stat-name { color: var(--kc-flame-light); }

.stat-card.speed { border-left-color: #f1c40f; }
.stat-card.speed .stat-name { color: #f1c40f; }

.stat-card.vitality { border-left-color: var(--kc-red); }
.stat-card.vitality .stat-name { color: var(--kc-red-light); }

.stat-card.concentration { border-left-color: #27ae60; }
.stat-card.concentration .stat-name { color: #2ecc71; }

.stat-card.regeneration { border-left-color: #c0392b; }
.stat-card.regeneration .stat-name { color: #e91e84; }

.stat-card.range { border-left-color: var(--kc-water); }
.stat-card.range .stat-name { color: var(--kc-water-light); }

/* --- Home Grid Cards — color accents on Material native cards --- */
.kc-home-grid > ul > li {
  border-left: 4px solid var(--md-default-fg-color--lightest);
  transition: border-color 0.2s;
}

/* Per-card color accents (fixed order) */
.kc-home-grid > ul > li:nth-child(1) { border-left-color: var(--kc-gold); }
.kc-home-grid > ul > li:nth-child(1):hover { border-color: var(--kc-gold); }

.kc-home-grid > ul > li:nth-child(2) { border-left-color: var(--kc-red); }
.kc-home-grid > ul > li:nth-child(2):hover { border-color: var(--kc-red); }

.kc-home-grid > ul > li:nth-child(3) { border-left-color: var(--kc-wisteria); }
.kc-home-grid > ul > li:nth-child(3):hover { border-color: var(--kc-wisteria); }

.kc-home-grid > ul > li:nth-child(4) { border-left-color: var(--kc-water); }
.kc-home-grid > ul > li:nth-child(4):hover { border-color: var(--kc-water); }

.kc-home-grid > ul > li:nth-child(5) { border-left-color: var(--kc-red-dark); }
.kc-home-grid > ul > li:nth-child(5):hover { border-color: var(--kc-red-dark); }

.kc-home-grid > ul > li:nth-child(6) { border-left-color: #27ae60; }
.kc-home-grid > ul > li:nth-child(6):hover { border-color: #27ae60; }

.kc-home-grid > ul > li:nth-child(7) { border-left-color: var(--kc-flame); }
.kc-home-grid > ul > li:nth-child(7):hover { border-color: var(--kc-flame); }

.kc-home-grid a {
  font-weight: 600;
  font-size: 0.88em;
}

/* --- Technique Cards (for Breathing pages) --- */
.technique-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  border-left: 4px solid var(--md-default-fg-color--lightest);
  background: var(--md-code-bg-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.technique-card:hover {
  transform: translateY(-3px);
}

.technique-card.water:hover {
  border-color: var(--kc-water);
  box-shadow: 0 10px 28px rgba(46, 134, 193, 0.22), 0 0 0 1px rgba(46, 134, 193, 0.35);
}

.technique-card.flame:hover {
  border-color: var(--kc-flame);
  box-shadow: 0 10px 28px rgba(230, 126, 34, 0.22), 0 0 0 1px rgba(230, 126, 34, 0.35);
}

.technique-card > p:first-child {
  margin: 0;
  flex-shrink: 0;
  line-height: 0;
}

.technique-card img {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  border-radius: 6px;
}

.technique-card-body {
  flex: 1;
  min-width: 0;
}

.technique-card-body .technique-name {
  font-size: 1.1em;
  font-weight: 700;
  margin: 0;
}

.technique-card-body .technique-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px 0;
}

.technique-card-body .technique-stats .stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78em;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.4;
}

/* Chip color variants */
.stat-chip.level {
  background: rgba(142, 68, 173, 0.18);
  color: var(--kc-wisteria-light);
}
.stat-chip.stamina {
  background: rgba(46, 204, 113, 0.15);
  color: #58d68d;
}
.stat-chip.cooldown {
  background: rgba(93, 173, 226, 0.15);
  color: var(--kc-water-light);
}
.stat-chip.priority {
  background: rgba(230, 126, 34, 0.15);
  color: var(--kc-flame-light);
}
.stat-chip.damage {
  background: rgba(192, 57, 43, 0.15);
  color: var(--kc-red-light);
}

.technique-card-body .technique-desc,
.technique-card-body .technique-desc p {
  margin: 0;
  font-size: 0.92em;
  opacity: 0.88;
}

.technique-card.water { border-left-color: var(--kc-water); }
.technique-card.water .technique-name { color: var(--kc-water-light); }

.technique-card.flame { border-left-color: var(--kc-flame); }
.technique-card.flame .technique-name { color: var(--kc-flame-light); }

/* --- Tables — cleaner look --- */
/* Desktop: centered, auto-width (aesthetic).
   Mobile: native horizontal scroll (see bottom of file). */
@media screen and (min-width: 60em) {
  .md-typeset__scrollwrap {
    display: flex;
    justify-content: center;
  }

  .md-typeset__table {
    width: auto;
  }

  .md-typeset table:not([class]) {
    width: auto;
    margin-left: auto;
    margin-right: auto;
  }
}

.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.md-typeset table:not([class]) thead {
  background-color: var(--kc-red-dark);
  color: #fff;
}

[data-md-color-scheme="default"] .md-typeset table:not([class]) thead {
  background-color: var(--kc-red);
}

.md-typeset table:not([class]) th {
  color: #fff !important;
  font-weight: 600;
}

/* --- Mark Cards (for Combat States) --- */
.mark-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  margin: 12px 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  border-left: 4px solid var(--md-default-fg-color--lightest);
  background: var(--md-code-bg-color);
}

.mark-card > p:first-child {
  margin: 0;
  flex-shrink: 0;
  line-height: 0;
}

.mark-card img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border-radius: 6px;
}

.mark-card-body {
  flex: 1;
  min-width: 0;
}

.mark-card-body strong {
  font-size: 1.05em;
}

.mark-card-body p {
  margin: 4px 0 0 0;
  font-size: 0.92em;
  opacity: 0.88;
}

.mark-card .mark-badge {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Priority badge colors */
.mark-badge.highest {
  background: rgba(192, 57, 43, 0.2);
  color: var(--kc-red-light);
}
.mark-badge.medium {
  background: rgba(230, 126, 34, 0.2);
  color: var(--kc-flame-light);
}
.mark-badge.lowest {
  background: rgba(46, 134, 193, 0.2);
  color: var(--kc-water-light);
}

/* Border accent per mark type */
.mark-card.defensive { border-left-color: var(--kc-water); }
.mark-card.cc        { border-left-color: var(--kc-wisteria); }
.mark-card.elemental { border-left-color: var(--kc-flame); }

/* --- Sidebar Sub-section Headers --- */
/* Sub-section titles (e.g. "Mechanics", "Breathing Styles" inside Combat) */
.md-nav--lifted > .md-nav__list > .md-nav__item--section > .md-nav__link,
.md-nav__item--section > .md-nav__link {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light) !important;
  opacity: 0.7;
}

[data-md-color-scheme="default"] .md-nav--lifted > .md-nav__list > .md-nav__item--section > .md-nav__link,
[data-md-color-scheme="default"] .md-nav__item--section > .md-nav__link {
  color: var(--md-default-fg-color--light) !important;
  opacity: 0.65;
}

/* Override Material's red/accent color on all sidebar section labels */
.md-nav__item--section > .md-nav__link:is([href], [for]) {
  color: var(--md-default-fg-color--light) !important;
}

.md-nav__item--nested > .md-nav__link,
.md-nav__item--section .md-nav__item--section > .md-nav__link {
  color: var(--md-default-fg-color--light) !important;
}

/* === Table Variants — shared base style === */
.table-variant-purple table,
.table-variant-red table,
.table-variant-green table,
.table-variant-blue table {
  border-radius: 10px !important;
  border-collapse: separate !important;
  border-spacing: 0;
  width: auto;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: hidden;
  background: var(--md-code-bg-color);
  box-shadow: none !important;
}

.table-variant-purple thead,
.table-variant-red thead,
.table-variant-green thead,
.table-variant-blue thead {
  background-color: transparent !important;
}

.table-variant-purple th,
.table-variant-red th,
.table-variant-green th,
.table-variant-blue th {
  font-weight: 700;
  font-size: 0.85em;
  padding: 12px 16px;
}

.table-variant-purple td,
.table-variant-red td,
.table-variant-green td,
.table-variant-blue td {
  border: none;
  padding: 10px 16px;
  font-size: 0.9em;
}

.table-variant-purple tr:last-child td,
.table-variant-red tr:last-child td,
.table-variant-green tr:last-child td,
.table-variant-blue tr:last-child td {
  border-bottom: none;
}

.table-variant-purple td:first-child,
.table-variant-red td:first-child,
.table-variant-green td:first-child,
.table-variant-blue td:first-child {
  font-weight: 600;
}

/* --- Purple (Wisteria) --- */
.table-variant-purple table { box-shadow: 0 0 0 1px rgba(142, 68, 173, 0.25) !important; }
.table-variant-purple th { color: var(--kc-wisteria-light) !important; background: rgba(142, 68, 173, 0.15) !important; border-bottom: 1px solid rgba(142, 68, 173, 0.2); }
.table-variant-purple td { border-bottom: 1px solid rgba(142, 68, 173, 0.08); }
.table-variant-purple td:first-child { color: var(--kc-wisteria-light); }
[data-md-color-scheme="default"] .table-variant-purple th { color: var(--kc-wisteria) !important; background: rgba(142, 68, 173, 0.08) !important; }
[data-md-color-scheme="default"] .table-variant-purple td:first-child { color: var(--kc-wisteria); }

/* --- Red --- */
.table-variant-red table { box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.25) !important; }
.table-variant-red th { color: var(--kc-red-light) !important; background: rgba(192, 57, 43, 0.12) !important; border-bottom: 1px solid rgba(192, 57, 43, 0.2); }
.table-variant-red td { border-bottom: 1px solid rgba(192, 57, 43, 0.08); }
.table-variant-red td:first-child { color: var(--kc-red-light); }
[data-md-color-scheme="default"] .table-variant-red th { color: var(--kc-red-dark) !important; background: rgba(192, 57, 43, 0.08) !important; }
[data-md-color-scheme="default"] .table-variant-red td:first-child { color: var(--kc-red-dark); }

/* --- Green --- */
.table-variant-green table { box-shadow: 0 0 0 1px rgba(39, 174, 96, 0.25) !important; }
.table-variant-green th { color: #2ecc71 !important; background: rgba(39, 174, 96, 0.12) !important; border-bottom: 1px solid rgba(39, 174, 96, 0.2); }
.table-variant-green td { border-bottom: 1px solid rgba(39, 174, 96, 0.08); }
.table-variant-green td:first-child { color: #2ecc71; }
[data-md-color-scheme="default"] .table-variant-green th { color: #1a7a43 !important; background: rgba(39, 174, 96, 0.08) !important; }
[data-md-color-scheme="default"] .table-variant-green td:first-child { color: #1a7a43; }

/* --- Blue (Water) --- */
.table-variant-blue table { box-shadow: 0 0 0 1px rgba(46, 134, 193, 0.25) !important; }
.table-variant-blue th { color: var(--kc-water-light) !important; background: rgba(46, 134, 193, 0.12) !important; border-bottom: 1px solid rgba(46, 134, 193, 0.2); }
.table-variant-blue td { border-bottom: 1px solid rgba(46, 134, 193, 0.08); }
.table-variant-blue td:first-child { color: var(--kc-water-light); }
[data-md-color-scheme="default"] .table-variant-blue th { color: var(--kc-water) !important; background: rgba(46, 134, 193, 0.08) !important; }
[data-md-color-scheme="default"] .table-variant-blue td:first-child { color: var(--kc-water); }

/* --- Page-themed headings --- */
body {
  --kc-page-heading-h1: var(--kc-red-light);
  --kc-page-heading-sub: #c05a50;
}

[data-md-color-scheme="default"] body {
  --kc-page-heading-h1: var(--kc-red-dark);
  --kc-page-heading-sub: #b04a42;
}

body[data-kc-page-theme="blue"] {
  --kc-page-heading-h1: var(--kc-water-light);
  --kc-page-heading-sub: #8cc6eb;
}

[data-md-color-scheme="default"] body[data-kc-page-theme="blue"] {
  --kc-page-heading-h1: var(--kc-water);
  --kc-page-heading-sub: #4f9fd0;
}

body[data-kc-page-theme="green"] {
  --kc-page-heading-h1: #2ecc71;
  --kc-page-heading-sub: #7adfa5;
}

[data-md-color-scheme="default"] body[data-kc-page-theme="green"] {
  --kc-page-heading-h1: #1a7a43;
  --kc-page-heading-sub: #2f8f59;
}

body[data-kc-page-theme="purple"] {
  --kc-page-heading-h1: var(--kc-wisteria-light);
  --kc-page-heading-sub: #c39bd3;
}

[data-md-color-scheme="default"] body[data-kc-page-theme="purple"] {
  --kc-page-heading-h1: var(--kc-wisteria);
  --kc-page-heading-sub: #9b59b6;
}

body[data-kc-page-theme="red"] {
  --kc-page-heading-h1: var(--kc-red-light);
  --kc-page-heading-sub: #e07b72;
}

[data-md-color-scheme="default"] body[data-kc-page-theme="red"] {
  --kc-page-heading-h1: var(--kc-red-dark);
  --kc-page-heading-sub: #b04a42;
}

.md-typeset h1 {
  color: var(--kc-page-heading-h1);
}

.md-typeset h2,
.md-typeset h3 {
  color: var(--kc-page-heading-sub);
}

/* --- Hashira Screenshots (side by side) --- */
.hashira-screenshots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 1em 0;
}

/* --- In-game screenshots --- */
.kc-screenshot {
  display: block;
  width: auto;
  max-width: 60%;
  height: auto;
  border-radius: 10px;
  margin: 1.2em auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  border: none;
  image-rendering: pixelated;
}

/* Prevent Material's content img rule from stretching our screenshots */
.md-typeset img.kc-screenshot {
  width: auto;
  max-width: 60%;
}

.hashira-screenshots {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.hashira-screenshots img,
.md-typeset .hashira-screenshots img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  border: none;
  display: block;
  image-rendering: pixelated;
}

.hashira-screenshots figure {
  margin: 0;
}

.hashira-screenshots figcaption {
  text-align: center;
  font-size: 0.85em;
  opacity: 0.75;
  margin-top: 6px;
}

/* ============================================
   Mobile overrides (<60em) — desktop untouched
   ============================================ */
@media screen and (max-width: 59.99em) {
  /* Restore native horizontal scroll on wide tables */
  .md-typeset__scrollwrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-variant-purple,
  .table-variant-red,
  .table-variant-green,
  .table-variant-blue {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Shrink rank icons so the 7-column rank table fits comfortably */
  .rank-icon {
    height: 40px;
  }

  /* Always-visible top-level nav tabs with horizontal scroll */
  .md-tabs {
    display: block !important;
    background-color: var(--md-primary-fg-color--dark);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .md-tabs::-webkit-scrollbar {
    display: none;
  }

  .md-tabs__list {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    contain: none;
    margin: 0;
    padding: 0;
  }

  .md-tabs__item {
    display: inline-flex;
    height: 2.25rem;
    padding: 0 0.75rem;
  }

  .md-tabs__link {
    font-size: 0.72rem;
    margin: 0;
    opacity: 0.85;
  }

  .md-tabs__link--active,
  .md-tabs__item--active .md-tabs__link {
    opacity: 1;
    font-weight: 700;
  }
}
