/* media: Overrides des media-Agents, wird nach design.css geladen */

/* <picture> soll Layout und Selektoren nicht verändern: das <img> verhält sich wie ein direktes Kind */
:is(.own-pic,.live-pic,.feat-img,.pic,.cs-shot,.gallery button,.uni-poster,.film-frame,.me)>picture{display:contents}
picture>source{display:none}

/* Gemeinsamer Gerätelook für Hochformat-Screenshots auf Marine */
:root{
  --m-device-bg:radial-gradient(120% 90% at 50% 0%,var(--p-navy-600) 0%,var(--p-navy-800) 55%,var(--p-navy-900) 100%);
  --m-device-ring:0 0 0 5px rgba(255,255,255,.92),0 24px 40px -18px rgb(var(--p-navy-950-rgb) / .7);
}

/* ---------- Vorschau-Kacheln ---------- */
/* Desktop-Screenshots und Filmstill sind 16:9: Kachel passend, damit nichts seitlich abgeschnitten wird */
.live-pic{aspect-ratio:16/9!important}
.live-pic img{object-position:50% 0}
/* Zoomies: Seitenbalken sind aus dem Bild entfernt, Ausschnitt mit Logo, Start-Button und Juna */
.live-pic img[src*="live-zoomies"]{object-position:50% 23%}
/* Filmstill: Titel steht links, also nicht mittig beschneiden */
:is(.live-pic,.own-pic) img[src*="film-schamanen"]{object-position:0 50%}

/* Hochformat in Kacheln (.port): einheitliche Gerätegröße */
:is(.own-pic,.live-pic).port img{width:min(58%,230px)!important;max-width:none!important;height:auto!important}

/* Seitenkarte mit Hochformat (Ultron): gleicher Gerätelook wie .port statt weißer Fläche */
.shot .pic.tall{background:var(--m-device-bg)!important;display:flex;justify-content:center;align-items:flex-start;overflow:hidden}
.shot .pic.tall img{position:static!important;inset:auto!important;width:min(46%,210px)!important;height:auto!important;margin-top:6%;object-fit:fill!important;filter:none!important;border-radius:14px;box-shadow:var(--m-device-ring)}

/* ---------- Case-Bildstreifen ---------- */
.case-s{--shot-h:clamp(340px,62vh,560px)}
.cs-strip{align-items:start;scroll-padding-inline:var(--s100,8px)}
.cs-shot{display:grid!important;grid-template-rows:var(--shot-h) auto;justify-items:start}
.cs-shot img{align-self:center;max-width:none!important;object-fit:fill!important}
/* Hochformat: volle Streifenhöhe, als Gerät gerahmt */
.cs-shot.tall img{height:var(--shot-h)!important;width:auto!important;border:0!important;border-radius:18px!important;background:#fff;box-shadow:var(--m-device-ring)!important}
/* Querformat: gleiche Höhe, wenn Platz ist, sonst Breite begrenzt und vertikal mittig. Nie beschnitten. */
.cs-shot.wide img{width:auto!important;height:auto!important;max-height:var(--shot-h)!important;max-width:min(82vw,1040px)!important;border:0!important;border-radius:12px!important;box-shadow:0 0 0 1px rgba(255,255,255,.22),0 30px 60px -30px rgb(var(--p-navy-950-rgb) / .7)!important}
.cs-shot.tall{padding:5px 5px 0}
@media(max-width:700px){
  .case-s{--shot-h:min(60vh,500px)}
  .cs-shot.wide img{max-width:86vw!important}
}

/* ---------- Fotografie: ruhiges Blocksatz-Raster ohne Beschnitt ---------- */
.gallery{display:flex!important;flex-wrap:wrap;gap:16px;columns:auto!important}
.gallery>button{flex:var(--ar,1.5) 1 calc(var(--ar,1.5) * 240px);aspect-ratio:var(--ar,1.5);margin:0!important;break-inside:auto;border-radius:var(--k-r-in,12px)!important;background:#0a1530!important;box-shadow:0 0 0 1px var(--k-line,rgba(255,255,255,.12))}
.gallery>button img{width:100%;height:100%;object-fit:cover;transition:transform 900ms var(--ease),filter 600ms var(--ease)!important}
.gallery>button:hover img{transform:scale(1.02)!important;filter:brightness(1.05)}
.gallery>button:focus-visible{outline:2px solid #cfe0ff;outline-offset:3px}
.gallery span{left:12px!important;bottom:12px!important;padding:3px 10px!important;border-radius:999px!important;background:rgb(var(--p-navy-950-rgb) / .62)!important;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color:var(--p-mist)!important;transform:translateY(4px);transition:opacity 300ms var(--ease),transform 300ms var(--ease)!important}
.gallery button:hover span,.gallery button:focus-visible span{transform:none}
@media(hover:none){.gallery span{transform:none}}
@media(max-width:560px){
  .gallery{gap:12px}
  .gallery>button{flex:1 1 100%}
}

/* ---------- Lightbox ---------- */
dialog#lb{width:100vw;height:100vh;height:100dvh;max-width:none!important;max-height:none!important;margin:0;inset:0;overflow:hidden!important;overscroll-behavior:contain;touch-action:pinch-zoom}
dialog#lb::backdrop{background:rgb(var(--p-navy-950-rgb) / .94)}
#lb figure{margin:0;width:100%;height:100%;box-sizing:border-box;display:grid!important;align-content:center;justify-items:center;gap:14px;padding:calc(68px + env(safe-area-inset-top)) 72px calc(28px + env(safe-area-inset-bottom))}
#lb img{width:auto;height:auto;max-width:100%!important;max-height:calc(100dvh - 190px)!important;object-fit:contain;border-radius:10px;box-shadow:0 30px 80px -30px rgb(var(--p-navy-950-rgb) / .8);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#lb figcaption{max-width:62ch;text-align:center;color:var(--p-mist)!important;font-size:15px;line-height:1.45;text-wrap:balance;padding:0 8px}
#lb .btn{min-width:44px;min-height:44px;z-index:2}
#lb .lb-x{top:calc(14px + env(safe-area-inset-top))!important;right:calc(14px + env(safe-area-inset-right))!important}
#lb .lb-p,#lb .lb-n{top:50%!important;transform:translateY(-50%);width:48px;padding:0;justify-content:center}
#lb .lb-p{left:calc(16px + env(safe-area-inset-left))!important}
#lb .lb-n{right:calc(16px + env(safe-area-inset-right))!important}
#lb.single .lb-p,#lb.single .lb-n{display:none}
@media(max-width:700px){
  #lb figure{padding:calc(70px + env(safe-area-inset-top)) 12px calc(88px + env(safe-area-inset-bottom))}
  #lb img{max-height:calc(100dvh - 250px)!important;border-radius:8px}
  #lb .lb-p,#lb .lb-n{top:auto!important;bottom:calc(20px + env(safe-area-inset-bottom))!important;transform:none}
  #lb .lb-p{left:calc(50% - 60px)!important}
  #lb .lb-n{right:calc(50% - 60px)!important}
}

@media(prefers-reduced-motion:reduce){
  .gallery>button img,.gallery span{transition:none!important;transform:none!important}
}

/* Head of Agent: mobil keine Leerflächen um Querformat-Screenshots */
@media (max-width:700px){
  .cs-strip{align-items:flex-start}
  .cs-shot.wide{grid-template-rows:auto auto!important}
  .cs-shot.wide img{max-height:none!important;width:86vw!important;max-width:86vw!important;height:auto!important}
}
