/* ========== InfoWindow – final pack (slot fix + compact details) ========== */

#intro { position: relative; }

#info-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: #333;
  margin: 0 auto 8px auto;
  line-height: 1.4;
  max-width: var(--w, 460px);
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#info-window {
  position: relative;
  overflow: visible;
  margin-bottom: 48px;
  border: none;                  /* nyilak kilóghatnak */
  width: var(--w, 460px);
  z-index: 950;                  /* tipbar fölé */
}

/* Egységes slot – minden média ugyanakkora helyet kap */
#info-window .info-slide{
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  height: var(--iw-h, var(--card-h, 190px));
}

/* Média wrapper: töltse ki a slotot, ne nőjön túl */
#info-window .info-slide .info-media{
  display:flex; align-items:center; justify-content:center;
  width:100%;
  height:100%;
  min-height: var(--iw-h, var(--card-h, 190px));
  max-height: var(--iw-h, var(--card-h, 190px));
}

/* Képek/Videó: ne torzuljon, legyen kerekített, és férjen a slotba */
#info-window img,
#info-window video{
  display:block;
  height:100%;
  width:auto;
  max-width:100%;
  object-fit:contain;
  border-radius:12px;
  overflow:hidden;
}

/* -------- Details kártya – KOMPAKT TIPÓ + slot-kitöltés -------- */
#info-window .details-card{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  border-radius:12px;
  background:#fff;
  height:100%;                  /* a teljes slotmagasságot vegye fel */
  overflow:auto;                /* tartalom görgethető, slot nem nő meg */
  padding:10px;                 /* kicsit kisebb belső padding */
  font-size:13px;               /* KOMPAKT */
  line-height:1.25;             /* KOMPAKT */
}

#info-window .details-card__title{
  font-weight:600;
  opacity:.85;
  margin-bottom:6px;            /* KOMPAKT */
  font-size:13px;               /* egységes méret a tartalommal */
  line-height:1.25;
}

#info-window .details-card__inner > div{
  margin:2px 0;                 /* KOMPAKT – kisebb sormargó */
}

#info-window .details-card hr{
  margin:6px 0;                 /* KOMPAKT */
  border:0;
  border-top:1px solid var(--border, #e5e0d7);
}

/* Details card csak tartalom esetén jelenjen meg – (védő stílus) */
#details-card { display:none; position:relative; }
#info-window .details-card { overflow:hidden; }

/* ---- Vezérlő nyilak (kívül, nem a képen) ---- */
#info-window .info-prev,
#info-window .info-next {
  position: absolute;
  top: calc(100% + 12px);
  transform: translateY(0);
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  font-weight: 600;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  user-select: none;
  cursor: pointer;
  z-index: 2;
}
#info-window .info-prev { left: 12px; }
#info-window .info-next { right: 12px; }
#info-window .info-prev:hover,
#info-window .info-next:hover { background: rgba(255,255,255,0.95); }

/* ---- Pöttyök (középre igazítva, a nyilak „sorában”) ---- */
#info-dots{
  display:flex;
  gap:6px;
  justify-content:center;
  align-items:center;
  margin-top:12px;
  position:relative;
}
#info-dots .dot{
  width:8px; height:8px;
  border-radius:50%;
  background:#cfcfcf;
  cursor:pointer;
}
#info-dots .dot.active { background:#333; }

.info-media.highlight { outline:2px solid #88a; border-radius:12px; }

/* ========== Responsive ==========
   (méretek maradnak, csak a meglévő variánsok finomhangolása) */
@media (max-width: 767.98px){
  #info-title{ font-size:14px; padding:0 12px; max-width:100%; }
  #info-window{
    max-width:100%;
    border:none;
    margin-bottom:32px;
    --card-h: clamp(110px, 20vh, 170px);
    --w: 100%;
  }
  #info-window .info-prev { left:10px; }
  #info-window .info-next { right:10px; }
}

@media (min-width: 768px) and (max-width: 1439px){
  #info-window{ --w: 340px; --card-h: clamp(120px, 21vh, 190px); }
  #info-title{ max-width:340px; font-size:15px; }
}

@media (min-width: 1440px){
  #info-window{ --w: 340px; --card-h: clamp(130px, 20vh, 200px); }
  #info-title{ max-width:340px; font-size:16px; }
}

/* ==== PATCH: egységes slot + kerek sarok + kompakt Details ==== */

/* 1) A slide SLOT mérete: rögzített arány, nincs méricskélés/ugrálás */
#info-window .info-slide{
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto !important;           /* a var(--iw-h) override-ot kiütjük */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2) Közös WRAPPER minden tartalomnak: itt a kerek sarok + clipping */
#info-window .info-slide .info-media{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;               /* a gyerek középen, de a sloton belül */
  justify-content: center;
  border-radius: 12px;               /* kerek sarok MINDENRE */
  overflow: hidden;                  /* a gyereket itt vágjuk le */
}

/* 3) Kép/Videó: a wrapper tölti a keretet; a gyerek csak igazodik.
      (nem piszkáljuk a videó méretezését, nem tesszük szélesebbre) */
#info-window img,
#info-window video{
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;               /* ne vágjunk a képből/videóból */
  border-radius: 0 !important;       /* a sarok a WRAPPEREN van */
}

/* 4) Details kártya: pontosan a slotot töltse ki – pont mint a videó */
#info-window .details-card{
  width: 100%;
  max-width: 100% !important;        /* ne legyen picit szélesebb */
  height: 100%;
  box-sizing: border-box;
  overflow: auto;                    /* tartalom görgethető, slot fix */
  border-radius: 0;                  /* kerek sarok a WRAPPEREN */
  /* -- kompakt tipó -- */
  font-size: 13px;
  line-height: 1.25;
}

/* 5) Kompakt függőleges ritmus a sorok között */
.details-card__title{ margin: 0 0 6px; font-weight: 600; opacity: .85; }
.details-card__inner > div{ margin: 2px 0; }
.details-card__inner hr{ margin: 6px 0; }

/* --- 1) Egységes keret és lekerekítés minden médiára (video/img/details) --- */
#info-window .info-slide .info-media{
  /* már van height/width beállításod – ez csak a keret! */
  border-radius: 12px;
  overflow: hidden;          /* a videó képe most már “belül marad” a kerek sarkokban */
  background: #fff;          /* hogy a Details alatt ne látszódjon át semmi */
}

/* a tényleges media töltsön ki szélességre is, de NE torzuljon */
#info-window img,
#info-window video{
  width: 100%;               /* korábbi width:auto helyett – a wrapper határozza meg a méretet */
  height: 100%;
  object-fit: contain;       /* így nem lesz széthúzás */
  border-radius: 0;          /* a vágást most a wrapper végzi; nem kell dupla lekerekítés */
}

/* --- 2) Kompakt details tipó + rendezett címke-érték igazítás --- */
#info-window .details-card{
  font-size: 13px;
  line-height: 1.25;
  padding: 10px 12px;        /* picit feszesebb */
}

/* sorok kisebb függőleges térközzel */
.details-card__inner > div{
  margin: 2px 0;
  display: flex;
  gap: 8px;
}

/* címkék fix (keskeny) oszlopban, szépen igazítva */
.details-card__inner > div > b{
  flex: 0 0 92px;            /* finoman állítható: 88–100px */
  font-weight: 600;
  opacity: .8;
}

/* vízszintes elválasztó kompaktabban */
#info-window .details-card hr{
  border: 0;
  border-top: 1px solid #e6e0d6;
  margin: 6px 0;
}

/* Estimated blokkok (Cost/Area/Time/Risk) is szépen zárjanak */
#info-window .details-card__inner div:last-child{
  margin-bottom: 0;
}


/* InfoWindow egységes “kártya” szélesség */
.infowindow,
.infowindow .card,
.details-card,
.image-card {
  max-width: 600px;
  margin: 0 auto;
}

/* Képslide: azonos padding/margó, mint a details */
.image-card .genimg-wrap {
  border-radius: 12px;
  overflow: hidden;
}

/* 16:9, kifeszítve mint a videó (cover) */
.image-card .genimg {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.details-card .generated-images {
  margin-top: 12px;
}
.details-card .generated-images:empty {
  display: none; /* üresen ne foglaljon helyet */
}

/* === InfoWindow — kompakt méret + egységes médiakeret =================== */

:root{
  /* könnyen hangolható méretek */
  --iw-w: 420px;                 /* teljes szélesség desktopon */
  --iw-h: 230px;                 /* egységes látható magasság */
  --iw-radius: 12px;
  --iw-shadow: 0 6px 18px rgba(0,0,0,.12);
}

/* külső ablak */
#info-window{
  width:100%;
  max-width: var(--iw-w);
  margin: 0 auto 12px;
  background: transparent;
  border: none;
  position: relative;
  z-index: 950;
}

/* látható diatér */
#info-window .info-slide{
  display:flex; justify-content:center; align-items:center;
  height: var(--iw-h);
  padding: 0;
}

/* egységes media host: minden TARTALOM pontosan ugyanott, ugyanakkora */
.info-media{
  width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;                 /* hogy a kerekítés működjön */
  border-radius: var(--iw-radius);
  box-shadow: var(--iw-shadow);
  background:#000;                 /* videónál ne villogjon a háttér */
}

/* kép / videó / vászon egységes keretezése */
.info-media > img,
.info-media > video,
.info-media > canvas{
  width:100%;
  height:100%;
  display:block;
  object-fit: contain;             /* mind ugyanakkorának HAT */
  border-radius: var(--iw-radius); /* <<< kerek sarok képre és videóra is */
}

/* details kártya ugyanebben a keretben */
.info-media .details-card{
  width:100%; height:100%;
  overflow:auto; box-sizing:border-box;
  border-radius: var(--iw-radius);
  border: 1px solid var(--border, #e3dfd6);
  background:#fff;
}

/* vezérlők / pöttyök ne csússzanak a keret alá */
#info-window .info-controls{
  position:absolute; left:8px; right:8px; bottom:8px;
  display:flex; align-items:center; justify-content:space-between;
  pointer-events:none;
}
#info-window .info-prev, #info-window .info-next{
  pointer-events:auto;
  width:26px; height:26px; border-radius:50%;
  background:#fff; border:1px solid var(--border, #ddd);
  display:grid; place-items:center; font-size:13px; cursor:pointer;
}
#info-window .info-dots{
  position:absolute; left:48px; right:48px; bottom:10px;
  display:flex; gap:6px; justify-content:center; align-items:center;
}
#info-window .info-dots button{
  width:6px; height:6px; border-radius:50%;
  border:1px solid #333; background:#ddd; cursor:pointer;
}
#info-window .info-dots button[aria-current="true"]{ background:#333; }

/* mobilon teljes szélesség, de marad a fix magasság */
@media (max-width: 767.98px){
  :root{ --iw-w: calc(100% - 24px); }
}

/* === Lightbox (kattintásra nagy kép/videó) ============================= */
.iw-lightbox{
  position: fixed; inset:0; z-index: 3000;
  background: rgba(0,0,0,.6);
  display: none; align-items:center; justify-content:center;
}
.iw-lightbox[aria-hidden="false"]{ display:flex; }

.iw-lightbox__inner{
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  background:#000; border-radius:14px;
  box-shadow: 0 20px 48px rgba(0,0,0,.35);
  position: relative; overflow:hidden;
}

.iw-lightbox__media{
  width:100%; height:100%;
  display:block; object-fit: contain;
  background:#000;
}

.iw-lightbox__close{
  position:absolute; top:10px; right:10px;
  width:32px; height:32px; border-radius:50%;
  border: none; cursor:pointer;
  background:#fff; display:grid; place-items:center;
  font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}



/* --- InfoWindow final overrides --------------------------------------- */

/* 1) kompakt alapméret (szükség szerint változtatható) */
#info-window { --w: 340px; --iw-h: 200px; }

/* ha nem 16:9-et szeretnél, rögzített magasságot használjunk a slotban */
#info-window .info-slide{
  aspect-ratio: auto !important;
  height: var(--iw-h) !important;
}

/* 2) Egységes keret MINDEN tartalomnak (kép/video/details) */
#info-window .info-slide .info-media{
  border-radius: 12px;
  overflow: hidden;
  background: #000;            /* videónál szebb */
}

/* 3) A gyerek elemeken NE legyen külön lekerekítés (különben “dupla” lesz) */
#info-window .info-slide img,
#info-window .info-slide video,
#info-window .info-slide canvas{
  width: 100%;
  height: 100%;
  object-fit: contain;         /* minden ugyanabban a dobozban, vágás nélkül */
  border-radius: 0 !important; /* sarok a WRAPPEREN van */
}

/* 4) Details pontosan ugyanakkora legyen és ugyanott */
#info-window .details-card{
  height: 100%;
  max-width: 100% !important;
  border-radius: 0 !important; /* sarok a WRAPPEREN */
  overflow: auto;               /* tartalom görgethető, slot fix */
}

/* 5) Generált kép is “contain”, hogy ugyanúgy viselkedjen mint a video */
.image-card .genimg-wrap { border-radius: 12px; overflow: hidden; }
.image-card .genimg{
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;         /* eddigi cover helyett */
  border-radius: 0 !important;
}

/* --- InfoWindow: egységes szélesség (ha még nem tetted meg) --- */
#info-window{
  --iw-w: 340px;                 /* itt állítod a végső szélességet */
  --iw-h: 216px;                 /* ez a látható magasság */
  --iw-radius: 12px;
  --iw-shadow: 0 6px 18px rgba(0,0,0,.12);
  --w: var(--iw-w);              /* régi változót hozzákötjük az újhoz */

  width: 100% !important;
  max-width: var(--iw-w) !important;
}
#info-title{ max-width: var(--iw-w) !important; }

/* Slot + media host */
#info-window .info-slide{ height: var(--iw-h) !important; }

#info-window .info-slide .info-media,
#info-window .info-slide video.info-media,     /* ha maga a <video> a host */
#info-window .info-slide img.info-media {      /* ha maga az <img> a host */
  width: 100%; height: 100%;
  border-radius: var(--iw-radius);
  overflow: hidden;
  background: #fff;                 /* ne legyen fekete sáv */
  box-shadow: var(--iw-shadow);
}

/* FILL: a videó kitölti a keretet (kisebb vágással) */
#info-window .info-slide video,
#info-window .info-slide video.info-media{
  width: 100%; height: 100%;
  object-fit: contain;
}

/* Képek maradjanak torzítás nélkül */
#info-window .info-slide img{
  width: 100%; height: 100%;
  object-fit: contain;
}

.iw-lightbox__close{ z-index: 1; pointer-events: auto; }