/* Homepage only: readable card tracks and continuous opening-column flow. */
body main.fix .k24-home-popular-panel .stories-post {
 display:grid;grid-template-columns:80px minmax(0,1fr);column-gap:12px;row-gap:0;
 align-items:start;
}
body main.fix .k24-home-popular-panel .stories-post-content {display:contents;}
body main.fix .k24-home-popular-panel .k24-home-popular-heading {grid-column:2;grid-row:1;min-width:0;}
body main.fix .k24-home-popular-panel .stories-post-thumb {
 grid-column:1;grid-row:1;align-self:start;width:80px;min-width:0;max-width:none;height:60px;
 margin:0;border-radius:7px;overflow:hidden;
}
body main.fix .k24-home-popular-panel .stories-post-thumb img {
 display:block;width:100%;height:100%;min-height:0;object-fit:cover;object-position:center;border-radius:7px;
}
body main.fix .k24-home-popular-panel p.k24-card-description {grid-column:1/-1;grid-row:2;}
@media(min-width:360px) and (max-width:1199px){
 body main.fix .k24-home-popular-panel .stories-post {grid-template-columns:96px minmax(0,1fr);}
 body main.fix .k24-home-popular-panel .stories-post-thumb {width:96px;height:72px;}
}
/* These three stories remain one list; no narrow three-column text tracks. */
@media(min-width:600px){
 body main.fix .k24-home-compact-top > .row {display:grid;grid-template-columns:minmax(0,1fr);row-gap:20px;}
 body main.fix .k24-home-compact-top > .row > [class*="col-"] {width:100%;max-width:none;min-width:0;}
 body main.fix .k24-home-compact-top .horizontal-post-four {
  display:grid;grid-template-columns:160px minmax(0,1fr);column-gap:16px;row-gap:0;align-items:start;
 }
 body main.fix .k24-home-compact-top .horizontal-post-content-four {display:contents;}
 body main.fix .k24-home-compact-top .k24-card-heading-group {grid-column:2;grid-row:1;}
 body main.fix .k24-home-compact-top .horizontal-post-thumb-four {
  grid-column:1;grid-row:1/3;width:160px;height:120px;align-self:start;border-radius:7px;
 }
 body main.fix .k24-home-compact-top .horizontal-post-thumb-four img {
  display:block;width:100%;height:100%;min-height:0;object-fit:cover;object-position:center;
 }
 body main.fix .k24-home-compact-top p.k24-card-description {grid-column:2;grid-row:2;}
}
@media(max-width:599px){
 body main.fix .k24-home-compact-top .horizontal-post-content-four {display:contents;}
 body main.fix .k24-home-compact-top .k24-card-heading-group {grid-column:2;grid-row:1;min-width:0;}
 body main.fix .k24-home-compact-top .horizontal-post-thumb-four {grid-column:1;grid-row:1;}
 body main.fix .k24-home-compact-top p.k24-card-description {grid-column:1/-1;grid-row:2;}
 body main.fix .k24-home-compact-top .horizontal-post-four {row-gap:0;}
}
/* Preserve source order: opening left column, sidebar, calculator. The sidebar
   spans the two opening grid rows; the calculator follows the left articles.
   Existing wrapper boxes flatten only here, without moving or cloning nodes. */
@media(min-width:1200px){
 body main.fix {
  --k24-opening-container:min(1320px,100%);--k24-opening-pad:24px;
  display:grid;
  grid-template-columns:minmax(0,1fr)
   calc((var(--k24-opening-container) - 2 * var(--k24-opening-pad) + 30px) * .75)
   calc((var(--k24-opening-container) - 2 * var(--k24-opening-pad) + 30px) * .25)
   minmax(0,1fr);
  grid-template-rows:min-content auto;
 }
 body main.fix > * {grid-column:1/-1;min-width:0;}
 body main.fix > .banner-post-area-five,
 body main.fix > .banner-post-area-five > .container,
 body main.fix > .banner-post-area-five > .container > .row {display:contents;}
 body main.fix > .banner-post-area-five > .container > .row > .col-xl-9 {
  grid-column:2;grid-row:1;width:100%;align-self:start;margin-top:32px;
 }
 body main.fix > .banner-post-area-five > .container > .row > .col-xl-3 {
  grid-column:3;grid-row:1/3;width:100%;align-self:start;margin-top:32px;
 }
 body main.fix > #kalkulator-snage-klime {grid-column:2;grid-row:2;align-self:start;}
 body main.fix > #kalkulator-snage-klime > .container {
  width:100% !important;max-width:none !important;padding-inline:15px;margin-inline:0 !important;
 }
}
@media(min-width:1400px){body main.fix {--k24-opening-container:min(1320px,calc(100% - 48px));--k24-opening-pad:34px;}}
@media(min-width:1600px){body main.fix {--k24-opening-pad:42px;}}

/* Homepage ads: one mount per existing position, shared mobile rectangle.
   Existing margins, desktop formats, backgrounds and borders remain unchanged. */
body main.fix .k24-home-ad-size-mobile {display:none;}
@media(min-width:768px){
 body main.fix #k24-ad-before-practical > .klima24-v98-ad-creative {
  width:970px;max-width:100%;height:90px;min-height:90px;flex:0 1 970px;
 }
}
@media(max-width:767px){
 body main.fix .k24-home-ad-slot {display:flex;justify-content:center;min-width:0;}
 body main.fix .k24-home-ad-slot > .k24-home-ad-creative {
  box-sizing:border-box;width:300px;min-width:300px;max-width:300px;
  height:250px;min-height:250px;max-height:250px;aspect-ratio:auto;
  flex:none;margin-inline:0;
 }
 body main.fix .k24-home-ad-size-desktop {display:none;}
 body main.fix .k24-home-ad-size-mobile {display:inline;}
}

/* Approved homepage Popular topics: vertical cards on phones only.
   Card text, image files, panel glass and separators remain unchanged. */
@media(max-width:767px){
 body main.fix .k24-home-popular-panel .stories-post {
  position:relative;grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto auto auto;gap:8px;min-width:0;
 }
 body main.fix .k24-home-popular-panel .k24-home-popular-heading {display:contents;}
 body main.fix .k24-home-popular-panel .stories-post-thumb {
  grid-column:1;grid-row:1;width:100%;height:auto;aspect-ratio:16/9;
  min-width:0;max-width:100%;margin:0;border-radius:8px;
 }
 body main.fix .k24-home-popular-panel .stories-post-thumb > a {display:block;width:100%;height:100%;}
 body main.fix .k24-home-popular-panel .stories-post-thumb img {
  width:100%;height:100%;aspect-ratio:16/9;object-fit:cover;object-position:center;border-radius:inherit;
 }
 body main.fix .k24-home-popular-panel .stories-post .post-tag-four {
  position:relative;z-index:1;grid-column:1;grid-row:1;
  align-self:start;justify-self:end;
  max-width:calc(100% - 16px);margin:8px;padding:5px 8px;
  background:rgba(244,250,255,.94);border:1px solid rgba(197,222,239,.7);
  border-radius:6px;white-space:normal;overflow-wrap:anywhere;
 }
 body main.fix .k24-home-popular-panel .stories-post .post-title {
  grid-column:1;grid-row:2;min-width:0;margin:0;overflow-wrap:break-word;
 }
 html body main.fix .k24-home-popular-panel .stories-post p.k24-card-description {
  grid-column:1;grid-row:3;min-width:0;margin:0!important;
 }
}

/* Homepage Popular topics: full-width desktop photos and compact text stack.
   Mobile/tablet rules, sidebar width, panel glass and separators stay untouched. */
@media(min-width:1024px){
 body main.fix .k24-home-popular-panel .stories-post {
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;
  column-gap:0;row-gap:8px;min-width:0;
 }
 body main.fix .k24-home-popular-panel .stories-post-thumb {
  grid-column:1;grid-row:1;width:100%;max-width:100%;height:auto;
  aspect-ratio:16/9;margin:0;border-radius:8px;
 }
 body main.fix .k24-home-popular-panel .stories-post-thumb > a {display:block;width:100%;height:100%;}
 body main.fix .k24-home-popular-panel .stories-post-thumb img {
  width:100%;height:100%;aspect-ratio:16/9;object-fit:cover;object-position:center;border-radius:inherit;
 }
 body main.fix .k24-home-popular-panel .stories-post-content {
  grid-column:1;grid-row:2;display:flex;flex-direction:column;gap:6px;min-width:0;
 }
 body main.fix .k24-home-popular-panel .k24-home-popular-heading {
  display:flex;flex-direction:column;gap:6px;grid-column:auto;grid-row:auto;min-width:0;
 }
 body main.fix .k24-home-popular-panel .stories-post .post-tag-four {position:static;margin:0;align-self:flex-start;width:fit-content;}
 body main.fix .k24-home-popular-panel .stories-post .post-title {margin:0;overflow-wrap:break-word;}
 html body main.fix .k24-home-popular-panel .stories-post p.k24-card-description {margin:0!important;}
}
