/* -------------------------------------------------------------------------- */
/* Design Digital Studio – responsive layer for the original 960px layout.
/* Desktop (>= 1000px) is untouched; tablets get a fluid container; phones
/* (< 768px) get a stacked layout, menu toggle and a swipeable slider.
/* -------------------------------------------------------------------------- */

#mobile-nav-toggle {
  display: none;
}

img,
iframe {
  max-width: 100%;
}
img {
  height: auto;
}

.contacts-map .element-holder {
  display: block;
}
.contacts-map-frame {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
}

/* Tablet: fluid 960px containers ------------------------------------------- */
@media (max-width: 999px) {
  .container-block {
    min-width: 0;
  }
  .container-aligner,
  #page-subheader,
  #page-body-content-inner,
  #bottom-widgets .container-aligner,
  .gallery-filterable,
  .portfolio-filterable {
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
  }
  #page-subheader {
    margin-left: 20px;
    margin-right: 20px;
  }
  #page-body-content-inner,
  #bottom-widgets .container-aligner {
    padding-left: 20px;
    padding-right: 20px;
  }
  .page-sidebar-right #page-content {
    width: calc(100% - 340px);
  }
  .contacts-map .gmap-holder {
    width: 100%;
  }
}

/* Phone -------------------------------------------------------------------- */
@media (max-width: 767px) {
  body {
    -webkit-text-size-adjust: 100%;
    font-size: 14px;
    line-height: 22px;
  }

  /* Header + menu toggle */
  #page-header .container-inner {
    padding: 14px 0;
  }
  #page-header .container-aligner {
    min-height: 40px;
  }
  #header-logo {
    position: static;
    margin: 0 0 0 16px;
    line-height: 0;
  }
  #header-logo img {
    width: 210px;
    height: auto;
  }
  #mobile-nav-toggle {
    display: block;
    position: absolute;
    top: 0;
    right: 16px;
    width: 44px;
    height: 40px;
    margin-top: 0;
    padding: 10px 10px;
    border: 0;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
    cursor: pointer;
  }
  #mobile-nav-toggle span {
    display: block;
    height: 2px;
    margin: 0 0 6px;
    background: #dedede;
    transition: transform 0.2s, opacity 0.2s;
  }
  #mobile-nav-toggle span:last-of-type {
    margin-bottom: 0;
  }
  #mobile-nav-toggle em {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .mobile-nav-open #mobile-nav-toggle span:nth-of-type(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .mobile-nav-open #mobile-nav-toggle span:nth-of-type(2) {
    opacity: 0;
  }
  .mobile-nav-open #mobile-nav-toggle span:nth-of-type(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  #header-navigation-wrapper {
    display: none;
    float: none;
    clear: both;
    margin: 14px 0 -14px;
    padding: 6px 0;
    background: rgba(0, 0, 0, 0.55);
  }
  .mobile-nav-open #header-navigation-wrapper {
    display: block;
  }
  #header-navigation,
  #header-navigation > li {
    float: none;
    width: auto;
    height: auto;
    margin: 0;
  }
  #header-navigation > li > a,
  #header-navigation li a {
    display: block;
    padding: 12px 16px;
    line-height: 20px;
    height: auto;
    font-size: 15px;
  }
  #header-navigation ul,
  #header-navigation ul ul {
    position: static;
    display: block !important;
    width: auto;
    margin: 0;
    padding: 0 0 0 16px;
    box-shadow: none;
    background: none;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto;
  }
  #header-navigation ul li,
  #header-navigation ul li:first-child,
  #header-navigation ul li:last-child {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
  }

  /* Containers */
  #page-subheader {
    margin: 12px 16px;
  }
  #subheader-search-form #subheader-search {
    width: 110px;
  }
  #page-title {
    padding-left: 16px;
    padding-right: 16px;
  }
  #page-title .title-right {
    float: none;
    position: static;
    display: block;
    margin: 12px 0 0;
    height: auto;
  }
  #page-title .portfolio-filter a {
    display: inline-block;
    margin-bottom: 6px;
  }
  #page-title,
  #title-summary {
    float: none;
    height: auto;
    overflow: visible;
    margin-left: 0;
  }
  #page-title {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  #page-title:after {
    content: "";
    display: table;
    clear: both;
  }
  #page-body-content-inner,
  #bottom-widgets .container-aligner {
    padding-left: 16px;
    padding-right: 16px;
  }
  #page-body-content,
  .page-sidebar-right #page-body-content,
  .page-sidebar-left #page-body-content {
    background: none;
  }
  .page-sidebar-right #page-content,
  .page-sidebar-left #page-content,
  .page-sidebar,
  .page-sidebar-right .page-sidebar,
  .page-sidebar-left .page-sidebar {
    float: none;
    display: block;
    width: auto;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .page-sidebar {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .page-sidebar-right .widget-heading,
  .page-sidebar-right .widget-content,
  .page-sidebar-left .widget-heading,
  .page-sidebar-left .widget-content {
    margin-left: 0;
    margin-right: 0;
  }
  #page-body:after,
  .dark-skin.page-sidebar-right #page-body:after,
  .dark-skin.page-sidebar-left #page-body:after {
    background: #151515;
  }

  /* Grid: every column becomes full width */
  [class*="layout-"] {
    float: none !important;
    display: block;
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .featured-icon {
    float: left !important;
    width: 40px !important;
    margin-right: 12px !important;
  }
  .frontpage-featured h3.layout-5-6 {
    display: block;
    overflow: hidden;
    padding-top: 6px;
  }
  .frontpage-featured section {
    margin-bottom: 24px;
  }
  .frontpage-projects .element-holder {
    display: block;
    margin-bottom: 14px;
  }
  .frontpage-projects .element-holder img {
    width: 100%;
  }

  /* Call to action bar */
  #target-action {
    display: block;
    height: auto;
    margin: 0;
    padding: 6px 0;
    text-align: center;
  }
  #target-action .target-action-text {
    float: none;
    width: auto;
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 26px;
  }
  #target-action .btn-xl {
    float: none;
    display: inline-block;
    position: static;
    margin: 0;
  }

  /* Homepage slider: swipeable carousel (bxSlider runs on wider screens only) */
  #page-slider {
    margin: 20px 0 10px;
  }
  .slider-content .slider-inner {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .slider-content .slider-inner::-webkit-scrollbar {
    display: none;
  }
  .slider-content .slider-inner li,
  .slider-content li:first-child {
    display: block;
    flex: 0 0 100%;
    width: 100% !important;
    box-sizing: border-box;
    padding: 0 16px;
    scroll-snap-align: start;
    text-align: left;
    background: none;
  }
  .slider-content .slider-inner li.text-center {
    text-align: center;
  }
  .slider-dots {
    margin: 0;
    padding: 4px 0 0;
    text-align: center;
    line-height: 0;
  }
  .slider-dots button {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
  }
  .slider-dots button.is-active {
    background: #dedede;
  }
  .slide-text,
  .slide-element,
  .text-left .slide-text,
  .text-right .slide-text,
  .text-left .slide-element,
  .text-right .slide-element {
    float: none;
    width: auto;
    margin: 0 0 14px;
    padding: 0;
  }
  .slide-text h1 {
    font-size: 24px;
    line-height: 30px;
  }
  .slide-text h5 {
    font-size: 15px;
    line-height: 22px;
  }
  .slide-element img {
    width: 100%;
  }
  .slide-element iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .slide-caption-left,
  .slide-caption-right {
    display: block !important;
    position: static;
    width: auto;
    margin: 0;
  }

  /* Project pages: swipeable image strip */
  .gallery-fading ul {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0;
  }
  .gallery-fading li,
  .gallery-fading li:first-child {
    display: block;
    flex: 0 0 100%;
    scroll-snap-align: start;
  }
  .gallery-fading .slide-caption-left,
  .gallery-fading .slide-caption-right {
    padding: 12px 0;
    background: none;
  }

  /* Gallery: two columns */
  .gallery-filterable {
    margin: 0 -6px;
  }
  .gallery-item {
    width: calc(50% - 12px) !important;
    margin: 0 6px 12px !important;
  }
  .gallery-item img {
    width: 100%;
  }

  /* Blog */
  .post-header .post-header-comments {
    position: static;
    display: inline-block;
    margin-top: 6px;
  }
  .post-content .element-holder,
  .post-content iframe {
    max-width: 100%;
  }
  .post-content iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  /* Bottom widgets + footer */
  #bottom-widgets .layout-1-4 {
    margin-bottom: 20px;
  }
  #page-footer .container-aligner {
    padding: 0 16px;
  }
  #footer-left,
  #footer-right {
    float: none;
    text-align: center;
  }
  #footer-right .footer-navigation {
    float: none;
    display: inline-block;
    margin-top: 6px;
  }
}
