/* The look is a fork of krekenavosbazilika.lt's, including its Merriweather Sans (bundled). */
:root {
  --blue: #1a4789;      /* header, buttons */
  --red: #ad2601;       /* headings, accents */
  --gold: #cfa557;      /* small labels on dark backgrounds */
  --cream: #fcf8e5;     /* text on dark backgrounds */
  --sky: #ebf5ff;       /* page and header background */
  --line: #ccc;
  --shade: rgba(0, 0, 0, 0.5); /* over photos and behind the scanner */
}

/* Merriweather Sans, SIL OFL 1.1: ./OFL-c487138e4ea46883.txt */
@font-face {
  font-family: "Merriweather Sans";
  src: url("./MerriweatherSans-bef90d227eeb5b58.ttf");
  font-weight: 300 800;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--sky);
  color: #000;
  font: 16px/1.6 "Merriweather Sans", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

h1, h2 {
  margin: 0 0 0.5em;
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  color: var(--red);
  font-size: 2rem;
  text-transform: uppercase;
}

h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--blue);
  font-size: 1.4rem;
  text-transform: uppercase;
}

h2::after {
  content: "";
  flex: 1;
  height: 16px;
  border-radius: 4px;
  background: var(--blue);
}

a {
  color: inherit;
  text-decoration: none;
}

a:not(.button, .stop-card):hover {
  color: var(--red);
}

button {
  font: inherit;
  color: inherit;
}

img, video {
  display: block;
  max-width: 100%;
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

audio {
  width: 100%;
}

/* Icons are small SVGs painted in the text colour through a mask, on the ::before (leading) or ::after (trailing) of their element.
   The chevron points right and is mirrored where it points back; on .stop-card ::before is the tick and ::after the chevron. */
.scan-shortcut::before,
.button--primary::before,
label.button--light::before,
.icon-button::before,
.previous::before,
.back-link::before,
.stop-card::before,
a.button--light::after,
.next::after,
.stop-card::after {
  content: "";
  flex: none;
  width: 1.2em; height: 1.2em;
  background-color: currentColor;
  mask: center / contain no-repeat;
}

.scan-shortcut::before, .button--primary::before {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14.5 4 16 6h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3l1.5-2h5Z'/><circle cx='12' cy='12.5' r='3.5'/></svg>");
}

label.button--light::before {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 16V4m0 0L7 9m5-5 5 5M5 14v5h14v-5'/></svg>");
}

.icon-button::before {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 6 12 12M18 6 6 18'/></svg>");
}

.stop-card::before {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12 4 4L19 6'/></svg>");
}

.previous::before,
.back-link::before,
a.button--light::after,
.next::after,
.stop-card::after {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>");
}

.previous::before, .back-link::before {
  transform: scaleX(-1);
}

.shell {
  width: min(1100px, 100% - 32px);
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Header */
.site-header {
  padding-block: 0.75rem;
  border-bottom: 6px solid var(--blue);
  background: var(--sky);
  color: var(--blue);
}

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

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
}

.brand img {
  max-height: 64px;
}

.scan-shortcut {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 700;
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--blue);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.button--primary {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.button--light {
  background: white;
  color: var(--blue);
}

.button input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}

:focus-visible, .button:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.button:disabled {
  border-color: var(--line);
  background: var(--line);
  color: #555;
  cursor: default;
}

/* Home page */
.hero {
  min-height: 70svh;
  display: flex;
  flex-direction: column;
  color: white;
  background: linear-gradient(var(--shade), var(--shade)), url("./background-f0a78d948bb02092.jpg") center 45% / cover;
}

.hero-top {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
}

.language-switch {
  display: flex;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px;
}

.language-switch a {
  display: grid;
  place-items: center;
  min-width: 44px; min-height: 44px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

html[lang="lt"] .language-switch [hreflang="lt"],
html[lang="en"] .language-switch [hreflang="en"] {
  background: var(--blue);
  color: white;
}

.hero-content {
  margin-block: auto 3rem;
}

.hero h1 {
  color: white;
  font-size: 2.6rem;
  text-transform: none;
}

.section {
  padding-block: 3rem;
}

.section--dark {
  background: var(--blue);
  color: var(--cream);
}

.section--dark h2 {
  color: white;
}

.section--dark h2::after {
  background: var(--cream);
}

.section--dark :focus-visible {
  outline-color: var(--cream);
}

.hero .eyebrow, .section--dark .eyebrow {
  color: var(--gold);
}

.stop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.stop-card {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}

.stop-card:hover {
  background: var(--red);
  color: white;
}

.stop-card:hover .stop-number {
  color: inherit;
}

.stop-number {
  color: var(--red);
  font-size: 1.1rem;
  font-weight: 700;
}

/* Opened stops get a blue tick; :visited may only change colours, so the tick is white until then. */
.stop-card::before {
  grid-area: 1 / 3;
  background-color: white;
}

.stop-card::after {
  grid-area: 1 / 4;
}

.stop-card:visited::before {
  background-color: var(--blue);
}

.stop-card:hover::before {
  background-color: var(--red);
}

.stop-card:hover:visited::before {
  background-color: white;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 1.5rem;
}

.gallery-grid a:first-child {
  grid-column: span 2;
}

.gallery-grid img {
  width: 100%; height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Stop page */
.stop-hero {
  padding-block: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  margin-bottom: 1rem;
  color: var(--blue);
  font-weight: 700;
}

.stop-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 2rem;
  padding-bottom: 3rem;
}

.audio-panel {
  align-self: start;
  position: sticky;
  top: 1rem;
  padding: 1.25rem;
  border-top: 3px solid var(--red);
  background: white;
}

.story {
  font-size: 1.05rem;
  line-height: 1.75;
}

.panorama {
  padding-bottom: 0;
}

/* The 2:1 panorama is 60vh tall, or fills the width on screens wider than that, with nothing to scroll and no hint. */
.panorama-strip {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.panorama-strip img {
  width: max(120vh, 100%);
  max-width: none;
  aspect-ratio: 2 / 1;
}

.panorama-strip.failed {
  display: none;
}

@media (min-aspect-ratio: 6 / 5) {
  .panorama-hint {
    display: none;
  }
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem;
}

.pagination > * {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.pagination .next {
  margin-left: auto;
  text-align: right;
}

.pagination small {
  display: block;
  color: var(--blue);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Scanner */
dialog {
  width: min(560px, 100% - 24px);
  border: 0;
  border-radius: 6px;
  background: var(--sky);
}

dialog::backdrop {
  background: var(--shade);
}

dialog h2 {
  margin-right: 52px;
}

dialog h2::after {
  display: none;
}

dialog form {
  position: absolute;
  top: 12px; right: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

.camera-frame {
  height: min(320px, 100svh - 16rem);
  background: #000;
}

.camera-frame video {
  height: 100%;
  object-fit: cover;
}

.scan-status {
  color: var(--red);
  font-weight: 700;
}

.scan-status:empty {
  display: none;
}

.media-error {
  display: none;
  color: var(--red);
  font-weight: 700;
}

.failed + .media-error {
  display: block;
}

.section--dark .media-error {
  padding-inline: 16px;
  color: white;
}

/* Without scripting the scanner cannot open. */
@media (scripting: none) {
  [data-open-scanner] {
    display: none;
  }
}

/* Phones: one column. */
@media (max-width: 760px) {
  .hero h1 {
    font-size: 2rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .stop-body {
    grid-template-columns: 1fr;
  }

  .audio-panel {
    position: static;
  }

  .scan-shortcut {
    min-width: 44px;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 2px;
  }

  .scan-shortcut span {
    display: none;
  }
}

/* Landscape phones: a slimmer header and no hero paragraph keep the scan button on screen. */
@media (max-height: 450px) {
  .brand img {
    max-height: 48px;
  }

  .hero h1 + p {
    display: none;
  }
}
