/* Demo KTA Midtjylland: a facility's own website (not the app), used to try the embed. */

/* Barlow and Barlow Condensed, a grotesque drawn after road signs (SIL Open Font Licence, fonts/OFL.txt). Served
   from this site: no third-party font host sees the visitors. */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/barlow-400.b0a8ad37ac.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/barlow-600.4b52ddd483.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/barlow-condensed-700.3787a5a419.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/barlow-condensed-800.2515494e8c.woff2') format('woff2');
}

/* Until Barlow arrives, Arial scaled to Barlow's width (measured on this page's text), so the lines break in the same
   places and nothing moves when the font swaps in. */
@font-face {
  font-family: 'Barlow Fallback';
  font-weight: 400;
  src: local('Arial'), local('ArialMT'), local('Liberation Sans');
  size-adjust: 96.5%;
}

@font-face {
  font-family: 'Barlow Fallback';
  font-weight: 600;
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold');
  size-adjust: 91%;
}

@font-face {
  font-family: 'Barlow Condensed Fallback';
  font-weight: 700 800;
  src: local('Arial Narrow Bold'), local('ArialNarrow-Bold');
  size-adjust: 92.6%;
}

@font-face {
  font-family: 'Barlow Condensed Arial';
  font-weight: 700 800;
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold');
  size-adjust: 76%;
}

:root {
  --concrete: #eceee9;
  --paper: #ffffff;
  --asphalt: #272b2e;
  --ink: #121416;
  --marking: #f7f7f2;
  --sign: #1c4f8c;
  --sign-dark: #153d6d;
  --muted: #535d65;
  --line: #d6dad4;
  --wrap: 1200px;
  --gutter: 24px;
  --display: 'Barlow Condensed', 'Barlow Condensed Fallback', 'Barlow Condensed Arial', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Barlow Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  background: var(--concrete);
  color: var(--asphalt);
  font: 18px/1.6 var(--body);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

a {
  color: var(--sign);
  text-underline-offset: 3px;
}

/* Only 400 and 600 are loaded: bold text uses 600 rather than a synthesised bold. */
b,
strong {
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--sign);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.demo-note {
  margin: 0;
  padding: 8px 20px;
  background: var(--ink);
  color: #c9d0d4;
  font-size: 14px;
}

.demo-note code {
  color: var(--marking);
}

/* header */

/* The header lies on the hero's picture: transparent, light text. Absolute without a top keeps its place below the
   demo note while the hero moves up underneath it. */
.site-header {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px var(--gutter);
  color: var(--marking);
}

.site-header :focus-visible {
  outline-color: var(--marking);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font: 700 25px/1 var(--display);
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

/* A Danish information sign: blue field, white inner border. */
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--sign);
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px var(--marking);
  color: var(--marking);
  font-size: 16px;
  text-shadow: none;
}

.site-header nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.site-header nav a {
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

.site-header nav a:hover,
.site-header nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

/* buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--sign);
  color: var(--marking);
  font: 600 17px/1.2 var(--body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  background: var(--sign-dark);
}

.button-small {
  min-height: 42px;
  padding: 0 20px;
  font-size: 16px;
}

.button-light {
  background: var(--marking);
  color: var(--ink);
}

.button-light:hover {
  background: #ffffff;
}

/* On the hero: the second action, as an outline in the text colour. */
.button-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--marking);
  color: var(--marking);
}

.button-ghost:hover {
  background: rgba(247, 247, 242, 0.14);
}

.button-outline {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--sign);
  color: var(--sign);
}

.button-outline:hover {
  background: var(--sign);
  color: var(--marking);
}

.text-link-dark {
  color: var(--sign);
  font-weight: 600;
}

/* hero: the picture fills the first screen; the headline sits on it, left and vertically centred. The sub pages use
   the same hero, lower (.hero-page). */

.hero {
  position: relative;
  display: grid;
  background: var(--ink);
  color: var(--marking);
}

.hero > .hero-media,
.hero > .hero-panel {
  grid-area: 1 / 1;
}

.hero-media {
  position: relative;
  height: clamp(600px, 92vh, 980px);
  height: clamp(600px, calc(100svh - 40px), 980px);
  overflow: hidden;
}

.hero-page .hero-media {
  height: clamp(440px, 66vh, 700px);
}

.hero-media img,
.hero-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Shade under the header (top), behind the text (left) and along the lower edge. The left shade is measured from the
   text column's edge, not the window: at least 0.72 black under every line of text at any width (4.5:1 for the text
   even over a white frame), fading out beyond it. It never takes a tap (Safari's play glyph, the video's menu). */
.hero-media::after {
  --text-edge: max(var(--gutter), (100% - var(--wrap)) / 2 + var(--gutter));
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 20, 22, 0.8) 0, rgba(18, 20, 22, 0.45) 110px, rgba(18, 20, 22, 0) 220px),
    linear-gradient(90deg, rgba(18, 20, 22, 0.9) 0, rgba(18, 20, 22, 0.76) calc(var(--text-edge) + 640px), rgba(18, 20, 22, 0.12) calc(var(--text-edge) + 1040px)),
    linear-gradient(0deg, rgba(18, 20, 22, 0.72) 0%, rgba(18, 20, 22, 0) 36%);
  pointer-events: none;
}

.hero-video-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: 20px;
  z-index: 2;
  padding: 5px 14px;
  border: 1px solid rgba(247, 247, 242, 0.6);
  border-radius: 999px;
  background: rgba(18, 20, 22, 0.6);
  color: var(--marking);
  font: 600 14px/1.4 var(--body);
  cursor: pointer;
}

.hero-video-toggle:hover {
  border-color: var(--marking);
}

.hero-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 104px var(--gutter) 48px; /* clear of the header */
}

.hero h1 {
  max-width: 11ch;
  margin: 0 0 24px;
  font-size: clamp(56px, 7.4vw, 112px);
  line-height: 0.9;
}

.hero-page h1 {
  max-width: 14ch;
  font-size: clamp(50px, 6vw, 92px);
}

.hero h1,
.lede {
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}

.lede {
  max-width: 42ch;
  margin: 0 0 34px;
  color: #e4e8ea;
  font-size: clamp(18px, 1.45vw, 21px);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
}

.hero :focus-visible {
  outline-color: var(--marking);
}

/* bands: full-width sections, white and concrete in turn */

.band {
  padding: 104px 0;
  background: var(--concrete);
}

.band-light {
  background: var(--paper);
}

.band-head {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.band-head h2,
.section h2 {
  margin: 0;
  font-size: clamp(42px, 4.6vw, 62px);
  line-height: 1;
}

.section-lede {
  max-width: 58ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 19px;
}

/* What the facility offers: one card per vehicle or kind of course, each with its own ways in. */
.offers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: var(--wrap);
  margin: 48px auto 0;
  padding: 0 var(--gutter);
  list-style: none;
}

.offer {
  display: flex;
  flex-direction: column;
  padding: 28px 26px 26px;
  border-radius: 18px;
  background: var(--concrete);
}

.offer-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  fill: none;
  stroke: var(--sign);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.offer-icon .fill {
  fill: var(--sign);
  stroke: none;
}

.offer h3 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1;
}

.offer p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

/* The buttons sit at the foot of the card, whatever the length of its text. */
.offer .offer-actions {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin: auto 0 0;
}

/* A track, course or service: photo on one side, text on the other, alternating sides down the page. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px var(--gutter);
}

.band-head + .split {
  padding-top: 64px;
}

.split:last-child {
  padding-bottom: 0;
}

.band > .split:first-child {
  padding-top: 0;
}

.split:nth-of-type(even) .split-photo,
.split-flip .split-photo {
  order: 2;
}

.split-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
}

.split-text h2,
.split-text h3 {
  margin: 0 0 10px;
  font-size: clamp(38px, 3.8vw, 54px);
  line-height: 1;
}

.split-text > p:not([class]) {
  margin: 0 0 14px;
}

.split-lede {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

/* Facts with a tick, as on a checklist. */
.checks {
  display: grid;
  gap: 10px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.band-head .checks {
  margin: 28px 0 0;
}

.checks li {
  position: relative;
  padding-left: 34px;
}

.checks li::before {
  content: '';
  position: absolute;
  top: 0.28em;
  left: 7px;
  width: 8px;
  height: 15px;
  border: solid var(--sign);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* What can be booked on a track: one row per vehicle, the button opens the calendar on that course. */
.options {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.options li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.options p {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.options strong {
  display: block;
  color: var(--asphalt);
  font: 700 23px/1.2 var(--display);
}

.options .button {
  flex: none;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin: 0;
}

.band-head .split-actions {
  margin-top: 28px;
}

/* Prices for driving schools: three small tables side by side. */
.prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  align-items: start;
  max-width: var(--wrap);
  margin: 44px auto 0;
  padding: 0 var(--gutter);
}

.prices table {
  width: 100%;
  border-spacing: 0;
  background: var(--paper);
  border-radius: 18px;
}

.prices caption {
  padding: 0 0 12px;
  font: 800 30px/1.1 var(--display);
  text-align: left;
}

.prices th,
.prices td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prices th {
  font-weight: 400;
}

.prices td {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.prices tbody tr:last-child > * {
  border-bottom: 0;
}

.prices tfoot td {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  white-space: normal;
}

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  max-width: var(--wrap);
  margin: 44px auto 0;
  padding: 0 var(--gutter);
  list-style: none;
}

.services li {
  padding-top: 22px;
  border-top: 4px solid var(--sign);
}

.services h3 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.05;
}

.services p {
  margin: 0;
  color: var(--muted);
}

/* The 404 page. */
.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 96px var(--gutter);
}

/* footer */

.site-footer {
  background: var(--ink);
  color: var(--marking);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 64px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 72px var(--gutter) 48px;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1;
}

.site-footer address {
  font-style: normal;
}

.site-footer a {
  color: var(--marking);
}

.site-footer p {
  margin: 16px 0 0;
  color: #c3cacd;
}

.footer-nav {
  display: grid;
  gap: 12px;
  align-content: start;
  font-weight: 600;
}

.site-footer .credits {
  grid-column: 1 / -1;
  margin: 24px 0 0;
  color: #98a1a6;
  font-size: 14px;
}

.site-footer :focus-visible {
  outline-color: var(--marking);
}

/* Too narrow for brand, menu and button on one row: the menu gets its own row under the other two. */
@media (max-width: 900px) {
  .site-header nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .site-header .button-small {
    margin-left: auto;
  }

  .hero-panel {
    padding-top: 150px;
  }
}

/* Too narrow for photo and text side by side: the photo goes on top. Two offer cards a row. */
@media (max-width: 980px) {
  .offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .split:nth-of-type(even) .split-photo,
  .split-flip .split-photo {
    order: 0;
  }

  .split-photo {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 20px;
  }

  .site-header {
    gap: 10px 20px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand {
    gap: 10px;
    font-size: 21px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  /* It scrolls sideways if it must; the padding keeps the underline and the focus ring inside the scroll box. */
  .site-header nav {
    justify-content: space-between;
    gap: 14px;
    margin: -8px -6px;
    padding: 8px 6px 12px;
    overflow-x: auto;
    font-size: 15px;
  }

  /* The picture on top, the text below it on the dark ground, overlapping its faded lower edge. */
  .hero {
    display: block;
  }

  .hero-media,
  .hero-page .hero-media {
    height: clamp(420px, 60vh, 560px);
    height: clamp(420px, 60svh, 560px);
  }

  /* Two header rows here: the top shade covers both. */
  .hero-media::after {
    background:
      linear-gradient(180deg, rgba(18, 20, 22, 0.84) 0, rgba(18, 20, 22, 0.62) 130px, rgba(18, 20, 22, 0) 230px),
      linear-gradient(0deg, var(--ink) 0%, rgba(18, 20, 22, 0) 40%);
  }

  .hero-panel {
    margin-top: -96px;
    padding: 0 var(--gutter) 56px;
  }

  .hero-video-toggle {
    bottom: 112px;
  }

  .band {
    padding: 72px 0;
  }

  .split {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .band-head + .split {
    padding-top: 40px;
  }

  .options li {
    flex-direction: column;
    align-items: flex-start;
  }

  .offers,
  .services,
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Small phones (360 px): brand and button still share a row, and the menu fits without scrolling. */
@media (max-width: 380px) {
  .brand {
    gap: 8px;
    font-size: 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .site-header .button-small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 15px;
  }

  .site-header nav {
    gap: 10px;
    font-size: 14px;
  }
}
