/* Sternmotor timeline
   All visual design lives in this file.
   Pages are HTML in de/, en/ and fr/. Pictures are in media/images/. */

:root {
  --paper: #f4f0e6;
  --paper-2: #e6e0d2;
  --sheet: #fffdf8;
  --ink: #1d1a16;
  --ink-soft: #5c564c;
  --line: #d9d1c3;
  --accent: #7f2f2b;
  --steel: #2a4660;
  --header: #1d1a16;
  --header-ink: #f4f0e6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 48rem;
}

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

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  hyphens: auto;
  hyphenate-limit-chars: 10 5 5;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--steel);
}

::selection {
  background: #e4cfc0;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 30;
  background: var(--sheet);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
}

.skip:focus {
  top: 0.5rem;
}

.site-header {
  background: #003399;
  color: var(--header-ink);
}

@media screen {
  .site-header {
    background-image: url("../media/images/eu-stars.svg?v=full");
    background-position: center;
    background-repeat: no-repeat;
    background-size: auto 100%;
  }
}

.header-inner,
.years,
main,
.site-footer .inner {
  width: min(var(--measure), calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem 1rem;
  padding: 0.85rem 0 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.28rem;
  letter-spacing: 0.01em;
}

.brand img {
  display: block;
  width: 1.7rem;
  height: 1.7rem;
}

.langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  max-width: 100%;
}

.langs a {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 36px;
  border-radius: 0.25rem;
}

.langs img {
  display: block;
  border-radius: 2px;
}

.langs a[aria-current="page"] img {
  outline: 2px solid var(--header-ink);
  outline-offset: 2px;
}

.langs a:hover {
  background: rgb(255 255 255 / 14%);
}

.years {
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem 0 0.85rem;
  overflow-x: auto;
}

.years a,
.years span {
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.years a:hover {
  border-color: rgb(244 240 230 / 45%);
}

.years span[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
}

.site-header :focus-visible,
.pager a:focus-visible,
.year-list a:focus-visible,
.door:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}

main :focus-visible,
.site-footer :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

main {
  padding: 2.3rem 0 3.2rem;
}

.kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0.4rem 0 1.2rem;
  font-weight: 560;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h2,
h3 {
  font-family: var(--sans);
  font-weight: 650;
  line-height: 1.3;
}

h2 {
  margin: 2.3rem 0 0.7rem;
  font-size: 1.35rem;
}

h3 {
  margin: 1.7rem 0 0.45rem;
  font-size: 1.12rem;
}

.lead {
  margin-top: 0;
  color: var(--ink-soft);
  font-size: 1.22rem;
}

article p {
  margin: 0.85rem 0;
}

article ul,
article ol {
  margin: 0.8rem 0 1rem;
  padding-left: 1.3rem;
}

article li + li {
  margin-top: 0.45rem;
}

article li::marker {
  color: var(--accent);
}

article a {
  text-underline-offset: 0.16em;
}

figure.photo,
figure.video {
  margin: 1.6rem 0 1.8rem;
}

figure.photo img {
  display: block;
  width: 100%;
  background: var(--paper-2);
  cursor: zoom-in;
}

figure.video figcaption {
  margin-top: 0.45rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--header);
}

.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: inherit;
  text-decoration: none;
  padding: 0.35rem 0;
}

.pager .next {
  grid-column: 2;
  text-align: right;
  align-items: flex-end;
}

.pager .label {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pager strong {
  font-weight: 560;
  font-size: 1.45rem;
}

.pager em {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.site-footer {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.9rem;
}

.site-footer .inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 2.4rem;
}

.site-footer p {
  grid-column: 1;
  margin: 0.2rem 0;
}

.footer-home {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  border-radius: 0.25rem;
}

.footer-home img {
  display: block;
  border-radius: inherit;
}

.footer-home span {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: calc(100% + 0.4rem);
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.3rem 0.6rem;
  border-radius: 0.25rem;
  background: var(--header);
  color: var(--header-ink);
  visibility: hidden;
}

.footer-home:hover span,
.footer-home:focus-visible span {
  visibility: visible;
}

.doors {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.door {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 16rem;
  padding: 1.2rem 1.15rem 1.05rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.door:hover {
  border-color: var(--accent);
}

.year-list a:hover .name {
  color: var(--accent);
}

.door-lang {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.door p {
  margin: 0;
  font-size: 1.12rem;
}

.door-go {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--steel);
}

.year-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.year-list li {
  border-top: 1px solid var(--line);
}

.year-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.year-list a {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  column-gap: 0.9rem;
  row-gap: 0.35rem;
  padding: 1.05rem 0 1.15rem;
  color: inherit;
  text-decoration: none;
}

.year-list .year {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-family: var(--sans);
  padding-top: 0.28rem;
}

.year-list .name {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  line-height: 1.25;
}

.year-list .excerpt {
  grid-column: 2;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

#lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
}

#lightbox::backdrop {
  background: rgba(18, 15, 12, 0.9);
}

#lightbox img {
  display: block;
  max-width: 94vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  margin: 0 auto;
}

#lightbox .close {
  position: fixed;
  top: 0.7rem;
  right: 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--header-ink);
  background: var(--header);
  border: 1px solid rgba(244, 240, 230, 0.4);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

@media (min-width: 860px) {
  .doors {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 860px) {
  .site-header {
    background-position: right max(1rem, calc((100% - var(--measure)) / 2)) top 0.35rem;
    background-size: 10.08rem 10.08rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0.7rem;
  }

  .brand {
    min-height: 2.55rem;
  }

  .langs {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 1.0625rem;
  }

  .year-list a {
    grid-template-columns: 1fr;
  }

  .year-list .excerpt {
    grid-column: 1;
  }

  .pager strong {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .skip,
  #lightbox {
    position: static;
    background: white;
    color: black;
  }

  .years,
  .langs,
  .pager,
  .frame {
    display: none;
  }

  body {
    background: white;
    font-size: 12pt;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }

  figure.photo img {
    cursor: auto;
  }
}
