/* BSC Badminton Hastedt, built on tinypage's starter design (tinymedia's Satz): tokens, the parts every page
   shares, then the pages. Colours from the club's logo: navy #00305e and yellow #ffed00. */
:root {
  color-scheme: light dark;
  --navy: #00305e;
  --yellow: #ffed00;
  /* paper and ink: a cool white and the logo's navy by day, a deep navy at night */
  --paper: light-dark(#f5f7fa, #0a1626);
  --ink: light-dark(#0b1d33, #e9eef5);
  --muted: light-dark(#46566c, #a8b6c8);
  --line: light-dark(#c8d1dd, #2b3d57);
  /* the masthead keeps the logo's navy in both schemes */
  --band: light-dark(#00305e, #00264b);
  --band-ink: #ffffff;
  /* links: navy by day, the logo's yellow at night */
  --accent: light-dark(#00305e, #ffed00);
  /* the short bar before a heading */
  --mark: light-dark(#00305e, #ffed00);
  --focus-color: light-dark(#00305e, #ffed00);

  /* type: the system's own sans, no download */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tiny: 12px;
  --small: 14px;
  --body: 17px;
  --lead: clamp(19px, 1.1rem + 0.5vw, 23px);
  --regular: 400;
  --medium: 500;
  --bold: 700;
  --heavy-weight: 800;
  --leading: 1.55;
  --tight: 1.05;
  --caps-tracking: 0.08em;

  /* space: an 8 px grid; the gutter keeps clear of the phone's safe areas */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --s16: 64px;
  --gutter: max(var(--s4), env(safe-area-inset-left), env(safe-area-inset-right));

  /* lines and shapes */
  --hairline: 1px;
  --heavy: 4px;
  --control-border: 1.5px;
  --focus: 3px;
  --focus-offset: 2px;
  --target: 44px;
  --radius: 6px;

  /* widths */
  --page: 1040px;
  --measure: 38rem;
}
*,
::before,
::after {
  box-sizing: border-box;
}
:root {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: var(--regular) var(--body) / var(--leading) var(--sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
figure,
fieldset {
  margin: 0;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: var(--focus) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

/* the page's column: the full width on the phone, at most --page on desktop */
.page {
  width: min(var(--page), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip {
  position: absolute;
  z-index: 20;
  top: -100px;
  left: var(--gutter);
  padding: var(--s2) var(--s3);
  background: var(--yellow);
  color: var(--navy);
  font-weight: var(--bold);
}
.skip:focus {
  top: var(--s2);
}

/* the masthead: the logo's navy, closed by a yellow line like a court's boundary */
.masthead {
  background: var(--band);
  color: var(--band-ink);
  border-bottom: var(--heavy) solid var(--yellow);
  padding-top: env(safe-area-inset-top);
  --focus-color: var(--yellow);
}
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s6);
  padding-block: var(--s3);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: var(--target);
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 56px;
  height: 56px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-size: 19px;
  font-weight: var(--heavy-weight);
  letter-spacing: -0.01em;
}
.brand-place {
  color: var(--yellow);
  font-size: var(--small);
  font-weight: var(--bold);
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
}

/* the navigation: one row of plain links, the current page underlined in yellow. On a phone it sits behind the menu
   button as a navy panel (popover: no script; Esc and a tap beside it close it); a browser without popover shows the
   row, so the button appears only where :popover-open is known (frontend.md › Layout). */
.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: inline-block;
  min-height: var(--target);
  line-height: var(--target);
  color: var(--band-ink);
  font-weight: var(--bold);
  text-decoration: none;
}
.nav a:hover {
  text-decoration: underline 2px;
  text-underline-offset: 0.4em;
}
.nav a[aria-current="page"] {
  text-decoration: underline var(--heavy) var(--yellow);
  text-underline-offset: 0.45em;
}
.menu-open,
.menu-close {
  display: none;
  place-items: center;
  width: var(--target);
  height: var(--target);
  padding: 0;
  border: 0;
  background: none;
  color: var(--band-ink);
  cursor: pointer;
}
.menu-open svg,
.menu-close svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}
@supports selector(:popover-open) {
  @media (width < 720px) {
    .menu-open {
      display: grid;
    }
    .nav:popover-open {
      inset: 0 0 auto;
      width: auto;
      margin: 0;
      padding: max(var(--s3), env(safe-area-inset-top)) var(--gutter) var(--s6);
      border: 0;
      border-bottom: var(--heavy) solid var(--yellow);
      background: var(--band);
      color: var(--band-ink);
      --focus-color: var(--yellow);
    }
    .nav:popover-open .menu-close {
      display: grid;
      margin-left: auto;
    }
    .nav:popover-open ul {
      flex-direction: column;
    }
    .nav:popover-open a {
      font-size: 20px;
    }
    .nav::backdrop {
      background: rgb(0 0 0 / 0.5);
    }
  }
}

/* the start page's head: still the navy band, with court lines in the corner */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--band);
  color: var(--band-ink);
  --focus-color: var(--yellow);
}
.hero::after {
  /* a badminton court seen from above (6.10 × 13.40 m): net, short and long service lines, centre and singles
     side lines, in thin yellow lines; decoration only */
  --l: linear-gradient(var(--yellow), var(--yellow));
  content: "";
  position: absolute;
  top: 24px;
  right: -150px;
  width: 240px;
  aspect-ratio: 6.1 / 13.4;
  border: 2px solid var(--yellow);
  background:
    var(--l) 0 50% / 100% 2px no-repeat,
    var(--l) 0 35.2% / 100% 2px no-repeat,
    var(--l) 0 64.8% / 100% 2px no-repeat,
    var(--l) 0 5.7% / 100% 2px no-repeat,
    var(--l) 0 94.3% / 100% 2px no-repeat,
    var(--l) 7.5% 0 / 2px 100% no-repeat,
    var(--l) 92.5% 0 / 2px 100% no-repeat,
    var(--l) 50% 0 / 2px 35.2% no-repeat,
    var(--l) 50% 100% / 2px 35.2% no-repeat;
  opacity: 0.3;
  transform: rotate(-12deg);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding-block: var(--s8) var(--s12);
}
.kicker .wide {
  display: none;
}
.kicker {
  margin-bottom: var(--s3);
  color: var(--yellow);
  font-size: var(--small);
  font-weight: var(--bold);
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
}
.hero h1 {
  max-width: 14ch;
  margin-bottom: var(--s6);
  font-size: clamp(40px, 1.4rem + 4vw, 72px);
  font-weight: var(--heavy-weight);
  line-height: var(--tight);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: var(--s2) var(--s6);
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 18px;
  font-weight: var(--heavy-weight);
  text-decoration: none;
}
.cta::after {
  content: "→";
  margin-left: var(--s2);
}
.cta:hover {
  text-decoration: underline 2px;
  text-underline-offset: 0.25em;
}
.cta:focus-visible {
  outline-color: var(--band-ink);
  outline-offset: 3px;
}

/* the inner pages' title */
main {
  padding-bottom: var(--s12);
}
main.inner > article > h1 {
  padding-top: var(--s8);
  margin-bottom: var(--s6);
  font-size: clamp(34px, 1.2rem + 2.6vw, 54px);
  font-weight: var(--heavy-weight);
  line-height: var(--tight);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
main.home > .page {
  padding-top: var(--s8);
}
.lead {
  font-size: var(--lead);
  line-height: 1.4;
}

/* text a Redakteurin writes (Markdown) */
.prose {
  max-width: var(--measure);
}
.prose > * + * {
  margin-top: 0.9em;
}
.home .prose > p:first-child {
  font-size: var(--lead);
  line-height: 1.45;
}
.prose :is(ul, ol) {
  margin-bottom: 0;
  padding-left: 1.25em;
}
.prose li + li {
  margin-top: var(--s1);
}
.prose h2 {
  margin-top: 1.6em;
  font-size: 1.3em;
  font-weight: var(--heavy-weight);
  line-height: 1.25;
}
/* a short bar before each heading, like the service line of a court */
.prose h2::before {
  content: "";
  display: block;
  width: var(--s8);
  height: var(--heavy);
  margin-bottom: var(--s2);
  background: var(--mark);
}
.prose h3 {
  margin-top: 1.4em;
  font-size: 1.1em;
  line-height: 1.3;
}
.prose blockquote {
  margin-inline: 0;
  padding-left: var(--s4);
  border-left: var(--heavy) solid var(--line);
}
.prose hr {
  border: 0;
  border-top: var(--hairline) solid var(--line);
}
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.prose :is(th, td) {
  padding: var(--s2) var(--s4) var(--s2) 0;
  border-bottom: var(--hairline) solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-weight: var(--bold);
}

/* the foot of every page: the club, its contact, the legal pages */
.foot {
  margin-top: auto;
  padding-bottom: max(var(--s8), env(safe-area-inset-bottom));
  border-top: var(--hairline) solid var(--line);
  font-size: var(--small);
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s6);
  padding-top: var(--s6);
}
.foot-club > * + * {
  margin-top: var(--s1);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot-links a {
  display: inline-block;
  min-height: var(--target);
  line-height: var(--target);
  font-weight: var(--medium);
}
.foot-links a[aria-current="page"] {
  color: var(--ink);
  text-decoration-thickness: 2px;
}

/* desktop: logo and navigation in one row, a larger head on the start page */
@media (min-width: 720px) {
  .bar {
    flex-wrap: nowrap;
    padding-block: var(--s3);
  }
  /* the list stands in the bar; these undo the browser's popover styles */
  .nav[popover] {
    display: block;
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    background: none;
    color: inherit;
  }
  .nav ul {
    gap: 0 var(--s8);
  }
  .brand img {
    width: 64px;
    height: 64px;
  }
  .brand-name {
    font-size: 22px;
  }
  .kicker .wide {
    display: inline;
  }
  .hero-inner {
    padding-block: var(--s16);
  }
  .hero::after {
    top: 40px;
    right: 8%;
    width: 280px;
  }
}

/* the Vorschau only: the faint watermark over the page head, and the marks of drafts */
.vorschau-mark {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  text-align: center;
  white-space: nowrap;
  font: 800 clamp(3rem, 15vw, 10rem) / 1.1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  opacity: 0.1;
}
.draft-note {
  margin-top: var(--s4);
  padding: var(--s2) var(--s3);
  border: var(--control-border) dashed var(--ink);
  font-size: var(--small);
  font-weight: var(--medium);
}
.draft {
  font-size: var(--tiny);
  font-weight: var(--bold);
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
  color: var(--muted);
}
.masthead .draft {
  color: var(--yellow);
}
