/* Mylotopi QR guide. Mobile first: one hand, outdoors, in the sun. */

/* ---------------------------------------------------------------- fonts */

/* Served from this site, so nothing depends on another host. All three families are under the SIL
   Open Font License 1.1 (copied from Google Fonts, 25/10/2026). Playfair Display has no Greek, so
   Greek headings use Noto Serif Display through the font stack; each file loads only when a page
   uses its characters. */

/* Manrope, cyrillic */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Manrope, greek */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

/* Manrope, latin-ext */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope, latin */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Playfair Display, cyrillic */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/playfair-display-700-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Playfair Display, latin-ext */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/playfair-display-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Playfair Display, latin */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/playfair-display-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Noto Serif Display, greek */
@font-face {
  font-family: "Noto Serif Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/noto-serif-display-700-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
  --bg: #f4efdf;
  --surface: #fffaf0;
  --surface-soft: #ebe2c9;
  --text: #262512;
  --muted: #5f5b48;
  --olive: #56631f;
  --charcoal: #1f2210;
  --accent: #a9822f;
  --accent-soft: #e4d3a2;
  --on-dark: #f4efdf;
  --on-dark-muted: #c9c3a8;
  --border: rgb(74 62 34 / 0.18);
  --shadow: 0 14px 36px rgb(40 37 19 / 0.1);

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --touch: 44px;

  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-display: "Playfair Display", "Noto Serif Display", Georgia, serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-fast: 160ms;

  /* Set by guide.js from the real bar sizes; these are first-paint guesses. */
  --header-height: 64px;
  --player-height: 0px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 12px);
  scroll-padding-bottom: calc(var(--player-height) + 12px);
}

body {
  margin: 0;
  min-height: 100svh;
  background: linear-gradient(180deg, var(--bg), var(--surface-soft));
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.has-player {
  padding-bottom: calc(var(--player-height) + 16px);
}

body.is-map-modal-open {
  overflow: hidden;
}

::selection {
  background: var(--accent-soft);
  color: var(--charcoal);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input {
  font: inherit;
  color: inherit;
}

button,
summary,
a {
  touch-action: manipulation;
}

button,
summary {
  cursor: pointer;
}

summary {
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

:where(a) {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--olive);
  outline-offset: 3px;
}

.site-header :focus-visible,
.player :focus-visible {
  outline-color: var(--accent-soft);
}

.icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.container {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 0 8px;
  background: var(--charcoal);
  box-shadow: 0 8px 24px rgb(31 34 16 / 0.18);
}

.site-header__inner {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.brand__logo {
  width: clamp(112px, 32vw, 150px);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: var(--touch);
  padding: 0 14px;
  border: 1px solid rgb(244 239 223 / 0.24);
  border-radius: 999px;
  color: var(--on-dark);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.header-button__chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.selector[open] .header-button__chevron {
  transform: rotate(180deg);
}

@media (hover: hover) and (pointer: fine) {
  .header-button:hover {
    background: rgb(244 239 223 / 0.1);
  }
}

@media (max-width: 380px) {
  .header-button__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .header-button {
    padding: 0 12px;
  }
}

/* ---------------------------------------------------------------- menus */

.selector {
  position: relative;
}

.selector__menu {
  position: absolute;
  z-index: 60;
  display: grid;
  gap: 4px;
  max-height: min(70svh, 460px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 18px 42px rgb(38 37 18 / 0.22);
  color: var(--text);
}

.selector__menu--language {
  top: calc(100% + 8px);
  right: 0;
  width: min(230px, calc(100vw - 32px));
}

.selector__option {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: var(--touch);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.selector__option[aria-current="true"],
.selector__option[aria-current="page"] {
  background: var(--olive);
  color: var(--surface);
}

@media (hover: hover) and (pointer: fine) {
  .selector__option:hover:not([aria-current="true"]):not([aria-current="page"]) {
    background: rgb(235 226 201 / 0.7);
  }
}

.selector__option--stop {
  grid-template-columns: 30px minmax(0, 1fr);
}

.selector__option-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgb(169 130 47 / 0.14);
  color: var(--olive);
  font-size: 0.875rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.selector__option[aria-current="true"] .selector__option-number {
  background: var(--accent-soft);
  color: var(--charcoal);
}

.language-option {
  grid-template-columns: 24px minmax(0, 1fr);
}

.language-option__flag {
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgb(38 37 18 / 0.16);
}

.language-option__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- hero */

.qr-main {
  display: grid;
  gap: 16px;
  padding: 24px 0 24px;
}

.qr-hero {
  display: grid;
  gap: 6px;
  padding: 4px 2px 8px;
}

.qr-hero__title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 9vw, 3.6rem);
  font-weight: 700;
  line-height: 1;
  text-wrap: balance;
}

.qr-hero__place {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------- stops */

.qr-stop {
  display: grid;
  gap: 16px;
  padding: 18px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.qr-stop__title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
}

/* The stop number is the sequence the visitor walks, so it carries real weight. */
.qr-stop__number {
  min-width: 1.1ch;
  color: var(--olive);
  font-size: clamp(2.8rem, 13vw, 3.6rem);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 0.8;
}

.qr-stop__name {
  color: var(--text);
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  text-wrap: balance;
}

/* ---------------------------------------------------------------- photos */

.qr-carousel {
  display: grid;
  gap: 8px;
  margin: 0;
}

/* Swiping between photos is plain horizontal scrolling with snap points. */
.qr-carousel__track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.qr-carousel__track::-webkit-scrollbar {
  display: none;
}

.qr-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  outline: 1px solid rgb(0 0 0 / 0.08);
  outline-offset: -1px;
}

.qr-carousel__track > .qr-carousel__frame {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.qr-carousel__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.qr-carousel__frame[data-image-fit="contain"] .qr-carousel__image {
  padding: 6px;
  object-fit: contain;
}

.qr-carousel__controls {
  display: grid;
  grid-template-columns: var(--touch) minmax(0, 1fr) var(--touch);
  gap: 10px;
  align-items: center;
}

.qr-carousel__controls[hidden] {
  display: none;
}

.qr-carousel__button {
  display: grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.qr-carousel__button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.4;
}

.qr-carousel__counter {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.qr-media__placeholder {
  display: grid;
  gap: 4px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.qr-media__placeholder strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.4rem;
}

/* ---------------------------------------------------------------- listen */

.qr-listen {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 60px;
  padding: 8px 20px 8px 8px;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--on-dark);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.2;
  transition: transform var(--duration-fast) var(--ease-out);
}

.qr-listen:active {
  transform: scale(0.98);
}

.qr-listen__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--charcoal);
}

.qr-listen__time {
  color: var(--on-dark-muted);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.icon--pause,
.is-playing .icon--play {
  display: none;
}

.is-playing .icon--pause {
  display: block;
}

.qr-listen-missing,
.qr-listen-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------- story */

.qr-story {
  display: grid;
  gap: 18px;
}

.story-block {
  display: grid;
  gap: 8px;
}

.story-block__heading,
.qr-copy__heading {
  margin: 0;
  color: var(--olive);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.3;
  text-wrap: balance;
}

.story-block__paragraph,
.story-block__list,
.qr-copy p,
.qr-copy__list {
  max-width: 68ch;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.story-block__list,
.qr-copy__list {
  display: grid;
  gap: 10px;
  padding-left: 1.25rem;
}

.story-block__item::marker,
.qr-copy__list li::marker {
  color: var(--stop-accent, var(--accent));
}

.story-block__item-label,
.qr-copy__item-label {
  font-weight: 800;
}

.story-expanded,
.qr-copy {
  display: grid;
  gap: 18px;
}

.qr-readmore > summary + * {
  margin-top: 16px;
}

.qr-readmore + .qr-readmore {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.qr-readmore__button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: var(--touch);
  padding: 8px 12px 8px 16px;
  border: 1px solid rgb(169 130 47 / 0.45);
  border-radius: 999px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.qr-readmore[open] > .qr-readmore__button {
  background: rgb(169 130 47 / 0.12);
}

/* The summary says "Read the story" while closed and "Show less" while open. */
.qr-readmore:not([open]) .qr-readmore__label--open,
.qr-readmore[open] .qr-readmore__label--closed {
  display: none;
}

.qr-readmore__chevron {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.qr-readmore[open] .qr-readmore__chevron {
  transform: rotate(180deg);
}

/* ---------------------------------------------------------------- stop navigation */

.qr-stop-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
}

.qr-stop-nav__button {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 56px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  line-height: 1.25;
}

a.qr-stop-nav__button--previous {
  border: 1px solid var(--border);
  background: rgb(235 226 201 / 0.5);
}

a.qr-stop-nav__button--next {
  background: var(--charcoal);
  color: var(--on-dark);
  text-align: right;
}

.qr-stop-nav__meta {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.qr-stop-nav__button--next .qr-stop-nav__meta {
  color: var(--on-dark-muted);
}

.qr-stop-nav__title {
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 800;
}

/* ---------------------------------------------------------------- end of the tour */

.qr-end {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 32px 16px;
  text-align: center;
}

.qr-end__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  line-height: 1.1;
}

.qr-end__restart {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: var(--touch);
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
}

/* ---------------------------------------------------------------- player */

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: var(--charcoal);
  box-shadow: 0 -8px 24px rgb(31 34 16 / 0.2);
  color: var(--on-dark);
}

.player[hidden] {
  display: none;
}

.player__inner {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
}

.player__toggle {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--charcoal);
  transition: transform var(--duration-fast) var(--ease-out);
}

.player__toggle:active {
  transform: scale(0.95);
}

.player__toggle .icon {
  width: 26px;
  height: 26px;
}

.player__stops {
  position: static;
  min-width: 0;
}

.player__stop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 0 4px;
}

.player__number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}

.player__title {
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__time {
  color: var(--on-dark-muted);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.player__chevron {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.player__stops[open] .player__chevron {
  transform: rotate(180deg);
}

.selector__menu--stops {
  bottom: calc(100% + 8px);
  left: 16px;
  right: 16px;
  margin-inline: auto;
  max-width: 728px;
}

/* The position bar appears once a narration is loaded. */
.player__seek {
  display: none;
  grid-column: 1 / -1;
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: var(--accent-soft);
}

@media (max-width: 380px) {
  .player__time {
    font-size: 0.875rem;
  }

  .player__stop {
    gap: 8px;
  }
}

.player.is-loaded .player__seek {
  display: block;
}

/* ---------------------------------------------------------------- map */

.minimap-modal:not([open]) {
  display: none;
}

.minimap-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  border: 0;
  background: transparent;
}

.minimap-modal::backdrop {
  background: rgb(38 37 18 / 0.7);
}

.minimap-modal__dialog {
  display: grid;
  gap: 12px;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(38 37 18 / 0.35);
}

.minimap-modal__head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-left: 6px;
}

.minimap-modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
}

.minimap-modal__close {
  min-height: var(--touch);
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--on-dark);
  font-weight: 700;
}

.minimap-modal__image {
  width: 100%;
  max-height: calc(100dvh - 120px);
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

/* ---------------------------------------------------------------- entry page */

/* Seen only without JavaScript, or for the moment before the redirect. */
.qr-entry {
  display: grid;
  gap: 20px;
  justify-items: center;
  padding: 48px 0;
}

.qr-entry__languages {
  display: grid;
  gap: 6px;
  width: min(100%, 320px);
}

.qr-entry .selector__option {
  border: 1px solid var(--border);
  background: var(--surface);
}

/* ---------------------------------------------------------------- larger screens */

@media (min-width: 720px) {
  .qr-main {
    gap: 20px;
    padding-top: 32px;
  }

  .qr-stop {
    padding: 24px;
  }

  .qr-media {
    aspect-ratio: 16 / 10;
  }
}

/* ---------------------------------------------------------------- reduced motion */

/* State changes stay; only the movement between them goes. */
@media (prefers-reduced-motion: reduce) {
  .header-button__chevron,
  .qr-readmore__chevron,
  .player__chevron,
  .qr-listen,
  .player__toggle {
    transition: none;
  }

  .qr-listen:active,
  .player__toggle:active {
    transform: none;
  }
}
