/* TuxDex dark theme: neutral dark grey with a soft mint accent */
[data-md-color-scheme="slate"] {
  --tc-bg: #0f1115;
  --tc-surface: #161a21;
  --tc-border: #262b35;
  --tc-text: #d4d7dd;
  --tc-muted: #8b919c;
  --tc-accent: #7af7b9;
  --tc-accent-light: #a6fad1;
  --tc-basics: #f7dc7a;

  --md-hue: 220;
  --md-default-bg-color: var(--tc-bg);
  --md-default-fg-color: var(--tc-text);
  --md-default-fg-color--light: var(--tc-muted);
  --md-primary-fg-color: var(--tc-surface);
  --md-primary-fg-color--light: var(--tc-surface);
  --md-primary-fg-color--dark: var(--tc-bg);
  --md-primary-bg-color: var(--tc-text);
  --md-primary-bg-color--light: var(--tc-muted);
  --md-accent-fg-color: var(--tc-accent-light);
  --md-accent-fg-color--transparent: rgba(122, 247, 185, 0.1);
  --md-typeset-a-color: var(--tc-accent);
  --md-code-bg-color: var(--tc-surface);
  --md-footer-bg-color: var(--tc-surface);
  --md-footer-bg-color--dark: var(--tc-bg);
}

.md-header,
.md-tabs {
  background-color: var(--tc-surface);
}

.md-header {
  border-bottom: 1px solid var(--tc-border);
}

.md-tabs {
  border-bottom: 1px solid var(--tc-border);
}

.md-tabs__link--active,
.md-nav__link--active {
  color: var(--tc-accent);
}

.md-typeset h1 {
  color: var(--tc-accent);
  font-weight: 600;
}

.md-typeset h2 {
  color: var(--tc-text);
  border-bottom: 1px solid var(--tc-border);
  padding-bottom: 0.2em;
}

[dir] .md-typeset blockquote {
  border-left-color: var(--tc-accent);
  color: var(--tc-muted);
}

.md-typeset pre > code,
.md-typeset table:not([class]) {
  border: 1px solid var(--tc-border);
}

.md-typeset img[alt$="output"] {
  border-radius: 8px;
  border: 1px solid var(--tc-border);
}

/* Home page */
.tc-hero {
  text-align: center;
  margin: 1rem 0 2.5rem;
}

.tc-hero img {
  /* blends the logo's near-black background into the page background */
  mix-blend-mode: lighten;
}

.md-typeset .tc-hero h1 {
  margin: 0.5rem 0 0.75rem;
  font-size: 2.4em;
}

.tc-hero p {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--tc-muted);
}

.md-typeset .md-button--primary {
  background-color: var(--tc-accent);
  border-color: var(--tc-accent);
  color: var(--tc-bg);
}

.md-typeset .md-button--primary:hover {
  background-color: var(--tc-accent-light);
  border-color: var(--tc-accent-light);
  color: var(--tc-bg);
}

.md-typeset .grid.cards > ul > li {
  border-color: var(--tc-border);
  background-color: var(--tc-surface);
}

/* Whole card is clickable when its title is a link */
.md-typeset .grid.cards > ul > li:has(> p:first-child a) {
  position: relative;
  cursor: pointer;
}

.md-typeset .grid.cards > ul > li > p:first-child a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.md-typeset .grid.cards > ul > li:has(> p:first-child a):hover {
  border-color: var(--tc-accent);
}

.md-typeset .grid.cards .twemoji {
  color: var(--tc-accent);
}

/* Cards as compact tiles: icon in a tinted square on the left, title and description
   next to it. On chapter overviews the title (the command) is set in monospace. */
.md-typeset .grid.cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
  gap: 0.6rem;
}

.md-typeset .grid.cards > ul > li {
  position: relative;
  min-height: 3.6rem;
  padding: 0.65rem 0.8rem 0.65rem 3.4rem;
  border-radius: 0.4rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.md-typeset .grid.cards > ul > li:hover {
  background-color: #1a1f27;
}

.md-typeset .grid.cards > ul > li > hr {
  display: none;
}

.md-typeset .grid.cards > ul > li > p {
  margin: 0;
}

.md-typeset .grid.cards > ul > li > p:first-child {
  font-size: 0.78rem;
  line-height: 1.4;
}

.md-typeset .tc-hero--chapter ~ .grid.cards > ul > li > p:first-child {
  font-family: var(--md-code-font-family);
}

/* Chapters that are not written yet: dimmed, with a small "coming soon" */
.md-typeset .grid.cards > ul > li:has(> p:first-child > em) {
  opacity: 0.55;
}

.md-typeset .grid.cards > ul > li > p:first-child > em {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--tc-muted);
}

.md-typeset .grid.cards > ul > li > p:first-child strong {
  font-weight: 600;
}

.md-typeset .grid.cards > ul > li > p:last-child {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--tc-muted);
}

.md-typeset .grid.cards > ul > li > p:first-child > .twemoji {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  border-radius: 0.4rem;
  background-color: rgba(122, 247, 185, 0.1);
}

.md-typeset .grid.cards > ul > li > p:first-child > .twemoji svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Chapter overview pages */
.tc-hero--chapter {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.9rem;
  text-align: left;
  margin-bottom: 0.8rem;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .tc-hero--chapter > h1 {
    font-size: 1.9em;
  }
}

/* Icon left of the title, everything else below on the full width */
.tc-hero--chapter > * {
  grid-column: 1 / -1;
}

.md-typeset .tc-hero--chapter > p:first-child {
  grid-column: 1;
  margin: 0;
  line-height: 0;
}

.md-typeset .tc-hero--chapter > h1 {
  grid-column: 2;
  margin: 0;
}

.tc-hero--chapter p {
  max-width: 40rem;
  margin-left: 0;
  margin-right: 0;
}

.md-typeset .tc-hero-icon {
  display: inline-block;
  height: 2.8rem;
  color: var(--tc-accent);
}

.md-typeset .tc-hero-icon svg {
  width: 2.8rem;
  height: 2.8rem;
  max-height: none;
}

/* Command blocks vs. output blocks */
.md-typeset .language-bash pre {
  border-left: 3px solid var(--tc-accent);
}

.md-typeset .language-text pre > code {
  background-color: var(--tc-bg);
  color: var(--tc-muted);
}

/* Home page: alphabetical list of all commands */
.md-typeset .tc-command-index ul {
  columns: 7rem auto;
  column-gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

[dir] .md-typeset .tc-command-index li {
  margin: 0 0 0.35rem;
  break-inside: avoid;
}

.md-typeset .tc-command-index a code {
  color: var(--tc-accent);
  background: none;
  padding: 0;
}

.md-typeset .tc-command-index a:hover code {
  color: var(--tc-accent-light);
}

/* Header: title left, search in the middle, language and repository right */
.md-header__title {
  order: 1;
}

.md-header__inner > label[for="__search"],
.md-search {
  order: 2;
}

.md-header__option {
  order: 3;
}

.md-header__source {
  order: 4;
}

/* Header: "Tux" white, "Dex" in the accent colour */
.tc-title-tux {
  color: #ffffff;
}

.tc-title-dex {
  color: var(--tc-accent);
}

@media screen and (min-width: 60em) {
  /* Same width as the repository link on the right, so the search sits in the middle */
  .md-header__title {
    flex: 0 0 11.7rem;
    margin-right: 0;
  }

  .md-search {
    flex-grow: 1;
    display: flex;
    justify-content: center;
  }

  .md-search__inner,
  [data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
    float: none;
    width: 100%;
    max-width: 30rem;
  }

  .md-search__form {
    height: 2rem;
    background-color: var(--tc-bg);
    border: 1px solid var(--tc-border);
    border-radius: 0.5rem;
    box-shadow: none;
    transition: border-color 0.2s;
  }

  .md-search__form:hover,
  [data-md-toggle="search"]:checked ~ .md-header .md-search__form {
    background-color: var(--tc-bg);
    border-color: var(--tc-accent);
  }

  [data-md-toggle="search"]:checked ~ .md-header .md-search__form {
    border-radius: 0.5rem 0.5rem 0 0;
  }

  .md-search__input {
    height: 100%;
    font-size: 0.75rem;
  }

  /* Centre the icons vertically in the 2rem field (Material places them for 1.8rem) */
  .md-search__form .md-search__icon {
    top: 50%;
    transform: translateY(-50%);
  }

  .md-search__input::placeholder {
    color: var(--tc-muted);
  }

  .md-search__icon[for="__search"] {
    color: var(--tc-accent);
  }

  .md-search__output {
    border-radius: 0 0 0.5rem 0.5rem;
  }

  .md-search__scrollwrap {
    width: 100%;
  }
}

/* Navigation tabs: accent colour for the active tab, underline on hover */
.md-tabs__link {
  position: relative;
  opacity: 1;
  color: var(--tc-muted);
  transition: color 0.2s;
}

.md-tabs__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  background: var(--tc-accent);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.2s;
}

.md-tabs__link:hover {
  color: var(--tc-text);
}

.md-tabs__link:hover::after {
  transform: scaleX(0.6);
  opacity: 0.6;
}

.md-tabs__item--active .md-tabs__link,
.md-tabs__item--active .md-tabs__link:hover {
  color: var(--tc-accent);
}

.md-tabs__item--active .md-tabs__link::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Chapter overview pages: section headings with an accent bar on the left */
.md-typeset .tc-hero--chapter ~ h2 {
  margin-top: 2.2em;
  padding: 0.3em 0 0.3em 0.75em;
  font-weight: 600;
  color: #ffffff;
  border-bottom: none;
  border-left: 4px solid var(--tc-accent);
  border-radius: 0 0.3rem 0.3rem 0;
  background: linear-gradient(90deg, rgba(122, 247, 185, 0.1), transparent 70%);
}

/* Home page: distribution badges in their original colours */
.tc-distros {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0.9rem 0 0.6rem;
}

.md-typeset .tc-distros + p {
  margin-top: 0;
}

/* Same look as the shields.io badges in the README on GitHub (style "flat") */
.md-typeset .tc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border-radius: 3px;
  background-image: linear-gradient(rgba(187, 187, 187, 0.1), rgba(0, 0, 0, 0.1));
  font-family: Verdana, "DejaVu Sans", Geneva, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 20px;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3);
}

.md-typeset .tc-badge .twemoji {
  height: 14px;
}

.md-typeset .tc-badge .twemoji svg {
  fill: #ffffff;
  width: 14px;
  height: 14px;
}

.tc-badge--redhat { background-color: #ee0000; }
.tc-badge--debian { background-color: #a81d33; }
.tc-badge--ubuntu { background-color: #e95420; }
.tc-badge--arch { background-color: #1793d1; }

/* Centered hero titles: hide the permalink, which would push the title to the left */
.md-typeset .tc-hero h1 .headerlink {
  display: none;
}

/* Home page: author link to GitHub */
.md-typeset .tc-author {
  font-weight: 600;
  white-space: nowrap;
}

.md-typeset .tc-author .twemoji {
  vertical-align: -0.15em;
  margin-right: 0.15rem;
}

.md-typeset .tc-author .twemoji svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* Home page: tagline under the logo in the accent colour */
.md-typeset .tc-hero p.tc-tagline {
  max-width: none;
  margin: 0.4rem auto 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tc-accent);
}

.md-typeset .tc-hero p.tc-languages {
  margin: 0 auto 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* Home page: highlight the subject in the introduction */
.md-typeset .tc-hero p strong {
  color: #ffffff;
}

/* Visually hidden, still read by screen readers */
.md-typeset .tc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  margin: 0;
}

/* Link to the chapter basics, below the chapter hero */
.md-typeset a.tc-basics {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  border: 1px solid var(--tc-border);
  border-left: 3px solid var(--tc-basics);
  border-radius: 0.2rem;
  background: linear-gradient(90deg, rgba(247, 220, 122, 0.08), var(--tc-surface) 60%);
  color: var(--tc-text);
  transition: border-color 0.15s;
}

.md-typeset a.tc-basics:hover {
  border-color: var(--tc-basics);
  color: var(--tc-text);
}

.md-typeset a.tc-basics strong {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--tc-basics);
}

.md-typeset a.tc-basics .tc-basics-icon,
.md-typeset a.tc-basics .tc-basics-arrow {
  flex-shrink: 0;
  color: var(--tc-basics);
}

.md-typeset a.tc-basics .tc-basics-arrow {
  margin-left: 0.4rem;
  transition: transform 0.15s;
}

.md-typeset a.tc-basics:hover .tc-basics-arrow {
  transform: translateX(0.2rem);
}

/* Narrow screens: flow the box as normal text, otherwise every text part and code span
   becomes its own narrow flex column */
@media screen and (max-width: 44.99em) {
  .md-typeset a.tc-basics {
    display: block;
  }

  .md-typeset a.tc-basics strong {
    margin: 0 0.3rem;
  }

  .md-typeset a.tc-basics .tc-basics-arrow {
    display: inline-block;
  }
}

/* Sidebar: the Basics page of every chapter (always the first entry of a chapter) in the
   same yellow as the Basics box on the chapter overviews */
.md-nav--primary .md-nav[data-md-level="1"] > .md-nav__list > .md-nav__item:first-child > .md-nav__link {
  color: var(--tc-basics);
}

.md-nav--primary .md-nav[data-md-level="1"] > .md-nav__list > .md-nav__item:first-child > .md-nav__link:hover {
  color: #fbe9a8;
}

.md-nav--primary .md-nav[data-md-level="1"] > .md-nav__list > .md-nav__item:first-child > .md-nav__link--active {
  font-weight: 700;
}

/* Sidebar navigation: no site title above the chapter list on wide screens */
@media screen and (min-width: 76.25em) {
  .md-nav--primary > .md-nav__title {
    display: none;
  }
}

/* Chapters in the sidebar */
.md-nav--primary > .md-nav__list > .md-nav__item--nested > .md-nav__link {
  font-weight: 600;
}

.md-nav--primary .md-nav__item--active > .md-nav__link {
  color: var(--tc-accent);
}

/* Header: logo and title closer together (the logo is only shown on wide screens) */
@media screen and (min-width: 76.25em) {
  .md-header__button.md-logo {
    margin-right: 0;
    padding: 0.2rem 0.2rem 0.2rem 0.4rem;
  }

  /* Larger logo; the smaller padding keeps the header at its normal height */
  .md-header__button.md-logo img {
    height: 2rem;
  }

  .md-header__title {
    font-size: 1.05rem;
  }

  [dir] .md-header__title {
    margin-left: 0.2rem;
  }
}

/* sidebar-separators:start */
/* Generated by scripts/sidebar_separators.py: a line with a caption above the first
   chapter of every area. The rule targets the link right after the toggle, so it works
   without :has() in every browser. */
.md-nav--primary #__nav_3 + .md-nav__link,
.md-nav--primary #__nav_21 + .md-nav__link,
.md-nav--primary #__nav_26 + .md-nav__link,
.md-nav--primary #__nav_34 + .md-nav__link {
  flex-wrap: wrap;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--tc-border);
}

.md-nav--primary #__nav_3 + .md-nav__link::before,
.md-nav--primary #__nav_21 + .md-nav__link::before,
.md-nav--primary #__nav_26 + .md-nav__link::before,
.md-nav--primary #__nav_34 + .md-nav__link::before {
  display: block;
  flex: 0 0 100%;
  margin: 0 0 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tc-muted);
}

.md-nav--primary #__nav_3 + .md-nav__link::before {
  content: "Linux administration";
}

html[lang="de"] .md-nav--primary #__nav_3 + .md-nav__link::before {
  content: "Linux-Administration";
}

.md-nav--primary #__nav_21 + .md-nav__link::before {
  content: "Server services";
}

html[lang="de"] .md-nav--primary #__nav_21 + .md-nav__link::before {
  content: "Serverdienste";
}

.md-nav--primary #__nav_26 + .md-nav__link::before {
  content: "Automation & DevOps";
}

html[lang="de"] .md-nav--primary #__nav_26 + .md-nav__link::before {
  content: "Automatisierung & DevOps";
}

.md-nav--primary #__nav_34 + .md-nav__link::before {
  content: "Security";
}

html[lang="de"] .md-nav--primary #__nav_34 + .md-nav__link::before {
  content: "Sicherheit";
}

/* sidebar-separators:end */

/* Tables: no line breaks inside inline code (such as after the hyphen of --install), and
   option names in the first column stay on one line */
.md-typeset table:not([class]) td code {
  white-space: nowrap;
}

.md-typeset table:not([class]) td:first-child:has(> code:first-child) {
  white-space: nowrap;
}

/* Basics overview page: tiles in the yellow of the basics boxes, titles in normal font */
.md-typeset .grid.cards.tc-basics-cards > ul > li > p:first-child {
  font-family: inherit;
}

.md-typeset .grid.cards.tc-basics-cards > ul > li > p:first-child a {
  color: var(--tc-basics);
}

.md-typeset .grid.cards.tc-basics-cards > ul > li > p:first-child > .twemoji {
  color: var(--tc-basics);
  background-color: rgba(247, 220, 122, 0.1);
}

.md-typeset .grid.cards.tc-basics-cards > ul > li:has(> p:first-child a):hover {
  border-color: var(--tc-basics);
}

.md-typeset .grid.cards.tc-basics-cards > ul > li > p:first-child a:hover {
  color: #fbe9a8;
}

/* Basics overview page: section headings in the yellow of the basics boxes */
.md-typeset .tc-hero--basics ~ h2 {
  border-left-color: var(--tc-basics);
  background: linear-gradient(90deg, rgba(247, 220, 122, 0.1), transparent 70%);
}
