/* AI Summit Content – Recap-Mosaik (Frontend)
   Raster: 6 Spalten Desktop, 4 Tablet, 2 Mobile.
   Zellenhoehe wird per Container-Query-Einheit berechnet, damit die Kacheln
   ohne JavaScript quadratisch sind und beim Laden nichts springt. */

.aisc-gal {
  container-type: inline-size;
  --aisc-gap: 10px;
  --aisc-rad: 6px;
  font-family: Montserrat, system-ui, -apple-system, sans-serif;
}

.aisc-gal-title {
  font-family: Unbounded, Montserrat, sans-serif;
  font-size: clamp(20px, 2.2vw, 30px);
  margin: 0 0 16px;
}

.aisc-gal-block {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: calc((100cqw - 5 * var(--aisc-gap)) / 6);
  gap: var(--aisc-gap);
  margin-bottom: var(--aisc-gap);
}

/* Fallback fuer sehr alte Browser ohne Container-Query-Einheiten */
@supports not (width: 1cqw) {
  .aisc-gal-block { grid-auto-rows: 14vw; }
}

.aisc-tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--aisc-rad);
  background: #16191c;
  margin: 0;
}

.aisc-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
  transition: transform .6s cubic-bezier(.22, .61, .36, 1), filter .3s ease;
}

.aisc-gal[data-lightbox="1"] .aisc-tile,
.aisc-tile.is-video { cursor: pointer; }

.aisc-gal[data-lightbox="1"] .aisc-tile:hover img,
.aisc-tile.is-video:hover img { filter: brightness(1.07); }

.aisc-tile::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--aisc-rad);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  pointer-events: none;
}

/* Bildunterschrift als Overlay */
.aisc-tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 11px;
  font-size: 12px;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  background: linear-gradient(0deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .42) 45%, transparent 100%);
  pointer-events: none;
}
.aisc-r-hero figcaption,
.aisc-r-wide figcaption,
.aisc-r-rest figcaption {
  font-size: 15px;
  padding: 44px 20px 16px;
}

/* Videokachel ohne Vorschaubild */
.aisc-noposter {
  position: absolute; inset: 0;
  background: linear-gradient(140deg, #1b2226 0%, #0f1417 100%);
}

/* Video-Kachel: laedt erst beim Klick */
.aisc-tile.is-video .aisc-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .42));
}
.aisc-tile.is-video .aisc-play::before {
  content: "";
  width: 66px; height: 66px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .55);
  backdrop-filter: blur(4px);
  transition: background .25s ease, transform .25s ease, border-color .25s ease;
}
.aisc-tile.is-video .aisc-play::after {
  content: "";
  position: absolute;
  border-left: 17px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 5px;
  transition: border-left-color .25s ease;
}
.aisc-tile.is-video:hover .aisc-play::before {
  background: #55c1d6; border-color: #55c1d6; transform: scale(1.07);
}
.aisc-tile.is-video:hover .aisc-play::after { border-left-color: #04222b; }
.aisc-tile.is-video iframe,
.aisc-tile.is-video video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; z-index: 3; background: #000;
}

/* Tablet */
@media (max-width: 1100px) {
  .aisc-gal-block {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: calc((100cqw - 3 * var(--aisc-gap)) / 4);
    grid-auto-flow: row dense;
  }
  .aisc-gal-block .aisc-tile {
    grid-column: auto / span var(--w4) !important;
    grid-row: auto / span var(--h4) !important;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .aisc-gal-block {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: calc((100cqw - 1 * var(--aisc-gap)) / 2);
  }
  .aisc-gal-block .aisc-tile {
    grid-column: auto / span var(--w2) !important;
    grid-row: auto / span var(--h2) !important;
  }
  .aisc-tile figcaption { font-size: 11px; padding: 20px 10px 8px; }
  .aisc-r-hero figcaption, .aisc-r-wide figcaption, .aisc-r-rest figcaption { font-size: 13px; padding: 30px 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .aisc-tile img { transition: none; }
}

/* ---------- Lightbox ---------- */
.aisc-lb {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(6, 7, 8, .96);
  display: none;
  align-items: center; justify-content: center;
}
.aisc-lb.is-open { display: flex; }
.aisc-lb img {
  max-width: 92vw; max-height: 86vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.aisc-lb-cap {
  position: absolute; left: 0; right: 0; bottom: 22px;
  text-align: center; color: #f2f5f7;
  font-family: Montserrat, sans-serif; font-size: 14px;
  padding: 0 60px;
}
.aisc-lb button {
  position: absolute;
  background: transparent; border: 0; color: #fff;
  font-size: 34px; line-height: 1; padding: 16px;
  cursor: pointer; opacity: .6; transition: opacity .2s, color .2s;
}
.aisc-lb button:hover { opacity: 1; color: #55c1d6; }
.aisc-lb .aisc-lb-close { top: 8px; right: 14px; }
.aisc-lb .aisc-lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.aisc-lb .aisc-lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .aisc-lb .aisc-lb-prev, .aisc-lb .aisc-lb-next { font-size: 26px; padding: 10px; }
  .aisc-lb-cap { font-size: 12px; padding: 0 20px; }
}
