/* ============================================================
   Tablet and small-screen fixes (2026-11-05). CSS only, no text changed.
   Remove this file's <link> in includes/header.php to go back.
=============================================================*/

/* ---------- Space between the banner and the first content ---------- */
@media (max-width: 1040px) {
  html body.page-id-363 #site #content-body .content-body-inner.wrap,
  html body.page-id-1606 #site #content-body .content-body-inner.wrap,
  html body.page-id-1851 #site #content-body .content-body-inner.wrap,
  html body.page-id-3 #site #content-body .content-body-inner.wrap,
  html body.page-id-3436 #site #content-body .content-body-inner.wrap,
  html body.page-id-142 #site #content-body .content-body-inner.wrap,
  html body.blog #site #content-body .content-body-inner.wrap { padding-top: 48px !important; }
}

/* ---------- Home: Featured Case Study stacks, image first ---------- */
@media (max-width: 1040px) {
  html body.home #site .ems-case > .row-inner { display: block !important; }
  html body.home #site .ems-case > .row-inner > .vc_column_container { display: block; width: 100% !important; max-width: none !important; aspect-ratio: auto !important; }
  html body.home #site .ems-case > .row-inner > .vc_column_container:first-child .vc_column-inner { height: auto; padding: 0 !important; }
  html body.home #site .ems-case > .row-inner > .vc_column_container:first-child .wpb_wrapper,
  html body.home #site .ems-case > .row-inner > .vc_column_container:first-child .wpb_single_image,
  html body.home #site .ems-case > .row-inner > .vc_column_container:first-child .vc_figure,
  html body.home #site .ems-case > .row-inner > .vc_column_container:first-child .vc_single_image-wrapper { display: block; width: 100%; height: auto; margin: 0; }
  html body.home #site .ems-case > .row-inner > .vc_column_container:first-child img { position: static; display: block; width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; object-fit: cover; }
  html body.home #site .ems-case > .row-inner > .vc_column_container:last-child > .vc_column-inner { width: 100% !important; height: auto; min-height: 0 !important; margin: 0 !important; padding: 40px !important; box-sizing: border-box; }
}
@media (max-width: 767px) {
  html body.home #site .ems-case > .row-inner > .vc_column_container:last-child > .vc_column-inner { padding: 28px 20px !important; }
}

/* ---------- Home: hero badge stays inside the frame ---------- */
@media (min-width: 779px) and (max-width: 1024px) { html body.home #site .ems-hero { --bx: 735; } }
@media (min-width: 481px) and (max-width: 778px) { html body.home #site .ems-hero { --bx: 560; } }
@media (max-width: 480px) { html body.home #site .ems-hero { --bx: 340; } }

/* ---------- Careers and Core Values: three-column lists no longer touch ---------- */
@media (min-width: 600px) and (max-width: 1040px) {
  html body.page-id-1734 #site .iconlist.iconlist-icon-large.columns-3,
  html body.page-id-486 #site .iconlist.iconlist-icon-large.columns-3 {
    display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box;
  }
  html body.page-id-1734 #site .iconlist.iconlist-icon-large.columns-3 > li,
  html body.page-id-486 #site .iconlist.iconlist-icon-large.columns-3 > li { width: auto !important; max-width: none !important; min-width: 0; flex: none !important; margin: 0 !important; padding-left: 0 !important; padding-right: 0 !important; box-sizing: border-box; }
  html body.page-id-1734 #site .iconlist.iconlist-icon-large.columns-3 > li::after,
  html body.page-id-486 #site .iconlist.iconlist-icon-large.columns-3 > li::after { display: none !important; }
  html body.page-id-1734 #site .iconlist.iconlist-icon-large.columns-3 p,
  html body.page-id-486 #site .iconlist.iconlist-icon-large.columns-3 p { text-align: left !important; }
  html body.page-id-1734 #site .iconlist.iconlist-icon-large.columns-3 h3 { overflow-wrap: anywhere; }
}
/* Narrow tablets: three columns would be too tight, so one column */
@media (min-width: 600px) and (max-width: 899px) {
  html body.page-id-1734 #site .iconlist.iconlist-icon-large.columns-3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Core Values and Why Choose Us: icon lists fit the page ---------- */
@media (min-width: 600px) and (max-width: 1040px) {
  html body.page-id-486 #site .iconlist.iconlist-icon-small,
  html body.page-id-776 #site .iconlist.iconlist-icon-small {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; width: 100% !important; max-width: 100% !important; margin: 0 !important; box-sizing: border-box;
  }
  html body.page-id-486 #site .iconlist.iconlist-icon-small > li,
  html body.page-id-776 #site .iconlist.iconlist-icon-small > li { position: relative; width: auto !important; max-width: none !important; min-width: 0; flex: none !important; margin: 0 !important; padding: 0 0 0 56px !important; box-sizing: border-box; }
  html body.page-id-486 #site .iconlist.iconlist-icon-small > li .iconlist-item-icon,
  html body.page-id-776 #site .iconlist.iconlist-icon-small > li .iconlist-item-icon { left: 0 !important; }
  html body.page-id-486 #site .iconlist.iconlist-icon-small p,
  html body.page-id-776 #site .iconlist.iconlist-icon-small p { text-align: left !important; }
  html body.page-id-486 #site .iconlist.iconlist-icon-small h3,
  html body.page-id-776 #site .iconlist.iconlist-icon-small h3 { overflow-wrap: anywhere; }
}

/* ---------- Clients: counter numbers and labels no longer collide ---------- */
@media (max-width: 1280px) {
  html body.page-id-1606 #site .counter { display: flex; align-items: center; gap: 16px; }
  html body.page-id-1606 #site .counter .counter-content { width: auto !important; flex: 0 0 auto; }
  html body.page-id-1606 #site .counter .counter-title { min-width: 0; }
}

/* ---------- Management: name list fills the content width ---------- */
@media (min-width: 600px) and (max-width: 1040px) {
  html body.page-id-363 #site .content .vc_section { margin: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
  html body.page-id-363 #site .content .vc_row { margin: 0 !important; }
  html body.page-id-363 #site .content .row-inner { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; gap: 40px; }
  html body.page-id-363 #site .content .row-inner > .wpb_column { width: auto !important; max-width: none !important; flex: 1 1 0 !important; min-width: 0; padding: 0 !important; }
  html body.page-id-363 #site .content .row-inner > .wpb_column:empty { display: none; }
  html body.page-id-363 #site .content .vc_column-inner { padding-left: 0 !important; padding-right: 0 !important; }
}

/* Management: names in two columns */
@media (min-width: 600px) and (max-width: 1040px) {
  html body.page-id-363 #site .content .row-inner { flex-wrap: wrap !important; gap: 0 40px; }
  html body.page-id-363 #site .content .row-inner > .wpb_column { flex: 1 1 calc(50% - 20px) !important; }
  html body.page-id-363 #site .content .row-inner > .wpb_column.vc_col-sm-12 { flex-basis: 100% !important; }
  html body.page-id-363 #site .content p.vc_custom_heading { margin-left: 0 !important; padding-left: 0 !important; text-align: left !important; }
}
/* Core Values: space under the lists */
@media (min-width: 600px) and (max-width: 1040px) {
  html body.page-id-486 #site .iconlist.iconlist-icon-large.columns-3 { margin-bottom: 40px !important; }
  html body.page-id-486 #site .iconlist.iconlist-icon-small { margin-bottom: 56px !important; }
}

/* Careers: How to apply box keeps its inner space */
@media (max-width: 1040px) {
  html body.page-id-1734 #site .content .vc_row[class*="vc_custom_161588914145"] { padding: 40px 36px !important; box-sizing: border-box; }
}
@media (max-width: 767px) {
  html body.page-id-1734 #site .content .vc_row[class*="vc_custom_161588914145"] { padding: 28px 22px !important; }
}

/* Home counters: the widest numbers fit next to the map on laptops and small desktops */
@media (min-width: 992px) and (max-width: 1319px) {
  html body.home #site .vc_custom_1712646913131 .counter { padding-left: 20px !important; padding-right: 16px !important; }
  html body.home #site .vc_custom_1712646913131 .counter-content { font-size: 50px !important; }
  html body.home #site .vc_custom_1712646913131 .counter-content .counter-suffix { font-size: 26px !important; }
  html body.home #site .vc_custom_1712646913131 .counter-title { font-size: 18px !important; }
}
@media (min-width: 992px) and (max-width: 1100px) {
  html body.home #site .vc_custom_1712646913131 .counter-content { font-size: 42px !important; }
  html body.home #site .vc_custom_1712646913131 .counter-content .counter-suffix { font-size: 22px !important; }
  html body.home #site .vc_custom_1712646913131 .counter-title { font-size: 16px !important; }
}

/* Careers: building graphic stands on the line, with clear space above it and below the line */
@media (max-width: 1040px) {
  html body.page-id-1734 #site .content .vc_custom_1750144600929 { padding-bottom: 0 !important; margin-bottom: 56px !important; background-position: right bottom !important; background-size: 220px auto !important; }
  html body.page-id-1734 #site .content .vc_custom_1750144600929 .vc_separator { margin: 161px 0 0 !important; }
  html body.page-id-1734 #site .content .vc_custom_1750144600929 .vc_separator ~ * { display: none !important; }
  html body.page-id-1734 #site .content .vc_custom_1750144600929 .row-inner,
  html body.page-id-1734 #site .content .vc_custom_1750144600929 .wpb_wrapper { margin-bottom: 0 !important; padding-bottom: 0 !important; }
}
@media (max-width: 767px) {
  html body.page-id-1734 #site .content .vc_custom_1750144600929 { margin-bottom: 40px !important; background-size: 170px auto !important; }
  html body.page-id-1734 #site .content .vc_custom_1750144600929 .vc_separator { margin-top: 124px !important; }
}

/* Health and Safety: every image full width at its own shape, text underneath */
@media (max-width: 1100px) {
  html body #site .ems-hs__split { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-left: 0; padding-right: 0; align-items: start; }
  html body #site .ems-hs__split-media img { display: block; width: 100%; height: auto; aspect-ratio: 510 / 226; object-fit: cover; }
  html body #site .ems-hs__cards { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-left: 0; padding-right: 0; }
  html body #site .ems-hs__card { display: block; }
  html body #site .ems-hs__card img { display: block; width: 100%; height: auto; aspect-ratio: 510 / 226; object-fit: cover; }
  html body #site .ems-hs__card-body { padding: 28px 32px 32px; }
  html body #site .ems-hs__card h3 { font-size: 24px; }
  html body #site .ems-hs__roles { gap: 20px; }
}
@media (max-width: 599px) {
  html body #site .ems-hs__roles { grid-template-columns: minmax(0, 1fr); }
  html body #site .ems-hs__card-body { padding: 24px 20px 26px; }
}
