/*
 * The Gallery Wall (html/gallery.html)
 *
 * A fixed amani-stone wall with a vertical stack of framed "clusters"
 * (image + statement-panel compositions). Naming:
 *   .gallery-wall__*      page shell (opening, zone, stack)
 *   .gw-*                 shared gallery-wall pieces: frame, grid, media,
 *                         panel and typography
 *   .gw-<cluster>__*      one block per cluster (medallion, large-format,
 *                         stone-pool, mosaics, onyx, true-circle, composed,
 *                         geometric, mitres, final)
 *
 * Routes (exact conditions of the original):
 *   DESKTOP  (min-width: 901px), landscape ≥700 wide and ≥501 tall
 *            Desktop compositions; sizes are vw-based clamps tuned around a
 *            1440 canvas. Windows larger than 1280×720 in both dimensions
 *            render the page inside a magnified 1280×720 canvas
 *            (js/core/page-canvas.js), so the clamps resolve at 1280.
 *   MOBILE   (max-width: 699px), portrait 700–900, landscape 700–900 ≤500 tall
 *            Single-column stack (the exact complement of DESKTOP).
 *   Touch tablets in landscape (901–1366, ≥501 tall, coarse pointer) and the
 *   901–1366 landscape band (which includes the 1280×720 canvas) adjust a few
 *   desktop compositions. Immaculate Mosaics has its own phone / tablet
 *   portrait routes.
 */

/* ==========================================================================
   Tokens
   ========================================================================== */

.gallery-wall {
  --gw-opener-rail: clamp(980px, 78vw, 1440px);
  --gw-rail-pad: clamp(56px, 8.9vw, 156px);
  --gw-gap: clamp(4px, 0.42vw, 8px);
  --gw-stack-gap: clamp(96px, 9.7vw, 170px);
  --gw-cluster-tall: clamp(780px, 66.4vw, 1120px);
  --gw-medallion-offset: clamp(150px, 15.3vw, 260px);

  --gw-ui: 214 164 91;
  --gw-gold-title: 224 177 105;
  --gw-bronze-frame: rgb(var(--gw-ui) / 0.14);
  --gw-bronze-border: rgb(var(--gw-ui) / 0.16);
  --gw-bronze-glow: rgb(var(--gw-ui) / 0.18);
  --gw-edge-rule: linear-gradient(90deg, transparent, rgb(var(--gw-ui) / 0.75), transparent);
  --gw-frame-shadow: 0 40px 120px rgb(0 0 0 / 0.58), inset 0 1px 0 rgb(255 255 255 / 0.04);
  --gw-media-bg: #0b0907;
  --gw-text-title: rgb(var(--gw-gold-title) / 0.96);
  --gw-text-kicker: rgb(var(--gw-ui) / 0.72);
  --gw-text-body: rgb(245 235 216 / 0.86);
  --gw-text-body-muted: rgb(245 235 216 / 0.64);
  --gw-accent: rgb(224 163 83 / 0.92);
  --gw-accent-hover: rgb(246 207 142 / 0.98);
  --gw-highlight: rgb(245 204 135 / 0.94);
  --gw-plaque-border: #4a2712;
  --gw-panel-bg:
    linear-gradient(180deg, rgb(255 255 255 / 0.055), transparent 28%),
    radial-gradient(circle at 50% 0%, var(--gw-bronze-border), transparent 36%),
    linear-gradient(180deg, rgb(46 28 16 / 0.92), rgb(18 14 10 / 0.98));
  --gw-panel-overlay:
    linear-gradient(90deg, var(--gw-bronze-border), transparent 18%, transparent 82%, rgb(var(--gw-ui) / 0.11)),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.025) 0, rgb(255 255 255 / 0.025) 1px, transparent 1px, transparent 38px);
  --gw-cluster-glow:
    linear-gradient(90deg, transparent, var(--gw-bronze-glow), transparent),
    radial-gradient(circle at 34% 10%, var(--gw-bronze-glow), transparent 34%),
    radial-gradient(circle at 75% 70%, rgb(255 255 255 / 0.05), transparent 36%);
  --gw-rule-bg: linear-gradient(90deg, transparent, var(--gw-text-kicker), transparent);
  --gw-reveal-duration: 2600ms;
  --gw-reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gw-hero-vignette: radial-gradient(ellipse at 13% 13%, rgb(0 0 0 / 0.2) 0%, rgb(0 0 0 / 0.12) 28%, rgb(0 0 0 / 0.1) 50%, transparent 68%);

  --gw-fs-kicker: clamp(10px, 0.76vw, 12px);
  --gw-fs-title: clamp(31px, 2.78vw, 44px);
  --gw-fs-body: clamp(15px, 1.18vw, 18px);
  --gw-fs-credit: clamp(12.5px, 0.97vw, 15px);
  --gw-letter-kicker: clamp(0.18em, 0.22vw, 0.24em);
  --gw-letter-credit: clamp(0.16em, 0.2vw, 0.23em);
  --gw-rule-gap-top: clamp(18px, 1.53vw, 26px);
  --gw-rule-gap-bottom: clamp(18px, 1.67vw, 28px);
  --gw-panel-pad: clamp(30px, 2.64vw, 46px) clamp(22px, 1.94vw, 34px);
}

/* ==========================================================================
   Page shell
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

html {
  background: #080604;
}

/* Fixed stone wall. pointer-events: none so it never takes a pan. */
.gallery-stone {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #080604 url("../../images/gallery/011-dt-amani-stone-tile.webp") center / cover no-repeat;
}

.gallery-wall {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* The gallery never sets a page font, and on this page the original contact
   sheet's unstyled text (kicker, copy, brief, action details, foot) falls
   back to the browser's default serif. Reproduce that here; the sheet's
   Playfair headings set their own family. */
.enquiry {
  font-family: initial;
}

/* Gallery media is presentation, never a draggable interaction surface. */
.gallery-wall img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}

/* --- Large-desktop canvas host (js/core/page-canvas.js) --------------- */

:root {
  --page-canvas-background: #060504;
}

/* ==========================================================================
   Opening
   ========================================================================== */

.gallery-wall__opening {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(var(--gw-opener-rail), calc(100% - var(--gw-rail-pad)));
  margin-inline: auto;
  padding-top: clamp(64px, 7vw, 108px);
}

.gallery-wall__opening + .gallery-wall__zone {
  margin-top: var(--gw-stack-gap);
}

.gallery-wall__opener {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.gallery-wall__opener img {
  display: block;
  width: 100%;
  height: auto;
}

/* ==========================================================================
   Shared gallery-wall pieces
   ========================================================================== */

.gallery-wall__zone {
  position: relative;
  z-index: 1;
  display: grid;
  isolation: isolate;
}

.gallery-wall__stack {
  display: flex;
  flex-direction: column;
  gap: var(--gw-stack-gap);
}

.gallery-wall__stack img {
  display: block;
  max-width: 100%;
}

/* Cluster: a framed composition with a bronze glow behind and a hairline
   ring around it. */
.gw-cluster {
  position: relative;
  isolation: isolate;
  width: 100%;
  margin-inline: auto;
  font-family: var(--font-sans);
  color: var(--gw-text-body);
}

.gw-cluster::before,
.gw-mosaics::before {
  content: "";
  position: absolute;
  inset: clamp(-22px, -1.25vw, -14px);
  /* Clip the overhang above the frame so no bright band sits over the top border. */
  clip-path: inset(clamp(14px, 1.25vw, 22px) 0 0 0);
  z-index: -2;
  background: var(--gw-cluster-glow);
  opacity: 0.75;
  pointer-events: none;
}

.gw-cluster::after,
.gw-mosaics::after,
.gw-medallion__shell::before,
.gw-mitres__gallery::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--gw-bronze-border);
  pointer-events: none;
}

.gw-cluster::after,
.gw-mosaics::after {
  z-index: -1;
}

.gw-frame {
  box-shadow: var(--gw-frame-shadow);
}

.gw-grid,
.gw-mitres__gallery {
  padding: var(--gw-gap);
  background: var(--gw-bronze-frame);
}

.gw-grid {
  display: grid;
  gap: var(--gw-gap);
}

/* Media cell */
.gw-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--gw-media-bg);
}

.gw-media picture,
.gw-medallion__step picture,
.gw-large-format__detail picture {
  display: block;
  width: 100%;
  height: 100%;
}

.gw-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--gw-img-position, center);
}

/* Bronze hairline along the bottom edge of a media cell. */
.gw-media--edge::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  height: 1px;
  background: var(--gw-edge-rule);
  opacity: 0.55;
  pointer-events: none;
}

/* Hover vignette on the stone-pool hero. */
.gw-media--reveal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  background: var(--gw-hero-vignette);
  transition: opacity var(--gw-reveal-duration) var(--gw-reveal-ease);
}

.gw-media--reveal:hover::before {
  opacity: 1;
}

/* Statement panel */
.gw-panel {
  position: relative;
  overflow: hidden;
  background: var(--gw-panel-bg);
}

.gw-panel::before,
.gw-mosaics__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gw-panel-overlay);
  opacity: 0.42;
  pointer-events: none;
}

.gw-panel__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: var(--gw-panel-pad);
  text-align: center;
}

/* --- Typography ---------------------------------------------------------- */

.gw-kicker {
  margin: 0 0 clamp(12px, 1.11vw, 18px);
  font-size: var(--gw-fs-kicker);
  line-height: 1;
  letter-spacing: var(--gw-letter-kicker);
  text-transform: uppercase;
  color: var(--gw-text-kicker);
}

.gw-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--gw-fs-title);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gw-text-title);
}

.gw-rule {
  flex-shrink: 0;
  width: 72%;
  height: 1px;
  min-height: 1px;
  margin: var(--gw-rule-gap-top) 0 var(--gw-rule-gap-bottom);
  background: var(--gw-rule-bg);
}

.gw-body {
  max-width: 32ch;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--gw-fs-body);
  line-height: 1.55;
  letter-spacing: 0.015em;
  color: var(--gw-text-body);
}

.gw-body + .gw-body {
  margin-top: clamp(12px, 1.04vw, 18px);
  color: var(--gw-text-body-muted);
}

.gw-body strong {
  font-weight: 600;
  color: var(--gw-highlight);
}

/* Client credit (stone pool) */
.gw-credit {
  width: 100%;
  margin-top: clamp(6px, 0.56vw, 10px);
  border-top: 1px solid var(--gw-bronze-frame);
}

.gw-credit p,
.gw-credit span {
  display: block;
  margin-bottom: clamp(6px, 0.56vw, 10px);
  font-size: var(--gw-fs-credit);
  line-height: 1.35;
  letter-spacing: var(--gw-letter-credit);
  text-transform: uppercase;
  color: var(--gw-text-body-muted);
}

.gw-credit a {
  display: inline-block;
  font-size: var(--gw-fs-credit);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--gw-letter-kicker);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gw-accent);
  transition: color 450ms ease, text-shadow 450ms ease;
}

.gw-credit a:hover {
  color: var(--gw-accent-hover);
}

/* Designer attribution (onyx) */
.gw-attribution {
  margin: clamp(18px, 1.67vw, 28px) 0 0;
  font-size: var(--gw-fs-credit);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: clamp(0.1em, 0.12vw, 0.14em);
  text-transform: uppercase;
  color: rgb(var(--gw-ui) / 0.64);
}

.gw-attribution a {
  text-decoration: none;
  color: rgb(var(--gw-ui) / 0.7);
  transition: color 400ms ease;
}

.gw-attribution a:hover {
  color: var(--gw-highlight);
}

/* ==========================================================================
   Cluster look shared by every route
   ========================================================================== */

.gw-medallion__shell {
  position: relative;
}

/* Medallion card: content stretches; copy is centred in a narrower measure. */
.gw-medallion__card {
  min-height: 0;
  display: flex;
}

.gw-medallion__card-inner {
  align-items: stretch;
  width: 100%;
  height: 100%;
  padding: clamp(18px, 1.8vw, 28px) clamp(18px, 1.67vw, 30px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.07);
}

.gw-medallion__card-inner .gw-body {
  max-width: 36ch;
  margin-inline: auto;
  line-height: 1.62;
}

.gw-medallion__card-inner .gw-rule {
  margin: clamp(15px, 1.25vw, 22px) auto clamp(17px, 1.4vw, 25px);
}

/* Medallion hero: vignette over the photograph. */
.gw-medallion__hero {
  min-height: 0;
}

.gw-medallion__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 38%, rgb(0 0 0 / 0.1) 68%, rgb(0 0 0 / 0.46) 100%),
    radial-gradient(circle at 0 0, rgb(0 0 0 / 0.26), transparent 19%),
    radial-gradient(circle at 100% 0, rgb(0 0 0 / 0.16), transparent 89%),
    radial-gradient(circle at 0 100%, rgb(0 0 0 / 0.2), transparent 18%),
    radial-gradient(circle at 100% 100%, rgb(0 0 0 / 0.22), transparent 21%);
}

.gw-medallion__hero img {
  position: relative;
  z-index: 1;
  aspect-ratio: 1080 / 852;
}

.gw-medallion__progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 0.42vw, 8px);
  margin-top: clamp(18px, 2vw, 34px);
}

.gw-medallion__step {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 0.88;
  overflow: hidden;
  background: var(--gw-media-bg);
}

.gw-medallion__step img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gw-medallion__card-inner .gw-medallion__note {
  margin-top: clamp(13px, 1.1vw, 18px);
}

/* Large format: the centre panel is a size container for its detail image. */
.gw-large-format__panel {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
}

/* Stone pool statement (all routes): an opaque bronze strip. */
.gw-stone-pool__statement {
  background: linear-gradient(180deg, rgb(46 28 16), rgb(18 14 10));
}

.gw-stone-pool .gw-kicker {
  margin: 0;
}

.gw-stone-pool .gw-body {
  max-width: none;
  margin: 0;
  line-height: 1.42;
}

.gw-stone-pool .gw-body + .gw-body {
  margin-top: 0;
}

.gw-stone-pool .gw-rule {
  background: linear-gradient(180deg, transparent, var(--gw-text-kicker), transparent);
}

.gw-stone-pool .gw-credit {
  align-self: center;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  text-align: center;
}

.gw-geometric .gw-body {
  max-width: none;
}

.gw-true-circle__statement {
  scroll-margin-top: clamp(96px, 9vw, 130px);
}

/* Immaculate Mosaics: its own framed shell (not a .gw-cluster). */
.gw-mosaics {
  --gw-mosaics-panel-pad: clamp(30px, 2.64vw, 46px) clamp(20px, 1.8vw, 32px);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: var(--gw-gap);
  width: 100%;
  margin: 0;
  padding: var(--gw-gap);
  background: var(--gw-bronze-frame);
  box-shadow: var(--gw-frame-shadow);
  font-family: var(--font-sans);
  color: var(--gw-text-body);
}

.gw-mosaics__media {
  position: relative;
  isolation: isolate;
  display: block;
  margin: 0;
  overflow: hidden;
  background: var(--gw-media-bg);
}

.gw-mosaics__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: var(--gw-img-position, center);
}

.gw-mosaics__under > .gw-mosaics__media--herringbone img {
  object-position: 62% center;
}

.gw-mosaics__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--gw-mosaics-panel-pad);
  overflow: hidden;
  background: var(--gw-panel-bg);
  box-shadow: inset 0 0 70px rgb(0 0 0 / 0.42), inset 0 1px 0 rgb(255 255 255 / 0.045);
  text-align: center;
}

.gw-mosaics__panel > * {
  position: relative;
  z-index: 2;
}

/* Mitres */
.gw-mitres__gallery {
  position: relative;
}

.gw-mitres__card,
.gw-mitres__authority {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.035);
}

.gw-mitres__authority {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(30px, 3.6vw, 58px);
}

.gw-mitres__authority::after {
  content: "";
  position: absolute;
  right: 14%;
  bottom: 0;
  left: 14%;
  height: 1px;
  background: var(--gw-rule-bg);
  opacity: 0.7;
  pointer-events: none;
}

.gw-mitres__authority-inner {
  max-width: clamp(330px, 27.1vw, 430px);
}

/* --- Final plaque -------------------------------------------------------- */

.gw-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.gw-final__plaque {
  --gw-plaque-cut: clamp(12px, 1.11vw, 18px);
  position: relative;
  width: 100%;
  margin: clamp(18px, 3vw, 34px) auto 0;
}

.gw-final__plaque img {
  display: block;
  width: 100%;
  height: auto;
}

/* Bronze cut-corner frames traced over the plaque artwork's two panels. */
.gw-final__plaque::before,
.gw-final__plaque::after {
  content: "";
  position: absolute;
  z-index: 2;
  border: clamp(1px, 0.14vw, 2px) solid var(--gw-plaque-border);
  clip-path: polygon(
    var(--gw-plaque-cut) 0, calc(100% - var(--gw-plaque-cut)) 0,
    100% var(--gw-plaque-cut), 100% calc(100% - var(--gw-plaque-cut)),
    calc(100% - var(--gw-plaque-cut)) 100%, var(--gw-plaque-cut) 100%,
    0 calc(100% - var(--gw-plaque-cut)), 0 var(--gw-plaque-cut)
  );
  pointer-events: none;
}

.gw-final__plaque::before {
  top: 9.78%;
  left: 10.05%;
  width: 79.78%;
  height: 52.92%;
}

.gw-final__plaque::after {
  top: 72.48%;
  left: 10.05%;
  width: 79.78%;
  height: 14.77%;
}

/* Invisible hotspot over the plaque's "project enquiry" panel. */
.gw-final__plaque-link {
  position: absolute;
  z-index: 4;
  top: 68.95%;
  left: 5.95%;
  display: block;
  width: 88.1%;
  height: 19.9%;
  cursor: pointer;
}

.gw-final__plaque-link:focus-visible,
.gw-final__home:focus-visible {
  outline: 2px solid var(--gw-accent);
  outline-offset: 4px;
}

.gw-final__home {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  /* Pulled up into the plaque artwork's transparent lower gutter. */
  margin-top: clamp(-56px, -4vw, -28px);
  padding: 10px clamp(18px, 2vw, 30px);
  border-bottom: 1px solid rgb(var(--gw-gold-title) / 0.54);
  font-family: var(--font-sans);
  font-size: clamp(11px, 0.82vw, 13px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gw-text-title);
  transition: color 180ms ease, border-color 180ms ease;
}

.gw-final__home:hover {
  color: var(--gw-accent-hover);
  border-color: var(--gw-accent-hover);
}

/* ==========================================================================
   DESKTOP compositions
   ========================================================================== */

@media (min-width: 901px), (orientation: landscape) and (min-width: 700px) and (min-height: 501px) {
  /* --- Medallion: full-bleed frame below the opener plaque --------------- */
  .gw-medallion {
    width: 100vw;
    max-width: 100vw;
    margin: var(--gw-medallion-offset) 0 0 calc(50% - 50vw);
  }

  .gw-medallion__shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 0.52fr);
    gap: 6px;
    align-items: stretch;
    width: 100%;
    padding: 6px;
    background: var(--gw-bronze-frame);
  }

  /* --- Shared grid sizing ------------------------------------------------- */
  .gw-cluster .gw-grid {
    grid-template-columns: var(--gw-cols);
    grid-template-rows: var(--gw-rows);
    min-height: var(--gw-min-h, auto);
  }

  .gw-cluster .gw-media {
    min-height: var(--gw-media-min-h, auto);
  }

  .gw-cluster .gw-panel {
    min-height: var(--gw-panel-min-h, auto);
  }

  /* --- Large format: three columns, the centre panel holds a detail image -- */
  .gw-large-format {
    --gw-cols: minmax(0, 1.1fr) minmax(0, 0.48fr) minmax(0, 0.72fr);
    --gw-rows: calc(100svh - clamp(32px, 3vw, 56px));
    --gw-media-min-h: 0;
    --gw-panel-min-h: 0;
    --gw-detail-h: calc(100cqw * 980 / 929);
    --gw-detail-drop: clamp(18px, 1.5vw, 28px);
  }

  .gw-large-format .gw-grid {
    min-height: 0;
  }

  .gw-large-format .gw-grid > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .gw-large-format .gw-panel__inner {
    flex: 1 1 auto;
    min-height: 0;
    /* Reserve the space the absolutely placed detail image overlaps. */
    padding-bottom: calc(var(--gw-detail-h) - var(--gw-detail-drop) + clamp(30px, 2.64vw, 46px));
  }

  .gw-large-format__detail {
    position: absolute;
    right: 0;
    bottom: calc(-1 * var(--gw-detail-drop));
    left: 0;
    aspect-ratio: 929 / 980;
    overflow: hidden;
  }

  .gw-large-format__detail-img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 929 / 1400;
    object-fit: cover;
  }

  /* --- Stone pool: hero with a statement strip laid across its foot -------- */
  .gw-stone-pool {
    --gw-cols: 50fr 50fr;
    --gw-rows: clamp(650px, 54vw, 930px) clamp(435px, 36.9vw, 640px);
    --gw-min-h: var(--gw-cluster-tall);
    --gw-media-min-h: clamp(435px, 36.9vw, 640px);
  }

  /* The hero and strip span to line 4 of a two-column grid; the implicit
     third (empty) track adds one extra gap at the right of the lower row. */
  .gw-stone-pool__hero {
    grid-area: 1 / 1 / 2 / 4;
  }

  .gw-stone-pool__statement {
    grid-area: 1 / 1 / 2 / 4;
    align-self: end;
    z-index: 6;
  }

  .gw-stone-pool .gw-stone-pool__statement {
    min-height: 0;
  }

  .gw-stone-pool__left {
    grid-area: 2 / 1;
  }

  .gw-stone-pool__right {
    grid-area: 2 / 2;
  }

  .gw-stone-pool .gw-panel__inner {
    display: grid;
    grid-template-columns: minmax(190px, max-content) 1px minmax(0, 1fr) minmax(210px, 0.48fr);
    grid-template-areas:
      "kicker rule lead credit"
      "title rule detail credit";
    column-gap: clamp(18px, 2.8vw, 46px);
    row-gap: clamp(7px, 0.7vw, 11px);
    align-items: center;
    height: auto;
    padding: clamp(18px, 1.7vw, 28px) clamp(32px, 4.4vw, 72px);
    text-align: left;
  }

  .gw-stone-pool .gw-kicker { grid-area: kicker; }
  .gw-stone-pool .gw-title { grid-area: title; }
  .gw-stone-pool__lead { grid-area: lead; }
  .gw-stone-pool__detail { grid-area: detail; }
  .gw-stone-pool .gw-credit { grid-area: credit; }

  .gw-stone-pool .gw-rule {
    grid-area: rule;
    width: 1px;
    height: 100%;
    min-height: clamp(74px, 6.8vw, 110px);
    margin: 0;
  }

  /* --- Onyx: two rows; the lower row is its own three-column grid ---------- */
  .gw-onyx {
    --gw-cols: 0.46fr 0.78fr 0.40fr 0.66fr 0.12fr;
    --gw-lower-cols: 0.56fr 1.1fr 0.9fr;
    --gw-min-h: clamp(540px, 45vw, 780px);
    --gw-media-min-h: clamp(540px, 45vw, 780px);
    --gw-panel-min-h: clamp(430px, 36.1vw, 610px);
    --gw-rows: clamp(540px, 45vw, 780px) clamp(560px, 46vw, 820px);
  }

  .gw-onyx__vanity { grid-area: 1 / 1 / 2 / 3; }
  .gw-onyx__panel { grid-area: 1 / 3; }
  .gw-onyx__mirror { grid-area: 1 / 4 / 2 / 6; }

  .gw-onyx__lower {
    display: grid;
    grid-area: 2 / 1 / 3 / -1;
    grid-template-columns: var(--gw-lower-cols);
    gap: var(--gw-gap);
    min-height: 0;
  }

  .gw-onyx .gw-onyx__lower > * {
    min-height: 0;
  }

  .gw-onyx__template { grid-area: 1 / 1; }
  .gw-onyx__slab { grid-area: 1 / 2; }
  .gw-onyx__shower { grid-area: 1 / 3; }

  /* --- A True Circle: ten-column grid ------------------------------------- */
  .gw-true-circle {
    --gw-cols: repeat(10, 1fr);
    --gw-top-h: clamp(670px, 49vw, 960px);
    --gw-rows: var(--gw-top-h) clamp(445px, 37.5vw, 650px);
    --gw-min-h: clamp(920px, 80vw, 1320px);
    --gw-media-min-h: clamp(340px, 29.2vw, 500px);
    --gw-panel-min-h: clamp(340px, 29.2vw, 500px);
  }

  .gw-true-circle__patio {
    grid-area: 1 / 1 / 2 / 8;
  }

  .gw-true-circle .gw-true-circle__patio {
    min-height: var(--gw-top-h);
  }

  .gw-true-circle__patio picture {
    position: absolute;
    inset: 0;
  }

  .gw-true-circle__patio img {
    object-position: center 80%;
  }

  .gw-true-circle__progress-panel {
    grid-area: 1 / 8 / 2 / 11;
  }

  .gw-true-circle .gw-true-circle__progress-panel,
  .gw-true-circle .gw-true-circle__progress {
    min-height: var(--gw-top-h);
  }

  .gw-true-circle__progress {
    --gw-img-position: 38% center;
    height: 100%;
  }

  .gw-true-circle__feature {
    --gw-img-position: center 40%;
    grid-area: 2 / 1 / 3 / 5;
  }

  .gw-true-circle__statement { grid-area: 2 / 5 / 3 / 7; }
  .gw-true-circle__spa { grid-area: 2 / 7 / 3 / 11; }

  /* --- Composed (Moroccan) ------------------------------------------------- */
  .gw-composed {
    --gw-cols: 1fr 0.54fr 1fr;
    --gw-rows: clamp(460px, 38.9vw, 660px) clamp(395px, 33.3vw, 570px) clamp(410px, 34.7vw, 595px);
    --gw-media-min-h: 100%;
  }

  .gw-composed__top { grid-area: 1 / 1 / 2 / -1; }
  .gw-composed__left { grid-area: 2 / 1; }
  .gw-composed__panel { grid-area: 2 / 2; }
  .gw-composed__right { grid-area: 2 / 3; }
  .gw-composed__bottom { grid-area: 3 / 1 / 4 / -1; }

  /* --- Geometric pool & spa ----------------------------------------------- */
  .gw-geometric {
    --gw-cols: 1fr 0.54fr 1fr;
    --gw-rows: clamp(540px, 45.8vw, 790px) clamp(540px, 45.8vw, 790px);
    --gw-min-h: var(--gw-cluster-tall);
    --gw-media-min-h: clamp(540px, 45.8vw, 790px);
    --gw-panel-min-h: clamp(540px, 45.8vw, 790px);
  }

  .gw-geometric__hero { grid-area: 1 / 1 / 2 / 4; }
  .gw-geometric__left { grid-area: 2 / 1; }
  .gw-geometric__panel { grid-area: 2 / 2; }
  .gw-geometric__right { grid-area: 2 / 3; }

  /* --- Mitres: nested grids capped at one viewport height ------------------ */
  .gw-mitres {
    --gw-md-cap-h: 100vh;
    --gw-md-half-h: calc((var(--gw-md-cap-h) - var(--gw-gap)) / 2);
    --gw-md-h-wide: clamp(270px, 22.9vw, 390px);
    --gw-md-h-md: clamp(350px, 29.9vw, 510px);
    --gw-md-h-panel: clamp(390px, 33.3vw, 560px);
    --gw-md-h-grid-wide: clamp(380px, 31.5vw, 530px);
    --gw-md-h-tail-duo: clamp(440px, 36.5vw, 620px);
    --gw-md-h-tall: clamp(640px, 54.2vw, 900px);
  }

  .gw-mitres__gallery,
  .gw-mitres__top,
  .gw-mitres__stack,
  .gw-mitres__mid,
  .gw-mitres__tail,
  .gw-mitres__tail-grid,
  .gw-mitres__two {
    display: grid;
    gap: var(--gw-gap);
  }

  .gw-mitres__tail {
    grid-template-columns: 1.35fr 0.65fr;
    align-items: stretch;
  }

  .gw-mitres__tail-grid {
    grid-template-rows: var(--gw-md-h-grid-wide) auto;
  }

  .gw-mitres__two {
    grid-template-columns: 1fr 1fr;
  }

  .gw-mitres__mid {
    grid-template-columns: 1fr 0.6fr 1fr;
  }

  .gw-mitres__top {
    grid-template-columns: 1.02fr 0.98fr;
    align-items: stretch;
  }

  .gw-mitres__top,
  .gw-mitres__stack {
    height: var(--gw-md-cap-h);
    max-height: var(--gw-md-cap-h);
    min-height: 0;
  }

  .gw-mitres__stack {
    grid-template-rows: var(--gw-md-half-h) var(--gw-md-half-h);
  }

  .gw-mitres__card {
    height: min(var(--gw-md-h-md), var(--gw-md-cap-h));
  }

  .gw-mitres__card--medium,
  .gw-mitres__authority {
    height: min(var(--gw-md-h-panel), var(--gw-md-cap-h));
  }

  .gw-mitres__card--wide {
    height: min(var(--gw-md-h-wide), var(--gw-md-cap-h));
  }

  .gw-mitres__card--tall {
    height: min(var(--gw-md-h-tall), var(--gw-md-cap-h));
  }

  .gw-mitres__top > .gw-mitres__card--tall {
    height: var(--gw-md-cap-h);
    max-height: var(--gw-md-cap-h);
  }

  .gw-mitres__stack > .gw-mitres__card,
  .gw-mitres__tail > .gw-mitres__card--tall {
    height: 100%;
    min-height: 0;
  }

  .gw-mitres__tail-grid > .gw-mitres__card--wide {
    height: var(--gw-md-h-grid-wide);
  }

  .gw-mitres__two > .gw-mitres__card {
    height: min(var(--gw-md-h-tail-duo), var(--gw-md-cap-h));
  }
}

/* --- Immaculate Mosaics: desktop and landscape tablets ------------------- */
@media (min-width: 1101px),
  (orientation: landscape) and (min-width: 901px),
  (orientation: landscape) and (min-width: 700px) and (min-height: 501px) {
  .gw-mosaics__top,
  .gw-mosaics__bottom {
    display: grid;
    flex: 0 0 auto;
    gap: var(--gw-gap);
  }

  .gw-mosaics__top {
    grid-template-columns: minmax(0, 2fr) minmax(0, 0.9fr);
    grid-template-rows: var(--gw-mosaics-top-rows, clamp(370px, 30.5vw, 520px));
  }

  .gw-mosaics__bottom {
    grid-template-columns:
      minmax(clamp(170px, 14.6vw, 245px), clamp(230px, 19.8vw, 330px))
      minmax(clamp(170px, 14.6vw, 245px), clamp(205px, 17.7vw, 300px))
      minmax(0, 1fr);
    grid-template-rows: var(--gw-mosaics-bottom-rows, clamp(400px, 34vw, 565px) clamp(360px, 30.6vw, 510px));
  }

  .gw-mosaics__top > *,
  .gw-mosaics__bottom > *,
  .gw-mosaics__under > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Curve image: 106% cover crop anchored bottom-right. */
  .gw-mosaics__media--curve img {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 106%;
    height: 106%;
    max-width: none;
    object-position: right bottom;
  }

  .gw-mosaics__media--tall {
    --gw-img-position: left top;
    grid-area: 1 / 1 / span 2 / 2;
  }

  .gw-mosaics__panel {
    grid-area: 1 / 2;
    min-height: 100%;
  }

  .gw-mosaics__media--blue {
    grid-area: 1 / 3;
  }

  .gw-mosaics__under {
    display: grid;
    grid-area: 2 / 2 / 3 / 4;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gw-gap);
  }

  .gw-mosaics__media--entry {
    --gw-img-position: 8% center;
  }
}

/* ==========================================================================
   Wide windows that are too short for the canvas (> 1440 wide, ≤ 720 tall):
   continue the width-driven heights without their upper caps.
   ========================================================================== */

@media (min-width: 1441px) {
  .gallery-wall {
    --gw-opener-rail: 78vw;
    --gw-cluster-tall: 66.4vw;
  }

  .gallery-wall .gw-onyx {
    --gw-min-h: 45vw;
    --gw-media-min-h: 45vw;
    --gw-panel-min-h: 36.1vw;
    --gw-rows: 45vw 46vw;
  }

  .gallery-wall .gw-stone-pool {
    --gw-rows: 54vw 36.9vw;
    --gw-media-min-h: 36.9vw;
  }

  .gallery-wall .gw-mosaics {
    --gw-mosaics-top-rows: 30.5vw;
    --gw-mosaics-bottom-rows: 34vw 30.6vw;
  }

  .gallery-wall .gw-true-circle {
    --gw-top-h: 49vw;
    --gw-rows: var(--gw-top-h) 37.5vw;
    --gw-min-h: 80vw;
    --gw-media-min-h: 29.2vw;
    --gw-panel-min-h: 29.2vw;
  }

  .gallery-wall .gw-composed {
    --gw-rows: 38.9vw 33.3vw 34.7vw;
  }

  .gallery-wall .gw-geometric {
    --gw-rows: 45.8vw 45.8vw;
    --gw-media-min-h: 45.8vw;
    --gw-panel-min-h: 45.8vw;
  }

  /* Mitres scale as one nested composition; every child fills its row. */
  .gallery-wall .gw-mitres {
    --gw-md-cap-h: 56.25vw;
    --gw-md-h-wide: 22.9vw;
    --gw-md-h-md: 29.9vw;
    --gw-md-h-panel: 33.3vw;
    --gw-md-h-grid-wide: 31.5vw;
    --gw-md-h-tail-duo: 36.5vw;
    --gw-md-h-tall: 54.2vw;
  }

  .gallery-wall .gw-mitres__top,
  .gallery-wall .gw-mitres__stack {
    max-height: none;
  }

  .gallery-wall .gw-mitres__tail-grid {
    grid-template-rows: var(--gw-md-h-grid-wide) var(--gw-md-h-tail-duo);
  }

  .gallery-wall .gw-mitres__mid {
    grid-auto-rows: var(--gw-md-h-panel);
  }

  .gallery-wall .gw-mitres__tail-grid > .gw-mitres__card--wide,
  .gallery-wall .gw-mitres__two,
  .gallery-wall .gw-mitres__two > .gw-mitres__card,
  .gallery-wall .gw-mitres__tail > .gw-mitres__card--tall,
  .gallery-wall .gw-mitres__mid > *,
  .gallery-wall .gw-mitres__top > .gw-mitres__card--tall,
  .gallery-wall .gw-mitres__stack > .gw-mitres__card {
    height: 100%;
    min-height: 0;
    max-height: none;
    align-self: stretch;
  }
}

/* ==========================================================================
   Landscape touch tablets (901–1366 wide, ≥ 501 tall)
   ========================================================================== */

@media (orientation: landscape) and (min-width: 901px) and (max-width: 1366px) and (min-height: 501px) and (hover: none) and (pointer: coarse) {
  /* Stone pinned by a locked height (iOS ignores fixed backgrounds). */
  .gallery-stone {
    bottom: auto;
    height: var(--gallery-app-h, 100lvh);
    min-height: var(--gallery-app-h, 100lvh);
  }

  .gw-medallion__shell {
    min-height: clamp(540px, 43vw, 590px);
  }

  .gw-medallion__hero,
  .gw-medallion__hero picture,
  .gw-medallion__hero img {
    height: 100%;
  }

  .gw-medallion__hero img {
    aspect-ratio: auto;
  }

  /* Wider centre copy panels. */
  .gw-onyx {
    --gw-cols: 0.44fr 0.70fr 0.56fr 0.60fr 0.12fr;
  }

  .gw-true-circle {
    --gw-cols: repeat(50, minmax(0, 1fr));
  }

  .gw-true-circle__patio { grid-area: 1 / 1 / 2 / 36; }
  .gw-true-circle__progress-panel { grid-area: 1 / 36 / 2 / 51; }
  .gw-true-circle__feature { grid-area: 2 / 1 / 3 / 19; }
  .gw-true-circle__statement { grid-area: 2 / 19 / 3 / 33; }
  .gw-true-circle__spa { grid-area: 2 / 33 / 3 / 51; }

  .gw-geometric {
    --gw-cols: 1fr 0.60fr 1fr;
  }

  /* Large format: a deliberately taller shared row; tighter centre type. */
  .gw-large-format {
    --gw-cols: 1.05fr 0.58fr 0.78fr;
    --gw-rows: clamp(580px, 62vw, 840px);
  }

  .gw-large-format .gw-panel__inner {
    padding-inline: clamp(12px, 1.2vw, 20px);
  }

  .gw-large-format .gw-title {
    font-size: clamp(22px, 2.2vw, 32px);
  }

  .gw-large-format .gw-body {
    font-size: clamp(13px, 1.15vw, 15px);
    line-height: 1.45;
  }
}

/* --- Large format centre panel, 901–1366 landscape (incl. the canvas) ---
   Copy takes its natural height; the detail image takes what remains and
   crops from the bottom. */
@media (orientation: landscape) and (min-width: 901px) and (max-width: 1366px) and (min-height: 501px) {
  .gw-large-format .gw-panel__inner {
    height: 100%;
    min-height: 0;
    padding-block: 0;
  }

  .gw-large-format .gw-title,
  .gw-large-format .gw-rule,
  .gw-large-format .gw-body {
    flex-shrink: 0;
  }

  .gw-large-format .gw-title {
    margin-top: auto;
  }

  .gw-large-format__detail {
    position: relative;
    inset: auto;
    flex: 0 1 calc(100cqw * 980 / 929);
    width: 100cqw;
    min-height: 0;
    max-height: calc(100cqw * 980 / 929);
    margin-top: auto;
    aspect-ratio: auto;
  }

  .gw-large-format__detail picture,
  .gw-large-format__detail-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .gw-large-format__detail-img {
    aspect-ratio: auto;
    object-position: center top;
  }
}

/* ==========================================================================
   MOBILE: phones and portrait tablets — a single-column stack
   ========================================================================== */

@media (max-width: 699px),
  (orientation: portrait) and (min-width: 700px) and (max-width: 900px),
  (orientation: landscape) and (min-width: 700px) and (max-width: 900px) and (max-height: 500px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    position: relative;
  }

  /* Stone pinned by a locked height so address-bar resizes do not jump. */
  .gallery-stone {
    bottom: auto;
    height: var(--gallery-app-h, 100lvh);
    min-height: var(--gallery-app-h, 100lvh);
    background-image: url("../../images/gallery/mobile/011-dt-amani-stone-tile.webp");
  }

  .gallery-wall {
    --gw-gap: 4px;
    --gw-stack-gap: 48px;
    --gw-fs-kicker: 14px;
    --gw-fs-title: clamp(32px, 9vw, 40px);
    --gw-fs-body: 20px;
    --gw-fs-credit: 13px;
    --gw-letter-kicker: 0.2em;
    --gw-letter-credit: 0.16em;
    --gw-rule-gap-top: 14px;
    --gw-rule-gap-bottom: 14px;
    --gw-mobile-rail: min(78vw, 640px);
    width: 100%;
    padding-bottom: 72px;
  }

  /* --- Opening ------------------------------------------------------------- */
  .gallery-wall__opening {
    width: 100%;
    margin: 0;
    padding: 72px 12px 0;
  }

  .gallery-wall__opening + .gallery-wall__zone {
    margin-top: 40px;
  }

  .gallery-wall__opener img {
    object-fit: contain;
  }

  .gw-medallion {
    margin-top: 28px;
  }

  .gw-medallion__shell {
    margin-bottom: 28px;
    padding: var(--gw-gap);
    background: var(--gw-bronze-frame);
  }

  .gw-medallion__progress {
    gap: var(--gw-gap);
    margin-top: 18px;
  }

  /* Explicit stretch: all three steps share the tallest step's height. */
  .gw-medallion__step {
    align-self: stretch;
    aspect-ratio: 1 / 0.92;
  }

  /* --- Zone + clusters ----------------------------------------------------- */
  .gallery-wall__method {
    padding-inline: 12px;
  }

  .gw-cluster::before {
    inset: -10px;
    clip-path: inset(10px 0 0 0);
    opacity: 0.55;
  }

  .gw-grid,
  .gw-medallion__shell,
  .gw-onyx__lower,
  .gw-mitres__gallery,
  .gw-mitres__tail,
  .gw-mitres__tail-grid,
  .gw-mitres__two,
  .gw-mitres__mid,
  .gw-mitres__top,
  .gw-mitres__stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gw-gap);
  }

  /* Every media cell: a 4:3 cover crop unless the cluster says otherwise. */
  .gw-media,
  .gw-large-format__detail {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .gw-media img,
  .gw-medallion__step img {
    position: relative;
    object-position: center;
  }

  .gw-panel {
    display: flex;
  }

  .gw-cluster .gw-panel__inner {
    width: 100%;
    height: auto;
    padding: 22px 18px;
  }

  .gw-body,
  .gw-credit,
  .gw-credit p,
  .gw-credit span,
  .gw-attribution,
  .gw-mitres__authority-inner p {
    font-size: 20px;
    line-height: 1.55;
  }

  .gw-body {
    max-width: 38ch;
    margin-inline: auto;
  }

  .gw-body + .gw-body {
    margin-top: 12px;
  }

  .gw-rule {
    width: min(160px, 55%);
    margin: var(--gw-rule-gap-top) auto var(--gw-rule-gap-bottom);
  }

  .gw-onyx .gw-attribution {
    font-size: 16px;
  }

  /* Large format: portrait frames; the detail image sits below the copy. */
  .gw-large-format__bath {
    aspect-ratio: 2565 / 3000;
  }

  .gw-large-format__shower {
    aspect-ratio: 1500 / 2101;
  }

  .gw-large-format .gw-panel__inner {
    padding-bottom: 22px;
  }

  .gw-large-format__detail {
    position: relative;
    width: 100%;
    margin-top: 18px;
    overflow: hidden;
    aspect-ratio: 929 / 1100;
  }

  .gw-large-format__detail-img {
    position: relative;
    display: block;
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }

  /* Stone pool: statement stacks; the rule is a short horizontal hairline. */
  .gw-stone-pool .gw-panel__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .gw-stone-pool .gw-rule {
    height: 1px;
    min-height: 0;
    margin: 14px auto;
  }

  .gw-stone-pool__right { aspect-ratio: 5 / 6; }

  /* Onyx */
  .gw-onyx__mirror { aspect-ratio: 3 / 4; }
  .gw-onyx__shower { aspect-ratio: 1050 / 1400; }
  .gw-onyx__slab { aspect-ratio: 1023 / 1400; }

  /* True circle */
  .gw-true-circle__patio { aspect-ratio: 5 / 6; }
  .gw-true-circle__feature { aspect-ratio: 1028 / 1428; }
  .gw-true-circle__spa { aspect-ratio: 1 / 1; }

  .gw-true-circle__statement {
    scroll-margin-top: 88px;
  }

  /* Composed: the floating-vanity image is desktop only. */
  .gw-composed__right {
    display: none;
  }

  /* Geometric */
  .gw-geometric__hero { aspect-ratio: 5 / 4; }
  .gw-geometric__left,
  .gw-geometric__right { aspect-ratio: 4 / 5; }

  /* Mitres: four images are desktop only. */
  .gw-mitres__card--desktop-only {
    display: none;
  }

  .gw-mitres__card--finger { aspect-ratio: 3 / 5; }
  .gw-mitres__card--niches { aspect-ratio: 5 / 6; }

  .gw-mitres__authority {
    padding: 28px 18px;
  }

  .gw-mitres__authority-inner {
    max-width: none;
  }

  /* --- Final plaque: full-bleed across the 12px content gutters ----------- */
  .gw-final__plaque {
    width: calc(100% + 24px);
    margin: 20px -12px 4px;
  }

  .gw-final__plaque img {
    margin: 0 auto;
    object-fit: contain;
  }

  .gw-final__plaque-link {
    top: 72%;
    left: 3%;
    width: 94%;
    height: 18%;
  }

  .gw-final__home {
    width: max-content;
    max-width: calc(100% - 32px);
    min-height: 48px;
    margin-top: -4px;
    padding: 12px 18px;
    font-size: 11px;
    letter-spacing: 0.18em;
  }
}

/* Mobile portrait: the opener plaque is zoomed 1.42× (its square artwork
   carries generous transparent margins). */
@media (max-width: 699px) and (orientation: portrait),
  (orientation: portrait) and (min-width: 700px) and (max-width: 900px) {
  .gallery-wall__opening {
    padding-top: calc(70px + env(safe-area-inset-top, 0px) + 40px);
  }

  /* % margins resolve against the width: for the square portrait artwork
     they reserve exactly the scaled height. */
  .gallery-wall__opener img {
    --gw-opener-zoom: 1.42;
    margin-block: calc((var(--gw-opener-zoom) - 1) / 2 * 100%);
    transform: scale(var(--gw-opener-zoom));
  }

  .gw-final__plaque {
    margin-top: 24px;
  }

  .gw-final__plaque-link {
    top: 76.8%;
    height: 22%;
  }

  .gw-final__home {
    margin-top: -7px;
  }
}

/* Mobile landscape: no decorative backing layers; images and panels sit on a
   narrower centred rail so they do not dominate the short viewport. */
@media (max-width: 699px) and (orientation: landscape),
  (orientation: landscape) and (min-width: 700px) and (max-width: 900px) and (max-height: 500px) {
  .gw-cluster::before,
  .gw-cluster::after,
  .gw-medallion__shell::before,
  .gw-mitres__gallery::before {
    content: none;
  }

  .gw-cluster .gw-grid,
  .gw-cluster .gw-frame,
  .gw-mitres__gallery,
  .gw-medallion__shell {
    background: none;
    box-shadow: none;
  }

  .gw-large-format,
  .gw-media,
  .gw-panel {
    width: var(--gw-mobile-rail);
    max-width: var(--gw-mobile-rail);
    margin-inline: auto;
    justify-self: center;
  }

  .gw-large-format .gw-media,
  .gw-large-format .gw-panel {
    width: 100%;
    max-width: 100%;
  }

  .gw-final__home {
    max-width: var(--gw-mobile-rail);
    margin-top: -2px;
  }
}

/* --- Immaculate Mosaics: phones (incl. short landscape phones) ----------- */
@media (max-width: 699px),
  (orientation: landscape) and (min-width: 700px) and (max-width: 900px) and (max-height: 500px) {
  .gw-mosaics {
    --gw-mosaics-panel-pad: 22px 18px;
  }

  .gw-mosaics__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gw-gap);
  }

  .gw-mosaics__bottom {
    display: flex;
    flex-direction: column;
    gap: var(--gw-gap);
  }

  .gw-mosaics__media {
    aspect-ratio: 4 / 3;
  }

  .gw-mosaics__media img {
    position: relative;
    object-position: center;
  }

  .gw-mosaics__media--curve {
    align-self: start;
    aspect-ratio: auto;
  }

  .gw-mosaics__media--curve img {
    position: static;
    height: auto;
    object-fit: contain;
  }

  .gw-mosaics__media--floor { aspect-ratio: 1 / 1; }
  .gw-mosaics__under > .gw-mosaics__media--penny { aspect-ratio: 1632 / 1920; }
  .gw-mosaics__under > .gw-mosaics__media--entry { aspect-ratio: 1100 / 1040; }
  .gw-mosaics__under > .gw-mosaics__media--herringbone { aspect-ratio: 2 / 3; }
}

/* Wide landscape phones (≤ 950 wide, ≤ 500 tall): narrower rail and an
   uncropped curve image, also above the 900px mobile breakpoint. */
@media (orientation: landscape) and (max-width: 950px) and (max-height: 500px) {
  .gw-mosaics {
    width: min(78vw, 640px);
    max-width: min(78vw, 640px);
    margin-inline: auto;
  }

  .gw-mosaics__top {
    grid-template-rows: none;
  }

  .gw-mosaics__media--curve {
    align-self: start;
    aspect-ratio: auto;
  }

  .gw-mosaics__media--curve img {
    position: static;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }
}

/* --- Immaculate Mosaics: tablet portrait ---------------------------------- */
@media (orientation: portrait) and (min-width: 700px) and (max-width: 1100px) {
  .gw-mosaics {
    --gw-mosaics-panel-pad: 28px 24px;
  }

  .gw-mosaics__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gw-gap);
  }

  .gw-mosaics__bottom {
    display: flex;
    flex-direction: column;
    gap: var(--gw-gap);
  }

  .gw-mosaics__media {
    aspect-ratio: 4 / 3;
  }

  .gw-mosaics__media img {
    position: absolute;
    inset: 0;
    max-width: none;
    object-position: center;
  }

  .gw-mosaics__media--curve { aspect-ratio: 800 / 420; }
  .gw-mosaics__media--floor { aspect-ratio: 1 / 1; }
  .gw-mosaics__under > .gw-mosaics__media--penny { aspect-ratio: 1632 / 1920; }
  .gw-mosaics__under > .gw-mosaics__media--entry { aspect-ratio: 900 / 853; }
  .gw-mosaics__under > .gw-mosaics__media--herringbone { aspect-ratio: 750 / 720; }
}

/* Phones and portrait tablets: the tall and blue mosaics are desktop only;
   the panel and the lower images follow in normal flow. */
@media (max-width: 699px),
  (orientation: landscape) and (min-width: 700px) and (max-width: 900px) and (max-height: 500px),
  (orientation: portrait) and (min-width: 700px) and (max-width: 1100px) {
  .gw-mosaics__media--tall,
  .gw-mosaics__media--blue {
    display: none;
  }

  .gw-mosaics__panel {
    order: 1;
  }

  .gw-mosaics__under {
    order: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gw-gap);
  }
}
