/* Reise-Detailansichten. Original links and content remain usable without JS.
   The imported HTML uses direct image links with NBSP-only paragraphs between
   them. :empty does not match those paragraphs; keep them, but inline them. */
.zyl-travel__content > a:has(> img:only-child),
.zyl-travel__content > p:has(> a:only-child > img:only-child):has(+ p > a:only-child > img:only-child),
.zyl-travel__content > p:has(> a:only-child > img:only-child) + p:has(> a:only-child > img:only-child) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: calc((100% - 80px) / 3);
  min-height: 180px;
  margin: 0 10px 12px 0;
  padding: 6px;
  border: 1px solid var(--zyl-line);
  background: var(--zyl-paper);
}
.zyl-travel__content > a:has(> img:only-child) img,
.zyl-travel__content > p:has(> a:only-child > img:only-child):has(+ p > a:only-child > img:only-child) > a > img,
.zyl-travel__content > p:has(> a:only-child > img:only-child) + p:has(> a:only-child > img:only-child) > a > img {
  width: auto;
  max-width: 100%;
  max-height: 166px;
  margin: 0;
  object-fit: contain;
}
.zyl-travel__content > a:has(> img:only-child) + p:has(+ a > img:only-child) {
  display: inline;
  margin: 0;
}
/* Adjacent linked images separated only by a line break are also a row. */
.zyl-travel__content > a:has(> img:only-child) + br:has(+ a > img:only-child) { display: none; }
/* The separately headed ship image is not part of the preceding gallery. */
.zyl-travel__content > h2 + a:has(> img:only-child):not(:has(+ a > img:only-child, + p + a > img:only-child, + br + a > img:only-child)),
.zyl-travel__content > h3 + a:has(> img:only-child):not(:has(+ a > img:only-child, + p + a > img:only-child, + br + a > img:only-child)) {
  float: left;
  width: min(42%, 320px);
  min-height: 220px;
  margin: 0 24px 16px 0;
}
.zyl-travel__content > h2 + a:has(> img:only-child) img,
.zyl-travel__content > h3 + a:has(> img:only-child) img { max-height: 206px; }

/* A native modal dialog is created only after an eligible link is activated. */
.zyl-lightbox[open] {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border: 0;
  background: rgba(4, 17, 26, .91);
  color: #fff;
  box-sizing: border-box;
  overflow: auto;
}
.zyl-lightbox::backdrop { background: rgba(4, 17, 26, .91); }
.zyl-lightbox__panel { display: flex; flex-direction: column; align-items: center; width: min(100%, 1100px); max-height: 100%; gap: 14px; }
.zyl-lightbox .zyl-lightbox__close {
  align-self: flex-end;
  flex: none;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 16px;
  border: 2px solid #fff;
  border-radius: 3px;
  background: #fff;
  color: #102f47;
  font: 700 16px/1.3 system-ui, sans-serif;
  cursor: pointer;
}
.zyl-lightbox .zyl-lightbox__close:hover { background: #eaf0ef; color: #102f47; }
.zyl-lightbox .zyl-lightbox__close:focus-visible, .zyl-lightbox a:focus-visible { outline: 3px solid #ffdf6e; outline-offset: 4px; }
.zyl-lightbox__image { display: block; width: auto; max-width: 100%; max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); object-fit: contain; }
.zyl-lightbox__message { margin: 0; text-align: center; color: #fff; font: 400 16px/1.5 system-ui, sans-serif; }
.zyl-lightbox .zyl-lightbox__fallback { color: #fff; text-decoration: underline; }
.zyl-lightbox [hidden] { display: none !important; }
@media (max-width: 640px) {
  .zyl-travel__content > a:has(> img:only-child),
  .zyl-travel__content > p:has(> a:only-child > img:only-child):has(+ p > a:only-child > img:only-child),
  .zyl-travel__content > p:has(> a:only-child > img:only-child) + p:has(> a:only-child > img:only-child) {
    width: calc((100% - 48px) / 2);
    min-height: 130px;
  }
  .zyl-travel__content > a:has(> img:only-child) img,
  .zyl-travel__content > p:has(> a:only-child > img:only-child):has(+ p > a:only-child > img:only-child) > a > img,
  .zyl-travel__content > p:has(> a:only-child > img:only-child) + p:has(> a:only-child > img:only-child) > a > img { max-height: 116px; }
  .zyl-travel__content > h2 + a:has(> img:only-child):not(:has(+ a > img:only-child, + p + a > img:only-child, + br + a > img:only-child)),
  .zyl-travel__content > h3 + a:has(> img:only-child):not(:has(+ a > img:only-child, + p + a > img:only-child, + br + a > img:only-child)) {
    float: none;
    width: min(100%, 320px);
    min-height: 200px;
    margin: 0 0 18px;
  }
  .zyl-travel__content > h2 + a:has(> img:only-child) img,
  .zyl-travel__content > h3 + a:has(> img:only-child) img { max-height: 186px; }
}
@media print { .zyl-lightbox { display: none !important; } }
