.adf-gallery {
  --adf-navy: #22223e;
  --adf-red: #bd1622;
  --adf-muted: #676775;
  --adf-border: #e3e3e9;
  --adf-surface: #f6f6f8;
  color: var(--adf-navy);
  font-family: inherit;
  padding: clamp(28px, 5vw, 64px) 0;
}
.adf-gallery *, .adf-gallery *::before, .adf-gallery *::after { box-sizing: border-box; }
.adf-gallery [hidden] { display: none !important; }
.adf-gallery__inner { width: min(100% - 40px, 1200px); margin: 0 auto; }
.adf-gallery__intro { max-width: 700px; margin-bottom: 28px; }
.adf-gallery__eyebrow { margin: 0 0 12px; color: var(--adf-red); font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.adf-gallery .adf-gallery__title { margin: 0 0 14px; font-size: clamp(30px, 4vw, 46px); font-weight: 400; line-height: 1.15; letter-spacing: -.025em; }
.adf-gallery__lead { margin: 0; color: var(--adf-muted); font-size: 16px; line-height: 1.6; }
.adf-gallery__toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 300px); gap: 16px; align-items: end; margin-bottom: 18px; padding: 18px; border: 1px solid var(--adf-border); border-radius: 10px; background: var(--adf-surface); }
.adf-gallery__field { display: grid; gap: 8px; min-width: 0; }
.adf-gallery__label { font-size: 13px; font-weight: 600; }
.adf-gallery__input, .adf-gallery__select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #cfcfd8; border-radius: 6px; background: #fff; color: var(--adf-navy); padding: 11px 13px; font: inherit; font-size: 16px; line-height: 1.3; }
.adf-gallery__input::placeholder { color: #858590; }
.adf-gallery__summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 30px; min-height: 26px; color: var(--adf-muted); font-size: 13px; }
.adf-gallery__summary p { margin: 0; }
.adf-gallery__reset { border: 0; padding: 4px 0; background: none; color: var(--adf-red); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }
.adf-gallery__group + .adf-gallery__group { margin-top: 38px; }
.adf-gallery__group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--adf-border); }
.adf-gallery .adf-gallery__group-title { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 500; }
.adf-gallery__group-count { font-size: 12px; color: var(--adf-muted); white-space: nowrap; }
.adf-gallery__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; padding: 0; margin: 0; list-style: none; }
.adf-gallery__item { min-width: 0; margin: 0; padding: 0; }
.adf-gallery__card { display: block; height: 100%; border: 1px solid var(--adf-border); border-radius: 8px; overflow: hidden; background: #fff; color: var(--adf-navy); text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease; }
.adf-gallery__card:hover { border-color: #b8b8c6; box-shadow: 0 5px 16px rgba(34, 34, 62, .07); color: var(--adf-navy); }
.adf-gallery__image-wrap { display: block; position: relative; aspect-ratio: 1 / 1; background: #eeeef1; overflow: hidden; }
.adf-gallery__image { display: block; width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: var(--adf-position, 50% 50%); }
.adf-gallery__zoom { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: rgba(255, 255, 255, .91); color: var(--adf-navy); box-shadow: 0 1px 5px rgba(0, 0, 0, .12); }
.adf-gallery__zoom svg { width: 14px; height: 14px; }
.adf-gallery__caption { display: grid; gap: 5px; padding: 13px 14px 14px; }
.adf-gallery__code { font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.adf-gallery__name { font-size: 13px; color: var(--adf-muted); line-height: 1.4; overflow-wrap: anywhere; }
.adf-gallery__empty { padding: 36px 20px; border: 1px dashed #cfcfd8; border-radius: 8px; background: var(--adf-surface); text-align: center; }
.adf-gallery__empty p { margin: 0; font-size: 16px; line-height: 1.5; }
.adf-gallery__empty p + p { margin-top: 6px; color: var(--adf-muted); font-size: 14px; }
.adf-gallery__colour-note { margin: 30px 0 0; max-width: 700px; color: var(--adf-muted); font-size: 13px; line-height: 1.5; }
.adf-gallery :is(a, button, input, select):focus-visible { outline: 3px solid var(--adf-red); outline-offset: 4px; }
.adf-gallery__dialog { width: min(900px, calc(100vw - 28px)); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); margin: auto; padding: 0; border: 0; border-radius: 12px; overflow: auto; background: #fff; color: var(--adf-navy); box-shadow: 0 20px 90px rgba(0, 0, 0, .3); }
.adf-gallery__dialog:not([open]) { display: none; }
.adf-gallery__dialog::backdrop { background: rgba(15, 15, 30, .76); }
.adf-gallery__dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; }
.adf-gallery__dialog-heading { min-width: 0; }
.adf-gallery .adf-gallery__dialog-title { margin: 0; font-size: 23px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.adf-gallery__dialog-subtitle { margin: 4px 0 0; color: var(--adf-muted); font-size: 13px; line-height: 1.4; }
.adf-gallery__icon-button { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--adf-border); border-radius: 50%; background: #fff; color: var(--adf-navy); cursor: pointer; }
.adf-gallery__icon-button:hover { background: var(--adf-surface); }
.adf-gallery__icon-button svg { width: 19px; height: 19px; }
.adf-gallery__dialog-image-wrap { display: grid; place-items: center; min-height: 140px; background: var(--adf-surface); }
.adf-gallery__preview-viewport { width: 100%; }
.adf-gallery__dialog-image { display: block; width: 100%; height: auto; max-height: 64vh; max-height: 64dvh; object-fit: contain; }
.adf-gallery__crop-viewport { position: relative; overflow: hidden; aspect-ratio: 1 / 1; }
.adf-gallery__preview-viewport.adf-gallery__crop-viewport { width: min(100%, 64vh); width: min(100%, 64dvh); }
.adf-gallery__crop-viewport > img { position: absolute; width: var(--adf-crop-width); height: var(--adf-crop-height); left: var(--adf-crop-left); top: var(--adf-crop-top); max-width: none !important; max-height: none !important; aspect-ratio: auto; object-fit: contain; object-position: 50% 50%; image-orientation: from-image; }
.adf-gallery__dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 22px; }
.adf-gallery__photo-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.adf-gallery__original { color: var(--adf-red); font-size: 13px; text-underline-offset: 3px; }
.adf-gallery__navigation { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.adf-gallery__index { min-width: 44px; color: var(--adf-muted); font-size: 12px; text-align: center; white-space: nowrap; }
.adf-gallery__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 1350px) { .adf-gallery__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 900px) { .adf-gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .adf-gallery__inner { width: calc(100% - 32px); }
  .adf-gallery__intro { margin-bottom: 22px; }
  .adf-gallery__toolbar { grid-template-columns: 1fr; gap: 13px; padding: 14px; }
  .adf-gallery__summary { margin-bottom: 23px; }
  .adf-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .adf-gallery__caption { padding: 11px 10px 12px; }
  .adf-gallery__code { font-size: 15px; }
  .adf-gallery__name { font-size: 12px; }
  .adf-gallery__group-heading { margin-bottom: 13px; }
  .adf-gallery .adf-gallery__group-title { font-size: 19px; }
  .adf-gallery__dialog-header, .adf-gallery__dialog-footer { padding: 14px; }
  .adf-gallery__dialog-footer { gap: 10px; }
  .adf-gallery__navigation { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .adf-gallery__card { transition: none; } }


/* Actual preview images now have the approved wall/fabric crop baked in.
   No CSS-based image crop is applied inside the modal. */
.adf-gallery__preview-viewport { width: 100%; margin: 0 auto; }
.adf-gallery__dialog-image-wrap { background: #f6f6f8; }
.adf-gallery__dialog-image { display: block; width: 100%; height: auto; max-height: 70vh; max-height: 70dvh; object-fit: contain; }
@media (max-width: 600px) {
  .adf-gallery__dialog-image { max-height: 62vh; max-height: 62dvh; }
}

/* vF: each visible card now uses a real wall-preview asset (1320 x 1067).
   Match the asset ratio to keep wall visible at both sides of every tile. */
.adf-gallery .adf-gallery__image-wrap { aspect-ratio: 1320 / 1067; }
.adf-gallery .adf-gallery__image { aspect-ratio: 1320 / 1067; width: 100%; height: 100%; object-fit: cover; }
.adf-gallery .adf-gallery__image-wrap > img { position: static; max-width: 100%; max-height: none; }
