/* Culina Lignea – mobile Zusatzregeln für die historische Lightroom-Galerie.
   Bewahrt das bestehende Desktop-Layout. Keine Originalbilder verändert. */
@media screen and (max-width: 1270px) {
  #wrapper_large {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 0 16px;
  }
  #stage2, #previewFull {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    float: none;
  }
  #previewFull #detailImage { max-width: 100%; box-sizing: border-box; }
  #detailImage a { display: block; max-width: 100%; }
  #detailImage a > div {
    margin-left: 0 !important;
    padding: 12px;
    box-sizing: border-box;
    max-width: 100%;
  }
  #previewImage, #detailImage img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100% !important;
    max-height: 80vh;
    margin: 0 auto;
    object-fit: contain;
  }
}
@media screen and (max-width: 1010px) {
  #wrapper_thumb {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 0 16px;
  }
  #stage, #index {
    float: none;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  #index {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  #index > .clear, #index > .emptyThumbnail { display: none; }
  #index > .thumbnail {
    float: none;
    width: 100%;
    min-width: 0;
    height: 170px;
    box-sizing: border-box;
    border: 1px solid #eeeeee !important;
    overflow: hidden;
  }
  #index > .thumbnail > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
  }
  #index > .thumbnail > a > div {
    margin: 0 !important;
    padding: 10px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  #index img.thumb {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
  }
  #sitetitle h1 { font-size: 21px; line-height: 1.35; }
  #contact a { display: inline-block; padding: 8px 0; }
}
@media screen and (max-width: 720px) {
  body { padding: 12px 0 20px; }
  #wrapper_thumb, #wrapper_large { padding-left: 12px; padding-right: 12px; }
  #index { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  #index > .thumbnail { height: 155px; }
  #detailTitle, #detailCaption { font-size: 15px; line-height: 1.5; }
  .detailNav ul { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
  .detailNav ul li { padding: 0; }
  .detailNav a, .detailNav li { font-size: 15px; line-height: 1.45; }
  .detailNav a { display: inline-block; padding: 11px 13px; min-height: 44px; box-sizing: border-box; }
  #previewImage, #detailImage img { max-height: 72vh; }
}
@media screen and (max-width: 520px) {
  #index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  #index > .thumbnail { height: 157px; }
  #index > .thumbnail > a > div { padding: 7px; }
  #sitetitle h1 { font-size: 20px; }
  #detailImage a > div { padding: 8px; }
  #detailCaption { padding: 0 4px; overflow-wrap: break-word; }
}
