/* V53: compact square galleries and readable mobile facility cards */
:root {
  --v52-navy: #0b2f63;
  --v52-red: #d71920;
  --v52-red-dark: #b50f18;
  --v52-border: #d9e2ef;
  --v52-muted: #5c6f8c;
}

/* Keep section eyebrows legible and consistent across the site. */
.eyebrow,
.section-eyebrow,
[class*="eyebrow"] {
  color: var(--v52-red-dark) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: .05em !important;
  line-height: 1.35 !important;
  margin-bottom: 22px !important;
}

/* Optional galleries: three square cards on desktop, two on tablet, one on phone. */
html body .v47-film-shell,
html body .v47-album-shell {
  position: relative;
  overflow: hidden;
}

html body .v47-film-shell .v47-film-track,
html body .v47-album-shell .v47-album-track {
  display: flex !important;
  gap: 16px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  max-height: none !important;
  padding: 0 0 8px !important;
  overscroll-behavior-inline: contain;
}

html body .v47-film-track::-webkit-scrollbar,
html body .v47-album-track::-webkit-scrollbar {
  display: none;
}

html body .v47-film-track > .v47-film-card,
html body .v47-album-track > .v47-album-card {
  --v52-caption-height: 58px;
  box-sizing: border-box !important;
  flex: 0 0 calc((100% - 32px) / 3) !important;
  width: calc((100% - 32px) / 3) !important;
  min-width: calc((100% - 32px) / 3) !important;
  max-width: calc((100% - 32px) / 3) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: auto var(--v52-caption-height) !important;
  scroll-snap-align: start;
  overflow: hidden !important;
  padding: 0 !important;
  border: 1px solid var(--v52-border) !important;
  background: #fff !important;
  color: var(--v52-navy) !important;
  text-align: left !important;
  cursor: zoom-in;
}

html body .v47-film-track > .v47-film-card > img,
html body .v47-album-track > .v47-album-card > img {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  object-position: center !important;
}

html body .v47-film-track > .v47-film-card > :last-child:not(img),
html body .v47-album-track > .v47-album-card > :last-child:not(img) {
  box-sizing: border-box !important;
  min-height: var(--v52-caption-height) !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  color: var(--v52-navy) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

html body .v47-film-controls button,
html body .v47-album-controls button,
html body [data-v47-prev],
html body [data-v47-next] {
  min-width: 48px !important;
  min-height: 48px !important;
}

@media (max-width: 1024px) {
  html body .v47-film-track > .v47-film-card,
  html body .v47-album-track > .v47-album-card {
    flex-basis: calc((100% - 16px) / 2) !important;
    width: calc((100% - 16px) / 2) !important;
    min-width: calc((100% - 16px) / 2) !important;
    max-width: calc((100% - 16px) / 2) !important;
  }
}

/* On phones, separate factory photography from copy instead of overlaying text. */
@media (max-width: 820px) {
  .eyebrow,
  .section-eyebrow,
  [class*="eyebrow"] {
    font-size: 16px !important;
    margin-bottom: 20px !important;
  }

  html body .v44-facilities,
  html body .v44-facilities-detail {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
  }

  html body .v44-facilities .v44-facility,
  html body .v44-facilities-detail .v44-facility {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    border: 1px solid var(--v52-border) !important;
    background: #fff !important;
    box-shadow: 0 12px 28px rgba(11, 47, 99, .08) !important;
  }

  html body .v44-facilities .v44-facility::before,
  html body .v44-facilities-detail .v44-facility::before {
    display: none !important;
  }

  html body .v44-facilities .v44-facility > img,
  html body .v44-facilities-detail .v44-facility > img {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  html body .v44-facilities .v44-facility > div,
  html body .v44-facilities-detail .v44-facility > div {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    min-height: 0 !important;
    padding: 22px 20px 24px !important;
    background: #fff !important;
    color: var(--v52-navy) !important;
  }

  html body .v44-facilities .v44-facility h2,
  html body .v44-facilities .v44-facility h3,
  html body .v44-facilities .v44-facility h4,
  html body .v44-facilities .v44-facility p,
  html body .v44-facilities .v44-facility a,
  html body .v44-facilities-detail .v44-facility h2,
  html body .v44-facilities-detail .v44-facility h3,
  html body .v44-facilities-detail .v44-facility h4,
  html body .v44-facilities-detail .v44-facility p,
  html body .v44-facilities-detail .v44-facility a {
    color: var(--v52-navy) !important;
    text-shadow: none !important;
  }

  html body .v44-facilities .v44-facility .eyebrow,
  html body .v44-facilities-detail .v44-facility .eyebrow {
    color: var(--v52-red-dark) !important;
  }
}

@media (max-width: 640px) {
  html body .v47-film-shell .v47-film-track,
  html body .v47-album-shell .v47-album-track {
    gap: 12px !important;
  }

  html body .v47-film-track > .v47-film-card,
  html body .v47-album-track > .v47-album-card {
    --v52-caption-height: 56px;
    flex-basis: 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .v47-film-track,
  html body .v47-album-track {
    scroll-behavior: auto !important;
  }
}

/* V54: managed product-grade comparison */
.v54-products-intro {
  max-width: 820px;
  color: var(--v52-muted);
}

.v54-product-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 26px 0 22px;
}

.v54-product-filters button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--v52-border);
  background: #fff;
  color: var(--v52-navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.v54-product-filters button:hover,
.v54-product-filters button:focus-visible,
.v54-product-filters button.active {
  border-color: var(--v52-navy);
  background: var(--v52-navy);
  color: #fff;
}

.v54-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.v54-product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--v52-border);
  border-top: 4px solid var(--v52-red);
  background: #fff;
  box-shadow: 0 10px 26px rgba(11, 47, 99, .06);
}

.v54-grade {
  align-self: flex-start;
  padding: 5px 9px;
  background: #eaf0f8;
  color: var(--v52-navy);
  font-weight: 800;
  letter-spacing: .04em;
}

.v54-category {
  margin: 13px 0 3px;
  color: var(--v52-red-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.v54-product-card h3 {
  margin: 4px 0 18px;
  color: var(--v52-navy);
  font-size: clamp(19px, 2vw, 24px);
}

.v54-product-card strong {
  margin-top: 9px;
  color: var(--v52-navy);
}

.v54-product-card p {
  margin: 5px 0 10px;
  color: var(--v52-muted);
}

.v54-grade-link {
  margin-top: auto;
  padding-top: 15px;
  color: var(--v52-red-dark);
  font-weight: 800;
}

.v54-news-date {
  display: block;
  margin-bottom: 7px;
  color: var(--v52-red-dark);
  font-weight: 700;
}

@media (max-width: 980px) {
  .v54-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .v54-product-grid { grid-template-columns: 1fr; }
  .v54-product-card { padding: 20px; }
  .v54-product-filters { display: grid; grid-template-columns: 1fr 1fr; }
}

/* V59 managed product imagery and enquiry handoff */
.v59-grade-media {
  position: relative;
  width: calc(100% + 48px);
  aspect-ratio: 4 / 3;
  margin: -24px -24px 20px;
  overflow: hidden;
  border-bottom: 1px solid var(--v52-border);
  background-color: #eaf0f6;
}

.v54-product-card .v59-grade-media.fallback {
  background-image: url('/assets/images/recycled-pe-portfolio-12-grades.png');
  background-repeat: no-repeat;
  background-size: 600% 200%;
}

.v59-grade-media[data-grade="8001"] { background-position: 0% 0%; }
.v59-grade-media[data-grade="8002"] { background-position: 20% 0%; }
.v59-grade-media[data-grade="8003"] { background-position: 40% 0%; }
.v59-grade-media[data-grade="8004"] { background-position: 60% 0%; }
.v59-grade-media[data-grade="8005"] { background-position: 80% 0%; }
.v59-grade-media[data-grade="8006"] { background-position: 0% 100%; }
.v59-grade-media[data-grade="8007"] { background-position: 20% 100%; }
.v59-grade-media[data-grade="8008"] { background-position: 40% 100%; }
.v59-grade-media[data-grade="8009"] { background-position: 60% 100%; }
.v59-grade-media[data-grade="8010"] { background-position: 80% 100%; }
.v59-grade-media[data-grade="9001"] { background-position: 100% 0%; }
.v59-grade-media[data-grade="9002"] { background-position: 100% 100%; }

.v59-grade-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v46-grade-card .v59-grade-media {
  width: 100%;
  margin: 0 0 18px;
}

.v59-selected-grade input[readonly] {
  border-color: #123a82;
  background: #eef4fb;
  color: #0b2f63;
  font-weight: 800;
}

@media (max-width: 620px) {
  .v59-grade-media { width: calc(100% + 40px); margin: -20px -20px 18px; }
  .v46-grade-card .v59-grade-media { width: 100%; margin: 0 0 16px; }
}

/* V60 shorter homepage and technical comparison */
.v60-hero-image {
  background-image: linear-gradient(90deg, rgba(5, 25, 56, .96) 0%, rgba(5, 25, 56, .88) 48%, rgba(5, 25, 56, .34) 100%), url('/assets/images/hero-production.jpg');
  background-position: center;
  background-size: cover;
}
.v60-hero-image .v44-hero-grid > div { max-width: 760px; }
.v60-facility-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px; }
.v60-facility-grid .v44-facility { display:block; margin:0; background:#fff; border:1px solid rgba(17,52,91,.13); }
.v60-facility-grid .v44-facility img { width:100%; height:180px; object-fit:cover; }
.v60-facility-grid .v44-facility > div { padding:22px; }
.v60-facility-grid .v44-facility h3 { font-size:1.15rem; }
.v60-facility-grid .v44-facility h4 { margin:.5rem 0; }
.v60-home .finder-section { padding-top:72px; padding-bottom:72px; }
.v60-table-scroll { overflow-x:auto; margin-top:28px; border:1px solid #d8e1ec; }
.v60-comparison table { width:100%; min-width:920px; border-collapse:collapse; background:#fff; }
.v60-comparison th,.v60-comparison td { padding:15px 16px; border-bottom:1px solid #d8e1ec; text-align:left; vertical-align:top; }
.v60-comparison thead th { background:#0b2f63; color:#fff; font-size:.82rem; letter-spacing:.04em; text-transform:uppercase; }
.v60-comparison tbody th { color:#0b2f63; white-space:nowrap; }
.v60-comparison tbody tr:nth-child(even) { background:#f7f9fc; }
.v60-document-links { min-width:160px; }
.v60-document-links a { display:block; margin:0 0 7px; color:#0b2f63; font-weight:700; }
.technical-fields { border-top:1px solid var(--line); margin-top:10px; padding-top:16px; }
.technical-fields h3 { margin:0 0 4px; }
.technical-fields > p { margin-top:0; color:#61738d; font-weight:400; }
@media (max-width: 1024px) {
  .v60-facility-grid { grid-template-columns:1fr; }
  .v60-facility-grid .v44-facility { display:grid; grid-template-columns:minmax(220px,.8fr) 1.2fr; }
  .v60-facility-grid .v44-facility img { height:100%; min-height:220px; }
}
@media (max-width: 640px) {
  .v60-hero-image { background-image:linear-gradient(rgba(5,25,56,.9),rgba(5,25,56,.86)),url('/assets/images/hero-production.jpg'); }
  .v60-facility-grid .v44-facility { display:block; }
  .v60-facility-grid .v44-facility img { height:180px; min-height:0; }
  .v60-comparison th,.v60-comparison td { padding:12px; }
}
