/* DUNE brand accent, taken from dune_plot_style's SetDUNELogoColors()
   (github.com/DUNE/dune_plot_style), the subset of Okabe-Ito colors that
   overlaps the DUNE logo palette. #D55E00 (vermilion) is the closest match
   to "DUNE orange". The darker variant is used for interactive text so it
   keeps readable contrast on white. Same values as dune-phlex-project and
   dune-spack-project; adjust here if an official brand guide supersedes them. */
:root {
  --md-primary-fg-color: #A04700;
  --md-primary-fg-color--light: #A04700;
  --md-primary-fg-color--dark: #7C2D12;
  --md-accent-fg-color: #A04700;
  /* Highlight behind the current item in the left menu */
  --md-accent-fg-color--transparent: rgba(213, 94, 0, 0.1);

  --dt-vermilion: #D55E00;
  /* Softer than the DUNE navy #0E2238. The logo's light blue keeps 5:1 and
     its orange 3.8:1 against it, both above the 3:1 needed for graphics. */
  --dt-navy: #1F3A57;
  --dt-card-bg: var(--md-default-bg-color);
  --dt-card-border: rgba(0, 0, 0, 0.12);
  --dt-muted: rgba(0, 0, 0, 0.62);
  --dt-logo-bg: #FFFFFF;
  --dt-icon-bg: #F4F3F0;

  /* "In development" and similar status text, 4.5:1 on the page background */
  --dt-status-fg: #7A4F00;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #E8803A;
  --md-primary-fg-color--light: #E8803A;
  --md-primary-fg-color--dark: #A04700;
  --md-accent-fg-color: #F29A5C;
  --md-accent-fg-color--transparent: rgba(232, 128, 58, 0.16);
  --md-typeset-a-color: #F29A5C;

  --dt-card-bg: rgba(255, 255, 255, 0.03);
  --dt-card-border: rgba(255, 255, 255, 0.12);
  --dt-muted: rgba(255, 255, 255, 0.68);
  --dt-logo-bg: #E8E7E3;
  --dt-icon-bg: rgba(255, 255, 255, 0.04);
  --dt-status-fg: #F5CF73;
}

/* The header uses a soft navy rather than the orange accent, so the
   transparent colour logo stays legible. */
.md-header,
.md-tabs {
  background-color: var(--dt-navy);
  color: #fff;
}

.md-header .md-header__title,
.md-header .md-header__button,
.md-header .md-source,
.md-tabs .md-tabs__link {
  color: #fff;
}

.md-tabs .md-tabs__link {
  opacity: 0.8;
}

/* The transparent mark is wide and short, so give it a little more height
   than the theme's 1.2rem default. */
.md-header__button.md-logo img {
  height: 1.6rem;
}

.md-tabs .md-tabs__item--active .md-tabs__link,
.md-tabs .md-tabs__link:hover {
  opacity: 1;
  color: #F6B48A;
}

/* Catalog links read as UI, not prose, so drop the underline */
.md-typeset .dt-card a,
.md-typeset a.dt-pill {
  text-decoration: none;
}

/* ---------- Intro ---------- */

.md-typeset .dt-hero {
  margin: 0.5rem 0 2.5rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--dt-card-border);
}

.md-typeset .dt-hero h1 {
  margin: 0 0 0.6rem;
  color: var(--md-default-fg-color);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
}

.md-typeset .dt-hero p {
  max-width: 40rem;
  font-size: 0.9rem;
}

.md-typeset .dt-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.md-typeset .dt-hero__actions p {
  display: contents;
}

.md-typeset .dt-hero a.md-button {
  margin: 0;
  text-decoration: none;
}

/* White on the dark-mode orange is only 2.8:1. Dark text gives 6.5:1, and
   8.2:1 on the lighter hover orange. */
[data-md-color-scheme="slate"] .md-typeset .md-button--primary,
[data-md-color-scheme="slate"] .md-typeset .md-button--primary:hover,
[data-md-color-scheme="slate"] .md-typeset .md-button--primary:focus {
  color: #14171C;
}

/* ---------- Learning path ---------- */

.md-typeset .dt-path {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0.4rem;
  margin: 1.2rem 0 1.6rem;
}

.md-typeset .dt-path__arrow {
  display: flex;
  align-items: center;
  color: var(--dt-muted);
}

.md-typeset .dt-path__arrow svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* Step cards: a big emoji with the step number in the corner */
.md-typeset .dt-card__media.dt-card__media--step {
  position: relative;
  background: var(--dt-icon-bg);
}

.md-typeset .dt-emoji {
  font-size: 3rem;
  line-height: 1;
}

.md-typeset .dt-step {
  position: absolute;
  top: 0.5rem;
  left: 0.8rem;
  color: var(--dt-vermilion);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media screen and (max-width: 59.9844em) {
  .md-typeset .dt-path {
    grid-template-columns: 1fr;
  }

  .md-typeset .dt-path__arrow {
    justify-content: center;
    transform: rotate(90deg);
  }
}

/* ---------- Prerequisite links ---------- */

.md-typeset .dt-subhead {
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.md-typeset .dt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.md-typeset a.dt-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.8rem 0.35rem 0.4rem;
  border: 1px solid var(--dt-card-border);
  border-radius: 6px;
  color: var(--md-default-fg-color);
  font-size: 0.75rem;
  font-weight: 600;
}

.md-typeset a.dt-pill img {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0.15rem;
  border-radius: 4px;
  background: var(--dt-logo-bg);
  object-fit: contain;
}

.md-typeset a.dt-pill:hover,
.md-typeset a.dt-pill:focus-visible {
  border-color: var(--md-accent-fg-color);
}

/* ---------- Filters ---------- */

.md-typeset .dt-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin: 1rem 0 0.5rem;
}

.md-typeset .dt-filter[hidden] {
  display: none;
}

.md-typeset .dt-filter__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.md-typeset .dt-filter__label {
  margin-right: 0.3rem;
  color: var(--dt-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.md-typeset .dt-chip {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--dt-card-border);
  border-radius: 4px;
  background: transparent;
  color: var(--md-default-fg-color);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.md-typeset .dt-chip:hover {
  border-color: var(--md-accent-fg-color);
}

.md-typeset .dt-chip[aria-pressed="true"] {
  border-color: var(--md-default-fg-color);
  background: var(--md-default-fg-color);
  color: var(--md-default-bg-color);
}

.md-typeset .dt-filter__empty {
  flex-basis: 100%;
  margin: 0;
  color: var(--dt-muted);
  font-size: 0.8rem;
}

/* ---------- Catalog sections ---------- */

.md-typeset h3.dt-section {
  margin-top: 2.4rem;
  font-size: 1.05rem;
}

.md-typeset .dt-section__intro {
  margin-top: 0.2rem;
  color: var(--dt-muted);
  font-size: 0.8rem;
}

.md-typeset .dt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

/* ---------- Cards ---------- */

.md-typeset .dt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dt-card-border);
  border-radius: 6px;
  background: var(--dt-card-bg);
  transition: border-color 0.15s;
}

.md-typeset .dt-card:hover,
.md-typeset .dt-card:focus-within {
  border-color: var(--md-default-fg-color--light);
}

/* Logo panel. Logos keep a light background in both schemes, because many
   of them (GitHub, LHCb, HSF) are dark artwork with no light variant. */
.md-typeset .dt-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6.5rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--dt-card-border);
  background: var(--dt-logo-bg);
}

.md-typeset .dt-card__media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Cards without a logo get a quieter panel with a line icon */
.md-typeset .dt-card__media--icon {
  background: var(--dt-icon-bg);
  color: var(--dt-muted);
}

.md-typeset .dt-card__media--icon svg {
  width: 2.2rem;
  height: 2.2rem;
  stroke-width: 1.5;
}

.md-typeset .dt-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.8rem 1rem 0.8rem;
}

.md-typeset h3.dt-card__title {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.md-typeset .dt-card__title a {
  color: var(--md-default-fg-color);
}

/* The whole card is clickable through the title link */
.md-typeset .dt-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.md-typeset .dt-card__title a:hover,
.md-typeset .dt-card__title a:focus-visible {
  color: var(--md-accent-fg-color);
}

.md-typeset .dt-card__desc {
  flex: 1;
  margin: 0 0 0.6rem;
  color: var(--dt-muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.md-typeset .dt-card__meta {
  margin: 0;
  color: var(--dt-muted);
  font-size: 0.68rem;
}

.md-typeset .dt-status {
  color: var(--dt-status-fg);
}

/* Secondary links sit above the whole-card link so they stay clickable */
.md-typeset a.dt-card__link {
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.md-typeset .dt-card[hidden] {
  display: none;
}

/* ---------- Help and footer ---------- */

.md-typeset .dt-help {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.md-typeset .dt-help > div {
  padding: 0.9rem 1rem;
  border: 1px solid var(--dt-card-border);
  border-radius: 6px;
  font-size: 0.78rem;
}

.md-typeset .dt-help p {
  margin: 0;
}

.md-typeset .dt-footnote {
  margin-top: 2.5rem;
  color: var(--dt-muted);
  font-size: 0.72rem;
}

@media screen and (max-width: 44.9844em) {
  .md-typeset .dt-hero h1 {
    font-size: 1.7rem;
  }
}

/* Search button on the navy header: the dark-mode look in both schemes.
   Zensical renders search as a button, not the Material form and input. */
.md-header .md-search__button {
  color: rgba(226, 228, 233, 0.82);
  background-color: rgba(226, 228, 233, 0.12);
}

.md-header .md-search__button:hover {
  background-color: rgba(226, 228, 233, 0.2);
}

.md-header .md-search__button::before {
  background-color: rgba(226, 228, 233, 0.82);
}

.md-header .md-search__button::after {
  color: rgba(226, 228, 233, 0.82);
  background-color: rgba(11, 12, 15, 0.54);
}
