/* ==========================================================
   The Art Quote — shared styles (every page)
   Layout idea: a quiet ivory gallery wall; posters hang in a
   grid with small museum-style labels underneath.
   ========================================================== */
:root {
  --paper: #f4f2ec;       /* wall colour */
  --paper-glass: rgba(244, 242, 236, 0.9);
  --ink: #2b2a27;         /* main text */
  --muted: #8a8577;       /* labels, secondary text */
  --line: #e2ded2;        /* hairlines */
  --shadow: 0 6px 18px rgba(43, 42, 39, 0.14);
  --shadow-lift: 0 14px 32px rgba(43, 42, 39, 0.2);

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-ui: 'Outfit', 'Helvetica Neue', Arial, sans-serif;

  --gutter: max(16px, 4vw);
  --header-pad: 20px; /* space above and below the logo */
  --mark-h: 60px;      /* height of the brand mark (left) */
  --wordmark-w: 282px; /* width of "THEARTQUOTE" (right) */
  --nav-drop: 0px;     /* moves the menu up/down; 0 = envelope's bottom on the mark's bottom edge */
  --nav-mid: 6px;      /* slim bar: lifts the menu to the mark's middle */
  --header-full: calc(var(--mark-h) + 2 * var(--header-pad));
  --header-h: var(--header-full);
  /* White margin left, right and below the poster grid. The header and footer use it too,
     so the logo and the copyright line up with the posters. */
  --edge-x: 16px;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-ui);
  font-weight: 300;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ===== Header ===== */
/* Computer: brand mark on the left; "THEARTQUOTE" with the menu under it on the right.
   The right column is exactly as tall as the mark, so wordmark top = mark top, menu bottom = mark bottom. */
.site-top { display: contents; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header__inner {
  padding: var(--header-pad) var(--edge-x);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  transition: padding 0.3s ease;
}

.site-logo { display: block; flex-shrink: 0; }
.site-logo__mark { display: block; height: var(--mark-h); width: auto; transition: height 0.3s ease; }
.site-logo__phone { display: none; }

.site-header__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 0;
}
.site-wordmark { display: block; overflow: hidden; max-height: 60px; transition: max-height 0.3s ease, opacity 0.2s ease; }
.site-wordmark img { display: block; width: var(--wordmark-w); height: auto; }

.site-nav {
  display: flex;
  align-items: center; /* tags and envelope share one centre line */
  gap: 26px;
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: var(--nav-drop);
  transition: margin-bottom 0.3s ease;
}
.site-nav a {
  text-decoration: none;
  color: #000;
  transition: opacity 0.2s ease;
}
.site-nav a:hover { opacity: 0.55; }
.site-nav a.is-active { font-weight: 700; }
.site-nav a.is-active:hover { opacity: 1; }
/* reserve the bold width, so the menu doesn't shift when another tag is chosen */
.site-nav a[data-label] { display: inline-flex; flex-direction: column; align-items: center; }
.site-nav a[data-label]::after {
  content: attr(data-label);
  font-weight: 700;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
.site-nav__email { margin-left: 6px; display: block; }
.site-nav__email-icon { display: block; width: 26px; height: auto; transition: opacity 0.2s ease; }
/* fade only the envelope on hover, so the "Copied" label stays solid */
.site-nav a.site-nav__email:hover { opacity: 1; }
.site-nav__email:hover .site-nav__email-icon { opacity: 0.55; }
.site-nav__email-text { display: none; }

/* What the bar does on scroll (set $HEADER_SCROLL in includes/site.php) */
@media (min-width: 761px) {
  .site-top--away .site-header { position: relative; }
  .site-top--away .site-header.is-scrolled { border-bottom-color: transparent; }

  .site-top--shrink { display: block; height: var(--header-full); }
  .site-top--shrink .site-header { position: fixed; top: 0; left: 0; right: 0; }
  .site-top--shrink .is-scrolled .site-header__inner { padding-top: 12px; padding-bottom: 12px; }
  .site-top--shrink .is-scrolled .site-logo__mark { height: 36px; }
  .site-top--shrink .is-scrolled .site-wordmark { max-height: 0; opacity: 0; }
  /* slim bar: menu sits on the mark's centre line */
  .site-top--shrink .is-scrolled .site-nav { margin-bottom: var(--nav-mid); }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  width: 44px;
  height: 44px;
  cursor: pointer;
  position: relative;
  z-index: 60;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
}
.site-footer__inner {
  /* the footer is the white margin under the posters: as tall as the side margins are wide */
  min-height: var(--edge-x);
  padding: 8px var(--edge-x);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-size: 13px;
}
.site-footer a { text-decoration: none; font-weight: 400; }
.site-footer a:hover { opacity: 0.6; }
.site-footer__copy { color: var(--muted); }

/* "Copied hello@…" label, left of the envelope, same height as the envelope */
.email-link { position: relative; }
.email-tip {
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translate(6px, -50%);
  display: flex;
  align-items: center;
  height: 23px;
  padding: 0 9px;
  background: #55565a;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.email-tip b { font-weight: 700; margin-right: 0.3em; }
.email-tip.is-on { opacity: 1; transform: translate(0, -50%); }

/* ===== Mobile ===== */
@media (max-width: 760px) {
  :root { --header-h: 57px; }
  /* one-line logo centred; "#" button on the right, in line with the posters' right edge */
  .site-logo__mark, .site-wordmark { display: none; }
  .site-logo__phone { display: block; height: 25px; width: auto; }
  .site-header__inner { position: relative; padding: 16px var(--edge-x); align-items: center; justify-content: center; }
  .site-header__right { display: contents; }
  .site-footer__inner { padding: 20px var(--edge-x); }
  .nav-toggle {
    display: block;
    position: absolute;
    right: var(--edge-x);
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    padding: 0;
    text-align: right;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 26px;
    color: #000;
  }
  /* blur would trap the full-screen menu inside the header bar, so use a solid bar on phones */
  .site-header { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }

  /* Phone menu: opens under the logo bar, same type as the computer menu
     (Outfit, lowercase, chosen tag in bold), lined up with the posters' left edge */
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 18px;
    margin-bottom: 0;
    padding: 48px var(--edge-x) 40px;
    background: var(--paper);
    font-family: var(--font-ui);
    font-size: 32px;
    line-height: 1.1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a { color: #000; }
  .site-nav a[data-label] { align-items: flex-start; }
  .site-nav__email { margin: 22px 0 0; }
  .site-nav__email-icon { width: 30px; }
  body.menu-open { overflow: hidden; }
  .email-tip { right: auto; left: calc(100% + 10px); transform: translate(-6px, -50%); }
  .email-tip.is-on { transform: translate(0, -50%); }

  .site-footer__inner { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== Poster grid (homepage) =====
   Posters tile edge to edge like a wall of prints: no gaps, no text. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  overflow-x: clip; /* trims the 1px overlap, no sideways scroll */
}

/* On computers: fixed 36px white margin left, right and below the posters
   (the footer is that bottom margin). Phones have no hover zoom, so posters run edge to edge. */
@media (hover: hover) {
  :root { --edge-x: 36px; }
  .gallery {
    padding: 0 var(--edge-x); /* posters start right under the header bar */
  }
}
.tile {
  min-width: 0;
  position: relative;
  z-index: 0;
  animation: tileIn 0.4s ease both;
}
@keyframes tileIn { from { opacity: 0; } }

.tile__link { display: block; text-decoration: none; cursor: pointer; }
.tile__link--static { cursor: default; } /* poster not clickable yet ($POSTER_LINKS in includes/site.php) */

.tile__frame {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  max-width: 100%;
  overflow: hidden;
  margin: 0 -1px -1px 0; /* overlap neighbours by 1px so no hairline seams show between posters */
  background: var(--tile-bg, var(--line)); /* poster's own colour shows while the image loads */
  /* z-index waits until the shrink finishes, so the poster stays on top while it settles back */
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.tile__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

/* Hover: the whole poster grows 10% and lifts above the grid with a soft shadow.
   Only on devices with a real pointer, so a tap on a phone just opens the poster. */
@media (hover: hover) {
  .tile { transition: z-index 0s linear 0.35s; }
  /* above the header bar (z-index 50), so a zoomed top-row poster may cover the menu */
  .tile:hover,
  .tile:focus-within { z-index: 60; transition-delay: 0s; }

  .tile:hover .tile__frame,
  .tile__link:focus-visible .tile__frame {
    transform: scale(1.1);
    box-shadow: 0 10px 28px rgba(43, 42, 39, 0.28);
  }
}
.tile__link:focus-visible { outline: none; }
.tile__link:focus-visible .tile__frame { outline: 2px solid var(--ink); outline-offset: -2px; }

@media (max-width: 760px) {
  :root { --edge-x: 30px; } /* white margin left and right of the posters on phones */
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 var(--edge-x); }
}

/* ===== Standard poster page =====
   The poster hangs on the left, as tall as the screen allows; a museum-style
   label sits beside it on the right (number, quote, author, a short note, tags).
   On phones the label goes underneath. */
.poster-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px var(--edge-x) 64px;
}

.poster-view__art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(32px, 5vw, 72px);
  width: 100%;
  max-width: 1180px;
}
.poster-view__frame {
  position: relative;
  flex: 0 0 auto;
  width: min(58%, calc((100svh - var(--header-h) - 80px) * 2 / 3));
  min-width: 300px;
  aspect-ratio: 2 / 3;
  box-shadow: 0 14px 36px rgba(43, 42, 39, 0.22);
}
.poster-view__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.poster-view__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 0 1 380px;
  min-width: 260px;
  padding-bottom: 6px;
  text-align: left;
}
.poster-view__no {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.poster-view__quote {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  text-wrap: balance;
}
.poster-view__author { font-size: 14px; color: var(--muted); }
.poster-view__note {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}
.poster-view__fact {
  margin-top: 4px;
  padding: 12px 14px;
  background: #ece9e0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  text-wrap: pretty;
}
.poster-view__fact-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.poster-view__tags { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 14px; }
.poster-view__tags a { color: var(--muted); text-decoration: none; }
.poster-view__tags a:hover { color: var(--ink); }

/* ② per-poster section (interactive / edition) */
.poster-view__section { width: 100%; max-width: 960px; margin-top: 96px; }

/* ③ previous / next */
.poster-view__nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 520px);
  margin-top: 72px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.poster-view__nav a { text-decoration: none; color: var(--ink); }
.poster-view__nav a:hover { opacity: 0.55; }

/* narrow screens: label goes under the poster */
@media (max-width: 860px) {
  .poster-view__art { flex-direction: column; align-items: center; gap: 0; }
  .poster-view__frame { width: min(100%, calc((100svh - var(--header-h) - 40px - 150px) * 2 / 3)); min-width: min(100%, 300px); }
  .poster-view__label { flex: none; width: 100%; max-width: 520px; min-width: 0; margin-top: 26px; }
}
@media (max-width: 760px) {
  .poster-view { padding-top: 16px; padding-bottom: 48px; }
  .poster-view__frame { width: 100%; min-width: 0; }
  .poster-view__quote { font-size: 19px; }
  .poster-view__section { margin-top: 72px; }
  .poster-view__nav { margin-top: 56px; }
}

/* "Print it" box on poster pages (includes/print-box.php) */
.print-box { margin-top: 6px; }
.print-box__btn {
  display: inline-block; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 9px 20px;
}
.print-box__btn:hover { opacity: .85; }
.print-box__btn:disabled { opacity: .35; cursor: not-allowed; }
.print-box__btn--wide { width: 100%; margin-top: 6px; }
.print-box__panel { margin-top: 14px; max-width: 340px; }
.print-box__title { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.print-box__option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.print-box__option:hover, .print-box__option.is-on { border-color: var(--ink); }
.print-box__option input { accent-color: var(--ink); flex: none; }
.print-box__info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.print-box__info small { font-size: 12px; color: var(--muted); }
.print-box__price { font-size: 14px; font-weight: 600; }
.print-box__note { margin-top: 10px; font-size: 12px; color: var(--muted); }
