/**
 * Data Center West responsive overlay for Artisteer chrome.
 * Desktop (>=1000px) stays on Artisteer defaults. Fluid rules only below that.
 * Brand accents: #8d070e / #AA0911 / #9B0810
 */

/* Prevent mobile browsers from auto-shrinking text / layout */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Allow phones to shrink; harmless on desktop when viewport is wide */
html,
body,
#art-main,
#art-page-background-glare,
#art-page-background-glare-image,
#art-page-background-gradient,
#art-page-background-gradient-bottom,
#art-page-background-top-texture,
#art-page-background-middle-texture,
#art-page-background-bottom-texture,
#art-page-background-glare-wrapper {
  min-width: 0 !important;
}

#art-main {
  width: 100% !important;
  max-width: 100% !important;
}

/* Hard-cap Artisteer fixed widths so Chrome won't shrink-to-fit a 1000px page */
.art-sheet {
  width: 100% !important;
  max-width: 1000px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Desktop slideshow: clip cycle slides; don't become a horizontal scroller */
@media (min-width: 1000px) {
  .slideshow {
    width: 720px !important;
    max-width: 720px !important;
    height: 258px !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .ssbutton {
    width: 73px !important;
    height: 20px !important;
    float: right !important;
    clear: both !important;
    text-align: right !important;
  }

  .ssbutton img {
    max-width: none !important;
    width: auto !important;
    height: auto !important;
  }
}

.blog-dcw-news,
.dcw-top-links,
.dcw-five-way-bar,
.dcw-footer-menu,
.dcw-slogan {
  max-width: 100% !important;
  box-sizing: border-box !important;
}


/* Tablet / phone: unlock fixed 1000px chrome */
@media (max-width: 999px) {
  .art-sheet,
  .art-nav,
  .art-nav-wrapper,
  .art-nav-outer,
  .art-nav-inner {
    width: 100% !important;
    max-width: 1000px;
    box-sizing: border-box;
  }

  .art-sheet {
    margin-left: auto !important;
    margin-right: auto !important;
    background-color: #ffffff !important;
    background-image: none !important;
    overflow: visible !important;
  }

  .art-sheet-body {
    background-color: #ffffff !important;
    background-image: none !important;
  }

  /* Hide Artisteer edge slices / pseudo borders that leave gray gutters */
  .art-sheet:before,
  .art-sheet:after,
  .art-sheet-body:before,
  .art-sheet-body:after,
  .art-sheet-tl,
  .art-sheet-tr,
  .art-sheet-bl,
  .art-sheet-br,
  .art-sheet-tc,
  .art-sheet-bc,
  .art-sheet-cl,
  .art-sheet-cr {
    display: none !important;
  }

  .art-footer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    background-image: none !important;
  }

  .art-footer:before,
  .art-footer:after,
  .art-footer-body:before,
  .art-footer-body:after {
    display: none !important;
  }

  .art-footer-body,
  .art-footer-text {
    max-width: 100%;
    box-sizing: border-box;
  }

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

  /* Prev/next controls are tiny PNGs — don't let the rule above squash them */
  .ssbutton img,
  .ssbutton .prev img,
  .ssbutton .next img {
    max-width: none !important;
    width: auto !important;
    height: auto !important;
  }

  .art-content table,
  .art-postcontent table,
  .art-blockcontent table,
  .art-layout-cell table {
    max-width: 100%;
  }

  /* Tablet: keep slideshow, compress to content width (desktop is 720×258) */
  .slideshow {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 720 / 258;
    box-sizing: border-box !important;
    float: none !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .slideshow ul {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    left: 0 !important;
  }

  .slideshow li,
  .slideshow li a {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
  }

  .slideshow img {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
  }

  .ssbutton {
    clear: both !important;
    float: right !important;
    width: 73px !important;
    height: 20px !important;
    margin: -36px 6px 0 0 !important;
    padding: 0 !important;
    text-align: right !important;
    position: relative !important;
    z-index: 200 !important;
    background: transparent !important;
  }

  .ssbutton a {
    display: inline-block !important;
    vertical-align: middle;
  }

  .dcw-top-links {
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    text-align: right;
    top: 8px !important;
    margin: 0 10px 0 0;
    box-sizing: border-box;
  }

  .dcw-top-right {
    float: none !important;
    width: auto !important;
    max-width: 100%;
  }

  .dcw-logo {
    max-width: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    box-sizing: border-box;
  }

  .dcw-slogan {
    max-width: 100%;
    box-sizing: border-box;
  }

  .dcw-footer-menu {
    float: none !important;
    width: auto !important;
    max-width: 100%;
    margin-bottom: 12px;
  }

  /* Homepage five-way bar is hard-coded 720px */
  .dcw-five-way-bar {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  .dcw-five-way-bar table {
    width: 100% !important;
    max-width: 100% !important;
  }

  #dcw-way-one,
  #dcw-way-two,
  #dcw-way-three,
  #dcw-way-four,
  #dcw-way-five {
    float: left !important;
    width: 20% !important;
    max-width: 20% !important;
    box-sizing: border-box !important;
    font-size: 0.85em;
  }

  .dcw-way-seperator {
    display: none !important;
  }

  .art-vmenublock {
    margin-left: 6px !important;
    margin-right: 6px !important;
  }

  /*
   * One page scroller only. Artisteer sets html/body height:100% and
   * html { overflow-y: scroll }; pairing that with overflow-y:auto on both
   * creates nested vertical scrollbars (especially on apps.portal-branded).
   */
  html {
    height: auto !important;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    height: auto !important;
    overflow-x: hidden;
    overflow-y: visible;
  }

  #art-main {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }
}

/* Apps (and any portal-branded twin): kill nested scrollers at all widths */
body.portal-branded html,
html:has(body.portal-branded) {
  height: auto !important;
  overflow-x: hidden;
  overflow-y: auto;
}

body.portal-branded {
  height: auto !important;
  overflow-x: hidden;
  overflow-y: visible;
}

body.portal-branded #art-main {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}

/*
 * Tablet: keep menu | content side-by-side so the slideshow sits
 * to the right of the Site Menu (not stacked under it).
 */
@media (max-width: 999px) and (min-width: 721px) {
  .art-content-layout {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
  }

  .art-content-layout-row {
    display: table-row !important;
  }

  .art-content-layout .art-sidebar1 {
    display: table-cell !important;
    width: 30% !important;
    max-width: 30% !important;
    vertical-align: top !important;
  }

  .art-content-layout .art-content {
    display: table-cell !important;
    width: 70% !important;
    max-width: 70% !important;
    vertical-align: top !important;
  }

  .art-vmenublock {
    margin: 12px 4px 8px 4px !important;
  }
}

/* Hamburger is phone-only */
#dcw-nav-toggle {
  display: none;
}

/* Phone: stack sidebar above content; scale logo; wrap top links */
@media (max-width: 720px) {
  #dcw-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: #8d070e;
    color: #ffffff;
    font: 600 16px/1.2 Arial, Helvetica, sans-serif;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  #dcw-nav-toggle .dcw-nav-toggle-icon {
    display: block;
    width: 22px;
    height: 16px;
    background:
      linear-gradient(#fff, #fff) 0 0 / 100% 2px no-repeat,
      linear-gradient(#fff, #fff) 0 7px / 100% 2px no-repeat,
      linear-gradient(#fff, #fff) 0 14px / 100% 2px no-repeat;
  }

  body.dcw-nav-open #dcw-nav-toggle .dcw-nav-toggle-icon {
    background:
      linear-gradient(#fff, #fff) center / 100% 2px no-repeat;
    transform: rotate(45deg);
    position: relative;
  }

  body.dcw-nav-open #dcw-nav-toggle .dcw-nav-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 7px;
    height: 2px;
    background: #fff;
    transform: rotate(90deg);
  }

  .art-content-layout,
  .art-content-layout-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .art-content-layout .art-layout-cell {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Content first when menu closed; sidebar only when open */
  .art-content-layout .art-sidebar1 {
    display: none !important;
    order: 1;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.dcw-nav-open .art-content-layout .art-sidebar1 {
    display: block !important;
  }

  .art-content-layout .art-sidebar2,
  .art-content-layout .art-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    order: 2;
  }

  .art-sheet {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .art-sheet-body,
  .art-content-layout,
  .art-post,
  .art-postcontent,
  .art-blockcontent,
  .art-layout-cell {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .art-content,
  .art-article {
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  /*
   * Wide data tables (colocation pricing, etc.): keep the page from
   * scrolling sideways, but let the table scroll inside the article.
   */
  .art-article,
  .art-postcontent,
  .art-post-inner {
    overflow-x: auto !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
  }

  .art-article table:not(:has(img[alt="Kerio Authorized Partner"])),
  .art-postcontent table:not(:has(img[alt="Kerio Authorized Partner"])),
  .art-blockcontent table {
    width: max-content !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  .art-article table:not(:has(img[alt="Kerio Authorized Partner"])) th,
  .art-article table:not(:has(img[alt="Kerio Authorized Partner"])) td,
  .art-postcontent table:not(:has(img[alt="Kerio Authorized Partner"])) th,
  .art-postcontent table:not(:has(img[alt="Kerio Authorized Partner"])) td {
    white-space: nowrap;
    font-size: 0.9em;
    padding: 6px 8px !important;
  }

  .dcw-banner,
  .art-nostyle.dcw-banner {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .dcw-top-links {
    float: none !important;
    display: block;
    width: auto !important;
    max-width: 100% !important;
    text-align: right;
    position: relative !important;
    top: 4px !important;
    margin: 4px 8px 0 0;
    padding: 0 8px;
    white-space: normal !important;
    line-height: 1.35;
    font-size: 0.95em;
    box-sizing: border-box;
  }

  .dcw-top-links p,
  .dcw-top-links span {
    margin: 0;
    white-space: normal !important;
  }

  /* Phone: drop slideshow (too tight); five-way goes with it */
  .slideshow,
  .dcw-banner .slideshow {
    display: none !important;
  }

  .dcw-five-way-bar {
    display: none !important;
  }

  /*
   * Home partner block: full-width copy first, Technology/Kerio images under it.
   * (Desktop keeps the two-column table: images | text.)
   */
  .art-article table:has(img[alt="Kerio Authorized Partner"]),
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) {
    width: 100% !important;
    max-width: 100% !important;
  }

  .art-article table:has(img[alt="Kerio Authorized Partner"]) tbody,
  .art-article table:has(img[alt="Kerio Authorized Partner"]) tr,
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) tbody,
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .art-article table:has(img[alt="Kerio Authorized Partner"]) td,
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) td {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Text column first (full width), images second */
  .art-article table:has(img[alt="Kerio Authorized Partner"]) td:last-child,
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) td:last-child {
    order: 1;
    text-align: left !important;
  }

  .art-article table:has(img[alt="Kerio Authorized Partner"]) td:last-child p,
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) td:last-child p {
    margin-left: 0 !important;
  }

  .art-article table:has(img[alt="Kerio Authorized Partner"]) td:first-child,
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) td:first-child {
    order: 2;
    text-align: center !important;
    padding-top: 12px !important;
  }

  .art-article table:has(img[alt="Kerio Authorized Partner"]) td:first-child img,
  .art-postcontent table:has(img[alt="Kerio Authorized Partner"]) td:first-child img {
    display: block !important;
    margin: 8px auto !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
  }

  .dcw-logged-in {
    float: none !important;
    display: block;
    clear: both;
    margin: 4px 8px 0 0 !important;
    text-align: right;
  }

  /* Logo left; background image scales (no <img>) */
  .dcw-logo {
    float: none !important;
    display: block;
    width: 220px !important;
    max-width: 70% !important;
    height: 40px !important;
    margin: 10px 8px 6px 10px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
  }

  .dcw-slogan {
    display: none !important;
  }

  .dcw-footer-menu {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center;
    margin-bottom: 12px;
  }

  .art-footer-text {
    overflow-wrap: anywhere;
    word-wrap: break-word;
  }

  /* Vmenu: larger phone tap targets without stretching Artisteer sprites */
  .art-vmenublock {
    margin: 10px 4px !important;
  }

  .art-vmenublockheader {
    min-height: 32px !important;
    line-height: 32px !important;
  }

  .art-vmenublockheader .t {
    font-size: 1.15em !important;
  }

  ul.art-vmenu {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Drop 20px sprite chrome — it becomes grey bars when height grows */
  ul.art-vmenu > li > a:before,
  ul.art-vmenu > li > a:after,
  ul.art-vmenu a .l,
  ul.art-vmenu a .r {
    display: none !important;
  }

  ul.art-vmenu > li > a,
  ul.art-vmenu ul a {
    display: block !important;
    max-width: 100%;
    box-sizing: border-box !important;
    font-size: 16px !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.35 !important;
    padding: 10px 12px !important;
    white-space: normal !important;
    background-image: none !important;
    background-color: transparent !important;
    overflow: visible !important;
  }

  ul.art-vmenu > li > a.active,
  ul.art-vmenu > li > a:hover {
    background-color: #e8dadb !important;
  }

  ul.art-vmenu ul a {
    padding-left: 28px !important;
  }

  /* script.js injects these; hide so they don't paint grey bars */
  ul.art-vmenu .art-vmenu-separator,
  ul.art-vmenu .art-vmenu-separator-bg {
    display: none !important;
  }

  div.r-pad-1 {
    width: auto !important;
    max-width: 100%;
  }

  div.cell-1 {
    float: none !important;
    display: block;
    padding-left: 0 !important;
    margin-bottom: 8px;
  }

  /* Apps portal title stays readable in content column */
  body.portal-branded .art-postheader {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-wrap: break-word;
  }

  body.portal-branded .portal-main > h1,
  body.portal-branded .portal-content h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
