/* Stone gallery: Make Bespoke Studio. Colours come from the site CSS variables only;
   the colour-family dots use the --sg-fam-* variables defined below. Square corners,
   0.5px rules, 2px gaps, no shadows. */

.sg {
  --sg-bg: var(--warm-white, #FAFAF7);
  --sg-fg: var(--charcoal, #1C1C1A);
  --sg-muted: var(--dark-sage, #505E58);
  --sg-line: var(--stone-light, #D4CEC6);
  --sg-accent: var(--brand-green-dark, #4DAF92);
  --sg-accent-light: var(--brand-green, #8DD9BF);
  --sg-surface: var(--cream, #F5F0E8);

  --sg-fam-white: #F4F1EA;
  --sg-fam-grey: #A9A8A4;
  --sg-fam-black: #1E1E1D;
  --sg-fam-beige: #D9C9AE;
  --sg-fam-brown: #7B5B43;
  --sg-fam-gold: #C9A24B;
  --sg-fam-blue: #6F8FB0;
  --sg-fam-green: #5E7F65;
  --sg-fam-red: #B9695F;
  --sg-fam-purple: #7E6A92;

  font-family: 'Jost', sans-serif;
  font-weight: 300;
  color: var(--sg-fg);
  max-width: 1320px;
  margin: 0 auto;
}
/* Dark theme: the site swaps --charcoal, --warm-white and --cream itself, so no overrides are needed here. */

.sg *, .sg *::before, .sg *::after { box-sizing: border-box; }
.sg button, .sg input, .sg select, .sg textarea { font: inherit; color: inherit; border-radius: 0; }
.sg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- controls ---------- */
.sg-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 28px; border-bottom: 0.5px solid var(--sg-line); }
.sg-tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 14px 22px 16px; margin-bottom: -0.5px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sg-muted); border-bottom: 1.5px solid transparent;
}
.sg-tab[aria-pressed="true"] { color: var(--sg-fg); border-bottom-color: var(--sg-accent-light); }
.sg-tab:hover { color: var(--sg-fg); }
.sg-tab .sg-n { font-weight: 300; margin-left: 8px; opacity: 0.7; font-variant-numeric: tabular-nums; }

.sg-bar { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 24px; align-items: end; margin-bottom: 22px; }
.sg-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sg-field > span {
  font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sg-muted);
}
.sg-field input, .sg-field select {
  width: 100%; min-height: 44px; padding: 10px 0; background: transparent; border: 0;
  border-bottom: 0.5px solid var(--sg-line); font-size: 15px; font-weight: 300; color: var(--sg-fg);
  appearance: none; -webkit-appearance: none;
}
.sg-field select {
  padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, var(--sg-muted) 50%), linear-gradient(-45deg, transparent 50%, var(--sg-muted) 50%);
  background-position: calc(100% - 8px) 55%, calc(100% - 3px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.sg-field select option { color: var(--charcoal, #1C1C1A); background: var(--warm-white, #FAFAF7); }
.sg-field input:focus, .sg-field select:focus { outline: none; border-bottom-color: var(--sg-accent); }
.sg-field input::placeholder { color: var(--sg-muted); opacity: 0.7; }

.sg-chips-wrap { margin-bottom: 22px; }
.sg-chips-label { display: block; font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sg-muted); margin-bottom: 10px; }
.sg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-chip {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 9px;
  min-height: 40px; padding: 8px 16px; background: transparent;
  border: 0.5px solid var(--sg-line); font-size: 12px; font-weight: 400; letter-spacing: 0.06em; color: var(--sg-fg);
}
.sg-chip:hover { border-color: var(--sg-muted); }
.sg-chip[aria-pressed="true"] { border-color: var(--sg-fg); background: var(--sg-surface); }
.sg-chip[disabled] { opacity: 0.38; cursor: default; }
.sg-dot { width: 11px; height: 11px; border-radius: 0; border: 0.5px solid var(--sg-line); flex-shrink: 0; background: var(--sg-surface); }
.sg-dot[data-fam="White"] { background: var(--sg-fam-white); }
.sg-dot[data-fam="Grey"] { background: var(--sg-fam-grey); }
.sg-dot[data-fam="Black"] { background: var(--sg-fam-black); }
.sg-dot[data-fam="Beige & Cream"] { background: var(--sg-fam-beige); }
.sg-dot[data-fam="Brown"] { background: var(--sg-fam-brown); }
.sg-dot[data-fam="Gold & Yellow"] { background: var(--sg-fam-gold); }
.sg-dot[data-fam="Blue"] { background: var(--sg-fam-blue); }
.sg-dot[data-fam="Green"] { background: var(--sg-fam-green); }
.sg-dot[data-fam="Red & Pink"] { background: var(--sg-fam-red); }
.sg-dot[data-fam="Purple"] { background: var(--sg-fam-purple); }

.sg-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 6px 0 14px; }
.sg-count { font-size: 13px; letter-spacing: 0.04em; color: var(--sg-muted); }
.sg-count strong { font-weight: 400; color: var(--sg-fg); }
.sg-reset {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 6px 0;
  font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sg-accent);
  border-bottom: 0.5px solid currentColor;
}
.sg-reset[hidden] { display: none; }

/* ---------- grid ---------- */
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px; list-style: none; margin: 0; padding: 0; }
.sg-grid > li { margin: 0; padding: 0; list-style: none; min-width: 0; }
.sg-tile {
  appearance: none; display: block; width: 100%; text-align: left; cursor: pointer; padding: 0;
  background: var(--sg-surface); border: 0; color: var(--sg-fg);
}
.sg-tile-img { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--sg-surface); }
.sg-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: no-preference) {
  .sg-tile-img img { transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
  .sg-tile:hover .sg-tile-img img, .sg-tile:focus-visible .sg-tile-img img { transform: scale(1.04); }
}
.sg-badge {
  position: absolute; top: 10px; left: 10px; padding: 5px 9px;
  font-size: 9px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  background: color-mix(in srgb, var(--warm-white, #FAFAF7) 92%, transparent); color: var(--charcoal, #1C1C1A);
}
.sg-badge[data-s="Arriving"] { background: var(--charcoal, #1C1C1A); color: var(--warm-white, #FAFAF7); }
.sg-tile-cap { display: block; padding: 14px 16px 18px; }
.sg-tile-name { display: block; font-family: 'Cormorant Garamond', serif; font-size: 21px; font-weight: 400; line-height: 1.2; color: var(--sg-fg); }
.sg-tile-sub { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sg-muted); }
.sg-tile-code { font-weight: 500; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.sg-tile:focus-visible, .sg-chip:focus-visible, .sg-tab:focus-visible, .sg-reset:focus-visible, .sg-more:focus-visible,
.sg-x:focus-visible, .sg-nav:focus-visible, .sg-form-wrap button:focus-visible { outline: 1.5px solid var(--sg-accent); outline-offset: 2px; }

.sg-empty { padding: 56px 0; text-align: center; font-size: 15px; line-height: 1.7; color: var(--sg-muted); }
.sg-empty[hidden] { display: none; }
.sg-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 36px 0 8px; }
.sg-shown { font-size: 12px; letter-spacing: 0.06em; color: var(--sg-muted); }
.sg-more {
  appearance: none; cursor: pointer; background: transparent; min-height: 48px; padding: 16px 36px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sg-fg); border: 0.5px solid var(--sg-line);
}
.sg-more:hover { border-color: var(--sg-accent); color: var(--sg-accent); }
.sg-more[hidden] { display: none; }
.sg-note { margin: 28px 0 0; font-size: 13px; line-height: 1.7; color: var(--sg-muted); max-width: 70ch; }
.sg-error { padding: 40px 0; font-size: 15px; line-height: 1.7; color: var(--sg-muted); }
.sg-error a { color: var(--sg-fg); font-weight: 400; }

/* ---------- lightbox ---------- */
.sg-dialog {
  padding: 0; border: 0; background: var(--sg-bg); color: var(--sg-fg);
  width: min(1240px, 100vw); max-width: 100vw; max-height: 100vh; max-height: 100dvh; overflow: hidden;
  margin: auto;
}
.sg-dialog::backdrop { background: color-mix(in srgb, var(--near-black, #141412) 82%, transparent); }
.sg-dialog:not([open]) { display: none; }
.sg-dialog.sg-nomodal[open] { position: fixed; inset: 0; z-index: 10000; background: var(--sg-bg); }
.sg-dialog-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); max-height: 100vh; max-height: 100dvh; }
.sg-stage { position: relative; background: var(--sg-surface); min-height: 0; display: flex; align-items: center; justify-content: center; }
.sg-stage img { display: block; width: 100%; height: auto; max-height: 100dvh; object-fit: contain; }
.sg-info { padding: 40px 40px 36px; overflow-y: auto; max-height: 100vh; max-height: 100dvh; }
.sg-x {
  position: absolute; top: 0; right: 0; z-index: 3; width: 52px; height: 52px; display: grid; place-items: center;
  appearance: none; cursor: pointer; background: var(--sg-bg); border: 0; color: var(--sg-fg);
}
.sg-x svg, .sg-nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sg-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 64px; display: grid; place-items: center;
  appearance: none; cursor: pointer; border: 0; color: var(--sg-fg); background: color-mix(in srgb, var(--sg-bg) 88%, transparent);
}
.sg-nav[hidden] { display: none; }
.sg-prev { left: 0; } .sg-next { right: 0; }
.sg-eyebrow { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sg-accent-light); padding-right: 40px; }
.sg-eyebrow::before { content: ''; display: block; width: 32px; height: 1.5px; background: var(--sg-accent-light); flex-shrink: 0; }
.sg-info h3 { font-family: 'Cormorant Garamond', serif; font-weight: 300; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; margin: 0 0 22px; color: var(--sg-fg); }
.sg-dl { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0 0 22px; border-top: 0.5px solid var(--sg-line); }
.sg-dl dt, .sg-dl dd { margin: 0; padding: 12px 0; border-bottom: 0.5px solid var(--sg-line); font-size: 14px; line-height: 1.5; }
.sg-dl dt { font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sg-muted); padding-right: 24px; display: flex; align-items: center; }
.sg-dl dd { color: var(--sg-fg); font-weight: 300; }
.sg-dl dd .sg-code { font-weight: 500; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.sg-dlnote { font-size: 12px; line-height: 1.65; color: var(--sg-muted); margin: 0 0 26px; }
.sg-form-wrap h4 { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0 0 18px; color: var(--sg-fg); }
.sg-form-wrap .mbs-hubspot-form { gap: 22px; max-width: none; }
.sg-form-wrap .mbs-hubspot-form .form-row { gap: 22px; }
.sg-form-wrap select { font-family: 'Jost', sans-serif; font-size: 15px; font-weight: 300; background: transparent; border: 0; border-bottom: 0.5px solid var(--sg-line); padding: 10px 0 12px; width: 100%; color: var(--sg-fg); appearance: none; -webkit-appearance: none; border-radius: 0;
  background-image: linear-gradient(45deg, transparent 50%, var(--sg-muted) 50%), linear-gradient(-45deg, transparent 50%, var(--sg-muted) 50%);
  background-position: calc(100% - 8px) 55%, calc(100% - 3px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.sg-form-wrap select option { color: var(--charcoal, #1C1C1A); background: var(--warm-white, #FAFAF7); }
.sg-form-wrap .form-honeypot { display: none !important; }

@media (max-width: 1000px) {
  .sg-bar { grid-template-columns: 1fr 1fr; gap: 20px; }
  .sg-bar .sg-field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .sg-dialog { height: 100dvh; width: 100vw; overflow-y: auto; }
  .sg-dialog-in { display: block; max-height: none; }
  .sg-stage img { max-height: 52vh; }
  .sg-info { max-height: none; overflow: visible; padding: 28px 20px 40px; }
  .sg-nav { width: 44px; height: 56px; }
  .sg-x { position: fixed; }
}
@media (max-width: 600px) {
  .sg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-tile-cap { padding: 10px 10px 14px; }
  .sg-tile-name { font-size: 18px; }
  .sg-tile-sub { flex-direction: column; gap: 2px; font-size: 10px; }
  .sg-tab { padding: 12px 14px 14px; letter-spacing: 0.12em; }
  .sg-tabs { margin-bottom: 22px; }
  .sg-bar { gap: 16px; }
  .sg-badge { top: 6px; left: 6px; }
}

.sg-desc { margin: 0 0 22px; max-width: 46ch; font-size: 15px; line-height: 1.7; font-weight: 300; color: var(--sg-muted); text-wrap: pretty; }
.sg-desc[hidden] { display: none; }
