/* ==========================================================================
   Mobile layout for the static archive of guter-gastgeber-guter-arbeitgeber.de
   Loaded after theme.css; the desktop layout above 1024px is unchanged.
   ========================================================================== */

/* Media never wider than the screen (all sizes) */
img, iframe, video, object, embed { max-width: 100%; }
.nav-toggle { display: none; }

/* --------------------------------------------------------------------------
   Header + navigation (tablet & phone)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  header { height: auto; margin-top: 12px !important; }
  .header-content {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding-bottom: 12px;
  }
  .logo { float: none; width: auto; flex: 0 0 auto; order: 1; }
  .logo img { width: 150px; height: auto; display: block; }
  .inqa-logo { float: none; margin-left: auto; order: 2; }
  .nav-toggle { order: 3; }
  .main-menu { order: 4; }
  .inqa-logo img { height: 48px; width: auto; display: block; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 46px; height: 46px; padding: 0 11px; margin: 0;
    background: #00878a; border: 0; border-radius: 6px; cursor: pointer;
  }
  .nav-toggle span {
    display: block; height: 3px; background: #fff; border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .main-menu {
    display: none; float: none; flex: 0 0 100%;
    margin: 0; font-size: 16px; border-top: 3px solid #00878a;
  }
  header.nav-open .main-menu { display: block; }
  .main-menu ul.menu { margin: 0; padding: 0; list-style: none; }
  .main-menu .menu li,
  .main-menu .menu li a,
  .main-menu .menu li span.nolink { float: none; }
  .main-menu .menu li { display: block; height: auto !important; border-bottom: 1px solid #d9ecec; position: relative; }
  .main-menu .menu li:after { content: none; }
  .main-menu .menu li a,
  .main-menu .menu li span.nolink {
    display: block; height: auto; width: auto; text-align: left;
    padding: 12px 8px; color: #32343f; font-size: 16px;
  }
  .main-menu .menu li a.is-active { color: #00878a; font-weight: 600; }
  .main-menu .menu li span.nolink { cursor: pointer; }
  .main-menu ul.menu > li.dropdown > .nolink:after { float: right; transition: transform .2s; }
  .main-menu ul.menu > li.dropdown.open > .nolink:after { transform: rotate(180deg); }

  /* sub menus: accordion instead of hover dropdown */
  .main-menu .menu li:hover > ul { display: none; }
  .main-menu .menu li ul,
  .main-menu .menu li.open > ul,
  .main-menu .menu li.open:hover > ul {
    position: static; width: auto; margin: 0; padding: 0 0 6px;
    background: #eef7f7; z-index: auto;
  }
  .main-menu .menu li.open > ul { display: block; }
  .main-menu .menu li ul li { border-bottom: 0; }
  .main-menu .menu li ul li a,
  .main-menu .menu li ul li a:hover {
    width: auto; font-size: 15px; line-height: 1.4; padding: 9px 8px 9px 24px;
    background: transparent; color: #00878a;
  }
  .menu-bubbel { display: none !important; }
}

/* --------------------------------------------------------------------------
   Content layout (tablet portrait & phone)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  body { font-size: 15px; }
  .after-section-wrapper-pad { padding-left: 16px; padding-right: 16px; }

  /* every float column becomes full width */
  .start-left, .start-right, .slideshow, .einfache-seite-startseite,
  .kont-down, .kont-term-down, .einfache-seite-zwei-inhalt,
  .gp-bsp-bild, .gp-bsp-text, .start-bild, .start-text,
  .wrapper-hilfepraxis, .wrapper-aktuelles {
    float: none; width: auto; max-width: none; margin-left: 0; margin-right: 0;
  }

  /* home: slideshow + claim */
  .slideshow { margin-bottom: 0; }
  .bx-wrapper .bx-pager, .bx-wrapper .bx-controls-auto { bottom: auto; top: 8px; left: 8px; }
  .bx-wrapper .bx-caption span { font-size: 12px; padding: 8px 10px; }
  .einfache-seite-startseite { height: auto; background-image: none; padding: 16px 0 20px; }
  .einfache-seite-bild-text-startseite {
    position: static; width: auto; border-radius: 40px 0 0 40px; padding: 10px 14px 12px 24px;
  }
  .start-left { margin-bottom: 24px; }
  .start-bild { margin-bottom: 12px; }
  .start-bild img { width: 100%; height: auto; }
  .start-text { margin-bottom: 28px; }
  .startseite-header { max-width: none; }
  .startseite-header h1 { font-size: 1.6em; }
  .start-right { margin-top: 0; margin-bottom: 30px; }
  .youtube-videos iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }

  /* sub pages: header picture + claim */
  .einfache-seite, .einfache-seite-zwei { height: auto; background-image: none; }
  .einfache-seite-bild, .einfache-seite-zwei-bild, .einfache-seite-drei-bild {
    width: 100%; height: 180px; background-size: cover; background-position: center;
  }
  .einfache-seite-bild-text, .einfache-seite-zwei-bild-text {
    position: static; left: auto; bottom: auto; width: auto;
    border-radius: 0 0 0 40px; padding: 10px 14px 12px 24px; margin-bottom: 16px;
  }
  .einfache-seite-bild-text h4, .einfache-seite-bild-text-startseite h4,
  .einfache-seite-zwei-bild-text h4 { margin: 6px 0; font-size: 1.15em; }

  /* text content */
  h1 { font-size: 1.6em; overflow-wrap: anywhere; hyphens: auto; }
  h3 { overflow-wrap: anywhere; }
  .einfache-seite-inhalt, .einfache-seite-zwei-inhalt, .gute-praxis-bsp-inhalt,
  #wrapper-inhalt-links { overflow-wrap: break-word; }
  .einfache-seite-inhalt img, .einfache-seite-zwei-inhalt img,
  .gute-praxis-bsp-inhalt img, .gp-bsp-bild img, .accordion img {
    height: auto !important; max-width: 100% !important;
  }
  .gp-bsp-wrapper { margin-bottom: 24px; }
  .gp-bsp-bild { margin-bottom: 10px; }

  /* coloured section bars (Praxishilfen, Aktuelles): grow with long titles */
  .hilfepraxis, .aktuellesneu {
    height: auto; min-height: 40px; padding: 6px 70px 6px 10px; box-sizing: border-box;
  }
  .hilfepraxis p, .aktuellesneu p { font-size: 19px; line-height: 1.3; }

  /* side boxes (Termine, Kontakt, Downloads) */
  .termine-top, .termine-bottom, .kontakt-top, .kontakt-bottom, .download-top {
    width: 80%; margin-left: 20%;
  }
  .kont-down, .kont-term-down { margin-top: 24px; }

  /* tables (partner logos, Beraterpool): one cell under the other */
  .section-wrapper table, .section-wrapper table tbody, .section-wrapper table thead,
  .section-wrapper table tr, .section-wrapper table td, .section-wrapper table th {
    display: block; width: auto !important; height: auto !important;
  }
  .section-wrapper table { border: 0 !important; }
  .section-wrapper table tr { padding: 12px 0; border-bottom: 1px solid #d9ecec; }
  .section-wrapper table td { padding: 4px 0 !important; border: 0 !important; }
  .section-wrapper table td p { margin: 4px 0; }
  .section-wrapper table img { max-width: 180px !important; height: auto !important; }
  /* Beraterpool: hide the column-header row, name in bold as card title */
  table.beraterpool tr:has(th) { display: none; }
  table.beraterpool tr { padding: 14px 0; border-bottom: 2px solid #00878a; }
  table.beraterpool td { font-size: 14px; }
  table.beraterpool td:first-child { font-weight: 700; color: #00878a; font-size: 15px; }
  table.beraterpool ul { margin: 4px 0; padding-left: 20px; }

  /* jQuery UI accordion */
  .accordion .ui-accordion-header { padding: 10px 12px 10px 30px; font-size: 15px; }
  .accordion .ui-accordion-content { padding: 12px !important; height: auto !important; }

  /* footer */
  .footer-menu { height: auto; padding-bottom: 10px; }
  .footer-menu-block, .footer-menu-block:last-child { float: none; margin: 0 0 18px !important; }
  .footer-menu-block li a { display: inline-block; padding: 4px 0; }
}

/* Tablet portrait: teaser picture left, text right */
@media (min-width: 601px) and (max-width: 900px) {
  .start-bild { float: left; width: 40%; margin-right: 4%; }
  .start-text { float: left; width: 56%; }
  .start-aktuelles > .views-element-container > div > div,
  .start-hilfen-praxis > .views-element-container > div > div,
  .guta-praxis-start-wrapper { overflow: hidden; }
}

@media (max-width: 420px) {
  .logo img { width: 128px; }
  .inqa-logo img { height: 40px; }
  .bx-wrapper .bx-caption { position: static; }
}
