/* Preserve the existing desktop theme; adapt its fixed-width layout on smaller screens. */
@media screen and (max-width: 1023px) {
  html, body { width: 100%; min-width: 0 !important; }
  body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  #bg, #home-bg, #wrapper { width: 100% !important; min-width: 0 !important; }
  #bg, #home-bg { overflow: visible; }
  .top-cont, .foot-cont { box-sizing: border-box; width: 100% !important; min-width: 0; }

  #header { box-sizing: border-box; width: calc(100% - 32px) !important; min-height: 0 !important; padding: 16px 0 0 !important; }
  #header .logo { display: block; float: none; width: fit-content; max-width: 100%; margin: 0 !important; }
  #header .logo img { display: block; max-width: 100%; height: auto; }
  #header nav { box-sizing: border-box; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); float: none; width: 100% !important; height: auto !important; margin: 15px 0 22px; overflow: hidden; border-radius: 3px; background: linear-gradient(#f5f5f5, #cecece); }
  #header #nav { display: contents; width: auto !important; margin: 0; padding: 0; }
  #header #nav > li { box-sizing: border-box; float: none; width: 100%; margin: 0; padding: 0; background: none; text-align: left; }
  #header #nav > li > a { box-sizing: border-box; display: flex; align-items: center; min-height: 44px; margin: 0; padding: 8px 12px; border-right: 1px solid #b8b8b8; border-bottom: 1px solid #b8b8b8; background: transparent; font-size: 13px; line-height: 1.25; }
  #header #nav > li > a.act { color: #0879c0; }
  #header .soc-ico { box-sizing: border-box; display: flex; align-items: center; justify-content: center; float: none; width: auto; max-width: none !important; height: 44px; margin: 0; padding: 0; overflow: visible; border-bottom: 1px solid #b8b8b8; }
  #header .soc-ico li { float: none; }
  #header .soc-ico li a { box-sizing: content-box; display: block; position: relative; float: none; width: 44px; height: 44px; margin: 0; background: none !important; }
  #header .soc-ico li a::before { position: absolute; top: 14px; left: 13px; width: 18px; height: 17px; content: ""; background-repeat: no-repeat; background-position: 0 0; }
  #header .soc-ico li a.linkedin::before { background-image: url('/wp-content/themes/dt-cardamon/images/soc-ico/linkedin.png'); }
  #header .soc-ico li a.youtube::before { background-image: url('/wp-content/themes/dt-cardamon/images/soc-ico/YouTube.png'); }

  #slide { box-sizing: border-box; width: calc(100% - 32px) !important; margin: 0 auto; }
  #slide .slider-wrapper { box-sizing: border-box; width: 100% !important; max-width: 100%; }
  #slide #slider { box-sizing: border-box; width: 100% !important; min-height: 0 !important; height: auto !important; aspect-ratio: 950 / 420; margin: 0 !important; overflow: hidden; background-size: 100% 100% !important; }
  #slide #slider img { max-width: 100%; height: auto !important; }
  #slide #slider .nivo-box, #slide #slider .nivo-slice { background-size: calc(100vw - 32px) auto !important; }
  #slide .nivo-caption { box-sizing: border-box; left: 10px; bottom: 10px; width: auto; max-width: calc(100% - 20px); }
  #slider .caption-head { max-width: 100%; padding: 6px 9px !important; font-size: 14px !important; line-height: 1.25; }
  #slide .mask, #slide .grid { display: none !important; }
  #home-bg .navig-nivo, #home-bg .navig-nivo.small, #home-bg .navig-nivo.small.big-slider { box-sizing: border-box; left: auto; top: calc(22.105vw - 27.07px); width: calc(100% - 32px); min-width: 0; max-width: none; margin: 0 auto; }
  #home-bg .navig-nivo .nivo-prevNav, #home-bg .navig-nivo .nivo-nextNav { width: 44px !important; height: 44px; margin: 0 !important; background-position: center top; background-color: rgba(0, 0, 0, .35); }

  #container, #container.full-width { box-sizing: border-box; display: block; float: none; width: auto !important; min-width: 0; min-height: 0 !important; margin: 12px 16px 25px !important; padding: 0 !important; letter-spacing: normal; }
  #container > *, .foot-cont > * { font-size: 15px; line-height: 1.6; letter-spacing: normal; }
  #container > div, #container > section, #container > aside { box-sizing: border-box; display: block !important; width: auto; max-width: 100%; margin-right: 0 !important; margin-left: 0 !important; }
  #container > p, #container > a, #container > span, #container > img { margin-right: 0 !important; margin-left: 0 !important; }
  #container > h1, #container > h2, #container > h3, #container > h4 { margin-right: 0 !important; margin-left: 0 !important; }
  #container h1, #container h2, #container h3, #container h4 { max-width: 100% !important; overflow-wrap: anywhere; overflow-x: clip; overflow-y: visible; }
  #container .entry-content, #container .entry-meta, #container .item-blog, #container .full-width, #container .half, #container .full, #container .two-thirds, #container .one-third, #container .one-fourth, #container .three-fourth { box-sizing: border-box; width: 100% !important; max-width: 100%; float: none !important; }
  #container .full-width { margin-right: 0 !important; margin-left: 0 !important; }
  #container img { max-width: 100% !important; height: auto !important; }
  #container .wp-caption { box-sizing: border-box; max-width: 100% !important; height: auto !important; margin: 5px auto 15px !important; float: none !important; }
  #container table { box-sizing: border-box; width: 100% !important; max-width: 100%; table-layout: fixed; }
  #container table td, #container table th { box-sizing: border-box; width: auto !important; max-width: 100%; overflow-wrap: anywhere; }
  #home-bg #container table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #home-bg #container table td:empty { display: none; }
  #home-bg #container table td img { width: 100%; }
  #bg #container.full-width > table, #bg #container.full-width > table > tbody, #bg #container.full-width > table > tbody > tr, #bg #container.full-width > table > tbody > tr > td { display: block; width: 100% !important; }
  #container .videos { box-sizing: border-box; position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; }
  #container .videos iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
  #container .gallery, #container .gall_std { box-sizing: border-box; display: grid !important; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; width: 100% !important; margin: 12px 0 !important; padding: 0; list-style: none; }
  #container .gallery li, #container .gall_std li { box-sizing: border-box; float: none !important; width: auto !important; margin: 0 !important; }
  #container .gallery img, #container .gall_std img { display: block; width: 100% !important; height: auto !important; aspect-ratio: 1; object-fit: cover; }

  #aside, #aside.left, #aside.right { box-sizing: border-box; display: block; clear: both; float: none; width: auto !important; margin: 20px 16px 28px !important; }
  #aside .widget, #aside .post { box-sizing: border-box; float: none; width: 100%; max-width: 100%; }
  .page-id-1069 #wrapper { display: flex; flex-direction: column; }
  .page-id-1069 #header { order: -2; }
  .page-id-1069 #aside { order: -1; margin: 0 16px 5px !important; }
  .page-id-1069 #aside .levels-summary li { margin-bottom: 0 !important; background-position: 0 center; }
  .page-id-1069 #aside .levels-summary a { display: flex; align-items: center; min-height: 44px; }
  .bottom-cont { box-sizing: border-box; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 15px; width: calc(100% - 32px); height: auto; min-height: 63px; padding: 10px 0; line-height: 1.4; overflow: visible; }
  .bottom-cont span, .bottom-cont .logo-down { float: none !important; width: auto; height: auto; line-height: 1.4; }
}
