/*
 * Responsive layout (tablet + mobile)
 * Desktop (>= 1190px) stays unchanged.
 */

/* hamburger button - hidden on desktop */
.WEB #header_wrapper .nav_toggle{
  display: none;
}

@media (max-width: 1189px){
  html, body{
    min-width: 0;
    overflow-x: hidden;
  }
  .WEB #header_wrapper,
  .WEB #header_text,
  #signature{
    width: auto;
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }
  .WEB #header_text p{
    white-space: normal;
  }
  .WEB #header_text .kontakt{
    width: auto;
    max-width: 940px;
  }
  /* fixed widths set in the CMS (inline styles) */
  .WEB .wrapper .container_wrapper,
  .WEB #content .wrapper article.article_normal{
    max-width: 100%;
    box-sizing: border-box;
  }
  .WEB #content .wrapper article.article_normal{
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  /* container columns: fixed px widths from the CMS are converted to % in header.ips.js */
  .WEB .wrapper .container_wrapper .box{
    max-width: 100%;
  }
  .WEB #content .wrapper article .article_show_article h1,
  .WEB #content .wrapper article .article_show_article .text{
    width: auto;
    max-width: 718px;
    padding: 0 20px;
  }
  .WEB #content img,
  .WEB #content iframe,
  .WEB #content table{
    max-width: 100%;
  }
  .WEB #content img{
    height: auto !important;
  }
  .WEB .partner_items_grid{
    width: auto;
    max-width: 100%;
  }
  .WEB .container_wrapper .partner_items_grid .item{
    margin: 0 20px;
  }
  /* contact form */
  .WEB #content .contact_form{
    width: auto;
    max-width: 653px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }
  .WEB #content .contact_form table{
    width: 100%;
  }
  .WEB #content .contact_form textarea{
    width: 100%;
    box-sizing: border-box;
  }
  .cross{
    right: 20px;
  }
}

/* hamburger menu */
@media (max-width: 1023px){
  .WEB #header_wrapper{
    position: relative;
    z-index: 100;
  }
  .WEB #header_text{
    font-size: 44px;
  }
  .WEB #header_wrapper .nav_toggle{
    display: block;
    float: right;
    width: 44px;
    height: 44px;
    margin-top: 11px;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
  }
  .WEB #header_wrapper .nav_toggle span{
    display: block;
    height: 3px;
    margin-bottom: 5px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  .WEB #header_wrapper .nav_toggle span:last-child{
    margin-bottom: 0;
  }
  .WEB #header_wrapper.nav_open .nav_toggle span:nth-child(1){
    transform: translateY(8px) rotate(45deg);
  }
  .WEB #header_wrapper.nav_open .nav_toggle span:nth-child(2){
    opacity: 0;
  }
  .WEB #header_wrapper.nav_open .nav_toggle span:nth-child(3){
    transform: translateY(-8px) rotate(-45deg);
  }
  .WEB #header_wrapper nav{
    display: none;
    float: none;
    clear: both;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    background: rgba(44, 43, 45, 0.95);
    padding: 10px 0;
  }
  .WEB #header_wrapper.nav_open nav{
    display: block;
  }
  .WEB #header_wrapper nav .item{
    float: none;
    line-height: normal;
    padding: 0;
  }
  .WEB #header_wrapper nav .item a{
    display: block;
    padding: 12px 20px;
  }
  .WEB #header_wrapper nav .item.active a,
  .WEB #header_wrapper nav .item a:hover{
    border-bottom: 0;
    padding-bottom: 12px;
    background: rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 767px){
  /* header has min-height from the CMS (inline style, e.g. 694px) */
  .WEB header{
    min-height: 0 !important;
    padding-bottom: 60px;
  }
  .WEB #header_text{
    font-size: 32px;
    padding-top: 40px;
  }
  .WEB #header_text .kontakt .left,
  .WEB #header_text .kontakt .right{
    float: none;
    width: auto;
  }
  .WEB #header_text .kontakt .line{
    display: none;
  }
  /* container columns -> one column */
  .WEB .wrapper .container_wrapper .box{
    float: none;
    width: auto !important;
  }
  /* layout tables in articles (e.g. 3 icons in a row, labels in the next row) stay in columns, just narrower */
  .WEB #content .article_text table{
    width: 100% !important;
    table-layout: fixed;
  }
  .WEB #content .article_text td{
    width: auto !important;
    word-wrap: break-word;
  }
  /* other layout tables (icon | spacer | heading + list, text | logo, ...) -> one column,
     marked in header.ips.js (PSP_Web_Header.responsive_tables) */
  .WEB #content .article_text table.r_stack,
  .WEB #content .article_text table.r_stack > tbody,
  .WEB #content .article_text table.r_stack > tbody > tr,
  .WEB #content .article_text table.r_stack > tbody > tr > td{
    display: block;
    width: auto !important;
    height: auto !important;
  }
  .WEB #content .article_text table.r_stack > tbody > tr > td.r_empty{
    display: none;
  }
  .WEB #content .article_text table.r_stack > tbody > tr > td.r_image{
    text-align: center !important;
    padding-bottom: 15px;
  }
  .WEB #content .article_text table.r_stack > tbody > tr > td.r_image img{
    float: none !important;
    margin: 0 auto;
  }
  .WEB #content .article_text table.r_stack > tbody > tr > td.r_short,
  .WEB #content .article_text table.r_stack > tbody > tr > td.r_short *{
    text-align: center !important;
  }
  .WEB #content .article_text table.r_media > tbody > tr{
    display: flex;
    flex-direction: column;
  }
  .WEB #content .article_text table.r_media > tbody > tr > td.r_image{
    order: -1;
  }
  .WEB #content .article_text table.r_media{
    margin-bottom: 30px;
  }
  /* justified text makes big gaps on narrow screens */
  .WEB #content .article_text [style*="justify"],
  .WEB #content .article_show_article .text,
  .WEB #content .article_show_article .text [style*="justify"]{
    text-align: left !important;
  }
  .WEB .container_wrapper .partner_items_grid .item{
    margin: 0 10px;
  }
  .WEB #content .contact_form{
    padding-top: 50px;
    padding-bottom: 60px;
  }
  .WEB #content .contact_form h1{
    margin-bottom: 30px;
  }
  .WEB #content .contact_form table,
  .WEB #content .contact_form tbody,
  .WEB #content .contact_form tr,
  .WEB #content .contact_form td{
    display: block;
    width: 100%;
  }
  .WEB #content .contact_form input[type="text"]{
    width: 100%;
    box-sizing: border-box;
  }
  .WEB #content .contact_form input[type="submit"]{
    min-width: 0;
    width: 100%;
  }
  .WEB #content .contact_form label{
    width: auto;
    float: none;
    overflow: hidden;
  }
  footer{
    height: auto;
    min-height: 50px;
  }
}
