/* Mobile Ansicht – greift nur bei schmalen Bildschirmen, Desktop bleibt unverändert */

#menu-toggle,
.mobile-title,
#mviewer {
  display: none;
}

@media (max-width: 820px) {

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    background: #fff;
  }

  /* Kopfleiste mit Menü-Knopf */
  #menu-toggle {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    width: 100%;
    height: 56px;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.97);
    border: 0;
    border-bottom: 1px solid #e4e0e2;
    font-family: 'Conv_AHR', sans-serif;
    font-size: 21px;
    color: #000;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #menu-toggle small {
    font-size: 15px;
    color: #4a3f46;
    margin-left: 6px;
  }

  .mt-icon i {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px 0;
    background: #4a3f46;
    transition: transform 0.2s, opacity 0.2s;
  }

  body.menu-open .mt-icon i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.menu-open .mt-icon i:nth-child(2) { opacity: 0; }
  body.menu-open .mt-icon i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  #content {
    margin: 0;
    padding-top: 56px;
    height: auto;
    background: none;
  }

  /* Menü als ausklappbare Liste */
  #menu {
    display: none;
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    z-index: 299;
    overflow-y: auto;
    padding: 8px 0 24px;
    background: #fff;
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open #menu {
    display: block;
  }

  #menu li {
    display: block;
  }

  #menu li a {
    display: block;
    padding: 12px 24px;
    font-size: 24px;
    line-height: 1.25;
  }

  /* Desktop-Positionierung (main.js) aufheben */
  .getPos {
    position: static !important;
    left: auto !important;
    top: auto !important;
    display: block !important;
  }

  /* Startseite: Bild oben, darunter Text */
  .page-home #content {
    position: relative;
  }

  .page-home #content::before {
    content: '';
    display: block;
    height: 47.8vw;
    background: url(../images/background.jpg) center top / 100% auto no-repeat;
  }

  .page-home #logo {
    position: absolute !important;
    top: calc(56px + 6vw) !important;
    left: 50% !important;
    width: 30vw;
    height: auto;
    transform: translateX(-50%);
  }

  .page-home #title,
  .page-home #footer {
    width: auto !important;
    margin: 28px 16px 0;
  }

  .page-home #footer {
    margin-bottom: 24px;
  }

  #title p,
  #footer p {
    font-size: 26px;
    line-height: 38px;
    padding: 0;
  }

  /* Unterseiten */
  #pagecontent {
    width: auto;
    padding: 0 12px 24px;
  }

  .mobile-title {
    display: block;
    padding: 22px 4px 14px;
    font-family: 'Conv_AHR', sans-serif;
    font-size: 30px;
    font-weight: normal;
    text-align: center;
  }

  /* Galerie: alle Fotos untereinander, 2 Spalten */
  #pagecontent .photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #pagecontent .photos .block,
  #pagecontent .photos .block.active {
    display: contents;
  }

  #pagecontent .photos a {
    display: block;
    background: #f2eff1;
    border-radius: 4px;
    overflow: hidden;
  }

  #pagecontent .photos img {
    float: none;
    margin: 0;
    width: 100%;
    height: auto;
  }

  #pagecontent .nav {
    display: none;
  }

  /* Kontakt, Werner Lüthy */
  #pagecontent.kontakt {
    padding: 0 16px 24px;
  }

  #pagecontent.kontakt p {
    font-size: 24px;
    line-height: 36px;
    padding: 0;
  }

  #pagecontent.kontakt a[href^="mailto"] {
    font-size: 18px;
    word-break: break-all;
  }

  #pagecontent.wernerluethy {
    padding: 0 16px 24px;
    font-size: 17px;
    line-height: 1.5;
  }

  #pagecontent.wernerluethy img {
    max-width: 45%;
    height: auto;
  }

  #copyright,
  #copyright-created {
    margin: 12px;
    padding-left: 0;
  }

  /* Bildbetrachter */
  #mviewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #111;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
  }

  #mviewer.open {
    display: flex;
  }

  #mviewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
  }

  #mviewer button {
    position: absolute;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #mviewer .mv-close { top: 12px; right: 12px; }
  #mviewer .mv-prev { left: 8px; top: 50%; margin-top: -24px; }
  #mviewer .mv-next { right: 8px; top: 50%; margin-top: -24px; }

  #mviewer .mv-count {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ddd;
    font: 15px sans-serif;
    pointer-events: none;
  }
}

@media (max-width: 820px) {
  #pagecontent.wernerluethy {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: #222;
  }
}

@media (max-width: 820px) {
  #pagecontent.impressum {
    width: auto;
    height: auto;
    overflow: visible;
    padding: 0 16px 24px;
    background: none;
  }

  #pagecontent.impressum .legal {
    font-size: 16px;
    padding: 0;
  }

  #pagecontent.impressum .mobile-title {
    display: none;
  }
}

@media (max-width: 820px) {
  #mviewer .mv-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 20px 22px;
    background: rgba(0, 0, 0, 0.55);
    color: #f2f2f2;
    font: 15px/1.4 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    text-align: center;
    pointer-events: none;
  }

  #mviewer .mv-caption:empty {
    display: none;
  }
}

@media (max-width: 820px) {
  #pagecontent.austellung {
    padding: 0 16px 24px;
  }

  #pagecontent .exhibitions {
    margin: 0;
  }

  #pagecontent .exhibitions td {
    font-size: 19px;
    line-height: 24px;
  }

  #pagecontent .exhibitions td.year {
    padding-right: 16px;
  }
}
