
/* =========================================================
   Mobile Fix – Familienzirkel Bitsch
   Optimiert für Smartphones und kleine Tablets.
   ========================================================= */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

/* Logo: die Originaldatei hat einen weißen quadratischen Hintergrund,
   der im dunkelgrünen Header als hartkantiger weißer Kasten auffällt.
   Abgerundete Ecken + leichter Schatten lassen es wie ein Badge wirken,
   ohne Inhalt (z. B. den Schriftzug) wegzuschneiden. Gilt auf allen
   Bildschirmgrößen, nicht nur mobil. */
.u-header .u-image-1 {
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
  background-color: #ffffff;
}

/* Header: die ursprünglichen Nicepage-Abstände waren auf
   kleinen Displays sehr groß und haben den Header verschoben. */
@media (max-width: 767px) {
  .u-header .u-sheet-1 {
    position: relative;
    width: 100%;
    min-height: 72px !important;
    height: 72px;
    box-sizing: border-box;
    padding: 0 12px;
  }

  .u-header .u-logo-link {
    position: absolute;
    left: 12px;
    top: 6px;
    width: auto;
    max-width: calc(100% - 72px);
    height: 60px;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
  }

  .u-header .u-image-1 {
    position: static;
    flex: 0 0 52px;
    width: 52px !important;
    height: 52px !important;
    margin: 0 10px 0 0 !important;
  }

  .u-header .u-text-1 {
    position: static;
    width: auto;
    max-width: calc(100vw - 145px);
    margin: 0 !important;
    padding: 0;
    font-size: 1rem;
    line-height: 1.2;
    white-space: normal;
  }

  .u-header .u-menu-1 {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto !important;
    height: 56px;
    margin: 0 !important;
  }

  .u-header .u-menu-1 .menu-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
  }

  .u-header .u-menu-1 .u-hamburger-link {
    width: 44px;
    height: 44px;
    padding: 10px !important;
    box-sizing: border-box;
    margin: 0 !important;
  }

  .u-header .u-menu-1 .u-nav-container {
    display: none !important;
  }

  .u-header .u-menu-1 .u-nav-container-collapse {
    display: block;
  }

  .u-header .u-nav-container-collapse .u-sidenav {
    width: min(82vw, 320px);
    max-width: 320px;
  }

  .u-header .u-nav-container-collapse .u-nav-link {
    padding: 12px 20px;
    font-size: 1rem;
  }

  /* Inhalte dürfen nie breiter als das Smartphone werden. */
  .u-section-1,
  .u-section-1 .u-sheet-1 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .u-section-1 .u-sheet-1 {
    /* Der Header ist auf der Startseite absolut positioniert (u-overlap) und
       liegt daher optisch UEBER dem Seiteninhalt statt ihn nach unten zu
       schieben. Ohne diesen Abstand schneidet der dunkelgruene Header das
       Titelbild oben ab. 72px entspricht der festen Header-Hoehe weiter
       oben in dieser Datei. */
    padding-top: 72px !important;
  }

  /* Startseite */
  .u-section-1 .u-image-1 {
    width: min(340px, calc(100vw - 32px)) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin: 24px auto !important;
    display: block;
  }

  /* Allgemeine Text-/Box-Sicherheit */
  .agenda-wrap,
  .gal-wrap,
  .ueber-wrap,
  .kontakt-wrap,
  .mit-hero {
    max-width: 100%;
    box-sizing: border-box;
  }

  .agenda-wrap,
  .gal-wrap,
  .ueber-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .agenda-title,
  .gal-title,
  .anlaesse-title,
  .kontakt-heading,
  .mit-title,
  .ueber-title {
    overflow-wrap: anywhere;
  }

  /* Kontaktformular */
  .kontakt-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .kontakt-form-card {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .kontakt-form-group input,
  .kontakt-form-group select,
  .kontakt-form-group textarea {
    max-width: 100%;
  }

  /* Anlässe */
  .anlaesse-grid {
    width: 100%;
    box-sizing: border-box;
  }

  .anlaesse-item {
    min-width: 0;
  }

  /* Galerie */
  .gal-grid {
    width: 100%;
    box-sizing: border-box;
  }

  .gal-lightbox-img {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
  }

  .gal-lightbox-close {
    top: 12px;
    right: 14px;
  }

  .gal-lightbox-nav {
    font-size: 1.8rem;
    padding: 10px;
  }

  /* Mitgliedschaft */
  .mit-hero {
    padding: 48px 16px 56px;
  }

  .mit-content {
    width: 100%;
  }

  .mit-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Footer */
  .kontakt-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .kontakt-footer-inner {
    width: 100%;
  }

  .u-footer .u-text-1 {
    width: auto !important;
    max-width: calc(100vw - 32px);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Globale Input-Optimierungen für alle Geräte */
input,
select,
textarea,
button {
  font-size: 1rem; /* iOS Zoom-Prevention: mindestens 16px */
  font-family: inherit;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 575px) {
  .u-header .u-text-1 {
    font-size: 0.92rem;
    max-width: calc(100vw - 140px);
  }

  .agenda-wrap,
  .gal-wrap,
  .ueber-wrap {
    padding-top: 36px;
    padding-bottom: 48px;
  }

  .agenda-title,
  .gal-title {
    font-size: 1.9rem;
    word-wrap: break-word;
  }

  .anlaesse-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-left: 12px;
    padding-right: 12px;
    width: 100%;
  }

  .anlaesse-item {
    min-width: 0;
    overflow-wrap: break-word;
  }

  .anlaesse-title {
    font-size: 1.8rem;
    word-wrap: break-word;
  }

  .anlaesse-photo {
    height: auto;
    aspect-ratio: 4 / 3;
    width: 100%;
  }

  .kontakt-wrap {
    padding-left: 12px;
    padding-right: 12px;
    grid-template-columns: 1fr !important;
  }

  .kontakt-form-card {
    padding: 24px 16px;
    border-radius: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .mit-title {
    font-size: 1.9rem;
    word-wrap: break-word;
  }

  .mit-card {
    padding: 20px 24px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Extra-Sicherheit gegen zu breite Elemente */
  table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  pre,
  code {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
