/* Voxel Dynasties encyclopedia: lists, entries, change log.
   Colours come from site.yml (--fkw-color-*); gold is the primary colour.
   Mobile first: one column, then two, then the full grid. */

.vd-intro { padding-block: 0.5rem 0; }
.vd-intro .fkw-prose { max-width: 70ch; color: var(--fkw-color-muted); }
.vd-shell {
  --vd-gold: var(--fkw-color-primary);
  --vd-line: color-mix(in srgb, var(--fkw-color-primary) 18%, transparent);
  --vd-line-strong: color-mix(in srgb, var(--fkw-color-primary) 42%, transparent);
  --vd-surface-2: color-mix(in srgb, var(--fkw-color-surface) 82%, white 6%);
  --vd-up: #7fd18b;
  --vd-down: #f08a7e;
  padding-block: 1.25rem 3.5rem;
}

.vd-h2, .vd-h3, .vd-h4, .vd-hero__title, .vd-tile__title {
  font-family: var(--fkw-font-heading);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  margin: 0;
}
.vd-h2 { font-size: var(--fkw-step-2); margin-block: 2.5rem 1rem; }
.vd-h3 { font-size: var(--fkw-step-0); color: var(--vd-gold); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.9rem; }
.vd-h4 { font-size: var(--fkw-step-0); margin-block: 1rem 0.4rem; }
.vd-muted { color: var(--fkw-color-muted); font-size: 0.92rem; }
.vd-version { color: var(--fkw-color-muted); font-size: 0.88rem; margin: 0 0 1rem; }

/* ---- Sub navigation ------------------------------------------------------ */

.vd-kindnav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--fkw-gutter, 1rem)) 1.25rem;
  padding: 0 var(--fkw-gutter, 1rem) 0.9rem;
  border-bottom: 1px solid var(--vd-line);
}
.vd-kindnav::-webkit-scrollbar { display: none; }
.vd-kindnav__link {
  flex: none;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--fkw-color-muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.vd-kindnav__link:hover { color: var(--fkw-color-text); background: var(--fkw-color-surface); }
.vd-kindnav__link.is-current { color: var(--vd-gold); border-color: var(--vd-line-strong); background: var(--fkw-color-surface); }

/* ---- Badges -------------------------------------------------------------- */

.vd-age, .vd-badge, .vd-flag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.vd-age { background: color-mix(in srgb, var(--vd-gold) 16%, transparent); color: var(--vd-gold); }
.vd-badge { background: var(--vd-surface-2); color: var(--fkw-color-text); font-weight: 500; }
.vd-flag { background: var(--vd-gold); color: var(--fkw-color-background); }

/* ---- Overview tiles ------------------------------------------------------ */

.vd-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 720px) { .vd-tiles { grid-template-columns: repeat(3, 1fr); } }
.vd-tile__link {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
  padding: 1.1rem;
  border-radius: var(--fkw-radius);
  border: 1px solid var(--vd-line);
  background: linear-gradient(160deg, var(--fkw-color-surface), var(--fkw-color-background));
  color: var(--fkw-color-text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.vd-tile__link:hover { border-color: var(--vd-line-strong); transform: translateY(-2px); }
.vd-tile__images { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
.vd-tile__images img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; background: var(--fkw-color-background); }
.vd-tile__title { font-size: var(--fkw-step-1); display: flex; align-items: baseline; gap: 0.5rem; }
.vd-tile__count { font-family: var(--fkw-font-body); font-size: 0.85rem; color: var(--vd-gold); }
.vd-tile__text { color: var(--fkw-color-muted); font-size: 0.95rem; }

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

.vd-filters {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 calc(-1 * var(--fkw-gutter, 1rem)) 1.25rem;
  padding: 0.7rem var(--fkw-gutter, 1rem);
  background: color-mix(in srgb, var(--fkw-color-background) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--vd-line);
}
.vd-search {
  flex: 1 1 14rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: var(--fkw-color-surface);
  border: 1px solid var(--vd-line);
  color: var(--fkw-color-muted);
}
.vd-search:focus-within { border-color: var(--vd-gold); }
.vd-search input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0;
  border: 0;
  background: none;
  color: var(--fkw-color-text);
  font: inherit;
  outline: none;
}
.vd-filters__more { flex: none; }
.vd-filters__more > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--vd-line-strong);
  color: var(--vd-gold);
  font-weight: 600;
  font-size: 0.92rem;
}
.vd-filters__more > summary::-webkit-details-marker { display: none; }
.vd-filters__badge { min-width: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: var(--vd-gold); color: var(--fkw-color-background); font-size: 0.75rem; text-align: center; }
.vd-filters__more[open] {
  flex-basis: 100%;
  order: 3;
}
.vd-filters__more[open] > summary { margin-bottom: 0.75rem; }
.vd-filters__grid { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
@media (min-width: 560px) { .vd-filters__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .vd-filters__grid { grid-template-columns: repeat(6, 1fr); } }
.vd-select { display: grid; gap: 0.25rem; font-size: 0.8rem; color: var(--fkw-color-muted); }
.vd-select select {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--vd-line);
  background: var(--fkw-color-surface);
  color: var(--fkw-color-text);
  font: inherit;
  font-size: 0.92rem;
}
.vd-reset {
  margin-top: 0.75rem;
  padding: 0.4rem 0;
  border: 0;
  background: none;
  color: var(--fkw-color-muted);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: underline;
  cursor: pointer;
}
.vd-count { margin: 0 0 0 auto; color: var(--fkw-color-muted); font-size: 0.88rem; white-space: nowrap; }

/* ---- Card grid ----------------------------------------------------------- */

.vd-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 640px) { .vd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 960px) { .vd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .vd-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.vd-card[hidden] { display: none; }
.vd-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--fkw-radius);
  overflow: hidden;
  border: 1px solid var(--vd-line);
  background: var(--fkw-color-surface);
  color: var(--fkw-color-text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.vd-card__link:hover, .vd-card__link:focus-visible {
  border-color: var(--vd-line-strong);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.35);
}
.vd-card.is-changed .vd-card__link { border-color: var(--vd-line-strong); }
.vd-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 35%, var(--vd-surface-2), var(--fkw-color-background) 75%);
}
/* The portraits are rendered on black; lighten lets the gradient show through there. */
.vd-card__media, .vd-hero__media, .vd-tile__images, .vd-line__step a, .vd-link, .vd-change__entry { isolation: isolate; }
.vd-card__media img, .vd-hero__media img, .vd-tile__images img, .vd-line__step img, .vd-link img, .vd-change__entry img { mix-blend-mode: lighten; }
.vd-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-card__age { position: absolute; left: 0.5rem; bottom: 0.5rem; background: rgb(10 18 32 / 0.82); }
.vd-card__media .vd-flag { position: absolute; right: 0.5rem; top: 0.5rem; }
.vd-card__body { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.7rem 0.75rem 0.8rem; flex: 1; }
.vd-card__name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.vd-card__badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.vd-card__badges .vd-badge { font-size: 0.7rem; white-space: normal; }
.vd-card__stats { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: auto; font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--fkw-color-text); }
.vd-card__stats abbr { text-decoration: none; color: var(--fkw-color-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.vd-empty { padding: 3rem 0; text-align: center; color: var(--fkw-color-muted); }

/* ---- Entry --------------------------------------------------------------- */

.vd-notice { padding: 0.75rem 1rem; border-radius: var(--fkw-radius); background: color-mix(in srgb, var(--vd-down) 18%, transparent); }
.vd-hero { display: grid; gap: 1.25rem; margin-bottom: 1.5rem; }
@media (min-width: 760px) { .vd-hero { grid-template-columns: minmax(240px, 380px) 1fr; gap: 2.25rem; align-items: start; } }
.vd-hero__media {
  border-radius: calc(var(--fkw-radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--vd-line);
  background: radial-gradient(circle at 50% 35%, var(--vd-surface-2), var(--fkw-color-background) 75%);
  aspect-ratio: 1;
  max-width: 420px;
}
.vd-hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-hero__placeholder { display: block; width: 100%; height: 100%; }
.vd-back { display: inline-block; margin-bottom: 0.6rem; color: var(--fkw-color-muted); font-size: 0.9rem; text-decoration: none; }
.vd-back:hover { color: var(--vd-gold); }
.vd-hero__title { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; }
.vd-hero__alt { margin: 0.3rem 0 0; color: var(--fkw-color-muted); font-style: italic; }
.vd-hero__badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0; }
.vd-hero__desc { font-size: 1.05rem; line-height: 1.6; max-width: 60ch; }

.vd-cost { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.vd-cost__item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  background: var(--fkw-color-surface);
  border: 1px solid var(--vd-line);
  border-left: 3px solid var(--vd-res, var(--vd-gold));
}
.vd-cost__item dt { font-size: 0.78rem; color: var(--fkw-color-muted); }
.vd-cost__item dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.vd-res--food { --vd-res: #e0805e; }
.vd-res--wood { --vd-res: #a4794a; }
.vd-res--stone { --vd-res: #a7b0bd; }
.vd-res--gold { --vd-res: #f1d989; }
.vd-res--iron { --vd-res: #7c8a9e; }
.vd-res--oil { --vd-res: #3c4656; }
.vd-res--saltpeter { --vd-res: #e8e2d0; }
.vd-res--uranium { --vd-res: #8fdc5b; }

.vd-panels { display: grid; gap: 1rem; }
@media (min-width: 760px) { .vd-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vd-panel--wide { grid-column: 1 / -1; } }
.vd-panel {
  padding: 1.1rem 1.2rem 1.25rem;
  border-radius: var(--fkw-radius);
  border: 1px solid var(--vd-line);
  background: var(--fkw-color-surface);
  min-width: 0;
}
.vd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.6rem; margin: 0; }
.vd-stats div { padding: 0.6rem 0.75rem; border-radius: 10px; background: var(--fkw-color-background); }
.vd-stats dt { font-size: 0.75rem; color: var(--fkw-color-muted); }
.vd-stats dd { margin: 0.1rem 0 0; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }

.vd-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.vd-bars li { display: grid; grid-template-columns: 6.5rem 1fr 2.5rem; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.vd-bars__label { color: var(--fkw-color-muted); }
.vd-bars__track { height: 0.5rem; border-radius: 999px; background: var(--fkw-color-background); overflow: hidden; }
.vd-bars__fill { display: block; height: 100%; width: var(--vd-fill); border-radius: inherit; background: linear-gradient(90deg, var(--fkw-color-accent), var(--vd-gold)); }
.vd-bars__value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.vd-table-wrap { overflow-x: auto; }
.vd-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.vd-table th, .vd-table td { padding: 0.55rem 0.6rem; text-align: left; border-bottom: 1px solid var(--vd-line); vertical-align: top; }
.vd-table thead th { font-size: 0.75rem; color: var(--fkw-color-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.vd-table tbody th { font-weight: 600; }
.vd-dmg { display: inline-block; margin-right: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.vd-dmg small { font-weight: 400; color: var(--fkw-color-muted); }

.vd-effects { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }

.vd-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.vd-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.8rem 0.3rem 0.3rem;
  border-radius: 12px;
  background: var(--fkw-color-background);
  border: 1px solid var(--vd-line);
  color: var(--fkw-color-text);
  text-decoration: none;
  font-size: 0.92rem;
}
a.vd-link:hover { border-color: var(--vd-line-strong); color: var(--vd-gold); }
.vd-link img { border-radius: 8px; }
.vd-link span { display: grid; line-height: 1.2; }
.vd-link small { color: var(--fkw-color-muted); font-size: 0.72rem; }

.vd-line {
  list-style: none;
  margin: 0;
  padding: 0 0 0.4rem;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.vd-line__step { flex: none; scroll-snap-align: start; position: relative; }
.vd-line__step + .vd-line__step::before {
  content: "";
  position: absolute;
  left: -0.6rem;
  top: 2.6rem;
  width: 0.6rem;
  height: 2px;
  background: var(--vd-line-strong);
}
.vd-line__step a {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  width: 7.5rem;
  padding: 0.6rem 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--vd-line);
  background: var(--fkw-color-background);
  color: var(--fkw-color-text);
  text-decoration: none;
  text-align: center;
}
.vd-line__step a:hover { border-color: var(--vd-line-strong); }
.vd-line__step.is-current a { border-color: var(--vd-gold); box-shadow: 0 0 0 1px var(--vd-gold) inset; }
.vd-line__step img { border-radius: 8px; }
.vd-line__name { font-size: 0.85rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.vd-line__age { font-size: 0.7rem; color: var(--fkw-color-muted); }

.vd-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.vd-entry__foot { margin-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }
.vd-entry__foot p { margin: 0; }

/* ---- Changes ------------------------------------------------------------- */

.vd-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
@media (min-width: 900px) { .vd-changes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vd-change {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--fkw-radius);
  border: 1px solid var(--vd-line);
  background: var(--fkw-color-surface);
}
.vd-change__entry { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--fkw-color-text); text-decoration: none; }
.vd-change__entry:hover { color: var(--vd-gold); }
.vd-change__entry img { border-radius: 8px; }
.vd-change__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.9rem; }
.vd-change__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; padding: 0.3rem 0; border-top: 1px solid var(--vd-line); }
.vd-change__row:first-child { border-top: 0; }
.vd-change__row--added { color: var(--vd-up); }
.vd-change__row--removed { color: var(--vd-down); }
.vd-change__field { color: var(--fkw-color-muted); }
.vd-change__values { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vd-change__values del { color: var(--fkw-color-muted); }
.vd-change__values ins { text-decoration: none; font-weight: 600; }
.vd-change__values ins.is-up { color: var(--vd-up); }
.vd-change__values ins.is-down { color: var(--vd-down); }
.vd-release + .vd-release { margin-top: 1rem; padding-top: 0.5rem; border-top: 1px solid var(--vd-line); }
.vd-notes { margin-top: 1rem; }
.vd-notes summary { cursor: pointer; color: var(--vd-gold); font-weight: 600; }
.vd-recent { margin-top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .vd-card__link, .vd-tile__link { transition: none; }
  .vd-card__link:hover, .vd-tile__link:hover { transform: none; }
}

/* ---- Site frame ---------------------------------------------------------- */

.fkw h1, .fkw h2 { font-family: var(--fkw-font-heading); }
/* Dark text on the gold buttons; the package default is white. */
:root { --fkw-color-on-primary: #0e1826; --fkw-color-on-ink: #e7ecf3; --fkw-color-on-ink-muted: #97a9bf; }

/* ---- Home page ----------------------------------------------------------- */

.vd-home-hero { position: relative; isolation: isolate; min-height: min(88vh, 46rem); display: grid; align-items: end; overflow: hidden; }
.vd-home-hero picture, .vd-home-hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 25% 70%; z-index: -2; }
.vd-home-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(14 24 38 / 0.15) 0%, rgb(14 24 38 / 0.55) 55%, var(--fkw-color-background) 100%); }
.vd-home-hero__inner { padding-block: 6rem 3.5rem; }
.vd-home-hero__title { font-family: var(--fkw-font-heading); font-size: clamp(2.4rem, 8vw, 4.6rem); line-height: 1.05; color: #fff; margin: 0; text-shadow: 0 2px 18px rgb(0 0 0 / 0.55); }
.vd-home-hero__text { max-width: 42rem; font-size: clamp(1.05rem, 2.4vw, 1.3rem); line-height: 1.55; color: #f2f4f8; text-shadow: 0 1px 10px rgb(0 0 0 / 0.6); margin: 1rem 0 1.5rem; }
.vd-home-section { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
.vd-home-section .vd-h2 { margin-top: 0; }
.vd-pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 800px) { .vd-pillars { grid-template-columns: repeat(3, 1fr); } }
.vd-pillar { padding: 1.4rem; border-radius: var(--fkw-radius); border: 1px solid color-mix(in srgb, var(--fkw-color-primary) 18%, transparent); background: var(--fkw-color-surface); }
.vd-pillar__title { font-family: var(--fkw-font-heading); color: var(--fkw-color-primary); font-size: var(--fkw-step-1); margin: 0 0 0.6rem; }
.vd-pillar p { margin: 0; color: var(--fkw-color-muted); line-height: 1.6; }
.vd-home-trailer .fkw-embed { margin-top: 1.25rem; border-radius: var(--fkw-radius); overflow: hidden; }
.vd-features { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
.vd-feature { display: grid; gap: 1.25rem; align-items: center; }
@media (min-width: 860px) {
  .vd-feature { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .vd-feature:nth-child(even) .vd-feature__image { order: 2; }
  .vd-feature--text { grid-template-columns: 1fr; max-width: 46rem; }
}
.vd-feature__image { width: 100%; height: auto; border-radius: var(--fkw-radius); border: 1px solid color-mix(in srgb, var(--fkw-color-primary) 18%, transparent); }
.vd-feature__body p { color: var(--fkw-color-muted); line-height: 1.65; }
.vd-ages { list-style: none; margin: 1.25rem 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.6rem; }
.vd-ages a { display: grid; justify-items: center; gap: 0.35rem; padding: 0.5rem; border-radius: 12px; border: 1px solid var(--vd-line); background: var(--fkw-color-surface); color: var(--fkw-color-muted); text-decoration: none; font-size: 0.75rem; text-align: center; isolation: isolate; }
.vd-ages a:hover { border-color: var(--vd-line-strong); color: var(--fkw-color-primary); }
.vd-ages img { width: 100%; height: auto; mix-blend-mode: lighten; }
