/* =========================================================
   Tracy Boyd — Horizontal Gallery
   Left text column + three painting rows that float
   back-and-forth in alternating directions. Hover pauses a
   row, drag scrubs it, tap opens the painting.
   Layers on top of colors_and_type.css tokens.
   ========================================================= */

html { height: auto; }
body {
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--hg-bg, #222A30);
  transition: background 420ms var(--tb-ease-out);
}

.hg {
  position: relative;
  display: block;
  color: var(--tb-fg);            /* light text on a dark ground */
}

/* ---------- artist photo strip (continuously drifting row, sits above the menu) ---------- */
.hg__photobar {
  display: flex;
  height: clamp(156px, 19.5vh, 273px);
  background: #000;
  overflow: hidden;
}
.hg__photobar .hg-row { flex: 1 1 auto; }

/* hero = three drifting rows, fills the rest of the first viewport */
.hg__hero {
  position: relative;
  height: calc(100vh - clamp(156px, 19.5vh, 273px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- top bar (menu + brand + view controls) ---------- */
.hg__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(14px, 2vw, 22px) 18px 0;
  z-index: 40;
  background: var(--hg-bg, #222A30);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.hg__bar-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 22px;
}
.hg__bar-right { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }

/* menu pill: bigger, flush + cut off against the left edge */
.hg__menu-slot { flex: 0 0 auto; margin-left: -3px; }
.hg__menu-slot .pill__btn {
  height: 36px;
  padding: 0 22px 0 clamp(20px, 3vw, 34px);
  border-radius: 0 var(--tb-radius-full) var(--tb-radius-full) 0;
  font-size: 15px;
  font-weight: var(--tb-fw-bold);
  text-transform: none;
  letter-spacing: 0;
  gap: 10px;
}
.hg__menu-slot .pill__chev { width: 16px; height: 16px; }

/* brand block: small eyebrow + headline, right of the menu pill */
.hg__brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.hg__eyebrow {
  font-size: 13px;
  font-weight: var(--tb-fw-bold);
  color: var(--tb-fg);
}
.hg__title {
  margin: 0;
  font-weight: var(--tb-fw-bold);
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* view toggle: All Art / For Sale segmented control */
.hg__viewtoggle {
  display: flex;
  align-items: stretch;
  height: 36px;
  border-radius: var(--tb-radius-full);
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.hg__vt-btn {
  height: 100%;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--tb-fg);
  font-size: 11px;
  font-weight: var(--tb-fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms var(--tb-ease), color 160ms var(--tb-ease);
}
.hg__vt-btn.is-active {
  background: #2f6df0;
  color: #fff;
}
.hg__vt-btn:not(.is-active):hover { background: rgba(255,255,255,0.12); }

/* ingress pill: link out to the full art page — same translucent grey
   treatment as the nav pill on the left */
.hg__ingress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--tb-radius-full);
  background: rgba(255,255,255,0.08);
  color: var(--tb-fg);
  font-size: 11px;
  font-weight: var(--tb-fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 160ms var(--tb-ease);
}
.hg__ingress:hover { background: rgba(255,255,255,0.12); }
.hg__ingress svg { width: 14px; height: 14px; }

/* ---------- pills (brand menu + compact) ---------- */
.pill { position: relative; }
.pill__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--tb-radius-full);
  font-size: 11px;
  font-weight: var(--tb-fw-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms var(--tb-ease), color 180ms var(--tb-ease), border-color 180ms var(--tb-ease);
}
.pill__chev { width: 13px; height: 13px; opacity: 0.7; transition: transform 200ms var(--tb-ease); }
.pill.is-open .pill__chev { transform: rotate(180deg); }

/* brand + compact: soft translucent fill, matching the unselected view-toggle */
.pill--brand .pill__btn,
.pill__btn--solo {
  background: rgba(255,255,255,0.08);
  color: var(--tb-fg);
  border: 1px solid transparent;
}
.pill--brand .pill__btn:hover,
.pill__btn--solo:hover { background: rgba(255,255,255,0.12); }

/* filters: blue accent (legacy pill variant, still used for compact toggle) */
.pill--accent .pill__btn {
  background: #2f6df0;
  color: #fff;
  border: 1px solid #2f6df0;
}
.pill--accent-on .pill__btn {
  background: #1b4fc0;
  color: #fff;
  border: 1px solid #1b4fc0;
  box-shadow: 0 0 0 2px rgba(47,109,240,0.25);
}
.pill--accent .pill__btn:hover { background: #2a61d6; }

/* dropdown menu */
.pill__menu {
  position: absolute;
  top: calc(100% + 8px);
  min-width: 168px;
  background: var(--tb-bg-elevated);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: pill-menu-in 160ms var(--tb-ease-out) both;
}
.pill__menu--left { left: 0; }
.pill__menu--center { left: 50%; transform: translateX(-50%); }
.pill__menu--right { right: 0; }
@keyframes pill-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pill__menu--center { animation: none; }
.pill__item {
  display: block;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--tb-fg);
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms var(--tb-ease);
}
.pill__item:hover { background: rgba(255,255,255,0.06); }
.pill__item.is-sel { font-weight: var(--tb-fw-bold); }
.pill__item.is-sel::after { content: " \2713"; color: #2f6df0; }
.pill__sep { height: 1px; background: rgba(255,255,255,0.1); margin: 6px 4px; }

/* brand menu dropdown: one rounded dark card behind the trigger button —
   button sits visually "inside" the card's top-left corner. */
.pill--brand { position: relative; }
.pill--brand .pill__btn { position: relative; z-index: 2; }
.pill--brand .pill__menu {
  top: 0;
  left: 0;
  z-index: 1;
  min-width: 132px;
  background: var(--tb-bg-elevated);
  border: none;
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  padding: 68px 10px 16px;
}
.pill--brand .pill__item {
  color: var(--tb-fg);
  font-size: 19px;
  font-weight: var(--tb-fw-medium);
  padding: 11px 14px;
  border-radius: 12px;
}
.pill--brand .pill__item:hover { background: rgba(255,255,255,0.08); }
.pill--brand .pill__item.is-sel::after { content: none; }
.pill--brand .pill__sep { background: rgba(255,255,255,0.14); }

.hg__clear {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--tb-radius-full);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tb-fg);
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  transition: background 160ms var(--tb-ease);
}
.hg__clear:hover { background: rgba(255,255,255,0.07); }

/* ---------- body: three full-bleed rows ---------- */
.hg__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: 0;
}
.hg__empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: rgba(255,255,255,0.6);
  font-size: var(--tb-fs-body);
}

/* three stacked rows fill the width */
.hg__rows {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--row-gap, 6px);
  padding-bottom: var(--row-gap, 6px);
}

/* ---------- one floating row ---------- */
.hg-row {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  cursor: grab;
}
.hg-row.is-drag { cursor: grabbing; }
.hg-row.is-drag .hg-rtile { pointer-events: none; }
.hg-row__track {
  display: flex;
  align-items: stretch;
  gap: var(--tile-gap, 6px);
  height: 100%;
  width: max-content;
  padding-left: var(--tile-gap, 6px);
  will-change: transform;
}

/* a painting in a row — height fills the row, width follows the image's own
   aspect ratio. We render a real <img> so nothing is ever cropped. */
.hg-rtile {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  -webkit-user-drag: none;
}
.hg-rtile__img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;            /* never crop the painting */
  -webkit-user-drag: none;
  user-select: none;
  transition: filter 600ms var(--tb-ease-out);
}
.hg-rtile:hover .hg-rtile__img { filter: brightness(1.04); }

/* “FOR SALE” tag, top-right, revealed on hover */
.hg-rtile__sale {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  font-size: 9px; font-weight: var(--tb-fw-bold);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; background: #2f6df0;
  padding: 4px 8px; border-radius: 4px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 240ms var(--tb-ease-out), transform 240ms var(--tb-ease-out);
}
.hg-rtile:hover .hg-rtile__sale,
.feat-tile:hover .hg-rtile__sale { opacity: 1; transform: translateY(0); }

/* blue info box, bottom-left, revealed on hover */
.hg-rtile__cap {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  display: flex; flex-direction: column; gap: 1px;
  max-width: 78%;
  padding: 10px 13px;
  color: #fff; background: #2f6df0;
  line-height: 1.28;
  opacity: 0; transform: translateY(6px);
  transition: opacity 240ms var(--tb-ease-out), transform 240ms var(--tb-ease-out);
}
.hg-rtile__cap.is-off { display: none; }
.hg-rtile:hover .hg-rtile__cap,
.feat-tile:hover .hg-rtile__cap { opacity: 1; transform: translateY(0); }
.hg-rtile__cap .name { font-weight: var(--tb-fw-bold); font-size: 14px; letter-spacing: 0.01em; }
.hg-rtile__cap .meta { font-size: 12px; color: rgba(255,255,255,0.88); }

/* artist photos: no blue caption box — plain text, no background */
.hg-rtile.is-photo .hg-rtile__cap {
  background: none;
  padding: 0 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.75), 0 0 14px rgba(0,0,0,0.5);
}

/* ---------- featured horizontal-scroll section ---------- */
.hg__featured {
  padding: clamp(34px, 5vh, 64px) clamp(20px, 4vw, 56px) clamp(44px, 6vh, 80px);
}
.hg__featured-title {
  font-weight: var(--tb-fw-bold);
  font-size: clamp(34px, 5vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.0;
  margin: 0 0 12px;
}
.hg__featured-sub {
  display: flex; align-items: center; gap: 14px;
  font-size: var(--tb-fs-body);
  color: var(--tb-fg);
  margin: 0 0 26px;
}
.hg__featured-arrow {
  display: inline-block; width: 22px; height: 22px;
  animation: feat-bob 2.2s var(--tb-ease) infinite;
}
@keyframes feat-bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(5px)} }

.hg__scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 14px;
  scrollbar-width: thin;
  cursor: grab;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.hg__scroller.is-drag { cursor: grabbing; }
.hg__scroller.is-drag .feat-tile { pointer-events: none; }
.feat-tile {
  position: relative;
  flex: 0 0 auto;
  height: clamp(300px, 46vh, 440px);
  scroll-snap-align: start;
  -webkit-user-drag: none;
}
.feat-tile .hg-rtile__img { height: 100%; width: auto; }

/* compact mode: shorter rows = smaller images, denser wall */
.hg.is-compact .hg__rows { justify-content: center; }
.hg.is-compact .hg-row { flex: 0 0 auto; height: 26vh; }

/* "For Sale" view: a single row, twice the usual row height, rest left blank */
.hg.is-forsale .hg__rows { justify-content: flex-start; }
.hg.is-forsale .hg-row { flex: 0 0 66.6667%; }

/* ---------- full-page photo viewer (blue-circle nav, chevron-down close) ---------- */
.pv {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  cursor: pointer;
}
.pv__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}
.pv__close {
  position: absolute;
  top: 20px; left: 24px;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
}
.pv__close svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }
.pv__x {
  position: absolute;
  top: 20px; right: 24px;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--tb-radius-full);
  background: #0187D5;
  color: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  cursor: pointer;
  transition: background 160ms var(--tb-ease), transform 160ms var(--tb-ease-out);
}
.pv__x:hover { background: #1c9be3; }
.pv__x:active { transform: scale(0.94); }
.pv__x svg { width: 20px; height: 20px; }
.pv__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--tb-radius-full);
  background: rgba(1,135,213,0.75);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  cursor: pointer;
  transition: background 160ms var(--tb-ease), transform 160ms var(--tb-ease-out);
}
.pv__nav:hover { background: rgba(28,155,227,0.75); }
.pv__nav:active { transform: translateY(-50%) scale(0.94); }
.pv__nav svg { width: 24px; height: 24px; }
.pv__nav--prev { left: 24px; }
.pv__nav--next { right: 24px; }

/* ---------- full-page artwork viewer (uncropped, meta card bottom-right) ---------- */
.aw {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aw__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
.aw__close {
  position: absolute;
  top: 20px; left: 24px;
  z-index: 3;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
}
.aw__close svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }
.aw__x {
  position: absolute;
  top: 20px; right: 24px;
  z-index: 3;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  transition: opacity 160ms var(--tb-ease);
}
.aw__x:hover { opacity: 0.7; }
.aw__x svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }
.aw__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--tb-radius-full);
  background: rgba(47,109,240,0.75);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  cursor: pointer;
  transition: background 160ms var(--tb-ease), transform 160ms var(--tb-ease-out);
}
.aw__nav:hover { background: rgba(47,142,232,0.75); }
.aw__nav:active { transform: translateY(-50%) scale(0.94); }
.aw__nav svg { width: 24px; height: 24px; }
.aw__nav--prev { left: clamp(16px, 3vw, 56px); }
.aw__nav--next { right: clamp(16px, 3vw, 56px); }

.aw__meta {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  width: min(238px, 56vw);
}
.aw__tags {
  display: flex;
  width: 100%;
}
.aw__tag {
  flex: 1 1 auto;
  padding: 10px 16px;
  background: rgba(30,30,30,0.85);
  color: #fff;
  font-size: 15px;
  font-weight: var(--tb-fw-bold);
}
.aw__tag.is-sale { background: #2f6df0; }
.aw__similar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(60,60,60,0.85);
  color: #fff;
  font-size: 13px;
  font-weight: var(--tb-fw-medium);
  white-space: nowrap;
  transition: background 160ms var(--tb-ease);
}
.aw__similar:hover { background: rgba(80,80,80,0.9); }
.aw__similar svg { width: 14px; height: 14px; }
.aw__card {
  width: 100%;
  background: rgba(30,30,30,0.85);
  color: #fff;
  padding: 16px 16px 14px;
}
.aw__title {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: var(--tb-fw-bold);
  letter-spacing: -0.005em;
  line-height: 1.15;
}
.aw__spec {
  display: flex;
  gap: 22px;
  margin: 0;
}
.aw__spec > div { display: flex; flex-direction: column; }
.aw__spec dt {
  font-size: 10px;
  font-weight: var(--tb-fw-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 3px;
}
.aw__spec dd {
  margin: 0;
  font-size: 14px;
  font-weight: var(--tb-fw-bold);
}
@media (max-width: 640px) {
  .aw__meta { right: 14px; bottom: 14px; left: 14px; max-width: none; }
  .aw__nav { width: 44px; height: 44px; }
  .aw__nav svg { width: 20px; height: 20px; }
}

@media (max-width: 860px) {
  .hg-row { --tile-gap: 12px; }
  .hg__bar { flex-wrap: wrap; padding-bottom: 12px; }
  .hg__bar-left { gap: 14px; }
  .hg__menu-slot .pill__btn { height: 36px; font-size: 13px; }
  .hg__title { font-size: 18px; }
  .hg__bar-right { flex: 1 1 100%; justify-content: flex-start; padding-left: clamp(14px, 2vw, 22px); }
}
@media (max-width: 560px) {
  .hg__eyebrow { display: none; }
  .hg__ingress span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hg-rtile__img { transition: none; }
}
