/* VCC website - main stylesheet. Loaded with media="all", so Netscape 4 skips
   it and only gets base.css. Internet Explorer 4-6 and everything newer read
   this file, so the layout part is still CSS 2.1 only: no custom properties,
   no flexbox/grid, no calc(). Modern-only things (@font-face with WOFF2,
   focus outlines, max-width, the dark theme) are progressive enhancement that
   old browsers ignore.

   Source of truth: design/brand-guidelines.md and design/tokens.json.
   Tokens are written as literal values with the token name in a comment.

     colour token       light     dark
     -----------------  -------   -------
     surface            #ffffff   #1a1a1a
     surface-raised     #f2f2f2   #262626
     ink                #4d4d4d   #f2f2f2
     ink-muted          #666666   #b3b3b3
     accent             #0000ff   #6699ff
     border             #cccccc   #4d4d4d
     danger             #cc0000   #ff6666

     spacing token      value        type token   size / line height / weight
     -----------------  -----        ----------   ---------------------------
     space-1            4px          display      56px / 60px / 700
     space-2            8px          h1           40px / 44px / 700
     space-3            16px         h2           28px / 32px / 500
     space-4            24px         h3           22px / 28px / 500
     space-5            32px         label        13px / 16px / 500, caps, 0.08em
     space-6            48px         body-lg      18px / 28px
     space-7            64px         body         16px / 24px
                                     small        14px / 20px
                                     caption      12px / 16px
*/

/* --- Fonts (licensed, own domain only; see LICENSES.md) ------------------ */

@font-face {
  font-family: "Handel Gothic FS";
  src: url(../fonts/HandelGothic-Medium.woff2) format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Handel Gothic FS";
  src: url(../fonts/HandelGothic-Bold.woff2) format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Base ----------------------------------------------------------------- */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: Verdana, Arial, Helvetica, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 16px; /* body */
  line-height: 24px;
}

h1, h2, h3 {
  font-family: "Handel Gothic FS", "Arial Black", Arial, Helvetica, sans-serif;
}

h1 {
  font-size: 40px; /* h1 */
  line-height: 44px;
  font-weight: 700;
  margin: 0 0 24px 0; /* space-4 */
}

h1.display {
  font-size: 56px; /* display */
  line-height: 60px;
}

h2 {
  font-size: 28px; /* h2 */
  line-height: 32px;
  font-weight: 500;
  margin: 48px 0 16px 0; /* space-6, space-3 */
}

h3 {
  font-size: 22px; /* h3 */
  line-height: 28px;
  font-weight: 500;
  margin: 32px 0 8px 0; /* space-5, space-2 */
}

p, ul, ol {
  margin-top: 0;
  margin-bottom: 16px; /* space-3 */
}

li {
  margin-bottom: 8px; /* space-2 */
}

a:hover {
  text-decoration: underline;
}

a:focus {
  outline: 2px solid #0000ff; /* accent */
  outline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid #cccccc; /* border */
  height: 0;
  margin: 0;
}

/* --- Page frame ----------------------------------------------------------- */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px; /* space-3 */
}

.header {
  padding: 24px 0 8px 0; /* space-4, space-2 */
}

.logo {
  margin: 0 0 16px 0; /* space-3: clear space around the mark */
}

.content {
  padding: 32px 0 48px 0; /* space-5, space-6 */
}

/* --- Navigation and language switch: "label" style ------------------------- */

.nav, .lang {
  font-family: "Handel Gothic FS", "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 13px; /* label */
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lang {
  float: right;
  color: #666666; /* ink-muted */
}

.lang strong {
  font-weight: 500;
  color: #4d4d4d; /* ink */
}

.nav a, .lang a {
  text-decoration: none;
}

.nav a:hover, .lang a:hover {
  text-decoration: underline;
}

.nav .sep {
  display: none;
}

.nav a {
  display: inline-block;
  margin: 0 24px 0 0; /* space-4 */
  padding: 8px 0 6px 0; /* space-2 */
  border-bottom: 2px solid #ffffff; /* surface */
}

.nav a:link, .nav a:visited {
  color: #4d4d4d; /* ink */
}

.nav a.current:link, .nav a.current:visited {
  color: #0000ff; /* accent: selected state */
  border-bottom-color: #0000ff; /* accent */
}

/* --- Content pieces --------------------------------------------------------- */

.lead {
  font-size: 18px; /* body-lg */
  line-height: 28px;
}

.meta, .note {
  font-size: 14px; /* small */
  line-height: 20px;
}

.item {
  margin: 0 0 24px 0; /* space-4 */
}

.item h2, .item h3 {
  margin: 0 0 4px 0; /* space-1 */
}

.item h2 {
  font-size: 22px; /* h3: post titles in the news list */
  line-height: 28px;
}

.item p {
  margin-bottom: 4px; /* space-1 */
}

/* Tables: the HTML border attribute is the fallback; here hairlines only. */
table.events, table.facts {
  border: 0;
  border-collapse: collapse;
  font-size: 14px; /* small */
  line-height: 20px;
  margin: 0 0 24px 0; /* space-4 */
}

table.events {
  width: 100%;
}

table.events th, table.events td, table.facts th, table.facts td {
  border: 0;
  border-bottom: 1px solid #cccccc; /* border */
  padding: 8px; /* space-2 */
  text-align: left;
  vertical-align: top;
}

table.events th, table.facts th {
  font-size: 13px; /* label */
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert {
  font-weight: normal;
}

/* --- Footer ----------------------------------------------------------------- */

.footer {
  padding: 24px; /* space-4: card padding */
  margin: 32px 0 32px 0; /* space-5 */
  font-size: 14px; /* small */
  line-height: 20px;
}

.footer .caption {
  font-size: 12px; /* caption */
  line-height: 16px;
  margin-bottom: 0;
}

/* --- Small screens ---------------------------------------------------------- */

@media (max-width: 600px) {
  h1.display {
    font-size: 40px; /* h1 */
    line-height: 44px;
  }
  h1 {
    font-size: 28px; /* h2 */
    line-height: 32px;
  }
  h2 {
    font-size: 22px; /* h3 */
    line-height: 28px;
    margin-top: 32px; /* space-5 */
  }
  h3 {
    font-size: 18px; /* body-lg */
    line-height: 28px;
  }
  .nav a {
    margin-right: 16px; /* space-3 */
  }
  .footer {
    padding: 16px; /* space-3 */
  }
  table.events th, table.events td {
    padding: 8px 4px; /* space-2, space-1 */
  }
}

/* --- Dark theme (progressive enhancement) ----------------------------------- */

@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a; /* surface */
    color: #f2f2f2; /* ink */
  }
  h1, h2, h3, th {
    color: #f2f2f2; /* ink */
  }
  a:link, a:visited, a:active {
    color: #6699ff; /* accent */
  }
  a:focus {
    outline-color: #6699ff; /* accent */
  }
  hr {
    border-top-color: #4d4d4d; /* border */
  }
  /* Dark theme: show the transparent PNG logo straight on the dark surface.
     Only browsers from about 2019 on read this block, and they all support
     PNG transparency. The flattened GIF in the HTML is hidden but keeps its
     space, its link and its alt text. */
  .logo a {
    display: inline-block;
    width: 202px;
    height: 106px;
    background-image: url(../img/logo-transparent.png);
    background-repeat: no-repeat;
    background-size: 202px 106px;
  }
  .logo img {
    visibility: hidden;
  }
  .band {
    background-color: #1a1a1a; /* surface */
  }
  .lang, .meta, .note, .caption {
    color: #b3b3b3; /* ink-muted */
  }
  .lang strong {
    color: #f2f2f2; /* ink */
  }
  .nav a {
    border-bottom-color: #1a1a1a; /* surface */
  }
  .nav a:link, .nav a:visited {
    color: #f2f2f2; /* ink */
  }
  .nav a.current:link, .nav a.current:visited {
    color: #6699ff; /* accent */
    border-bottom-color: #6699ff; /* accent */
  }
  th, .footer {
    background-color: #262626; /* surface-raised */
  }
  table.events th, table.events td, table.facts th, table.facts td {
    border-bottom-color: #4d4d4d; /* border */
  }
  .alert {
    color: #ff6666; /* danger */
  }
}
