/*
 * Own CSS of jarolift.de, loaded last by layout.php: styles for site.js and the layer for phones and tablets.
 * Phone/tablet rules only inside @media (max-width: 979px): the desktop view stays as it was (960px theme).
 */

/* ------------------------------------------------------------------ site.js (all widths) */

/* header slider: one slide at a time (the theme's jQuery plugin did this) */
.micro-slider .zPSlide { display: none !important; }
.micro-slider .zPSlide.micro-current { display: block !important; animation: micro-fade .6s ease-out; }
.micro-slider .micro-current .zPSlideElement { display: block; }
@keyframes micro-fade { from { opacity: 0; } to { opacity: 1; } }
#sliderPrev, #sliderNext { cursor: pointer; }
html:not(.js) .zPSlide:first-child, html:not(.js) .zPSlide:first-child .zPSlideElement { display: block; }

/* lightbox of ".fancybox" links (images, Online-Berater) */
.micro-lightbox { max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 0; border: none; border-radius: 3px; box-shadow: 0 4px 20px rgba(0,0,0,.5); overflow: auto; }
.micro-lightbox::backdrop { background: rgba(0,0,0,.5); }
.micro-lightbox img { display: block; max-width: 100%; height: auto; }
.micro-lightbox-close { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; border: none; background: #000; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.micro-lightbox-body { padding: 0; }

/* menu button: only phones and tablets */
.nav-toggle { display: none; }

/* ------------------------------------------------------------------ phones and tablets */

@media (max-width: 979px) {
  html, body { font-size: 15px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  p { text-align: left; }
  .inner { width: auto; padding: 0 16px; box-sizing: border-box; }

  /* header: logo left, button "Menü" right, menu below (static instead of the fixed 50px bar) */
  #header { position: relative; height: auto; }
  #header .inner { display: flex; flex-wrap: wrap; align-items: center; padding: 0 16px; }
  #logo { float: none; display: block; margin: 0; padding: 14px 0; max-width: 200px; height: auto; }
  html.js .nav-toggle { display: block; margin-left: auto; min-height: 44px; padding: 10px 14px; background: none; border: 1px solid #333; border-radius: 3px; color: #fff; font-family: inherit; font-size: 15px; font-weight: bold; line-height: 1; cursor: pointer; }
  html.js .nav-toggle::after { content: " \2261"; color: #39A3DC; }
  html.js .nav-toggle[aria-expanded="true"]::after { content: " \00D7"; }
  html.js #header:not(.nav-open) #nav_main { display: none; }
  #nav_main { float: none; flex: 0 0 calc(100% + 32px); margin: 0 -16px; }
  #nav_main ul ul li.clicked > a { color: #39A3DC; }
  #nav_main li { float: none; border-left: none; border-top: 1px solid #333; }
  #nav_main li a { padding: 13px 16px; }
  #nav_main ul ul, #nav_main ul ul ul { position: static; width: auto; }
  #nav_main ul ul li { border-top: 1px solid #222; }
  #nav_main ul ul li a { padding: 12px 16px 12px 32px; color: #fff; font-size: 15px; }
  #nav_main ul ul ul li a { padding-left: 48px; color: #39A3DC; }
  #nav_main ul li:hover ul { display: none; }               /* no hover menus on touch screens */
  #nav_main ul li.clicked > ul, #nav_main ul li.active > ul, #nav_main ul li.trail > ul { display: block; }
  #nav_main a.submenu::after { content: " \25BE"; }
  #nav_main li.clicked > a.submenu::after { content: " \25B4"; }
  #subnavbg, #subnavbg_2 { display: none !important; }

  /* header slider: full width, texts below each other (no fixed 960 x 300px stage) */
  #slider { padding-top: 0; }
  #slider .inner { padding: 0; }
  #sliderContainer { height: auto; }
  #sliderContainer .zPSlide { height: auto !important; min-height: 170px; background-size: cover; background-position: 50% 50%; }
  #sliderContainer .zPSlideCenter { width: auto !important; height: auto !important; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 24px 16px 44px; box-sizing: border-box; }
  #sliderContainer .zPSlideElement { position: static !important; width: auto !important; max-width: 100%; text-align: left !important; }
  #sliderContainer .zPSlideElement img { max-width: 100%; height: auto; max-height: 160px; }
  #sliderContainer .tesa { font-size: 18px; line-height: 28px; }
  #sliderPrev, #sliderNext { top: auto; bottom: 6px; left: auto; right: 60px; width: 44px; height: 36px; opacity: .8; background-color: rgba(255,255,255,.7); border-radius: 3px; }
  #sliderNext { right: 12px; }

  /* content: one column, the text before the boxes of the right column */
  #main { padding: 12px 0 20px; }
  #main .mod_article { display: flex; flex-direction: column; }
  #main .mod_article > .col-1 { order: 1; }
  #main .mod_article > hr { order: 1; }
  .col-1, .col-2, .col-3 { width: auto; float: none !important; margin-left: 0 !important; margin-right: 0 !important; }
  .box-grey { margin-top: 10px; margin-bottom: 10px; }
  #main img { max-width: 100%; height: auto; }
  .img_content img.left, .img_content img.right { float: none; display: block; margin: 0 auto 10px; }
  #highlightbox > div { margin: -15px !important; }
  h1, h2 { font-size: 22px; line-height: 1.25; }
  h3 { line-height: 1.3; }
  .mod_breadcrumb { font-size: 13px; line-height: 1.5; }

  /* home page tiles: two per row on tablets, one on phones */
  .category-container { float: none; display: inline-block; vertical-align: top; width: calc(50% - 8px); height: auto; margin: 0 0 16px 0 !important; }
  .category-container:nth-child(odd) { margin-right: 12px !important; }
  .category-container a, .category-container a img.category-image { width: 100%; height: auto; box-sizing: border-box; }
  .category-container a span { width: 100%; left: 0; top: 0; height: auto; padding: 6px 0; font-size: 18px; }

  /* tabs and comparison tables: tables scroll sideways inside the page */
  #main ul.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  #main ul.tabs li { float: none; margin: 0; padding: 0; background-image: none; }
  #main ul.tabs li a { display: block; padding: 10px 12px; }
  .tab-container { margin: 15px 0 20px; }
  #main .ce_text { float: none !important; max-width: 100%; }
  #main { overflow-wrap: break-word; }   /* long URLs in the privacy text */
  #main table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.vergleich td { padding: 6px 10px; }
  table.vergleich td.first { padding-right: 10px; }

  /* contact form: fields below each other, 16px (no zoom on iPhone) */
  #kontakt .formbody .widget-text:nth-child(n) { width: auto; float: none; }
  #field-9, #field-10 { width: auto; float: none; }
  input[type=text], input[type=email], input[type=tel], textarea, select { font-size: 16px; padding: 8px; }
  input[type=submit] { width: 100%; padding: 12px; font-size: 16px; }

  /* footer: centred, links as tap targets */
  #footer { margin-top: 10px; text-align: center; }
  #footer .left, #footer .right { float: none; }
  #footer .left { margin-bottom: 10px; }
  #footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
  #footer ul li, #footer ul li.first { float: none; margin: 0; list-style: none; }
  #footer li a { padding: 8px 0; border-bottom: none; text-decoration: underline; }
}

@media (max-width: 599px) {
  .category-container, .category-container:nth-child(odd) { display: block; width: 100%; margin-right: 0 !important; }
}
