/* 3.3.41 — HOME VISUAL DENSITY / AI FACTOR
 * Deterministyczna gęstość sekcji głównej: mniej pustej wysokości przy małej liczbie elementów,
 * bez zmiany struktury katalogów i bez dokładania efektów wizualnych. */
.tvk-section--home-balanced { padding-block:clamp(36px,4.2vw,56px); }
.tvk-section--home-compact { padding-block:clamp(28px,3.3vw,44px); }
.tvk-section--home-balanced .tvk-section-head { margin-bottom:22px; }
.tvk-section--home-compact .tvk-section-head { margin-bottom:16px; }
.tvk-section--picks { padding-block:clamp(36px,4.2vw,54px); }
.tvk-home-hero { padding-top:clamp(42px,4.8vw,64px); padding-bottom:clamp(42px,4.5vw,60px); }
.tvk-home-hero__statement { margin-top:26px; }

.tvk-bridge-grid--home { grid-template-columns:repeat(3,minmax(0,1fr)); max-width:none; gap:18px; }
@media (min-width:901px) {
  .tvk-bridge-grid--home.tvk-bridge-grid--count-1 { grid-template-columns:minmax(0,680px); max-width:680px; }
  .tvk-bridge-grid--home.tvk-bridge-grid--count-2 { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:980px; }
}
.tvk-section--ecosystem-latest-home .tvk-bridge-head { margin-bottom:22px; }
.tvk-section--ecosystem-latest-home .tvk-card--sibling { display:flex; min-width:0; flex-direction:column; }
.tvk-section--ecosystem-latest-home .tvk-card--sibling .tvk-card__body { display:flex; min-width:0; flex:1; flex-direction:column; }
.tvk-section--ecosystem-latest-home .tvk-card--sibling .tvk-card__body > p { display:-webkit-box; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.tvk-section--ecosystem-latest-home .tvk-card--sibling .tvk-card__body h3 { display:-webkit-box; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:3; }

.tvk-section--home-editor .tvk-editorial-content > :first-child { margin-top:0; }
.tvk-section--home-editor .tvk-editorial-content > :last-child { margin-bottom:0; }

@media (min-width:901px) and (max-width:1120px) {
  .tvk-bridge-grid--home { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
  .tvk-section--ecosystem-latest-home .tvk-card--sibling .tvk-card__body > p { display:none; }
}
@media (min-width:721px) and (max-width:900px) {
  .tvk-bridge-grid--home { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tvk-section--home-balanced { padding-block:clamp(32px,5vw,44px); }
  .tvk-section--home-compact { padding-block:clamp(26px,4.4vw,36px); }
}
@media (max-width:720px) {
  .tvk-home-hero { padding-top:28px; padding-bottom:34px; }
  .tvk-home-hero__statement { margin-top:22px; }
  .tvk-section--picks { padding-block:30px 34px; }
  .tvk-section--home-balanced { padding-block:30px 36px; }
  .tvk-section--home-compact { padding-block:24px 30px; }
  .tvk-section--home-balanced .tvk-section-head,
  .tvk-section--home-compact .tvk-section-head { margin-bottom:16px; }
  .tvk-section--ecosystem-latest-home .tvk-bridge-head { margin-bottom:16px; }
  /* Mobile is a separate editorial composition, not a shrunken desktop. */
  .tvk-section--formats-home { display:none; }
  .tvk-section--rk-news .tvk-section-head p,
  .tvk-home-granica .tvk-section-head p,
  .tvk-section--ecosystem-latest-home .tvk-bridge-head p { display:none; }
  .tvk-section--history-home .tvk-section-head { align-items:center; text-align:center; }
  .tvk-section--history-home .tvk-section-head > div { display:grid; justify-items:center; width:100%; }
  .tvk-section--history-home .tvk-section-head .tvk-kicker,
  .tvk-section--history-home .tvk-section-head .tvk-text-link { justify-content:center; }
  .tvk-section--history-home .tvk-history-strip--home { width:min(100%,380px); margin-inline:auto; }
}

/* 3.3.42 — HOME CONTENT REGRESSION HARDENING
 * Rzeczywista liczba kart steruje siatką; długie tytuły nie rozciągają pojedynczych
 * pozycji i nie rozbijają rytmu sekcji. Reguły są ograniczone do strony głównej. */
@media (min-width:901px) {
  .tvk-editorial-grid--home.tvk-editorial-grid--count-1 { grid-template-columns:minmax(0,720px); max-width:720px; }
  .tvk-editorial-grid--home.tvk-editorial-grid--count-2 { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:980px; }
  .tvk-editorial-grid--home.tvk-editorial-grid--count-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .tvk-ketrzyn-grid--home.tvk-ketrzyn-grid--count-1 { grid-template-columns:minmax(0,720px); max-width:720px; }
  .tvk-ketrzyn-grid--home.tvk-ketrzyn-grid--count-2 { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:980px; }
  .tvk-program-grid--home.tvk-program-grid--count-1 { grid-template-columns:minmax(0,680px); max-width:680px; }
  .tvk-program-grid--home.tvk-program-grid--count-2 { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:980px; }
  .tvk-history-strip--home.tvk-history-strip--count-1 { grid-template-columns:minmax(0,860px); max-width:860px; }

  .tvk-editorial-grid--home > .tvk-card,
  .tvk-ketrzyn-grid--home > .tvk-card { display:flex; min-width:0; height:100%; flex-direction:column; }
  .tvk-editorial-grid--home > .tvk-card .tvk-card__body,
  .tvk-ketrzyn-grid--home > .tvk-card .tvk-card__body { display:flex; min-width:0; flex:1; flex-direction:column; }
  .tvk-editorial-grid--home > .tvk-card .tvk-card__body h3,
  .tvk-ketrzyn-grid--home > .tvk-card .tvk-card__body h3 {
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
  }
  .tvk-editorial-grid--home > .tvk-card .tvk-card__body > p,
  .tvk-ketrzyn-grid--home > .tvk-card .tvk-card__body > p {
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
  .tvk-editorial-grid--home > .tvk-card .tvk-card__meta,
  .tvk-ketrzyn-grid--home > .tvk-card .tvk-card__meta { margin-top:auto; }
}

@media (min-width:780px) and (max-width:900px) {
  .tvk-editorial-grid--home.tvk-editorial-grid--count-3,
  .tvk-ketrzyn-grid--home.tvk-ketrzyn-grid--count-3 { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
  .tvk-program-grid--home.tvk-program-grid--count-3 { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
}
@media (min-width:721px) and (max-width:779px) {
  .tvk-editorial-grid--home.tvk-editorial-grid--count-1,
  .tvk-ketrzyn-grid--home.tvk-ketrzyn-grid--count-1,
  .tvk-program-grid--home.tvk-program-grid--count-1 { grid-template-columns:minmax(0,1fr); }
  .tvk-editorial-grid--home.tvk-editorial-grid--count-3 > :last-child,
  .tvk-ketrzyn-grid--home.tvk-ketrzyn-grid--count-3 > :last-child,
  .tvk-program-grid--home.tvk-program-grid--count-3 > :last-child { grid-column:1 / -1; width:min(100%,440px); justify-self:center; }
}

@media (max-width:720px) {
  .tvk-editorial-grid--home > .tvk-card:first-child .tvk-card__body h3,
  .tvk-ketrzyn-grid--home > .tvk-card:first-child .tvk-card__body h3 {
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
  }
  .tvk-editorial-grid--home > .tvk-card:first-child .tvk-card__body > p,
  .tvk-ketrzyn-grid--home > .tvk-card:first-child .tvk-card__body > p {
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
  .tvk-program-grid--home .tvk-program-card h3 {
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
  }
}

@media (max-width:430px) {
  .tvk-section--home-balanced { padding-block:28px 32px; }
  .tvk-section--home-compact { padding-block:22px 26px; }
  .tvk-section--picks { padding-block:28px 30px; }
  .tvk-section--home-balanced .tvk-section-head,
  .tvk-section--home-compact .tvk-section-head { margin-bottom:14px; }
  .tvk-home-hero { padding-top:24px; padding-bottom:30px; }
  .tvk-home-hero__statement { margin-top:18px; padding-top:15px; }
}

/* 3.3.42 — HOME PICKS intrinsic-size overflow guard
   Media z dużym naturalnym wymiarem nie może poszerzać toru gridu karty. */
.tvk-home-picks .tvk-card--feature > .tvk-card__media-wrap,
.tvk-home-picks .tvk-card--feature > .tvk-card__body,
.tvk-home-picks .tvk-card--promoted > .tvk-card__media-wrap,
.tvk-home-picks .tvk-card--promoted > .tvk-card__body {
  min-width: 0;
}

/* Home picks są kartami pionowymi. Dziedziczone `height:100%` z wariantu feature
   wraz z aspect-ratio potrafiło wyliczyć szerokość media większą niż kolumna. */
.tvk-home-picks .tvk-card--feature .tvk-card__media-wrap,
.tvk-home-picks .tvk-card--feature .tvk-card__media,
.tvk-home-picks .tvk-card--promoted .tvk-card__media-wrap,
.tvk-home-picks .tvk-card--promoted .tvk-card__media {
  height: auto;
}

@media (max-width:720px) {
  /* 3 materiały TV Mrągowo mają pozostać pełnowymiarowymi kartami, a nie trzema
     mini-kolumnami. Późniejsza reguła desktopowa --home nie może kasować raila. */
  .tvk-bridge-grid--home {
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:minmax(260px,82vw);
    gap:14px;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    overscroll-behavior-inline:contain;
    scrollbar-width:none;
  }
  .tvk-bridge-grid--home::-webkit-scrollbar { display:none; }
  .tvk-bridge-grid--home > * { scroll-snap-align:start; }
}

/* Granica TV on home: only the compact grid, full route CSS stays conditional. */
.tvk-home-granica .tvk-granica-latest{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;min-width:0}.tvk-home-granica .tvk-granica-grid--count-1{grid-template-columns:minmax(0,720px)}.tvk-home-granica .tvk-granica-grid--count-2{grid-template-columns:repeat(2,minmax(0,1fr));max-width:980px}@media(max-width:900px){.tvk-home-granica .tvk-granica-latest{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:680px){.tvk-home-granica .tvk-granica-latest{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:12px;padding:0 18px 8px;margin-left:-18px;margin-right:-18px;scrollbar-width:none}.tvk-home-granica .tvk-granica-latest::-webkit-scrollbar{display:none}.tvk-home-granica .tvk-granica-latest>*{flex:0 0 min(84vw,360px);scroll-snap-align:start}}
