/* art.astonhotelriga.com — public site.
   Design tokens from astonhotelriga.com (brief §6). Mobile-first: the primary
   device is a phone held next to a painting — designed at 360–430 px first.

   Typography rules (domain):
   - Headings: 'Forum' (single 400 weight). NEVER bold — no real bold exists
     and browsers would synthesize a mushy fake. Hierarchy via size only.
   - Forum keeps letter-spacing: normal — tracked Forum makes Latvian
     combining marks drift sideways (verify any change on /styleguide).
   - Forum is self-hosted below as ONE face with no unicode-range: the Google
     API's Forum subsets make Chromium compose ā/ē/ī/ū from base + combining
     macron (which Forum can't position) instead of its precomposed glyphs.
     Do not switch Forum back to the API link without re-passing /styleguide.
   - Body/UI: 'Montserrat' 400/500/700 (Google API — renders Latvian fine).
     Safe to track lightly. */

@font-face {
  font-family: 'Forum';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../vendor/fonts/forum/forum-regular.woff2') format('woff2');
}

:root {
  --bg:       hsl(42, 38%, 90%);    /* ≈ #EFE9DC — cream page background */
  --bg-alt:   hsl(42, 38%, 85%);    /* subtle section alternation */
  --accent:   hsl(13, 75%, 47%);    /* ≈ #D2451E — rust */
  --accent-d: hsl(13, 75%, 37%);    /* rust dark (CTA hover) */
  --gold:     hsl(45.83, 55%, 55%); /* gold — link hover / underline accents */
  --ink:      #000;                 /* body text */
  --paper:    #fff;
  --muted:    rgb(95, 99, 104);     /* secondary text */
  --radius: 6px;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.08), 0 6px 20px rgb(0 0 0 / 0.06);
  --sticky-offset: 4.5rem;          /* room for the sticky pill bar */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip; /* belt & braces: never a horizontal page scroll */
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3 {
  font-family: 'Forum', 'Times New Roman', serif;
  font-weight: 400;            /* Forum: single weight, never bold */
  letter-spacing: normal;      /* Forum: never tracked (Latvian diacritics) */
  line-height: 1.15;
  margin: 0 0 0.5em;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: 1100px; margin-inline: auto; padding-inline: 1.1rem; }

/* ---------- header ---------- */

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem 1rem; padding-block: 0.9rem; flex-wrap: wrap;
}
.site-logo img { height: 64px; width: auto; }
.header-side {
  display: flex; align-items: center; gap: 0.6rem 0.9rem; flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 12rem; min-width: 0; /* force internal wrapping on narrow phones */
}
.back-link {
  color: var(--muted); text-decoration: none; font-size: 0.8rem;
  border-bottom: 1px solid transparent;
}
.back-link:hover { color: var(--ink); border-bottom-color: var(--gold); }
.lang-toggle { font-size: 0.85rem; font-weight: 500; display: flex; gap: 0.45rem; align-items: center; }
.lang-toggle a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.lang-toggle a:hover { color: var(--accent); border-bottom-color: var(--gold); }
.lang-current { font-weight: 700; }
.lang-sep { color: var(--muted); }
.btn-cta {
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 500; font-size: 0.85rem; padding: 0.55em 1.25em;
  border-radius: 0; /* square, matching the main site's CTA — the CTA only;
                       pills, cards etc. keep their radii */
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.btn-cta:hover { background: var(--accent-d); }

/* ---------- intro ---------- */

.intro { padding-block: 1.25rem 0.75rem; }
.intro h1 { font-size: clamp(2rem, 7vw, 3rem); }
.intro h1::after {
  content: ""; display: block; width: 3rem; height: 2px;
  background: var(--gold); margin-top: 0.35em;
}
.intro p { max-width: 62ch; margin: 0.75em 0 0; }

/* ---------- sticky pill navigation ---------- */

.pills {
  position: sticky; top: 0; z-index: 40;
  display: flex; gap: 0.5rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  background: var(--bg);
  padding-block: 0.8rem;
  margin-inline: -1.1rem; padding-inline: 1.1rem; /* edge-to-edge scroll on phones */
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  border: 1px solid rgb(0 0 0 / 0.28); border-radius: 999px;
  padding: 0.42em 1.05em;
  font-size: 0.88rem; font-weight: 500; letter-spacing: 0.02em; /* Montserrat — safe */
  color: var(--ink); text-decoration: none; background: transparent;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- stacked sections (floors 1→6, then Artists) ----------
   Always visible — pills are anchors, not tab switches. scroll-margin-top
   keeps section headings clear of the sticky bar on anchor jumps; the JS
   scroll-spy derives its trigger line from this same value. */

.panel { padding-block: 1.4rem 2.75rem; scroll-margin-top: var(--sticky-offset); }
.panel-heading { font-size: clamp(1.6rem, 5.5vw, 2.1rem); margin-bottom: 1.1rem; }
.panel-heading::after {
  content: ""; display: block; width: 2.5rem; height: 2px;
  background: var(--gold); margin-top: 0.3em;
}

/* ---------- artwork cards ---------- */

.art-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .art-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
}
.card {
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-image { display: block; padding: 1rem 1rem 0; background: var(--paper); }
.card-image img { width: 100%; height: auto; } /* full artwork, NEVER cropped */
.card-body { padding: 0.8rem 1rem 1.05rem; }
.card-title { font-size: 1.2rem; margin: 0; }
.card-artist-row { margin: 0.15rem 0 0; }
.card-artist {
  font-size: 0.83rem; font-weight: 500; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--gold);
}
.card-artist:hover { color: var(--accent); }
.card-meta { font-size: 0.8rem; color: var(--muted); margin: 0.45rem 0 0; }
.card-location { font-size: 0.8rem; color: var(--muted); font-style: italic; margin: 0.15rem 0 0; }

/* ---------- artists tab ---------- */

.artist-entry {
  padding-block: 1.5rem; border-bottom: 1px solid rgb(0 0 0 / 0.09);
  scroll-margin-top: var(--sticky-offset);
}
.artist-entry:last-child { border-bottom: 0; }
.artist-name { font-size: 1.55rem; margin-bottom: 0.4rem; }
.artist-years { color: var(--muted); font-size: 0.72em; }
.artist-bio { max-width: 68ch; }
.artist-bio p { margin: 0.55em 0; }
.artist-strip {
  display: flex; gap: 0.65rem; overflow-x: auto;
  padding-block: 0.7rem 0.2rem; scrollbar-width: thin;
}
.artist-strip a { flex: 0 0 auto; }
.artist-strip img {
  height: 96px; width: auto; /* scaled, not cropped */
  border-radius: 4px; box-shadow: 0 1px 4px rgb(0 0 0 / 0.15);
}

.empty-note { padding-block: 3rem; color: var(--muted); text-align: center; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 2.5rem; border-top: 1px solid rgb(0 0 0 / 0.1);
  padding-block: 2rem 2.4rem; text-align: center;
  font-size: 0.85rem; color: var(--muted);
}
.site-footer p { margin: 0.25em 0; }
.site-footer a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.site-footer a:hover { color: var(--ink); border-bottom-color: var(--gold); }

/* ---------- consent bar (GA4 gate) ---------- */

.consent {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 100;
  background: var(--paper);
  border-top: 1px solid rgb(0 0 0 / 0.12);
  box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
  align-items: center; justify-content: center;
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.78rem;
}
.consent[hidden] { display: none; }
.consent-text { margin: 0; max-width: 52ch; }
.consent-actions { display: flex; gap: 0.5rem; }
.consent-btn {
  font: inherit; font-weight: 500; border-radius: 999px;
  padding: 0.45em 1.1em; cursor: pointer; border: 1px solid transparent;
}
.consent-accept { background: var(--accent); color: #fff; border-color: var(--accent); }
.consent-accept:hover { background: var(--accent-d); }
.consent-decline { background: transparent; color: var(--muted); border-color: rgb(0 0 0 / 0.25); }
.consent-decline:hover { color: var(--ink); }

/* ---------- error pages ---------- */

.error-page { text-align: center; padding-block: 4rem 5rem; }
.error-code {
  font-family: 'Forum', serif; font-size: clamp(4rem, 18vw, 7rem);
  color: var(--accent); margin: 0; line-height: 1;
}
.error-page h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-top: 0.3em; }
.error-alt { color: var(--muted); }

/* ---------- lightbox caption typography ---------- */

.glightbox-container .gslide-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem; font-weight: 400; line-height: 1.5;
}

/* ---------- wider screens ---------- */

@media (min-width: 760px) {
  .site-logo img { height: 76px; }
  .intro { padding-block: 2rem 1rem; }
  /* ONE text measure for the whole page: intro copy, artist bios and the
     thumbnail strip all meet at 82ch (under the ~85ch readability cap; the
     strip scrolls inside it). Desktop only — below this breakpoint all of
     them are container-width already. The consent bar keeps its own compact
     52ch: it is a fixed overlay, not page copy. */
  .intro p, .artist-bio, .artist-strip { max-width: 82ch; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
