/* Backen – dark navy theme; blue, pink and green accents (backen-style.pdf) */
@font-face {
  font-family: "Bernier Shade";
  src: url("/fonts/BERNIERShade-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

/* Palette and type come from backen-style.pdf (graphic designer).
   The guide specifies the brand block below verbatim. It does not define
   card/border/muted tones — the card screenshots in it are of the previous
   site — so those are derived from --bg here. */
:root {
  /* Brand – verbatim from the style guide */
  --blue: #2dbcf1;
  --pink: #ff5ab2;
  --green: #238040;
  --bg: #171c2b;
  --text: #edf0f2;

  /* Derived to sit on the navy */
  --bg-card: #1e2434;
  --bg-card-hover: #262d40;
  --border: #2e3650;
  --text-muted: #9aa3b5;
  --blue-dim: #1f9fd0;
  --pink-dim: #e63d97;
  /* Grey strip under the hero, straight from the guide. */
  --band: #363839;

  /* Legacy aliases. These two names have always held each other's colour:
     --cyan was #ff00aa (pink) and --magenta was #00d4ff (blue). Mapped by
     value so existing rules keep their intent. Prefer --blue/--pink below. */
  --cyan: var(--pink);
  --cyan-dim: var(--pink-dim);
  --magenta: var(--blue);
  --magenta-dim: var(--blue-dim);

  --radius: 8px;
  --font-sans: "Open Sans", system-ui, -apple-system, sans-serif;
  --font-display: Cambria, Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* A column of header, main and footer at least as tall as the window, so
     that #main can absorb the slack and the footer's margin-top: auto has
     something to push against. Without a flex parent that margin is inert,
     which is why a short page used to leave the footer floating mid-screen
     while the fixed rail carried on to the bottom edge beside it. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Mobile browsers report 100vh as the window with the toolbars retracted, so
   the footer sat below the fold until you scrolled. dvh tracks the height
   that is actually visible. */
@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

.dark-theme {
  background: var(--bg);
}

/* Links are body-coloured and underlined rather than tinted. Colour alone
   also would not have been a sufficient affordance once it stopped standing
   out, so the underline carries it and the accent appears only on hover. */
a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* Navigation and branding opt out of the underline; they are not prose. */
.nav-main a,
.rail-logo {
  text-decoration: none;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.header-nav-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

/* Logo uses Bernier Shade (backenlinkoping.com) */
.logo {
  font-family: "Bernier Shade", var(--font-display);
  font-weight: normal;
  font-size: 1.65rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-main > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.nav-main a {
  color: var(--text-muted);
  font-weight: 500;
}

.nav-main a:hover,
.nav-main a.active {
  color: var(--text);
  text-decoration: none;
}

.nav-item-has-sub {
  position: relative;
}

.nav-chevron {
  margin-left: 0.25rem;
  color: var(--text-muted);
  font-size: 0.65em;
  vertical-align: 0.15em;
  transition: transform 0.2s;
}

.nav-item-has-sub:hover .nav-chevron,
.nav-item-has-sub:focus-within .nav-chevron {
  transform: rotate(180deg);
  color: var(--text);
}

.nav-main a:hover .nav-chevron,
.nav-main a.active .nav-chevron {
  color: var(--text);
}

.nav-sub {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  min-width: 10rem;
  position: absolute;
  display: block;
  left: 0;
  top: calc(100% + 0.35rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 100;
}

.nav-item-has-sub:hover .nav-sub,
.nav-item-has-sub:focus-within .nav-sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-sub li {
  margin: 0;
  display: block;
}

.nav-sub a {
  display: block;
  padding: 0.45rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-sub a:hover,
.nav-sub a.active {
  color: var(--text);
  background: rgba(45, 188, 241, 0.1);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  margin-left: auto;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--cyan);
}

.nav-lang {
  position: relative;
  font-size: 0.9rem;
}

.lang-dropdown {
  position: relative;
}

.lang-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.2s, background 0.2s;
}

.lang-dropdown-trigger::-webkit-details-marker,
.lang-dropdown-trigger::marker {
  display: none;
}

.lang-dropdown-trigger:hover,
.lang-dropdown-trigger:focus {
  border-color: var(--cyan);
  background: rgba(45, 188, 241, 0.06);
  outline: none;
}

.lang-dropdown-trigger:focus-visible {
  box-shadow: 0 0 0 2px var(--cyan);
}

.lang-flag {
  font-size: 1.1em;
  line-height: 1;
}

.lang-chevron {
  margin-left: 0.2rem;
  color: var(--text-muted);
  font-size: 0.7em;
  transition: transform 0.2s;
}

.lang-dropdown[open] .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 100;
  min-width: 10rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.lang-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.lang-dropdown-menu a:hover {
  background: rgba(45, 188, 241, 0.1);
  color: var(--text);
  text-decoration: none;
}

/* Hero – 16:9 photo band, heading in the right half (backen-style.pdf).
   Two stacked layers so the rotating photos can crossfade; the markup sets
   the first layer's image inline and the inline script swaps in a random one
   before paint. */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  /* 56.25vw is the 16:9 proportion the guide draws, so up to ~1200px wide the
     band is exactly the guide's shape. Above that it is capped against the
     viewport *height* rather than a fixed size: the hero takes all the room
     there is bar 12rem, which guarantees the grey band below stays visible
     without the hero being needlessly short on a tall display.

     Set as a height rather than an aspect-ratio on purpose: with
     aspect-ratio, a floored height feeds back into the width
     (320px x 16/9 = 569px) and overflows a 375px viewport. */
  height: clamp(20rem, 56.25vw, calc(100vh - 12rem));
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
}

/* Anchored to the top, not centred. The photos are 16:9 but a wide desktop
   hero is nearer 3:1, so `cover` has to crop vertically. Centring took the
   middle 23–77% of each frame, which cut the faces out of three of the five
   photos — their subjects sit between 2% and 49% of frame height. Anchoring
   to the top keeps every face and discards the bar surface and stools at the
   bottom instead. */
.hero-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero-layer.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .hero-layer {
    transition: none;
  }
}

/* Intro band – the #363839 strip the guide puts under the hero, holding the
   intro copy that used to sit on top of the photo. */
.intro-band {
  background: var(--band);
}

.intro-band-text {
  padding: 2.6rem 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  line-height: 1.5;
  text-align: center;
  color: #fff;
}

.intro-band-text p {
  margin: 0 auto;
  max-width: 60ch;
}

.intro-band-text p + p {
  margin-top: 1.1em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-cyan {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}

.btn-cyan:hover {
  background: var(--cyan-dim);
  border-color: var(--cyan-dim);
  color: var(--bg);
}

.btn-magenta {
  background: var(--magenta);
  color: #fff;
  border-color: var(--magenta);
}

.btn-magenta:hover {
  background: var(--magenta-dim);
  border-color: var(--magenta-dim);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border-color: var(--cyan);
}

.btn-outline:hover {
  background: rgba(45, 188, 241, 0.12);
  color: var(--cyan);
}

/* Home sections */
.home-sections {
  padding: 2rem 0 4rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, background 0.2s;
}

.card-link {
  color: inherit;
  display: block;
}

.card-link:hover {
  border-color: var(--cyan);
  background: var(--bg-card-hover);
  text-decoration: none;
  color: var(--text);
}

.card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Latest beers on homepage. Top padding separates the heading from the grey
   intro band, which butts straight up against this section. */
.home-latest {
  padding: 2.75rem 0 3rem;
}

.home-latest-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 1.1rem;
}

/* Timeline of new beers. A single rule draws the spine, as a pseudo-element
   on the list, and each node caps it with a dot. The newest node is filled so
   the top of the list reads as "now". */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.44rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: var(--border);
}

.timeline-node {
  position: relative;
  padding: 0 0 1.5rem 2.1rem;
}

.timeline-node:last-child {
  padding-bottom: 0;
}

.timeline-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 1rem;
  height: 1rem;
  box-sizing: border-box;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
}

/* Only the newest entry carries the accent; the rest match the spine. */
.timeline-node:first-child::before {
  border-color: var(--blue);
  background: var(--blue);
}

.timeline-time {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.timeline-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Page headers */
.page {
  padding: 2rem 0 3rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 0.5rem;
  color: var(--text);
}

.page-intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 50ch;
}

.menu-page .page-intro {
  max-width: none;
}

/* About page */
.about-page .page-header {
  margin-bottom: 2rem;
}

.about-body {
  display: block;
  margin-bottom: 2.5rem;
}

/* The group photo spans the content width above the text. It used to sit in
   a column beside the text, stretched to the text's height, which made a
   tall portrait box: fine for three people standing, but a landscape photo
   of four seated would lose the outer two. The box ratio matches the crops
   in static/images/about/ (5:2 wide, 3:2 for phones, swapped by the
   <picture> in layouts/about/list.html), so nothing is cropped further, and
   because it is fixed the text does not jump when the image arrives. */
.about-body-with-image .about-image-wrap {
  margin: 0 0 1.75rem;
}

.about-body-with-image .about-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Full width would run the lines to well over a hundred characters. */
.about-content .about-intro {
  max-width: 65ch;
}

@media (max-width: 600px) {
  .about-body-with-image .about-image {
    aspect-ratio: 3 / 2;
  }
}

.about-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.about-block-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.about-hours-table {
  width: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.about-hours-table td {
  padding: 0.35rem 0;
  vertical-align: top;
}

.about-hours-table .about-hours-day {
  color: var(--text);
  padding-right: 1.25rem;
  white-space: nowrap;
}

.about-hours-table .about-hours-time {
  color: var(--text-muted);
  text-align: left;
}

.about-address {
  font-style: normal;
  margin: 0;
}

.about-address-line {
  margin: 0 0 0.5rem;
}

.about-address-line:last-child {
  margin-bottom: 0;
}

.about-map-section {
  margin-bottom: 2rem;
}

.about-map-section .about-block-title {
  margin-bottom: 1rem;
}

.about-map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.about-map {
  display: block;
  border: 0;
  width: 100%;
  height: 320px;
}

.about-map-link {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  font-size: 0.95rem;
}

.about-map-link a {
  color: var(--text);
}

@media (max-width: 600px) {
  .about-blocks {
    grid-template-columns: 1fr;
  }
}

/* Menus */

/* Section index for the beer page. Underlined tabs, matching the quiz year
   tabs, rather than bordered boxes — these scroll the page, they are not
   buttons. Sticky, because the page runs to a hundred-odd entries and a
   section index that scrolls away is no index at all. */
.beer-section-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  margin: 0 0 1rem;
  /* The rule sits on the list, so this padding extends the page-coloured
     background below it — content scrolling underneath is hidden by that
     strip, which reads as a gap between the sticky index and the content. */
  padding: 0 0 0.8rem;
  background: var(--bg);
}

.beer-section-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.beer-section-nav a {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}

.beer-section-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--border);
  text-decoration: none;
}

/* Set by beer-section-nav.js for the section currently in view. */
.beer-section-nav a[aria-current="true"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--pink);
}

.beer-section-nav a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

/* Phones: keep this to a single row. Wrapping doubled the height of a sticky
   bar, which then ate the top of the content it was pinned above. Tighter
   gutters get all three labels across at 360px and up in every language; the
   German ones cannot fit a 320px screen at any sane size, so past that the
   row scrolls sideways rather than wrapping. */
@media (max-width: 800px) {
  .beer-section-nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    /* No visible scrollbar: it would sit on the underline. */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .beer-section-nav ul::-webkit-scrollbar {
    display: none;
  }

  .beer-section-nav a {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    white-space: nowrap;
  }
}



/* Öl på fat – the two bars stacked, each under its own heading. Replaced a
   pill/tab control: with only ever two lists, switching cost a click and hid
   half the content for no benefit. */
.beer-tap-group + .beer-tap-group {
  margin-top: 2.25rem;
}

.beer-tap-group-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.35rem;
}

/* Clears both the mobile header and the sticky section index when jumping to
   a section, so the heading does not land underneath them. */
.beer-page .menu-category {
  scroll-margin-top: calc(var(--header-h) + 3.75rem);
}

.menu-category {
  margin-bottom: 2.5rem;
}

.menu-category-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

/* Beer bottle table (Öl på flaska/burk) */
.beer-bottle-table-wrap,
.beer-large-table-wrap {
  margin-top: 0.5rem;
}

.beer-large-intro {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  white-space: pre-line;
}

.beer-table-search {
  width: 100%;
  max-width: 20rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.beer-table-search:focus {
  border-color: var(--cyan);
  outline: none;
  box-shadow: 0 0 0 2px var(--cyan);
}

.beer-table-search::placeholder {
  color: var(--text-muted);
}

.beer-table-scroll {
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.beer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.beer-table th,
.beer-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  /* Text wraps. These were nowrap, which let a 42-character brewery name
     ("Kurjovikens Bryggeri (Skellefteå Bryggeri)") push that one column to
     337px — wider than a phone — and forced the whole table sideways.
     break-word so a single long word still breaks rather than overflowing. */
  white-space: normal;
  overflow-wrap: break-word;
}

/* Short numeric columns read worse broken across lines than the space they
   save: strength in both tables, plus size and price in the large-bottle one. */
#beer-bottle-table th:nth-child(4),
#beer-bottle-table td:nth-child(4),
#beer-large-table th:nth-child(n + 3),
#beer-large-table td:nth-child(n + 3) {
  white-space: nowrap;
}

.beer-table th {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.beer-table th:hover {
  text-decoration: underline;
}

.beer-table th:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.beer-table th .sort-indicator {
  margin-left: 0.25rem;
  color: var(--text-muted);
  font-size: 0.75em;
}

.beer-table tbody tr.beer-table-row-hidden {
  display: none;
}

.beer-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Stops the long free-text columns hogging a wide screen. */
.beer-table td:nth-child(1),
.beer-table td:nth-child(2),
.beer-table td:nth-child(3) {
  max-width: 14rem;
}

/* Phones: hand out the width explicitly, with smaller type and tighter
   gutters so the wrapped columns need fewer lines.

   Auto layout cannot do this job: overflow-wrap does not reduce a column's
   intrinsic minimum width, so the browser refuses to shrink the text columns
   below their longest word and the table stays wider than the screen.

   The numeric columns are sized to fit their widest header across all three
   languages on one line — "Storlek" is the long pole, not any of the values. */
@media (max-width: 800px) {
  .beer-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.8rem;
  }

  .beer-table th,
  .beer-table td {
    padding: 0.4rem 0.35rem;
    max-width: none;
  }

  #beer-bottle-table th:nth-child(1) { width: 30%; }
  #beer-bottle-table th:nth-child(2) { width: 30%; }
  #beer-bottle-table th:nth-child(3) { width: 22%; }
  #beer-bottle-table th:nth-child(4) { width: 18%; }

  #beer-large-table th:nth-child(1) { width: 24%; }
  #beer-large-table th:nth-child(2) { width: 24%; }
  #beer-large-table th:nth-child(3) { width: 18%; }
  #beer-large-table th:nth-child(4) { width: 20%; }
  #beer-large-table th:nth-child(5) { width: 14%; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.menu-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.menu-item-name {
  font-weight: 600;
  color: var(--text);
}

.menu-item-price {
  color: var(--text);
  font-weight: 600;
  flex-shrink: 0;
}

.menu-item-desc {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.menu-item-variants {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.menu-item-variant-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.menu-item-variant-name {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.menu-item-variants .menu-item-price {
  flex-shrink: 0;
}

.menu-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: inline-block;
}

/* Ölcaféet draft-beer entries: circular label image on the left */
.menu-item-with-label {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.menu-item-with-label .menu-item-label-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.menu-item-with-label .menu-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.menu-item-with-label .menu-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-item-with-label .menu-item-name {
  font-size: 1.25rem;
}

.menu-item-with-label .menu-item-brewery {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* The flag sits beside the brewery name rather than above it: the name column
   is a flex column, so without this row wrapper the flag would take a line of
   its own and make the card taller. */
.menu-item-with-label .menu-item-brewery-line {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.menu-item-with-label .menu-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.menu-item-with-label .menu-item-style {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Events layout */
.events-page .page-header {
  margin-bottom: 2rem;
}

.events-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .events-layout {
    grid-template-columns: 340px 1fr;
    align-items: start;
  }
}

.events-calendar-wrap h2,
.events-list-wrap h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin: 0 0 1rem;
}

.calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 280px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-header button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.calendar-header button:hover {
  border-color: var(--text);
  color: var(--text);
}

.calendar-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.calendar-weekday {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.calendar-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  /* Lifts every number a little, so a day's dots sit clear of it and the
     numbers in a row still line up. */
  padding-bottom: 6px;
}

/* Event marks along the bottom of a day, one per event in its card's colour:
   a dot per one-day event, and a bar per multi-day event. Bars sit in lanes
   (--lane, set per event by calendar.js) so overlapping runs stack and a run
   stays in its row from day to day; the dots sit above the lanes in use
   (--lanes). A bar reaches 1px past the cell on each side to close the 2px
   grid gap, so a run reads as one line across the week, capped at its first
   and last day. */
.calendar-marks {
  position: absolute;
  inset: auto 0 0 0;
  height: 0;
  pointer-events: none;
}

.calendar-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(4px + var(--lanes, 0) * 5px);
  display: flex;
  justify-content: center;
  gap: 3px;
}

.calendar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.calendar-bar {
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: calc(4px + var(--lane, 0) * 5px);
  height: 3px;
}

.calendar-bar--start {
  left: 5px;
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}

.calendar-bar--end {
  right: 5px;
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

.calendar-day.other-month {
  opacity: 0.4;
}

/* Today is an outline, a day with a one-day event is a wash behind the
   number. The two compose, so a day that is both needs no rule of its own.
   Days inside a multi-day run get no wash: a month-long event would wash most
   of the calendar and bury the one-off days, so its bar carries it alone. */
.calendar-day.today {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--text-muted);
}

.calendar-day.has-event {
  color: var(--text);
}

.calendar-day.has-one-day-event {
  background: rgba(255, 90, 178, 0.15);
}

.calendar-day--clickable {
  cursor: pointer;
}

.calendar-day--clickable:hover {
  filter: brightness(1.15);
}

.calendar-day--clickable:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.calendar-day--selected {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  filter: brightness(1.1);
}

/* Event cards */
.events-group {
  margin-bottom: 2rem;
}

.events-group-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  margin: 0 0 1rem;
}

.events-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

.event-card--with-image {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.event-card--with-image .event-card-image-wrap {
  flex-shrink: 0;
}

.event-card--with-image .event-card-image {
  width: 140px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.event-card--with-image .event-card-content {
  flex: 1;
  min-width: 0;
}

.event-card--recurring {
  border-left: 3px solid var(--cyan);
}

.event-card-date,
.event-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.event-card-title {
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.event-card-price {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.event-card p,
.event-card-description {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.event-card-description p {
  margin: 0 0 0.5em;
}

.event-card-description p:last-child {
  margin-bottom: 0;
}

.event-card-link {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.event-card-link a {
  color: var(--text);
  font-weight: 500;
}

.event-card-link a:hover {
  text-decoration: underline;
}

/* Quiz results page */
.quiz-results-page .page-header {
  margin-bottom: 1.5rem;
}

.quiz-tournament-picker {
  margin-bottom: 1.5rem;
}

/* Mobile: native select (touch-friendly, no wrapping) */
.quiz-select {
  display: block;
  width: 100%;
  max-width: 20rem;
  padding: 0.65rem 2.25rem 0.65rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.quiz-select:hover {
  border-color: var(--text-muted);
}

.quiz-select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(255, 90, 178, 0.25);
}

/* Two-level season picker.
   Year is the primary level, as underlined tabs on a rule. Season is the
   secondary level inside the chosen year, as a small segmented control —
   legitimately a capsule here, because it is always a single row of two.
   A flat row of every tournament does not survive two new seasons a year. */
.quiz-years,
.quiz-seasons {
  display: none;
}

@media (min-width: 640px) {
  .quiz-select {
    display: none;
  }

  .quiz-years {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 0.9rem;
    padding: 0;
    border-bottom: 1px solid var(--border);
  }

  .quiz-seasons {
    display: inline-flex;
    gap: 0.2rem;
    margin: 0;
    padding: 0.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
  }

  /* Must out-specify .quiz-seasons above, or the display would override the
     hidden attribute the script uses to swap years. A year with one season
     needs no chooser at all. */
  .quiz-seasons[hidden],
  .quiz-seasons--single {
    display: none;
  }
}

.quiz-year {
  flex: 0 0 auto;
  padding: 0.55rem 0.9rem;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.quiz-year:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

.quiz-year.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--pink);
}

.quiz-year:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.quiz-season {
  padding: 0.35rem 0.95rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}

.quiz-season:hover {
  color: var(--text);
}

/* The selected pill is a raised chip with a pink edge rather than a block of
   pink, which matches how the year tabs mark the selection. */
.quiz-season.active {
  background: var(--bg-card-hover);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--pink);
  font-weight: 600;
}

.quiz-season:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.quiz-panel {
  display: none;
}

.quiz-panel.active {
  display: block;
}

.quiz-no-data {
  color: var(--text-muted);
  margin: 0;
}

.quiz-results-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.quiz-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.quiz-results-table th,
.quiz-results-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.quiz-results-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.quiz-results-matrix .quiz-col-team {
  text-align: left;
  min-width: 10rem;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
  box-shadow: 2px 0 0 var(--border);
}

.quiz-results-matrix .quiz-col-score,
.quiz-results-matrix .quiz-col-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 3rem;
}

.quiz-results-matrix .quiz-col-score.quiz-winner {
  font-weight: 700;
  color: var(--blue) !important;
}

.quiz-results-matrix .quiz-col-total {
  font-weight: 600;
}

.quiz-tiebreaker-mark {
  display: inline-flex;
  align-items: center;
}

.quiz-tiebreaker-icon {
  display: block;
  width: 0.58em;
  height: 0.55em;
}

/* Reserve a gutter for the marker only in tables that have one, so the
   scores keep a single right edge instead of being nudged by the star.
   0.75rem of normal cell padding + the star + a hair of separation. */
.quiz-results-matrix.quiz-has-tiebreaker .quiz-col-score {
  position: relative;
  padding-right: 1.4rem;
}

/* Out of flow, so the marker never shifts the number. Set like an exponent:
   flush with the normal cell padding, raised to the digits' cap height
   (cell padding-top + the line box's half-leading). */
.quiz-results-matrix .quiz-tiebreaker-mark {
  position: absolute;
  top: calc(0.4rem + 0.15em);
  right: 0.75rem;
  cursor: help;
}

.quiz-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-legend .quiz-tiebreaker-mark {
  color: var(--blue);
}

/* 404
   Centred in whatever height the sticky-footer layout leaves, so the glass
   sits in the middle of the window rather than hugging the header.

   #main has to become a flex container for that to work: a percentage
   min-height against an auto-height parent resolves to nothing, so the
   article cannot centre inside a height it does not have. Scoped with :has()
   rather than applied to #main globally, which would restretch every other
   page. Browsers without :has() simply show the content top-aligned. */
#main:has(.notfound-page) {
  display: flex;
  flex-direction: column;
}

.notfound-page {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0 4rem;
  text-align: center;
}

.notfound-page .container {
  max-width: 34rem;
}

.notfound-glass {
  display: block;
  width: auto;
  /* Scales with the viewport but stops before it dominates the page. */
  height: clamp(7rem, 22vh, 11rem);
  margin: 0 auto 1.75rem;
  color: var(--text-muted);
}

.notfound-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
}

.notfound-body {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.notfound-link {
  margin: 0;
}

/* Padded to a comfortable touch target; the bare text was 22px tall. */
.notfound-link a {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-name {
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  white-space: pre-line;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Takes every spare pixel between header and footer. This replaces a
   min-height: calc(100vh - 12rem) guess at the height of the surrounding
   chrome, which was wrong in both directions: 12rem overshot the real footer
   by 120px, and on a short window the subtraction left the page taller than
   the viewport and raised a scrollbar for nothing. */
#main {
  flex: 1 0 auto;
}

/* Responsive adjustments */
@media (max-width: 800px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding: 0.75rem 0;
  }

  .site-header .container {
    gap: 0.5rem;
  }

  .header-nav-wrap {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-left: 0;
    padding: 0.75rem 1.25rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: none;
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-nav-wrap.is-open {
    display: flex;
  }

  .nav-main ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav-item-has-sub {
    width: 100%;
  }

  .nav-sub {
    position: static;
    padding: 0.25rem 0 0.5rem;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-lang {
    align-self: stretch;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .menu-item-with-label {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-item-with-label .menu-item-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-item-with-label .menu-item-right {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .event-card--with-image {
    flex-direction: column;
  }

  .event-card--with-image .event-card-image {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .menu-item-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile tab bar
   Hidden by default; the header nav covers navigation on wide screens. Below
   the 800px breakpoint it takes over the sections that carry an icon param,
   those entries are hidden from the header, and the hamburger is dropped so
   there is only ever one navigation surface. */
.bottom-nav {
  display: none;
}

@media (max-width: 800px) {
  .bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    /* Clears the iOS home indicator. Needs viewport-fit=cover in baseof. */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bottom-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .bottom-nav li {
    flex: 1 1 0;
    min-width: 0;
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    /* 44px min target, the smallest comfortable tap area. */
    min-height: 3rem;
    padding: 0.45rem 0.2rem 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
  }

  .bottom-nav a:hover {
    color: var(--text);
    text-decoration: none;
  }

  .bottom-nav a.active {
    color: var(--pink);
  }

  .bottom-nav a:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--pink);
  }

  .bottom-nav-icon {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
  }

  .bottom-nav-label {
    font-size: 0.7rem;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Keep the fixed bar clear of page content and the footer. */
  body {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  }

  /* The header keeps the logo, the entries without a tab (Om oss) and the
     language switcher, laid out inline instead of behind the hamburger. */
  .nav-toggle {
    display: none;
  }

  .nav-item-in-bottom-nav {
    display: none;
  }

  .header-nav-wrap {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-left: auto;
    padding: 0;
    background: none;
    border-bottom: none;
  }

  .nav-main ul {
    flex-direction: row;
    gap: 0.75rem;
  }

  .nav-lang {
    align-self: auto;
  }

  /* Narrow phones: the flag alone identifies the language switcher. */
  @media (max-width: 420px) {
    .lang-dropdown-trigger .lang-name {
      display: none;
    }
  }

  /* Five tabs leave about 61px each at 320px, which clipped the longest
     label ("Evenemang"). Tightening the gutters and the type keeps every
     label whole rather than ellipsised. */
  @media (max-width: 360px) {
    .bottom-nav a {
      padding-left: 0.1rem;
      padding-right: 0.1rem;
    }

    .bottom-nav-label {
      font-size: 0.64rem;
    }
  }
}

.page-header-link {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.page-header-link a {
  color: var(--text);
}

/* ===== Desktop left rail =====================================================
   Replaces the top bar above the mobile breakpoint. Wide enough to carry the
   Backen badge at a size where the wordmark and crate actually read, with
   labels alongside icons and sub-items always visible, so there are no
   dropdowns to hover-manage.

   --rail-w is 0 by default and only set at the desktop breakpoint, so every
   rule that offsets content by it is a no-op on a phone. */
:root {
  --rail-w: 0px;
  /* Height of the sticky top header, which exists only on mobile. Anything
     that sticks below it offsets by this. */
  --header-h: 4.2rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--blue);
  border-radius: 0 0 var(--radius) 0;
  color: var(--text);
}

.skip-link:focus {
  left: 0;
  text-decoration: none;
}

.rail {
  display: none;
}

@media (min-width: 801px) {
  :root {
    --rail-w: 14rem;
    /* No top header on desktop — the rail replaces it. */
    --header-h: 0px;
  }

  /* The rail owns navigation on desktop, so the top bar goes away entirely.
     That also hands the hero the full height of the viewport top, which is
     how the guide draws it — edge to edge, nothing above the photo. */
  .site-header {
    display: none;
  }

  body {
    padding-left: var(--rail-w);
  }

  .rail {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--rail-w);
    z-index: 200;
    padding: 1.5rem 0.9rem 1.1rem;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .rail-logo {
    display: block;
    margin: 0 0.4rem 1.6rem;
    color: var(--text);
    transition: color 0.2s;
  }

  .rail-logo:hover {
    color: var(--text);
  }

  /* Scales with viewport height so a short laptop screen does not push the
     language switcher below the fold, while a tall one gets the badge at full
     rail width. */
  .rail-logo .logo-badge {
    display: block;
    width: min(100%, clamp(5rem, 20vh, 14rem));
    height: auto;
    margin: 0 auto;
  }

  .rail-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .rail-item {
    margin: 0;
  }

  .rail-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    /* Generous hit area: the old top-bar links were the glyph box only, 24px
       tall with no padding. */
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
  }

  .rail-link:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    text-decoration: none;
  }

  /* Current page is the one place pink is used in the rail, so hover and
     current never look alike. */
  .rail-link.active {
    color: var(--pink);
    background: rgba(255, 90, 178, 0.1);
    box-shadow: inset 2px 0 0 var(--pink);
  }

  .rail-link:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--blue);
  }

  .rail-link .bottom-nav-icon {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
  }

  .rail-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rail-sub {
    list-style: none;
    margin: 0.1rem 0 0.35rem;
    padding: 0;
    /* Aligns the sub-items under the parent's label, past the icon. */
    margin-left: 2.45rem;
    border-left: 1px solid var(--border);
  }

  .rail-sublink {
    display: block;
    padding: 0.3rem 0.6rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.15s;
  }

  .rail-sublink:hover {
    color: var(--text);
    text-decoration: none;
  }

  .rail-sublink.active {
    color: var(--pink);
  }

  .rail-foot {
    margin-top: auto;
    padding-top: 1rem;
  }

  .rail-foot .nav-lang,
  .rail-foot .lang-dropdown {
    width: 100%;
  }

  /* The dropdown opens upward here, since the switcher sits at the foot. */
  .rail-foot .lang-dropdown-menu {
    top: auto;
    bottom: calc(100% + 0.35rem);
    left: 0;
    right: auto;
  }

  /* The hero is 16:9 against the space left of the rail, not the viewport. */
  .hero {
    height: clamp(20rem, calc((100vw - var(--rail-w)) * 0.5625), calc(100vh - 12rem));
  }
}

/* Tap badge
   The tap label from Untappd ("B", "A", "Hus"…) over the top-right corner of
   a draft entry, in the manner of a notification badge. Values are one to
   three characters, so the badge is a circle that stretches to a pill rather
   than a fixed square. */
.menu-item--tapped {
  position: relative;
}

.tap-badge {
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  /* Separates the badge from the card edge it overlaps. */
  border: 2px solid var(--bg);
  /* The guide's third accent, which had no visible job anywhere else — the
     only other use is the events card border cycle, and that list is empty
     whenever Untappd has nothing upcoming. White rather than --bg for the
     text: navy on this green is 3.4:1, which fails for small bold type,
     while white reaches 4.96:1. */
  background: var(--green);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  /* No pointer-events: none here. The badge needs to take the pointer for its
     title tooltip to appear, and it can: it hangs off the card's top-right
     corner, clear of the two links in the card's left column. cursor: help
     advertises the tooltip, the same way .menu-item-added does. */
  cursor: help;
}

/* The list has no horizontal padding, so a badge hanging off the right edge
   of the outermost card would be clipped by the viewport on a phone. */
@media (max-width: 540px) {
  .tap-badge {
    top: -0.45rem;
    right: -0.2rem;
    min-width: 1.65rem;
    height: 1.65rem;
    font-size: 0.8rem;
  }
}

/* Country flag before a brewery name, on the draft cards and in both tables.
   Sized in em so it follows whatever text it stands next to, and a shade
   smaller than that text so the glyph does not push the line box open. */
.brewery-flag {
  font-size: 0.95em;
  line-height: 1;
  margin-right: 0.35em;
  /* Nothing to gain from stretching it when it is a flex item. */
  flex: none;
  cursor: help;
}

/* Beer and brewery names link out to Untappd. Underline only on hover, so a
   list of a hundred entries does not read as a wall of links, but the pointer
   and keyboard focus both make it obvious they are clickable. */
.menu-item-name--link,
.menu-item-brewery--link,
.beer-table-link {
  color: inherit;
  text-decoration: none;
}

.menu-item-name--link:hover,
.menu-item-brewery--link:hover,
.beer-table-link:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.menu-item-name--link:focus-visible,
.menu-item-brewery--link:focus-visible,
.beer-table-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
  text-decoration: none;
}

/* When a draft beer went on the menu, as a third line in the card's metadata
   column under style and ABV. Quieter than both, since it is the least
   important of the three. */
.menu-item-added {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: help;
}

/* Style and strength on one row, separated by a dot drawn between them so a
   missing style leaves no orphan separator. */
.menu-item-with-label .menu-item-specs {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.menu-item-with-label .menu-item-specs > * + *::before {
  content: "·";
  margin: 0 0.45rem;
  color: var(--text-muted);
  opacity: 0.55;
}

/* Back to a comfortable size now the column is two rows, not three. */
.menu-item-with-label .menu-item-specs .menu-item-style,
.menu-item-with-label .menu-item-specs .menu-item-meta {
  font-size: 0.95rem;
  margin-top: 0;
}

@media (max-width: 800px) {
  .menu-item-with-label .menu-item-specs {
    justify-content: flex-start;
  }
}
