/* -----------------------------------------------------------------------------------------
   responsive.css - wird nach screen.css, skins.css und navigation.css geladen.
   Teil 1: behutsame Modernisierung der Desktop-Ansicht (Layout unveraendert).
   Teil 2: Ansicht fuer Tablets und Handys (bis 999 px Breite), ersetzt die alte /m/-Version.
   ---------------------------------------------------------------------------------------*/

/* ---------- Teil 1: Desktop ---------- */
#content { font-size: 12px; line-height: 1.6; }
#content h2 { font-size: 12px; }
#mainnav li li a, #mainnav li.on li a, #mainnav li.on:hover li a { font-size: 11px; }
#leftnav li a { font-size: 11px; }
div.termine table td.c1 { width: 50px; }
div.termine table td.c2 { width: 24px; }
div.termine table td.c3 { width: 70px; }
div.termine table td.c4 { width: auto; }
#navtoggle { display: none; }
#navigation.homeNav { display: none; }
/* Social-Icons vor dem Blatt und vollstaendig rechts daneben */
#social { left: 822px; z-index: 125; }
#social a + a { margin-left: 2px; }
/* Hauptmenue: beim Ueberfahren eines anderen Punkts das Untermenue des aktuellen Bereichs ausblenden,
   damit sich die beiden Untermenues nicht ueberdecken */
@media (min-width: 1000px) {
  #mainnav > ul:has(> li:not(.on):hover) > li.on > ul { display: none; }
}

/* ---------- Teil 2: Tablet und Handy ---------- */
@media (max-width: 999px) {

  html { overflow-y: auto; -webkit-text-size-adjust: 100%; }
  html, body { height: auto; }

  /* Hintergrundbild des Skins fuellt immer den ganzen Bildschirm */
  #bg { min-width: 0; z-index: 0; }
  #bg img { width: 100%; height: 100%; object-fit: cover; }

  #wrapper {
    width: auto; max-width: 680px; min-height: 100vh; box-sizing: border-box;
    display: flex; flex-direction: column;
    padding: 62px 10px 30px 10px; overflow-x: hidden; overflow-x: clip;
  }

  /* Kopfzeile: Flagge links, Social-Icons mittig, Menue-Knopf rechts */
  #switchtoen { left: 12px; top: 14px; width: 48px; height: auto; }
  #switchtoen img { width: 48px; height: auto; }
  #switchtomobile { display: none; }

  #social { left: 72px; right: 66px; top: 13px; width: auto; height: auto; text-align: center; }
  #social > div { display: none; }
  #social img { width: 34px !important; height: auto; }
  #social a + a { margin-left: 8px; }

  #themenbild, #logoHome, #switcher, #blechi, #preloader { display: none; }

  /* Sprungmarken (Monate, Musiker ...) als wischbare Leiste ueber dem Blatt */
  #leftnavigation {
    position: sticky; top: 0; width: auto; text-align: left; z-index: 6;
    margin: 0 -10px 12px -10px; padding: 8px 10px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    order: 1; scrollbar-width: none;
    background: rgba(0, 0, 0, 0.22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  /* Termine: die Leiste bleibt beim Scrollen oben stehen, der Monat im Bild ist markiert */
  #leftnav li.spy a { background: #E2298E !important; }
  div.termine > a[name] { display: block; height: 0; scroll-margin-top: 62px; }
  #leftnavigation::-webkit-scrollbar { display: none; }
  #leftnavigation:empty { display: none; }
  #leftnav ul, #leftnav.col2 ul { display: flex; flex-wrap: nowrap; float: none; width: auto; margin: 0; }
  #leftnav li, #leftnav.col2 li { float: none; margin: 0 6px 0 0; flex: 0 0 auto; }
  #leftnav li a, #leftnav.col2 li a, #leftnav li.s3 a {
    display: block; font-size: 13px; line-height: 1.2; padding: 7px 12px; white-space: nowrap;
    background: rgba(1, 47, 107, 0.82) !important; border-radius: 16px; color: #fff;
  }
  #leftnav li[class*="on"] a { background: #E2298E !important; }
  /* im Blatt direkt unter der 2. Ebene (wird per responsive.js dorthin verschoben) */
  #blatt > #leftnavigation {
    order: 0; margin: 0 0 14px; padding: 8px 66px 8px 12px; top: 0;
    background: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(1, 47, 107, 0.12); border-bottom: 1px solid rgba(1, 47, 107, 0.12);
  }

  /* Das Blatt */
  #blatt {
    position: relative; top: auto; margin: 0; width: auto; min-height: 0;
    background-size: 100% auto; border-radius: 3px; z-index: 2; order: 3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  }
  #logo { width: 150px; height: 150px; background-size: contain; }
  /* Schriftzug liegt im Seitenfluss und ragt in den Kopf des Blatts hinein */
  #schriftzug {
    position: relative; left: auto; top: auto; order: 2; align-self: center;
    width: 220px; height: auto; margin: 0 auto -74px auto; padding-top: 14px; z-index: 3;
  }
  #schriftzug img { width: 100%; height: auto; }

  /* Hauptnavigation */
  #navigation { position: relative; top: auto; left: auto; width: auto; padding: 88px 16px 0 16px; }
  #navtoggle {
    display: block; position: fixed; right: 12px; top: 10px; z-index: 50; width: 46px; height: 42px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: none; border-radius: 6px; background: rgba(1, 47, 107, 0.82); cursor: pointer; padding: 0;
  }
  #navtoggle span, #navtoggle span:before, #navtoggle span:after {
    content: ""; display: block; position: absolute; left: 11px; width: 24px; height: 3px;
    background: #fff; border-radius: 2px;
  }
  #navtoggle span { top: 19px; }
  #navtoggle span:before { left: 0; top: -8px; }
  #navtoggle span:after { left: 0; top: 8px; }
  body.navopen #navtoggle { background: #E2298E; }

  #mainnav { line-height: 1.3; }
  #mainnav li > div, #mainnav li > br { display: none !important; }
  #mainnav li { float: none; margin: 0; }
  #mainnav li a, #mainnav li a.s1, #mainnav li a.s2, #mainnav li a.s3 {
    display: block; background-image: none !important; padding: 12px 4px; font-size: 16px;
    color: #012F6B; border-top: 1px solid #87B4D8;
  }
  #mainnav li.on > a { color: #E2298E; }
  #mainnav li ul, #mainnav li ul.subHidden, #mainnav li ul.subVisible {
    display: block; position: static; width: auto; margin: 0 0 8px 18px; background: none;
  }
  #mainnav li li a, #mainnav li.on li a, #mainnav li.on:hover li a {
    border: none; font-size: 14px; padding: 7px 0; margin: 0; color: #012F6B;
  }
  #mainnav ul li li.on a { color: #E2298E; }

  /* Menue zugeklappt: nur die Unterpunkte des aktuellen Bereichs als Zeile zeigen */
  body:not(.navopen) #mainnav > ul > li { display: none; }
  body:not(.navopen) #mainnav > ul > li.on { display: block; }
  body:not(.navopen) #mainnav > ul > li.on > a { display: none; }
  body:not(.navopen) #mainnav li.on ul {
    display: flex; flex-wrap: wrap; margin: 0; padding: 8px 0 6px 0;
    border-top: 1px solid #87B4D8; border-bottom: 1px solid #87B4D8;
  }
  body:not(.navopen) #mainnav li.on li a { padding: 4px 16px 4px 0; font-size: 13px; }

  /* Inhalt */
  #content, #content.knick { padding: 18px 0 6px 0; margin: 0 16px; font-size: 15px; line-height: 1.55; }
  #content h1, #content h2.h1 { font-size: 24px; margin-bottom: 14px; }
  #content h2 { font-size: 15px; padding-top: 6px; }
  #content img { max-width: 100%; height: auto; }
  #content table { max-width: 100%; }
  #content iframe, #content object, #content embed, #content video { max-width: 100%; }
  #content .top { margin: 6px 0 18px 0; }
  #footer { margin-bottom: 20px; }

  /* Termine: Datum, Tag und Uhrzeit in einer Zeile, Veranstaltung darunter */
  div.termine table, div.termine table tbody { display: block; width: 100%; }
  div.termine table { border-top: 1px solid #87B4D8; }
  div.termine table tr { display: flex; flex-wrap: wrap; align-items: baseline; }
  div.termine table tr + tr + tr { border-top: 1px solid #87B4D8; }
  div.termine table td, div.termine table td.c1, div.termine table td.c2, div.termine table td.c3 {
    width: auto; padding: 0 8px 0 0; margin-top: 7px; text-align: left; font-weight: bold; color: #012F6B;
  }
  div.termine table td.c3 { white-space: nowrap; }
  div.termine table td.c4 {
    order: 5; flex: 0 0 100%; width: auto; padding: 2px 0 0 0; margin: 0 0 7px 0;
    font-weight: normal; color: #000;
  }
  div.termine table td.c5 { margin-left: auto; width: auto; padding: 0; }
  div.termine table td.r { display: none; }
  div.termine table td.privat { color: #909090; }
  div.termine table td.c1 div.iconBB, div.termine table td.c1 div.icon { position: static; margin: 0; display: inline-block; }

  div.musik table, div.bestellung table, div.fanartikel table { width: 100%; }
  div.musik table td.c1, div.musik table td.c2, div.musik table td.c3 { width: auto; }
  .kontaktLeft, .kontaktRight { float: none; width: auto; }
  #imgBandEn, #copyBandEn { float: none; width: auto; margin-right: 0; }
  #copyBand { position: static; }
  #fadeshowBand { margin-bottom: 14px; }
  #content > div[style*="position:absolute"] {
    position: static !important; display: inline-block; margin: 0 16px 6px 0; vertical-align: middle;
  }
  .galerieCell { height: auto; }
  /* Galerie: Leerzeilen zwischen den Alben durch einen festen Abstand ersetzen */
  #content div.clear + br, #content div.clear + br + br { display: none; }
  #content br + h2 { margin-top: 16px; }

  /* Zettel und Sponsor unter dem Inhalt */
  #kaesten {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
    gap: 18px 14px; margin-top: 26px; z-index: 2; position: relative; order: 5;
  }
  #kastenNews, #kastenTour, #kastenWiesn25, #sponsor { position: relative; left: auto; top: auto; }
  #kastenWiesn25 img { width: 195px; height: auto; display: block; }
  #sponsor { flex: 0 0 100%; width: auto; text-align: center; font-size: 11px !important; }
  #sponsor p a { font-size: 13px !important; display: inline-block; padding: 4px 0; }
  /* Seiten, auf denen die Zettel direkt im Wrapper liegen (Musiker, Erdinger) */
  #wrapper > #kastenNews, #wrapper > #kastenTour, #wrapper > #kastenWiesn25 {
    order: 6; align-self: center; margin-top: 22px; z-index: 2;
  }
  #wrapper > #sponsor { order: 7; align-self: center; margin-top: 18px; z-index: 2; }

  /* Startseite */
  body.navopen #navigation.homeNav {
    display: block; order: 0; padding: 4px 16px 8px 16px; margin: 0 0 14px 0; z-index: 4;
    background: url(../../assets/gfx/blatt.jpg) repeat-y; background-size: 100% auto;
    border-radius: 3px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  }
  #navigation.homeNav #mainnav > ul > li:first-child > a { border-top: none; }
  #schriftzugHome {
    position: relative; left: auto; top: auto; width: 100%; max-width: 473px; height: auto;
    margin: 6px auto 0 auto; background-size: contain; background-position: center; order: 1; z-index: 2;
  }
  #schriftzugHome img { width: 100%; height: auto; display: block; aspect-ratio: 473 / 114; }
  #polaroid {
    position: relative; left: auto; top: auto; order: 2; z-index: 2;
    transform-origin: 0 0; align-self: flex-start; flex: 0 0 auto;
  }
  #wrapper > div[style*="top:670px"] {
    position: relative !important; left: auto !important; top: auto !important;
    order: 3; align-self: center; margin: 4px 0 0 0; z-index: 2;
  }
  #wrapper > div[style*="top:575px"] { display: none; }
}

@media (max-width: 380px) {
  #content, #content.knick { margin: 0 12px; font-size: 14px; }
  #social img { width: 30px !important; }
}
