/* Responsive overrides; loaded after the existing layout and slider styles. */
#navigation > ul > li:focus-within > ul {
  display: block;
}

#menu-toggle, .submenu-toggle { display: none; }

@media screen and (max-width: 980px) {
  #menu-toggle.menu-ready {
    display: block;
    margin: 0 auto;
    padding: 10px 18px;
    min-height: 44px;
    border: 0;
    border-radius: 4px;
    background: #00303f;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
  }

  #menu-toggle.menu-ready[aria-expanded="false"] + #navigation {
    display: none;
  }

  #menu-toggle[aria-expanded="true"] + #navigation {
    margin-top: 12px;
  }

  .innerContainer,
  #content .innerContainer,
  #teaser .teaserBelt .innerContainer {
    width: 100%;
    box-sizing: border-box;
  }

  #header,
  #header .innerContainer {
    height: auto;
  }

  #header .innerContainer {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
  }
  #header #logo { position: static; grid-area: 1 / 1; width: 48px; }
  #header .innerContainer h1 {
    grid-area: 1 / 2;
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
    text-align: left;
    overflow-wrap: anywhere;
  }
  #menu-toggle { grid-area: 1 / 3; }
  #navigation {
    grid-column: 1 / -1;
    position: static;
    width: auto;
    text-align: left;
    background: white;
  }
  #navigation > ul { margin: 0; }
  #navigation li { position: relative; list-style: none; }
  #navigation > ul > li { display: block; text-align: left; }
  #navigation > ul > li > a,
  #navigation > ul > li > ul > li a {
    display: block;
    padding: 12px 50px 12px 14px;
    border: 0;
    border-bottom: 1px solid #ddd;
    background: white;
    color: #00303f;
    font-size: 16px;
    line-height: 22px;
    text-align: left;
  }
  #navigation > ul > li > ul {
    position: static;
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  #navigation .subNavigation { padding-left: 16px; }
  #navigation .submenu-toggle {
    position: absolute;
    display: block;
    right: 0;
    top: 0;
    width: 46px;
    height: 46px;
    border: 0;
    background: transparent;
    color: #00303f;
    cursor: pointer;
  }
  #navigation .submenu-toggle::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  #navigation .submenu-toggle[aria-expanded="true"]::after {
    transform: rotate(225deg);
  }
  #header #navigation .submenu-toggle[aria-expanded="false"] + ul { display: none; }

  #content .innerContainer .mainContent,
  #content .innerContainer .gadgets {
    float: none;
    width: 100%;
    margin-right: 0;
    min-width: 0;
  }

  #content .gadgets {
    margin-top: 24px;
  }

  #content .mainContent {
    overflow-wrap: break-word;
  }

  #content img,
  #header img {
    max-width: 100%;
    height: auto;
  }

  #content iframe,
  #footer iframe {
    max-width: 100%;
  }

  #teaser .teaserBelt .innerContainer > div {
    margin-left: 0;
  }

  #teaser .dates li {
    margin-bottom: 16px;
  }

  #teaser .dates a {
    display: inline-block;
    margin-bottom: 6px;
  }

  #wowslider-container1 {
    width: 100%;
    height: auto;
    aspect-ratio: 980 / 320;
  }

  #footer .innerContainer,
  .socialNetworks .innerContainer {
    padding-left: 20px;
    padding-right: 20px;
  }

  #footer .row-fluid > [class*="span"] {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: 20px;
  }

  .socialNetworks {
    height: auto;
    padding: 20px 0;
  }

  .gadget .form-horizontal input {
    max-width: 100%;
    box-sizing: border-box;
    min-height: 40px;
  }
}

@media screen and (max-width: 480px) {
  #header .innerContainer,
  #content .innerContainer,
  #teaser .teaserBelt .innerContainer {
    padding: 16px;
  }


  .gadget {
    padding: 16px;
  }

  .gadget .innerContent {
    margin-left: 0;
    margin-top: 12px;
  }

  #content .form-horizontal .control-label {
    float: none;
    width: auto;
    text-align: left;
  }

  #content .form-horizontal .controls {
    margin-left: 0;
  }

  #content input,
  #content select,
  #content textarea {
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }
}

@media screen and (max-width: 980px) {
  .event .eventInfo .eventName {
    width: auto;
  }

  .event .eventInfo .eventCategory {
    position: static;
    margin-top: 4px;
  }
}

@media screen and (max-width: 600px) {
  #filter {
    background: transparent;
    color: #00303f;
    padding: 8px 0;
    margin-bottom: 16px;
  }

  #filter h4,
  #filter .control-label {
    margin: 0 0 3px;
    padding-top: 0;
  }

  #filter form,
  #filter .control-group,
  #filter .input-prepend {
    margin-bottom: 0;
  }

  #filter .control-group + .control-group {
    margin-top: 8px;
  }

  #filter .checkbox {
    margin: 0;
    line-height: 24px;
    padding-top: 0;
  }
}

/* Vendor badge inserted by the slider script. */
#wowslider-container1 a[href*="wowslider.com" i] {
  display: none !important;
}

#wowslider-container1 .ws_frame {
  border-bottom-width: 0;
}

@media screen and (max-width: 600px) {
  #teaser > .innerContainer {
    overflow: hidden;
  }

  #teaser #wowslider-container1 {
    width: 125%;
    max-width: none;
    margin-left: -12.5%;
  }
}

@media screen and (max-width: 600px) {
  #content .guild-dates,
  #content .guild-dates tbody {
    display: block;
    width: 100%;
  }

  .guild-dates colgroup,
  .guild-dates thead {
    display: none;
  }

  #content .guild-dates tbody tr {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-top: 1px solid #ccc;
  }

  .guild-dates tbody tr:nth-child(odd) {
    background: #fafafa;
  }

  #content .guild-dates tbody td {
    padding: 1px 0;
    border: 0;
    background: transparent;
    overflow-wrap: anywhere;
  }

  .guild-dates td:nth-child(3) {
    order: -1;
    font-weight: bold;
  }

  .guild-dates td:first-child br { display: none; }
  .guild-dates .guild-date-label { display: inline; }
}

@media screen and (max-width: 600px) {
  .intern-documents {
    margin: 20px 0;
  }

  .intern-documents h3 {
    margin: 0 0 6px;
  }

  .intern-documents .row-fluid > .span6 {
    float: none;
    width: 100%;
    min-height: 0;
    margin: 0;
  }

  .intern-documents ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .intern-documents li a {
    display: block;
    padding: 12px;
    background: white;
    border-bottom: 1px solid #ddd;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
}

@media screen and (max-width: 600px) {
  .intern-news a[href] {
    display: block;
    float: none;
    margin: 4px 0;
    overflow-wrap: anywhere;
  }
}

.snv-photo-album { margin: 0 0 24px; }
.snv-photo-album summary { cursor: pointer; color: #00303f; font-weight: bold; }
.snv-photo-album .album-cover {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  margin-bottom: 8px;
}
.snv-photo-album .album-close,
.snv-photo-album[open] .album-open { display: none; }
.snv-photo-album[open] .album-close { display: inline; }
.album-photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
#content .album-photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
@media (max-width: 600px) {
  .album-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

#teaser .teaserBelt .innerContainer > .dates-heading {
  margin-left: 0;
  text-align: left;
  font-weight: bold;
}

#teaser .teaserBelt .innerContainer ul.dates li a.event-link {
  display: inline-block;
  margin: 3px 0 0;
  padding: 5px 12px;
  border-radius: 4px;
  background: #fff;
  color: #39651c;
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
}

#teaser .teaserBelt ul.dates li + li {
  margin-top: 12px;
}

#teaser .teaserBelt .innerContainer ul.dates li a.event-link:hover,
#teaser .teaserBelt .innerContainer ul.dates li a.event-link:focus {
  text-decoration: underline;
}

#teaser #snv-dates {
  min-height: 0;
}

#snv-dates > summary {
  box-sizing: border-box;
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 16px;
  color: #00303f;
  cursor: pointer;
  text-align: right;
  list-style: none;
}

#snv-dates:not([open]) { background: #f2f2f2; }
#snv-dates[open] .dates-open-label,
#snv-dates:not([open]) .dates-close-label { display: none; }

#teaser #snv-dates[open] .innerContainer { padding-top: 0; }

#snv-dates > summary::-webkit-details-marker { display: none; }
#snv-dates .dates-open-label { text-decoration: underline; }
#snv-dates .dates-cross {
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font: bold 23px/1 Arial, sans-serif;
}
#snv-dates .dates-screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}


/* SNV Sponsoren – Responsive Layout */

.snv-sponsors {
  max-width: 950px;
  width: 100%;
  margin: 20px auto 40px;
  box-sizing: border-box;
}

.snv-sponsor {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-bottom: 16px;
  padding: 24px;
  background: #fff;
  border: 1px solid #e2e8eb;
  border-radius: 8px;
  box-sizing: border-box;
}

.snv-sponsor-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.snv-sponsor-logo img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 135px;
  height: auto;
  object-fit: contain;
}

.snv-sponsor-info {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
}

#content .snv-sponsor-info h3 {
  margin: 0 0 8px;
  padding: 0;
  color: #00303f;
  font-size: 19px;
  line-height: 1.3;
}

.snv-sponsor-info p {
  margin: 0 0 10px;
}

.snv-sponsor-info a {
  color: #39651c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.snv-sponsor-info a:hover,
.snv-sponsor-info a:focus {
  color: #00303f;
}

.snv-sponsor-no-logo {
  grid-template-columns: 1fr;
}

/* Smartphone und kleinere Tablets */

@media screen and (max-width: 640px) {
  .snv-sponsors {
    margin: 10px auto 30px;
  }

  .snv-sponsor {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 20px 16px;
    margin-bottom: 14px;
  }

  .snv-sponsor-logo {
    justify-content: center;
  }

  .snv-sponsor-logo img {
    max-width: 100%;
    max-height: 110px;
  }

  .snv-sponsor-info {
    font-size: 15px;
  }

  #content .snv-sponsor-info h3 {
    font-size: 18px;
  }
}
