/* Responsive layout overrides for the legacy 960px theme grid. */
html,
body {
  min-width: 0;
  width: 100%;
  overflow-x: clip;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
}

.container_12 {
  width: min(961px, calc(100% - 32px)) !important;
  max-width: 100%;
}

.container_12 .grid_1  { width: calc(8.333333% - 20px) !important; }
.container_12 .grid_2  { width: calc(16.666667% - 20px) !important; }
.container_12 .grid_3  { width: calc(25% - 20px) !important; }
.container_12 .grid_4  { width: calc(33.333333% - 20px) !important; }
.container_12 .grid_5  { width: calc(41.666667% - 20px) !important; }
.container_12 .grid_6  { width: calc(50% - 20px) !important; }
.container_12 .grid_7  { width: calc(58.333333% - 20px) !important; }
.container_12 .grid_8  { width: calc(66.666667% - 20px) !important; }
.container_12 .grid_9  { width: calc(75% - 20px) !important; }
.container_12 .grid_10 { width: calc(83.333333% - 20px) !important; }
.container_12 .grid_11 { width: calc(91.666667% - 20px) !important; }
.container_12 .grid_12 { width: calc(100% - 20px) !important; }

#main {
  width: 100%;
  overflow-x: clip;
}

/* Make the homepage hero span the viewport instead of the old 940px grid. */
#slider-wrapper {
  width: 100%;
  height: auto;
  margin-bottom: 26px;
  overflow: hidden;
}

#slider-wrapper .container_12,
#slider-wrapper .grid_12 {
  width: 100% !important;
  max-width: none;
  margin: 0;
  padding: 0;
  float: none;
  overflow: visible;
}

#slider {
  --hero-height: clamp(360px, 38vw, 560px);
  float: none;
  width: 100% !important;
  height: var(--hero-height) !important;
  max-width: 100%;
  overflow: hidden;
  background-size: 100vw var(--hero-height) !important;
  background-position: left top !important;
}

#slider img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

/* Nivo 2.5 creates each transition slice at the source image dimensions. */
#slider .nivo-slice,
#slider .nivo-box {
  background-size: 100vw var(--hero-height) !important;
}

.nivo-caption {
  left: 0 !important;
  bottom: 0 !important;
  width: min(420px, 34%) !important;
  height: 100% !important;
  overflow: auto;
}

.nivo-caption .nivo-caption-inner {
  padding: clamp(24px, 4vw, 58px);
}

/* Keep footer widget columns aligned with the 12-column grid. */
#first-footer,
#second-footer {
  min-width: 0;
}

#first-footer > .grid_2 {
  min-width: 0;
  width: calc(22.222222% - 20px) !important;
}

#widget-footer ul,
#copyright ul {
  overflow-wrap: anywhere;
}

#copyright nav.footer {
  float: none !important;
  display: block;
  clear: both;
  width: 100%;
}

#copyright nav.footer > div.footer-nav {
  display: block;
  width: 100%;
}

#copyright nav.footer > div.footer-nav > ul,
#copyright nav.footer > ul,
#copyright nav.footer > ul.footer-nav {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 32px;
  margin: 0 0 24px;
  padding: 0;
}

#copyright nav.footer > div.footer-nav > ul > li,
#copyright nav.footer > ul > li {
  float: none;
  padding: 0;
  min-width: 0;
}

#copyright nav.footer ul ul {
  margin: 8px 0 0;
  padding-left: 14px;
}

#copyright nav.footer ul ul li {
  float: none;
  padding: 3px 0;
}

@media (min-width: 768px) and (max-width: 1000px) {
  #first-footer > .grid_2 {
    width: calc(50% - 20px) !important;
  }
}

@media (max-width: 1000px) {
  .sf-menu {
    display: flex;
    width: 100%;
  }

  .sf-menu > li {
    float: none;
    flex: 1 1 16.6667%;
    min-width: 0;
    margin: 0;
  }

  .sf-menu > li > a {
    width: 100%;
    padding-left: 5px;
    padding-right: 5px;
    font-size: clamp(13px, 1.7vw, 18px);
    white-space: normal;
  }

  /* Convert the fixed side-by-side Nivo slider and caption into a fluid banner. */
  #slider-wrapper {
    height: auto;
    margin-bottom: 20px;
  }

  #slider-wrapper .container_12,
  #slider-wrapper .grid_12 {
    width: 100% !important;
    max-width: none;
    margin: 0;
    float: none;
  }

  #slider {
    --hero-height: clamp(300px, 54vw, 500px);
    float: none;
    width: 100% !important;
    height: var(--hero-height) !important;
    aspect-ratio: auto;
    overflow: hidden;
    background-size: 100vw var(--hero-height) !important;
  }

  #slider img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }

  .nivo-caption {
    left: 0 !important;
    bottom: 0 !important;
    width: 34% !important;
    height: 100% !important;
    overflow: auto;
  }

  .nivo-caption .nivo-caption-inner {
    padding: clamp(12px, 3vw, 32px);
  }

  .nivo-caption h2 {
    font-size: clamp(20px, 4vw, 36px);
    line-height: 1.1;
  }

  .nivo-caption h3 {
    font-size: clamp(14px, 2vw, 20px);
    line-height: 1.25;
    margin-bottom: 12px;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 16px;
    line-height: 1.5;
  }

  .container_12 {
    width: calc(100% - 28px) !important;
  }

  .container_12 .grid_1,
  .container_12 .grid_2,
  .container_12 .grid_3,
  .container_12 .grid_4,
  .container_12 .grid_5,
  .container_12 .grid_6,
  .container_12 .grid_7,
  .container_12 .grid_8,
  .container_12 .grid_9,
  .container_12 .grid_10,
  .container_12 .grid_11,
  .container_12 .grid_12 {
    float: none;
    display: block;
    clear: both;
    width: calc(100% - 20px) !important;
    margin-left: 10px;
    margin-right: 10px;
    left: auto;
    right: auto;
    padding-left: 0;
    padding-right: 0;
  }

  #header {
    height: auto;
    min-height: 0;
    padding-bottom: 16px;
  }

  #header .container_12 {
    padding-top: 16px;
  }

  #header .logo {
    position: static;
    width: 100%;
    margin: 0 auto 12px;
    text-align: center;
  }

  #header #logo img {
    display: inline-block;
    width: auto;
    height: auto;
    max-width: min(100%, 350px);
    max-height: 100px;
  }

  #top-search {
    position: relative;
    inset: auto;
    width: min(100%, 320px);
    margin: 0 auto;
  }

  #top-search form,
  #top-search .input-search {
    max-width: calc(100% - 36px);
  }

  nav.primary {
    height: auto;
    min-height: 0;
    margin-bottom: 18px;
    background-size: auto 100%;
  }

  nav.primary .container_12,
  nav.primary .grid_12 {
    width: calc(100% - 12px) !important;
    margin-left: auto;
    margin-right: auto;
  }

  .sf-menu {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
  }

  .sf-menu > li {
    float: none;
    flex: 0 0 50%;
    width: 50%;
    margin: 0;
  }

  .sf-menu > li > a {
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 12px 8px;
    font-size: 16px;
    line-height: 1.25;
    white-space: normal;
  }

  .sf-menu ul {
    top: -999em !important;
    left: 0 !important;
    width: 100%;
  }

  .sf-menu li:hover > ul,
  .sf-menu li.sfHover > ul,
  .sf-menu li:focus-within > ul {
    top: 100% !important;
    left: 0 !important;
    width: 100%;
  }

  .sf-menu li li a {
    padding: 10px 12px;
    line-height: 1.3;
  }

  .primary_content_wrap {
    padding-bottom: 28px;
  }

  #content,
  #sidebar {
    padding-top: 20px;
  }

  #content .indent {
    padding: 0;
  }

  #content.left {
    float: none !important;
  }

  .featured-thumbnail,
  .featured-thumbnail img,
  article .post-content img {
    width: auto;
    max-width: 100%;
    height: auto;
  }

  figure {
    max-width: 100%;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .content-box,
  .tabs .tab,
  .toggle .box {
    padding: 16px;
  }

  .toggle,
  .audiojs,
  .video-bg {
    max-width: 100%;
  }

  /* On phones, use a full-width image with a readable caption overlay. */
  #slider-wrapper .container_12,
  #slider-wrapper .grid_12 {
    width: 100% !important;
  }

  #slider {
    --hero-height: clamp(240px, 68vw, 380px);
    height: var(--hero-height) !important;
    aspect-ratio: auto;
    background-size: 100vw var(--hero-height) !important;
  }

  .nivo-caption {
    width: 100% !important;
    height: auto !important;
    max-height: 48%;
    padding: 0;
  }

  .nivo-caption .nivo-caption-inner {
    padding: 10px 12px;
  }

  .nivo-caption h2 {
    font-size: clamp(18px, 5.5vw, 25px);
    line-height: 1.1;
    margin-bottom: 5px;
  }

  .nivo-caption h3 {
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 6px;
  }

  .nivo-controlNav {
    top: 8px;
    right: 8px;
  }

  #widget-footer {
    padding: 32px 0;
  }

  #first-footer > .grid_2 {
    display: inline-block;
    vertical-align: top;
    float: left;
    clear: none;
    width: calc(50% - 20px) !important;
  }

  #second-footer {
    padding-top: 24px;
  }

  #copyright {
    padding: 22px 0;
  }

  #copyright nav.footer > div.footer-nav > ul,
  #copyright nav.footer > ul,
  #copyright nav.footer > ul.footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  nav.footer {
    float: none;
    width: 100%;
  }

  #copyright nav.footer > div.footer-nav > ul > li,
  #copyright nav.footer > ul > li {
    float: none;
    padding: 0;
  }

  #copyright nav.footer ul ul li {
    float: none;
    padding: 4px 0;
  }

  h1 {
    font-size: clamp(26px, 7vw, 36px);
    line-height: 1.15;
  }

  h2 {
    font-size: clamp(22px, 6vw, 30px);
    line-height: 1.2;
  }
}

@media (max-width: 420px) {
  #first-footer > .grid_2 {
    width: calc(100% - 20px) !important;
  }

  #copyright nav.footer > div.footer-nav > ul,
  #copyright nav.footer > ul,
  #copyright nav.footer > ul.footer-nav {
    grid-template-columns: 1fr;
  }

  .nivo-caption {
    max-height: 55%;
  }

  .nivo-caption p {
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.25;
  }
}

@media (max-width: 767px) {
  /* Prevent fixed-size portfolio and service cards from widening the page. */
  #gallery .portfolio li,
  .recent-posts.clients li,
  .recent-posts.services li,
  .recent-posts.services-overview li,
  .recent-posts.partners li {
    float: none;
    display: block;
    width: 100% !important;
    height: auto;
    margin: 0 0 18px;
    padding: 14px;
  }

  #gallery .portfolio li a.image-wrap,
  .recent-posts.clients li .thumb-wrap,
  #gallery .portfolio li a.image-wrap img,
  .recent-posts.clients li img,
  .recent-posts.services li img,
  .recent-posts.services-overview li img,
  .recent-posts.partners li img {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  #gallery .portfolio li a.image-wrap {
    aspect-ratio: 4 / 3;
  }

  #gallery .portfolio li a.image-wrap img {
    height: 100%;
    object-fit: cover;
  }

  .recent-posts.clients li .thumb-wrap {
    float: none;
  }

  .recent-posts li img.thumb,
  .post_list li img {
    float: none;
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 0 12px;
  }

  #map,
  #map iframe,
  .wpcf7-form textarea,
  .wpcf7-form p.field input,
  #commentform input[type="text"],
  #commentform textarea,
  #searchform .searching,
  #sidebar #searchform .searching {
    width: 100%;
    max-width: 100%;
  }

  .wpcf7-form p.field label {
    float: none;
    display: block;
    width: auto;
  }

  .wpcf7-form p.field input,
  .wpcf7-form textarea {
    float: none;
    display: block;
  }

  .wpcf7-not-valid-tip {
    width: 100% !important;
  }

  .audiojs {
    width: 100%;
  }

  .one_half,
  .one_third,
  .two_third,
  .three_fourth,
  .one_fourth,
  .one_fifth,
  .two_fifth,
  .three_fifth,
  .four_fifth,
  .one_sixth,
  .five_sixth {
    float: none;
    width: 100%;
    margin-right: 0;
  }
}
