/* Layout layer for generator output: sections ship as flat h2/p/img/article lists inside .shell */

/* ---------- heroes: copy left, photo right ---------- */
.hero > .shell,
.inner-hero > .shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(32px, 4vw, 64px);
  align-content: center;
  min-height: inherit;
  padding-block: 56px 72px;
}
.hero > .shell > :not(img),
.inner-hero > .shell > :not(img) { grid-column: 1; }
.hero > .shell > img,
.inner-hero > .shell > img {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  box-shadow: 14px 14px 0 var(--red);
}
.hero h1 { margin: 0 0 22px; color: var(--paper); font-size: clamp(2.6rem, 4.6vw, 4.6rem); line-height: 0.95; }
.hero > .shell > p,
.inner-hero > .shell > p { max-width: 600px; color: #c9d4df; }
.hero > .shell > p:last-of-type,
.inner-hero > .shell > p:last-of-type { margin-top: 8px; }

/* ---------- generic section layout ---------- */
.section > .shell,
.cta-band > .shell {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px 28px;
  align-items: start;
}
.section > .shell > * { grid-column: 1 / -1; min-width: 0; }
.section > .shell > h2 { max-width: 900px; margin: 0 0 6px; }
.section > .shell > p { max-width: 760px; margin: 0; color: var(--muted); }
.section > .shell:has(> h2 + img, > h2 + p + img) > p { grid-column: 1 / span 4; }
.section > .shell > h3 { margin: 18px 0 0; }

/* first photo after the heading or intro sits to the right of the copy */
.section > .shell > h2 + img,
.section > .shell > h2 + p + img {
  grid-column: 5 / -1;
  grid-row: 2 / span 2;
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 460px;
  object-fit: cover;
  box-shadow: 10px 10px 0 var(--red);
}
/* any other loose photo becomes a wide banner */
.section > .shell > img:not(h2 + img):not(h2 + p + img) {
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 7;
  max-height: 340px;
  object-fit: cover;
}

/* loose articles become cards: 3 across, 2 across when there are exactly 2 or 4 */
.section > .shell > article { grid-column: span 2; }
.section > .shell > article:not([class]) {
  align-self: stretch;
  padding: 26px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  background: var(--paper);
}
.section > .shell:has(> article:nth-of-type(2)):not(:has(> article:nth-of-type(3))) > article,
.section > .shell:has(> article:nth-of-type(4)):not(:has(> article:nth-of-type(5))) > article { grid-column: span 3; }
.section > .shell > article h3 { margin: 0 0 10px; font-size: 1.45rem; line-height: 1.1; }
.section > .shell > article p { margin: 0; color: var(--muted); }
.dark-panel.section > .shell > article:not([class]) { border-color: rgba(255, 255, 255, 0.14); border-top-color: var(--red); background: var(--navy-2); }
.dark-panel > .shell > article p, .dark-panel > .shell > p, .route-section > .shell > p { color: #c0ccda; }
.section > .shell > article:not([class]) > b {
  display: inline-grid;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  place-items: center;
  background: var(--red);
  color: var(--paper);
  font-family: var(--heading);
}
.section > .shell > article:not([class]) > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 1.35rem;
  line-height: 1.1;
  text-transform: uppercase;
}
.section > .shell > article:not([class]) > span { display: block; color: var(--muted); }
.dark-panel > .shell > article:not([class]) > strong { color: var(--paper); }

/* lists of links become chips */
.section > .shell > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.section > .shell > ul > li > a,
.section > .shell > ul > li:not(:has(a)) {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}
.section > .shell > ul > li > a:hover { border-color: var(--red); color: var(--red); }

.section > .shell > iframe { width: 100%; height: 380px; border: 0; }

/* ---------- homepage services: image cards, 4 across ---------- */
.services-section > .shell { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.services-section > .shell > article {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  padding: 0 0 20px;
  border-top: 0;
  overflow: hidden;
}
.services-section > .shell > article > img {
  order: -1;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 16px;
}
.services-section > .shell > article > h3,
.services-section > .shell > article > p { padding: 0 20px; }
.services-section > .shell > article > h3 { font-size: 1.25rem; }
.services-section > .shell > article > h3 a { color: var(--ink); text-decoration: none; }
.services-section > .shell > article:hover h3 a { color: var(--red); }

/* ---------- compare + gallery cards ---------- */
.compare-section > .shell > .compare-card.featured { border-top: 4px solid var(--red); }
.gallery-section > .shell > .detail-card { display: flex; flex-direction: column; padding: 0 0 22px; overflow: hidden; }
.gallery-section > .shell > .detail-card > img { order: -1; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 16px; }
.gallery-section > .shell > .detail-card > :not(img) { padding: 0 22px; }

/* ---------- CTA band: copy left, photo right ---------- */
.cta-band { padding: 84px 0; }
.cta-band > .shell { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; }
.cta-band > .shell > :not(img) { grid-column: 1; margin: 0; }
.cta-band > .shell > h2 { color: var(--paper); }
.cta-band > .shell > p { color: #c9d4df; }
.cta-band > .shell > p:has(.button) { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-band > .shell > img { grid-column: 2; grid-row: 1 / span 3; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- contact ---------- */
.contact-section > .shell > p:has(a + a) { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- quick strip under inner heroes ---------- */
.quick-strip > .shell { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-strip > .shell > p { grid-column: 1 / -1; margin: 0; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.22); font-size: 0.85rem; }
.quick-strip > .shell > p a { color: var(--paper); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero > .shell,
  .inner-hero > .shell,
  .cta-band > .shell { grid-template-columns: minmax(0, 1fr); padding-block: 40px 48px; }
  .hero > .shell > img,
  .inner-hero > .shell > img,
  .cta-band > .shell > img { grid-column: 1; grid-row: auto; margin-top: 26px; }
  .section > .shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section > .shell > p,
  .section > .shell > h2 + img,
  .section > .shell > h2 + p + img { grid-column: 1 / -1; grid-row: auto; }
  .section > .shell > h2 + img,
  .section > .shell > h2 + p + img { height: auto; aspect-ratio: 16 / 10; min-height: 0; }
  .section > .shell > article,
  .section > .shell:has(> article:nth-of-type(2)):not(:has(> article:nth-of-type(3))) > article,
  .section > .shell:has(> article:nth-of-type(4)):not(:has(> article:nth-of-type(5))) > article { grid-column: span 1; }
  .services-section > .shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-strip > .shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .section > .shell,
  .services-section > .shell { grid-template-columns: minmax(0, 1fr); }
  .section > .shell > article,
  .section > .shell:has(> article:nth-of-type(2)):not(:has(> article:nth-of-type(3))) > article,
  .section > .shell:has(> article:nth-of-type(4)):not(:has(> article:nth-of-type(5))) > article { grid-column: 1; }
  .hero > .shell > img, .inner-hero > .shell > img { box-shadow: 8px 8px 0 var(--red); }
}
