/* v47.14 — Site-wide alignment and responsive container consistency.
   Applies to the PRESENTATION only; nothing in WordPress is rewritten.
   Desktop editorial columns are deliberately preserved. */

/* Keep large sections centered within the viewport, rather than aligned to
   the left edge of a full-width Gutenberg group. */
body .dnj-footer .dnj-footer-inner,
body .dnj-page-shell > .wp-block-group__inner-container,
body .dnj-site-content > .wp-block-group__inner-container {
  box-sizing: border-box;
  width: 100%;
  margin-inline: auto;
}

/* Footer: the three desktop columns stay in place but each is balanced and
   centered, including the editable WordPress navigation. */
body .dnj-footer .dnj-footer-inner { max-width: 1280px; }
body .dnj-footer .dnj-footer-columns { justify-items: center; }
body .dnj-footer .dnj-footer-columns > .wp-block-column {
  box-sizing: border-box;
  width: 100%;
  max-width: 400px;
  min-width: 0;
  margin-inline: auto !important;
  text-align: center;
}
body .dnj-footer .dnj-footer-columns :is(h2,p) { text-align: center; }
body .dnj-footer .dnj-footer-brand,
body .dnj-footer .dnj-footer-description,
body .dnj-footer .dnj-footer-book-title,
body .dnj-footer .dnj-footer-book-link { margin-left: auto; margin-right: auto; }
body .dnj-footer .dnj-footer-navigation,
body .dnj-footer .dnj-footer-navigation .wp-block-navigation__container,
body .dnj-footer .dnj-footer-navigation ul {
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body .dnj-footer .dnj-footer-navigation a { text-align: center; }
body .dnj-footer .dnj-footer-bottom { width: 100%; margin-left: auto; margin-right: auto; }

/* Keep embedded media within its containing column without imposing a fixed
   video height on photo galleries, slideshows, PDFs or audio players. */
body .dnj-page-shell :is(img,video,iframe,embed),
body .dnj-homepage :is(img,video,iframe,embed) { max-width: 100%; }
body .dnj-page-shell img,
body .dnj-homepage img { height: auto; }
body .dnj-page-shell .wp-block-embed.is-type-video .wp-block-embed__wrapper,
body .dnj-page-shell .wp-block-embed.is-provider-youtube .wp-block-embed__wrapper {
  width: 100%; max-width: 100%; margin-inline: auto;
}
body .dnj-page-shell .wp-block-embed.is-type-video iframe,
body .dnj-page-shell .wp-block-embed.is-provider-youtube iframe {
  width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto;
  display: block; margin-inline: auto;
}

/* The narrow laptop split-screen range needs a deliberate single-column
   editorial layout, including standard blocks and old Custom HTML groups. */
@media (max-width: 1120px) {
  body .dnj-page-shell,
  body .dnj-site-content {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: clamp(18px, 4.5vw, 44px) !important;
  }
  body .dnj-page-shell > :is(.wp-block-group,.wp-block-columns,.wp-block-gallery,.wp-block-image,.wp-block-cover,.wp-block-embed,.wp-block-media-text,.dnj-card,.dnj-v10-project),
  body .dnj-page-shell .wp-block-post-content > :is(.wp-block-group,.wp-block-columns,.wp-block-gallery,.wp-block-embed,.wp-block-media-text),
  body .dnj-site-content > :is(.wp-block-group,.wp-block-columns,.wp-block-gallery,.wp-block-embed) {
    box-sizing: border-box !important;
    width: min(100%, 850px) !important;
    max-width: 850px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    min-width: 0 !important;
  }
  body .dnj-page-shell > :is(h1,h2,h3,h4,h5,h6,p,.dnj-eyebrow,.dnj-lead),
  body .dnj-page-shell .wp-block-post-content > :is(h1,h2,h3,h4,h5,h6,p) {
    box-sizing: border-box;
    max-width: min(100%, 820px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    overflow-wrap: break-word;
  }
  body .dnj-page-shell :is(.wp-block-heading,.dnj-eyebrow,.dnj-lead),
  body .dnj-page-shell .dnj-card :is(h2,h3,h4,p),
  body .dnj-page-shell .dnj-v10-project :is(h2,h3,h4,p),
  body .dnj-page-shell .wp-block-group > :is(h2,h3,h4) {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body .dnj-page-shell :is(.wp-block-columns:not(.dnj-grid),.wp-block-media-text) {
    box-sizing: border-box !important;
    width: min(100%, 850px) !important;
    max-width: 850px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: clamp(18px, 3vw, 32px) !important;
  }
  body .dnj-page-shell .wp-block-columns:not(.dnj-grid) > .wp-block-column,
  body .dnj-page-shell .wp-block-media-text > :is(.wp-block-media-text__media,.wp-block-media-text__content) {
    width: 100% !important;
    max-width: 820px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    flex: 0 1 auto !important;
    flex-basis: auto !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
  body .dnj-page-shell :is(.wp-block-image,.wp-block-gallery,.wp-block-media-text__media),
  body .dnj-page-shell .dnj-v10-project-grid > img {
    float: none !important;
    clear: both !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    justify-content: center !important;
    max-width: 100% !important;
  }
  body .dnj-page-shell .wp-block-image img,
  body .dnj-page-shell .wp-block-gallery img,
  body .dnj-page-shell .wp-block-media-text__media img,
  body .dnj-page-shell .dnj-v10-project-grid > img {
    display: block !important;
    float: none !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body .dnj-page-shell :is(.dnj-card,.dnj-v10-project) {
    box-sizing: border-box !important;
    width: min(100%, 850px) !important;
    max-width: 850px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }
  body .dnj-page-shell :is(.wp-block-buttons,.wp-block-social-links) {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    width: 100%;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 12px !important;
  }
  body .dnj-page-shell .wp-block-buttons > .wp-block-button { margin: 0 !important; max-width: 100% !important; }
  /* Gutenberg's Grid block stays a grid of cards. Center the card contents,
     but don't collapse multi-item galleries or slideshow tracks. */
  body .dnj-page-shell .dnj-grid { margin-left: auto !important; margin-right: auto !important; }
  body .dnj-page-shell .dnj-grid > .wp-block-column { margin-inline: auto !important; }
  body .dnj-page-shell .dnj-grid .dnj-card { text-align: center !important; }

  /* Footer has one centered flow at split-screen widths rather than three
     very narrow columns. Header mobile menu remains independently functional. */
  body .dnj-footer .dnj-footer-inner { padding: 52px clamp(18px, 5vw, 40px) 36px !important; }
  body .dnj-footer .dnj-footer-columns {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: center !important;
    align-items: start !important;
    gap: 34px !important;
    width: 100% !important;
    max-width: 620px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body .dnj-footer .dnj-footer-columns > .wp-block-column {
    width: 100% !important;
    max-width: 560px !important;
    margin-inline: auto !important;
    text-align: center !important;
  }
  body .dnj-footer .dnj-footer-heading { margin-bottom: 14px; }
  body .dnj-footer .dnj-footer-description { margin-top: 12px; }
  body .dnj-footer .dnj-footer-bottom { margin-top: 36px; }
}
@media (max-width: 600px) {
  body .dnj-page-shell > :is(h1,h2,h3,p),
  body .dnj-page-shell .wp-block-post-content > :is(h1,h2,h3,p) {
    max-width: 100% !important;
  }
  body .dnj-page-shell .wp-block-buttons:not(.is-content-justification-space-between) {
    flex-direction: column !important;
    gap: 12px !important;
  }
  body .dnj-page-shell .wp-block-button { width: min(100%, 320px) !important; }
  body .dnj-page-shell .wp-block-button__link {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    overflow-wrap: break-word;
  }
  body .dnj-page-shell .dnj-card { padding: clamp(18px, 5vw, 26px) !important; }
  body .dnj-footer .dnj-footer-inner { padding-inline: 20px !important; }
}
/* Forms are kept readable and usable: inputs and their labels stay left-aligned,
   even though the section heading and the form container are centered. */
@media (max-width: 1120px) {
  body .dnj-page-shell :is(.dnj-contact-form,form.wpforms-form,.wp-block-search,form) {
    box-sizing: border-box;
    max-width: 700px;
    margin-inline: auto;
  }
  body .dnj-page-shell form :is(label,input,select,textarea),
  body .dnj-page-shell .dnj-contact-form :is(label,input,select,textarea) {
    text-align: left !important;
  }
}

/* Keep TV/Films posters at their intentional thumbnail size instead of letting
   generic responsive-media rules enlarge them to a full-width landscape. */
@media (max-width: 1120px) {
  body .dnj-page-shell .dnj-v10-project-grid > img {
    width: auto !important;
    max-width: min(100%, 350px) !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

/* When a three-item card collection wraps into two columns, center its final
   card instead of leaving a lone card aligned with the left column. */
@media (min-width: 601px) and (max-width: 1120px) {
  body .dnj-page-shell .dnj-grid:has(> .wp-block-column:nth-child(3):last-child) > .wp-block-column:last-child {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
    width: min(100%, 365px) !important;
    margin-inline: auto !important;
  }
}
