/* Digi Print shared front-end consistency layer — 2026-09-10
   Loaded after each page's local CSS so established page-specific layouts remain intact. */

:root {
  --dp-container-pad: 28px;
  --dp-container-pad-mobile: 18px;
  --dp-card-gap: 20px;
  --dp-card-radius: var(--radius-lg, 20px);
  --dp-control-height: 44px;
}

html,
body {
  max-width: 100%;
}

img,
svg,
video {
  max-width: 100%;
}

.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--dp-container-pad);
}

.btn {
  min-height: var(--dp-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border-radius: 999px;
  text-align: center;
  line-height: 1.2;
}

.btn--sm {
  min-height: 40px;
  padding: 9px 18px;
}

.section-head {
  margin-bottom: clamp(36px, 5vw, 60px);
}

.cards-grid,
.related-grid,
.services-grid,
.secondary-grid,
.content-grid,
.system-grid,
.guidance-grid,
.process-grid,
.projects-row,
.supporting-grid,
.audience-grid {
  align-items: stretch;
}

.info-card,
.related-card,
.service-card,
.secondary-card,
.guide-card,
.system-card,
.guidance-card,
.product-card,
.project-card,
.work-card,
.application-card,
.benefit-card,
.finish-card,
.package-card,
.spec-card,
.why-card,
.outcome-card,
.testimonial-card {
  min-width: 0;
  height: 100%;
}

.info-card,
.related-card,
.service-card,
.secondary-card,
.guide-card,
.system-card,
.guidance-card,
.product-card,
.application-card,
.benefit-card,
.finish-card,
.package-card,
.spec-card,
.why-card,
.outcome-card {
  display: flex;
  flex-direction: column;
}

.related-card-link,
.service-card > a:last-child,
.info-card > a:last-child,
.guide-card > a:last-child,
.product-card > a:last-child,
.application-card > a:last-child,
.benefit-card > a:last-child,
.finish-card > a:last-child,
.package-card > a:last-child,
.spec-card > a:last-child,
.why-card > a:last-child,
.outcome-card > a:last-child {
  margin-top: auto;
}

.form-field,
.form-row,
.form-grid > * {
  min-width: 0;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.form-field input,
.form-field select,
.form-field textarea,
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
}

/* Keep every aside statistic on the same two-column alignment, including word labels. */
.aside-stat {
  min-width: 0;
}

.aside-stat-num {
  flex: 0 0 120px;
  min-width: 120px;
}

.aside-stat-label {
  min-width: 0;
  overflow-wrap: break-word;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.project-proof {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.project-proof > * {
  min-width: 0;
}

.project-proof img {
  width: 100%;
  height: auto;
}

.proof-layout,
.proof-images,
.proof-images > figure {
  min-width: 0;
}

.proof-images {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.supporting-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.supporting-grid > * {
  min-width: 0;
}

.supporting-grid img {
  width: 100%;
  height: auto;
}

/* The full header switches before its contents become crowded at laptop widths. */
@media (max-width: 1180px) {
  #site-header {
    overflow: visible;
  }

  #site-header .nav-hamburger {
    display: flex !important;
  }

  #site-header .header-socials,
  #site-header .header-divider,
  #site-header .header-cta .btn {
    display: none !important;
  }

  #site-header nav:not(.breadcrumb),
  #site-header #primary-navigation,
  #site-header .site-nav {
    position: absolute;
    top: calc(var(--header-h, 68px) + 4px);
    left: 0;
    right: 0;
    z-index: 101;
    display: none !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 0 16px;
    background: var(--primary, #12153e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 30px rgba(8, 11, 34, 0.24);
  }

  #site-header #primary-navigation.is-open,
  #site-header .site-nav.is-open,
  #site-header .nav-toggle:checked ~ .header-main nav:not(.breadcrumb) {
    display: flex !important;
  }

  #site-header nav:not(.breadcrumb) > a,
  #site-header #primary-navigation > a,
  #site-header .site-nav > a,
  #site-header .nav-window-trigger > a,
  #site-header .nav-submenu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 11px var(--dp-container-pad);
    border-radius: 0;
    white-space: normal;
  }

  #site-header .nav-window-group,
  #site-header .nav-window-trigger {
    display: block;
  }

  #site-header .nav-window-toggle {
    display: none;
  }

  #site-header .nav-submenu {
    position: static;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.035);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #site-header .nav-submenu a {
    padding-left: 44px;
  }
}

@media (max-width: 1000px) {
  .project-proof {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Older project pages retain their layouts but use the current control geometry. */
body.case-study header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary, #12153e);
}

body.case-study header .nav {
  min-height: 68px;
}

body.case-study header .logo-link svg {
  display: block;
  width: 116px;
  height: 54px;
}

body.case-study .case-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

body.case-study .case-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.2s, opacity 0.2s;
}

body.case-study .case-nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.case-study .case-nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

body.case-study .case-nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body.case-study footer {
  background: #080b22;
}

body.case-study .footer-inner-wrap {
  padding-top: 48px;
}

body.case-study .footer-bottom-bar {
  padding-bottom: 2px;
}

@media (max-width: 1180px) {
  body.case-study .case-nav-toggle {
    display: flex;
  }

  body.case-study header .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 101;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 0 16px;
    background: var(--primary, #12153e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 30px rgba(8, 11, 34, 0.24);
  }

  body.case-study header .nav-links.is-open {
    display: flex !important;
  }

  body.case-study header .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 11px var(--dp-container-pad);
  }
}

@media (max-width: 700px) {
  .table-scroll::before {
    content: "Swipe or scroll to view the full table →";
    position: sticky;
    left: 0;
    display: block;
    width: max-content;
    padding: 10px 14px;
    color: var(--muted, #5a6278);
    background: var(--surface, #f3f4f8);
    border-bottom: 1px solid var(--border, #e0e3ea);
    font-size: 0.76rem;
    font-weight: 700;
  }
}

@media (max-width: 640px) {
  :root {
    --dp-container-pad: var(--dp-container-pad-mobile);
  }

  /* Match the homepage carousel bleed to the shared mobile container inset. */
  .work-marquee {
    margin-inline: calc(-1 * var(--dp-container-pad));
  }

  .section {
    padding-block: 64px;
  }

  .section--sm {
    padding-block: 50px;
  }

  .cards-grid,
  .related-grid,
  .services-grid,
  .secondary-grid,
  .content-grid,
  .content-grid--three,
  .system-grid,
  .guidance-grid,
  .process-grid,
  .projects-row,
  .supporting-grid,
  .audience-grid,
  .application-grid,
  .benefits-grid,
  .finish-grid,
  .package-grid,
  .spec-grid,
  .sector-grid,
  .split-grid,
  .form-grid,
  .proof-images {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .form-field--full {
    grid-column: auto !important;
  }

  .hero-actions,
  .cta-actions {
    align-items: stretch;
  }

  .hero-actions .btn,
  .cta-actions .btn {
    max-width: 100%;
  }

  .page-hero {
    padding-top: calc(var(--header-h, 68px) + 4px + 44px) !important;
    padding-bottom: 56px !important;
  }

  .hero-visual {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hero-visual .hero-sign--wide {
    grid-column: auto !important;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 30px !important;
  }
}

@media (max-width: 520px) {
  #site-header .header-phone,
  body.case-study header .nav-phone {
    display: none !important;
  }

  .btn {
    white-space: normal;
  }

  body.case-study .footer-row,
  body.case-study .footer-links {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .section {
    padding-block: 48px;
  }

  .section--sm {
    padding-block: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.case-study .case-nav-toggle span {
    transition: none;
  }
}
