/* Room photo galleries and the landing-page layout (custom made, home viewings, runners), loaded only on pages that hold a gallery
   or lp-* blocks (inc/content.php). Raouf, 2026-10-12: gallery photos are tidied into one 4:3 frame each and landing photos fill
   their frames, so these are the one place the theme crops a photo; it is always a room photo, never a rug's own product photo,
   and the full uncropped photo opens from the gallery lightbox. content.css itself still never crops. */

/* ---------- photo galleries (custom made, home viewings and any page gallery), tidied 2026-10-12 ----------
   Portrait and landscape photos made ragged rows with large holes and one 8,900 px column on phones. Now: one grid, every tile
   the same 4:3 frame, the photo cropped to fill it a little below centre (the rug is on the floor), 2 columns on phones, 4 from 700 px (with the 2 x 2 lead photo both galleries end on a full row). The full
   uncropped photo still opens in the lightbox. */
.entry .wp-block-gallery.has-nested-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2, 8px);
  max-width: none;
  margin-block: var(--sp-6, 32px);
}
@media (min-width: 700px) { .entry .wp-block-gallery.has-nested-images { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3, 12px); } }
.entry .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
  width: auto;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--c-wall);
}
.entry .wp-block-gallery.has-nested-images figure.wp-block-image > :is(a, div) { display: block; width: 100%; height: 100%; }
.entry .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
  transition: transform 0.4s ease;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .entry .wp-block-gallery.has-nested-images figure.wp-block-image:hover img { transform: scale(1.03); }
}
.entry .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { display: none; }   /* the gallery has no captions worth a band over the photo */
/* the first photo leads as a 2 x 2 feature (it also closes the last row: 17 and 29 photos become 20 and 32 tiles) */
.entry .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image):first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }

/* ---------- landing pages (runners, custom made; scripts/redesign/landing_pages.py), 2026-10-12 ----------
   One hero (the H1, a lede, the two actions, one photo), alternating split sections, option cards, numbered steps (a real
   sequence), one FAQ list and one closing band. Built from core blocks with lp-* classes. */
.entry > .lp-hero { gap: var(--sp-8, 72px); margin: 0 0 var(--sp-8, 72px); }
.entry > .lp-hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.5rem); line-height: 1.02; margin: 0 0 var(--sp-4, 16px); }
.entry .lp-lede { font-size: 1.125rem; line-height: 1.65; max-width: 38rem; }
.entry .lp-note { color: var(--c-muted); font-size: var(--fs-ui, 0.9375rem); }
.entry > .lp-hero .wp-block-buttons,
.entry > .lp-cta .wp-block-buttons { margin-top: var(--sp-5, 24px); }
.entry .is-style-outline .wp-block-button__link { background-color: transparent; color: var(--c-brand); border: 1px solid var(--c-brand); }
.entry .is-style-outline .wp-block-button__link:hover { color: var(--c-on-brand); }   /* the fill is the sweep in buttons.css */
.entry > :is(.lp-hero, .lp-split) .wp-block-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.entry > .lp-hero .wp-block-image img { aspect-ratio: 4 / 5; }

.entry > .lp-split { gap: var(--sp-8, 72px); margin-block: var(--sp-8, 72px); }
.entry > .lp-split h2 { margin-top: 0; }
.entry > .lp-split h3 { margin-top: var(--sp-6, 32px); }

.entry > :is(.lp-section, .lp-faq, .lp-wall) { margin-block: var(--sp-8, 72px); padding-top: var(--sp-7, 48px); border-top: 1px solid var(--c-rule); }
.entry > :is(.lp-section, .lp-faq, .lp-wall) > h2 { margin-top: 0; }

/* option cards */
.entry .lp-cards { list-style: none; margin: var(--sp-5, 24px) 0; padding: 0; display: grid; gap: var(--sp-4, 16px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); max-width: none; }
.entry .lp-cards li { margin: 0; padding: var(--sp-5, 24px); background: var(--c-mat); box-shadow: var(--shadow-mat); border-top: 3px solid var(--c-accent); }
.entry .lp-cards li > strong:first-child { display: block; margin-bottom: var(--sp-2, 8px); font: 500 1.375rem / 1.2 var(--font-display); }
.entry .lp-cards li > span { display: block; color: var(--c-text); line-height: 1.6; }

/* numbered steps: the process is a real sequence, so the numbers carry meaning */
.entry .lp-steps { list-style: none; counter-reset: step; margin: var(--sp-5, 24px) 0 0; padding: 0; display: grid; gap: var(--sp-5, 24px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); max-width: none; }
.entry .lp-steps li { counter-increment: step; margin: 0; padding-top: var(--sp-4, 16px); border-top: 1px solid var(--c-rule); }
.entry .lp-steps li::before { content: counter(step); display: block; margin-bottom: var(--sp-3, 12px); font: 500 2.75rem / 1 var(--font-display); color: var(--c-brand); }
.entry .lp-steps li > strong { display: block; font-size: 1.0625rem; margin-bottom: 4px; }
.entry .lp-steps li > span { display: block; color: var(--c-muted); line-height: 1.6; }

/* one FAQ column at reading width */
.entry > .lp-faq > .wp-block-details { max-width: 46rem; }

/* the closing band */
.entry > .lp-cta { margin: var(--sp-8, 72px) 0 0; padding: var(--sp-7, 48px) clamp(var(--sp-5, 24px), 5vw, var(--sp-8, 72px));
  background: var(--c-band-oxblood); color: var(--c-on-band); }
.entry > .lp-cta h2 { margin-top: 0; color: inherit; }
.entry > .lp-cta p { max-width: 42rem; }
.entry > .lp-cta a:not(.wp-block-button__link) { color: inherit; text-decoration: underline; }
.entry > .lp-cta .wp-block-button__link { background-color: var(--c-on-band); color: var(--c-band-oxblood); border: 1px solid var(--c-on-band); }
.entry > .lp-cta .is-style-outline .wp-block-button__link { background-color: transparent; color: var(--c-on-band); }
.entry > .lp-cta .lp-note { color: inherit; opacity: 0.85; }
.entry > .lp-cta :focus-visible { outline-color: var(--c-on-band); }

/* the runners wall on the page */
.entry > .lp-wall .lp-more a { display: inline-flex; align-items: center; min-height: 44px; font: 500 var(--fs-ui, 0.9375rem) / 1 var(--font-ui); color: var(--c-link); }
@media (max-width: 781px) {
  .entry > :is(.lp-hero, .lp-split) { gap: var(--sp-5, 24px); margin-block: var(--sp-7, 48px); }
  .entry > .lp-hero .wp-block-image img { aspect-ratio: 4 / 3; }
}
/* the lead photo never sets the row height (a portrait lead photo stretched the first two rows) */
.entry .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image):first-child { position: relative; }
.entry .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image):first-child > :is(a, div, img) { position: absolute; inset: 0; }
/* option cards: four in a row on desktop, two on tablets, one on phones */
@media (min-width: 600px) { .entry .lp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .entry .lp-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* steps in a column beside a video or photo (home viewings): one step under another, the number beside the text */
.entry .lp-steps.lp-steps-list { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4, 16px); }
.entry .lp-steps.lp-steps-list li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: var(--sp-3, 12px); padding-top: var(--sp-3, 12px); border-top: 1px solid var(--c-rule); }
.entry .lp-steps.lp-steps-list li::before { grid-row: span 2; margin: 0; font-size: 2.25rem; }
/* a quiet aside between sections (the sister business, Rug Cleaning Pro) */
.entry > .lp-aside { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3, 12px) var(--sp-6, 32px);
  margin-block: var(--sp-7, 48px); padding: var(--sp-5, 24px); background: var(--c-mat); border: 1px solid var(--c-rule); }
.entry > .lp-aside p { margin: 0; max-width: 40rem; }
.entry > .lp-aside .wp-block-buttons { margin: 0; }
/* five cards (cleaning): they wrap and the last row's cards widen to fill it (3 + 2), never five narrow columns */
.entry .lp-cards:has(> li:nth-child(5):last-child) { display: flex; flex-wrap: wrap; }
.entry .lp-cards:has(> li:nth-child(5):last-child) > li { flex: 1 1 12rem; }
/* option cards and choices use the full section width (the reading-measure rule for lists in groups held them to 46rem) */
.entry .wp-block-group > :is(.lp-cards, .lp-steps, .lp-choices) { max-width: none; }
.entry > :is(.lp-hero, .lp-split) .wp-block-video video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--c-text); }

/* choices (custom made: material, style, colour, size): label beside its description, one row each */
.entry .lp-choices { list-style: none; margin: var(--sp-4, 16px) 0; padding: 0; border-top: 1px solid var(--c-rule); max-width: none; }
.entry .lp-choices li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--sp-4, 16px); margin: 0; padding: var(--sp-4, 16px) 0; border-bottom: 1px solid var(--c-rule); }
.entry .lp-choices li > strong { font: 500 1.25rem / 1.3 var(--font-display); color: var(--c-brand); }
.entry .lp-choices li > span { line-height: 1.6; }
@media (max-width: 479px) { .entry .lp-choices li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
/* a portrait photo in a split keeps its shape */
.entry > .lp-split .wp-block-image.lp-portrait img { aspect-ratio: 4 / 5; max-height: 44rem; }
