/* ==========================================================================
   PVC SOLUTIONS USA — Layout
   ========================================================================== */

.pvc-container {
  width: 100%;
  max-width: var(--pvc-container);
  margin-inline: auto;
  padding-inline: var(--pvc-gutter);
}
.pvc-container--wide { max-width: var(--pvc-container-wide); }
.pvc-container--text { max-width: var(--pvc-container-text); }
.pvc-container--flush { padding-inline: 0; }

/* --- Sections ----------------------------------------------------------- */

.pvc-section {
  position: relative;
  padding-block: var(--pvc-section-y);
}
.pvc-section--tight { padding-block: var(--pvc-section-y-sm); }
.pvc-section--flush-top    { padding-top: 0; }
.pvc-section--flush-bottom { padding-bottom: 0; }

.pvc-section--alt    { background: var(--pvc-bg-alt); }
.pvc-section--navy   { background: var(--pvc-navy); color: var(--pvc-text-invert-mut); }
.pvc-section--deep   { background: var(--pvc-navy-deep); color: var(--pvc-text-invert-mut); }

.pvc-section__head {
  max-width: 720px;
  margin-bottom: var(--pvc-s-8);
}
.pvc-section__head--center {
  margin-inline: auto;
  text-align: center;
}
.pvc-section__head p:last-child { margin-bottom: 0; }

/* The full-bleed flag divider between major sections */
.pvc-divider-flag {
  height: 6px;
  background: linear-gradient(
    to right,
    var(--pvc-red) 0%, var(--pvc-red) 38%,
    var(--pvc-navy) 38%, var(--pvc-navy) 100%
  );
}

/* --- Grids -------------------------------------------------------------- */

.pvc-grid {
  display: grid;
  gap: var(--pvc-s-5);
}
.pvc-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pvc-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pvc-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pvc-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.pvc-grid--gap-lg { gap: var(--pvc-s-7); }
.pvc-grid--gap-sm { gap: var(--pvc-s-3); }

/* Auto-fit grid — the default for product tiles */
.pvc-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.pvc-grid--auto-sm {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* Two-column split: media + copy */
.pvc-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}
.pvc-split--media-right .pvc-split__media { order: 2; }
.pvc-split--top { align-items: start; }
.pvc-split--wide-copy { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.pvc-split--wide-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }

.pvc-stack   { display: flex; flex-direction: column; gap: var(--pvc-s-4); }
.pvc-stack--lg { gap: var(--pvc-s-6); }
.pvc-cluster { display: flex; flex-wrap: wrap; gap: var(--pvc-s-3); align-items: center; }
.pvc-cluster--center { justify-content: center; }

/* --- Aspect ratios ------------------------------------------------------ */

.pvc-ratio { position: relative; overflow: hidden; background: var(--pvc-mist); }
.pvc-ratio > img,
.pvc-ratio > video,
.pvc-ratio > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pvc-ratio--16x9 { aspect-ratio: 16 / 9; }
.pvc-ratio--4x3  { aspect-ratio: 4 / 3; }
.pvc-ratio--3x2  { aspect-ratio: 3 / 2; }
.pvc-ratio--1x1  { aspect-ratio: 1 / 1; }
.pvc-ratio--3x4  { aspect-ratio: 3 / 4; }
.pvc-ratio--21x9 { aspect-ratio: 21 / 9; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1024px) {
  .pvc-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pvc-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .pvc-split,
  .pvc-split--wide-copy,
  .pvc-split--wide-media { grid-template-columns: minmax(0, 1fr); }
  .pvc-split--media-right .pvc-split__media { order: 0; }
  .pvc-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .pvc-grid--2,
  .pvc-grid--3,
  .pvc-grid--4 { grid-template-columns: minmax(0, 1fr); }
  .pvc-grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pvc-section__head { margin-bottom: var(--pvc-s-6); }
}

/* --- Full-bleed sections ------------------------------------------------- */
/*
 * Homepage sections run edge to edge like the header and footer, so the
 * layout does not narrow as the viewport grows. Interior pages keep the
 * measured container, where long-form copy needs a readable line length.
 */
/*
 * Sections run edge to edge across the whole site, matching the header and
 * footer, so the layout does not narrow as the viewport grows.
 *
 * The one exception is long-form prose: a paragraph stretched across a wide
 * monitor is genuinely hard to read, so .pvc-container--text keeps its
 * measure. Everything else fills.
 */
.pvc-container,
.pvc-container--wide {
  max-width: 100%;
  padding-inline: clamp(1rem, 2.5vw, 3rem);
}

/* Reading measure is preserved where it earns its place. */
.pvc-container--text {
  max-width: var(--pvc-container-text);
}

/* Elementor wraps widgets in its own containers, which carry a max-width from
   the global kit. Those need releasing too, or the section inside stays narrow
   however wide the viewport gets. */
.elementor-section > .elementor-container,
.e-con > .e-con-inner {
  max-width: 100% !important;
}

/* Banners and prose keep their measure on interior pages, but the standfirst
   should use the full width rather than stopping short on the right. */
.pvc-banner__text {
  max-width: none;
  font-size: var(--pvc-fs-lead);
  line-height: var(--pvc-lh-normal);
}
