/* 06-components/ff-site — a FiniteFrontier city's own site (layouts/ff_city,
   freehold.finitefrontier.com): the city's masthead (its bell and name, the
   economy day, sign-in), its sections as large item-icon links, the page
   heading, the front page and the foot. Icons are Minecraft textures, drawn
   block-sharp at whole multiples of 16px. */

/* ── Masthead ─────────────────────────────────────────────────────────── */
.c-ff-site {
  border-block-end: 1px solid var(--rule);
  background: color-mix(in srgb, var(--brand) 3%, transparent);
  padding-block: var(--space-sm) var(--space-md);
}
.c-ff-site__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-lg);
}
.c-ff-site__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--brand);
  text-decoration: none;
}
.c-ff-site__mark { image-rendering: pixelated; flex: none; }
.c-ff-site__name {
  font-family: var(--font-chrome);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-chrome);
  text-shadow: var(--glow) color-mix(in srgb, var(--brand) 45%, transparent);
}
.c-ff-site__brand:hover .c-ff-site__name { text-shadow: var(--glow) var(--brand); }

.c-ff-site__status {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-md);
  font-family: var(--font-chrome);
  font-size: var(--text-sm);
}
.c-ff-site__day { color: var(--value); }
.c-ff-site__live { color: var(--brand); }
.c-ff-site__live::before { content: "● "; }

.c-ff-site__auth {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-chrome);
  font-size: var(--text-sm);
}
.c-ff-site__user {
  color: var(--ink);
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Sections: one row of large links, three to a row on a phone ─────── */
.c-ff-site__nav {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-xs);
}
.c-ff-site__link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 3.5rem;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--link);
  font-family: var(--font-chrome);
  font-size: var(--text-md);
  letter-spacing: var(--tracking-chrome);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.c-ff-site__link:hover {
  border-color: color-mix(in srgb, var(--link) 60%, transparent);
  background: color-mix(in srgb, var(--link) 6%, var(--surface));
}
/* The section you are in: brand colour, a brand frame and a bar under it (not colour alone). */
.c-ff-site__link.is-active {
  color: var(--brand);
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  box-shadow: inset 0 -3px 0 var(--brand);
}
.c-ff-site__icon { image-rendering: pixelated; flex: none; }
/* A villager's face cut from its 64×64 skin (face at 8,8, 8×10), drawn ×4. */
.c-ff-site__face {
  flex: none;
  width: 32px;
  height: 40px;
  margin-block: -4px;
  background-repeat: no-repeat;
  background-size: 256px 256px;
  background-position: -32px -32px;
  image-rendering: pixelated;
}

/* Six to a row needs about 62rem before the longer labels ("Deliveries") clip. */
@media (max-width: 62rem) {
  .c-ff-site__nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-ff-site__link {
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2xs);
    font-size: var(--text-sm);
    text-align: center;
  }
}

/* ── A page's heading (ff/shared/_header) ────────────────────────────── */
.c-ff-page-head { display: flex; flex-direction: column; gap: var(--space-xs); }
.c-ff-page-head h1 { margin: 0; }
.c-ff-page-head__lede {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-dim);
}

/* ── The front page (ff/cities/show) ─────────────────────────────────── */
.c-ff-front__hero { position: relative; display: block; }
.c-ff-front__hero > img { display: block; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; image-rendering: pixelated; }
.c-ff-front__hero-cta {
  position: absolute;
  inset-inline-end: var(--space-md);
  inset-block-end: var(--space-md);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  color: var(--brand);
  font-family: var(--font-chrome);
  font-size: var(--text-md);
}
.c-ff-front__intro {
  max-width: var(--measure);
  font-family: var(--font-read);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--ink-read);
  margin: var(--space-sm) 0 0;
}
@media (max-width: 52rem) {
  .c-ff-front__hero > img { aspect-ratio: 4 / 3; }
  .c-ff-front__hero-cta { font-size: var(--text-sm); inset-inline-end: var(--space-xs); inset-block-end: var(--space-xs); }
}
.c-ff-front__cards { --o-grid-gap: var(--space-sm); }
.c-ff-front__card { display: flex; gap: var(--space-md); align-items: flex-start; color: inherit; text-decoration: none; }
.c-ff-front__card .c-ff-site__icon,
.c-ff-front__card .c-ff-site__face { margin-block-start: var(--space-2xs); }
.c-ff-front__card h2 { margin: 0 0 var(--space-2xs); font-size: var(--text-lg); color: var(--link); }
.c-ff-front__card p { margin: 0; color: var(--ink-dim); font-family: var(--font-read); line-height: 1.5; }
.c-ff-front__visit h2 { margin: 0; font-size: var(--text-lg); }
.c-ff-front__visit p { margin: 0; }
.c-ff-front__address { color: var(--value); font-family: var(--font-chrome); font-size: var(--text-lg); }

/* ── The city map under the masthead: the viewer fills what the masthead leaves ── */
.c-terminal-frame:has(.c-ff-site__main--bleed) { height: 100svh; }
.c-ff-site__main--bleed { position: relative; min-height: 0; padding: 0; }
.c-ff-site__main--bleed .c-map-viewer { position: absolute; }

/* ── The foot: where to play, and the one link back to the main site ── */
.c-ff-site__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-lg);
  font-family: var(--font-chrome);
  font-size: var(--text-xs);
  color: var(--ink-dim);
}
.c-ff-site__foot p { margin: 0; }
.c-ff-site__foot a { color: var(--ink-dim); }
.c-ff-site__foot a:hover { color: var(--link); }
.c-ff-site__address { color: var(--value); }

/* ── The richest burghers (ff/burghers/_showcase): three, two or one to a row ── */
.c-ff-showcase {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
@media (max-width: 64rem) { .c-ff-showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .c-ff-showcase { grid-template-columns: minmax(0, 1fr); } }
.c-ff-showcase__card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-xs) var(--space-md);
  align-content: start;
}
.c-ff-showcase__rank {
  position: absolute;
  inset-block-start: var(--space-xs);
  inset-inline-end: var(--space-sm);
  font-family: var(--font-chrome);
  color: var(--value);
}
.c-ff-showcase__portrait { grid-row: span 2; align-self: start; }
.c-ff-showcase__who { min-width: 0; padding-inline-end: var(--space-lg); }
.c-ff-showcase__who h2 { margin: 0; font-size: var(--text-lg); overflow-wrap: anywhere; }
.c-ff-showcase__who p { margin: var(--space-2xs) 0 0; font-size: var(--text-sm); }
.c-ff-showcase__stats { margin: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
.c-ff-showcase__stats dt { font-family: var(--font-chrome); font-size: var(--text-xs); color: var(--ink-dim); }
.c-ff-showcase__stats dd { margin: 0; font-family: var(--font-chrome); }
.c-ff-showcase__money { color: var(--value); font-size: var(--text-xl); }
.c-ff-showcase__goods { grid-column: 1 / -1; display: flex; gap: var(--space-sm); align-items: flex-start; }
.c-ff-showcase__goods-label {
  flex: none;
  width: 3.5rem;
  padding-block-start: 3px;
  font-family: var(--font-chrome);
  font-size: var(--text-xs);
  color: var(--ink-dim);
}
.c-ff-showcase__goods ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.c-ff-showcase__goods li { line-height: 0; }
.c-ff-showcase__goods > .u-dim { font-size: var(--text-sm); }
.c-ff-showcase__goods li.u-dim { line-height: normal; font-family: var(--font-chrome); font-size: var(--text-sm); padding-inline-start: 2px; }
.c-ff-showcase__goods img { image-rendering: pixelated; display: block; }
