/* The TV apps' menu: a gallery of towns, with recently watched towns in a sidebar. Sized in
   vw so it reads the same from the couch on any TV, with 5% kept clear on every side for
   TVs that crop the edges. Aim for Chromium 68 (no flex gap, no min()/clamp()). */
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

html, body { margin: 0; height: 100%; overflow: hidden; background: #062a19; color: #fff; }
body { font-family: 'Barlow Condensed', system-ui, sans-serif; font-weight: 700; cursor: none; }
a { outline: none; text-decoration: none; }

/* The header and sidebar stay put and only the gallery scrolls, inside the safe area. */
.tv { box-sizing: border-box; height: 100%; padding: 2.8vw 5vw 3vw; display: flex; flex-direction: column; }
.tv-head { flex: none; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2vw; }
.tv-logo { height: 3.4vw; width: auto; display: block; }
.tv-head p { margin: 0; font-size: 2.4vw; color: #f5a623; text-transform: uppercase; letter-spacing: .04em; }
.tv-body { flex: 1; min-height: 0; display: flex; }
.tv-keys { flex: none; margin: 1vw 0 0; font-size: 1.4vw; color: #dbe6d3; letter-spacing: .04em; text-align: right; }
[hidden] { display: none; }

/* Sidebar: the towns this TV watched last, newest first. */
.tv-recent { flex: none; width: 19vw; margin-right: 2vw; padding: 1.2vw; box-sizing: border-box; border-radius: .8vw; background: #0b3b24; overflow: hidden; }
.tv-recent h2 { margin: 0 0 1vw; font-size: 1.6vw; color: #f5a623; text-transform: uppercase; letter-spacing: .05em; }
.tv-recent-town {
  display: block; margin-bottom: .8vw; padding: .9vw 1.1vw; border-radius: .5vw; background: #062a19; color: #fff;
  font-size: 2vw; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: .25vw solid transparent;
}
.tv-recent-town small { display: block; margin-top: .2vw; font-size: 1.2vw; font-weight: 600; color: #dbe6d3; }
.tv-recent-town:focus { background: #f5a623; color: #062a19; border-color: #fff; }
.tv-recent-town:focus small { color: #062a19; }

/* Gallery: one card per town. */
.tv-grid {
  flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: .8vw;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 8vw; grid-gap: 1.2vw; align-content: start;
}
.tv-grid::-webkit-scrollbar { display: none; }
.tv-town {
  box-sizing: border-box; height: 8vw; display: flex; flex-direction: column; justify-content: center; padding: 0 1.2vw;
  border-radius: .8vw; color: #fff; border: .3vw solid transparent; overflow: hidden;
  background: #0b3b24 linear-gradient(135deg, #1c5236 0%, #0b3b24 70%);
}
.tv-town-name { font-size: 2.2vw; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-town-meta { margin-top: .3vw; font-size: 1.3vw; font-weight: 600; color: #dbe6d3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-town:focus { background: #f5a623; color: #062a19; border-color: #fff; transform: scale(1.05); }
.tv-town:focus .tv-town-meta { color: #062a19; }
