/* Mod map page (mods.html only). Everything is scoped to .modmap and prefixed mm-, so it
   can't touch the rest of the site; colours and fonts follow the site's palette. */

.section.section-mods {
  padding-top: calc(76px + clamp(2.2rem, 5vw, 3.5rem));
}

.section-mods .section-head {
  max-width: 820px;
  margin-bottom: 1.8rem;
}

.section-mods .section-head p + p {
  margin-top: 0.8rem;
}

.mm-intro-link {
  color: color-mix(in srgb, var(--text-primary) 80%, var(--gold) 20%);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.mm-intro-link:hover,
.mm-intro-link:focus-visible {
  color: var(--gold);
}

.modmap {
  --mm-ink: var(--text-primary);
  --mm-muted: var(--text-secondary);
  --mm-faint: rgba(185, 175, 162, 0.62);
  --mm-line: rgba(242, 238, 231, 0.12);
  --mm-line-gold: rgba(200, 161, 95, 0.3);
  --mm-hover: rgba(200, 161, 95, 0.1);
  --mm-chip: rgba(242, 238, 231, 0.06);
  --mm-mod: #8fb59a;       /* a category's own mods; "addon / built on" lines */
  --mm-works: #c8a15f;     /* "works together" */
  --mm-support: #86a3c9;   /* "has support for" */
  --mm-elysian: #f0c56e;   /* Elysian's own mods */
  --mm-outside: rgba(242, 238, 231, 0.24);
  display: grid;
  gap: 22px;
  color: var(--mm-ink);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* The site's global heading, paragraph and link rules are reset here. */
.modmap h2,
.modmap h3 {
  margin: 0;
  line-height: 1.2;
  text-transform: none;
}

.modmap h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mm-ink);
}

.modmap h3 {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.modmap p {
  margin: 0;
  font-size: inherit;
  color: var(--mm-muted);
}

.modmap a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.modmap button {
  font: inherit;
}

.modmap button:focus-visible,
.modmap input:focus-visible,
.modmap a:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

/* search and key */
.mm-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}

.mm-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 440px;
}

.mm-search input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--mm-line-gold);
  border-radius: var(--radius);
  background: rgba(17, 16, 13, 0.85);
  color: var(--mm-ink);
  font: inherit;
}

.mm-search input::placeholder {
  color: var(--mm-faint);
}

.mm-search ul {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 100%;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  max-height: 300px;
  overflow: auto;
  background: rgb(23, 20, 16);
  border: 1px solid var(--mm-line-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.mm-search li button {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--mm-ink);
  text-align: left;
  cursor: pointer;
}

.mm-search li button:hover,
.mm-search li button:focus-visible {
  background: var(--mm-hover);
  outline: none;
}

.mm-sub {
  color: var(--mm-faint);
  font-size: 0.85em;
}

.mm-empty {
  padding: 6px 8px;
  color: var(--mm-faint);
}

.mm-key {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--mm-muted);
  font-size: 0.85rem;
}

.mm-key i {
  display: inline-block;
  width: 24px;
  border-top: 2.5px solid currentColor;
}

/* map and side panel */
.mm-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
  scroll-margin-top: 96px;
}

@media (max-width: 980px) {
  .mm-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mm-mapbox {
  min-width: 0;
}

.mm-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 10px 0;
}

.mm-crumbs button {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--gold);
  cursor: pointer;
}

.mm-crumbs span {
  color: var(--mm-faint);
}

.mm-crumbs strong {
  font-weight: 400;
  color: var(--mm-ink);
}

svg#mmMap {
  display: block;
  width: 100%;
  height: 600px;
}

@media (max-width: 640px) {
  svg#mmMap {
    height: 560px;
  }
}

.mm-hint {
  padding: 8px 0;
  color: var(--mm-faint);
  font-size: 0.82rem;
}

.mm-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
  max-height: 700px;
  overflow: auto;
  padding: 10px 4px 0 0;
  scrollbar-width: thin;
  scrollbar-color: var(--mm-line-gold) transparent;
}

@media (max-width: 980px) {
  .mm-panel {
    max-height: none;
    overflow: visible;
  }
}

.modmap .mm-full-list {
  font-size: 0.9rem;
}

.mm-lede {
  margin-top: 6px !important;
}

.mm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--mm-muted);
  font-size: 0.85rem;
}

.mm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mm-chips.mm-spaced {
  margin-top: 8px;
}

.mm-chip {
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--mm-chip);
  color: var(--mm-muted);
  font-size: 0.85rem;
}

button.mm-chip {
  color: var(--mm-ink);
  cursor: pointer;
}

button.mm-chip:hover {
  background: var(--mm-hover);
  border-color: var(--mm-line-gold);
}

button.mm-chip.mm-is-elysian {
  color: var(--mm-elysian);
}

/* category colour key: a small square like the ones on the map */
.mm-swatch {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.5em;
  background: var(--c);
  vertical-align: 0.04em;
}

h2 .mm-swatch {
  width: 0.45em;
  height: 0.45em;
  vertical-align: 0.12em;
}

.mm-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
  color: var(--mm-elysian);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: 3px;
}

.mm-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.mm-who {
  padding: 0;
  border: 0;
  background: none;
  color: var(--mm-ink);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--mm-line-gold);
  text-underline-offset: 3px;
}

.mm-who:hover {
  color: var(--gold);
  text-decoration-color: currentColor;
}

.modmap .mm-why {
  color: var(--mm-muted);
  font-size: 0.85rem;
}

/* labels on the map: 10px is one screen pixel per font pixel, so the pixel font stays sharp */
.mm-node text {
  font: 10px "Slightly Improved", "Sora", sans-serif;
  fill: var(--mm-ink);
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
}

.mm-cnode text {
  font: 600 15px "Cormorant Garamond", serif;
  fill: var(--mm-ink);
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
}

.mm-cnode text.mm-count {
  font: 10px "Slightly Improved", "Sora", sans-serif;
  fill: var(--mm-muted);
}

@media (prefers-reduced-motion: reduce) {
  .modmap * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
