/* ===== CLS guards + Mobile responsive ===== */

/* === Universal CLS prevention === */
img, .photo-img { content-visibility: auto; }
.photo-slot { contain: layout paint; }

/* Reserve space for sticky header layers up front to prevent layout shift */
.site-header { contain: layout style; }

/* Reserve viewport height for the slider frame so the page doesn't reflow on slide change */
.poster-frame, .spor-media, .fs-media { contain: layout paint; }

/* Skeleton sizes so SSR/initial paint matches React paint */
.__skeleton { min-height: 800px; }

/* === Tablet: ≤ 1100px === */
@media (max-width: 1100px) {
  :root { --gutter: 20px; --max: 100%; }

  /* Header — collapse extras */
  .ys-top-row { grid-template-columns: 1fr auto; }
  .ys-top-nav { display: none; }
  .ys-edisyon { display: none; }
  .ys-main-row { grid-template-columns: auto auto 1fr auto; gap: 14px; height: 72px; }
  .ys-logo { height: 48px; }
  .ys-tvnet-text { display: none; }
  .ys-tvnet { padding: 8px 12px; }
  .ys-nav-row { padding-bottom: 14px; }
  .ys-nav-btn { font-size: 18px; padding: 6px 4px; }
  .ys-nav-btn.is-pill { padding: 6px 14px; font-size: 16px; }
  .ys-market-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ys-mcard:nth-child(n+5) { display: none; }
  .ys-mcard { padding: 8px 10px; min-width: 0; }
  .ys-mcard-val { font-size: 15px; }
  .ys-mcard-code { font-size: 10px; }
  .ys-market-cta { min-width: 80px; font-size: 10px; padding: 8px 10px; }

  /* Hero */
  .hero-ys-grid { grid-template-columns: 1fr; gap: 22px; }
  .hys-sky { display: none; }
  .poster-frame { aspect-ratio: 4/3; }
  .poster-title { font-size: clamp(34px, 7vw, 60px); }
  .poster-sub { font-size: 14px; max-width: 100%; }
  .poster-overlay { padding: 24px 26px 26px; }

  /* Widgets — keep 3 side-by-side */
  .hys-widgets { grid-template-columns: repeat(3, 1fr); }
  .wcard { min-height: 0; padding: 12px; }
  .wc-temp { font-size: 44px; }
  .prc-remaining { padding: 8px 10px; }
  .prc-remaining-val { font-size: 18px; }
  .mch-time-val { font-size: 17px; }

  /* Authors */
  .op-ys-card { flex-basis: calc(50% - 6px); height: 420px; }

  /* Featured row */
  .fs-grid { grid-template-columns: 1fr; }
  .fs-sky { display: none; }
  .tr-list { margin-top: 24px; }

  /* Spor card */
  .spor-sect-row { max-width: 100%; }
  .spor-card { padding: 18px; }

  /* Footer */
  .ys-foot-links-row { grid-template-columns: repeat(3, 1fr); }
  .ys-foot-meta { grid-template-columns: 1fr; gap: 24px; }
  .ys-foot-apps { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .ys-app { min-width: 0; padding: 6px 12px; }
  .ys-foot-expand { display: none; }
}

/* === Mobile: ≤ 720px === */
@media (max-width: 720px) {
  :root { --gutter: 14px; }

  body { font-size: 14px; }

  /* TOP BAR — keep it minimal */
  .ys-top { font-size: 11px; }
  .ys-top-row { height: 36px; gap: 8px; }
  .ys-date { font-size: 11px; }
  .ys-actions .ys-top-link { display: none; }

  /* MAIN HEADER — clean for mobile */
  .ys-main-row { grid-template-columns: auto 1fr auto; gap: 10px; height: 60px; padding-top: 4px; }
  .ys-edisyon { display: none; }
  .ys-tvnet { padding: 6px 10px; font-size: 11px; }
  .ys-tvnet-brand { font-size: 14px; }
  .ys-tvnet-pulse span { width: 3px; height: 3px; }
  .ys-tvnet-pulse span:nth-child(2) { width: 4px; height: 4px; }
  .ys-tvnet-pulse span:nth-child(3) { width: 5px; height: 5px; }
  .ys-logo { height: 40px; }
  .ys-burger { width: 34px; height: 34px; }
  .ys-burger svg { width: 24px; height: 24px; }
  .ys-search { width: 36px; height: 36px; }

  /* NAV row — horizontal scroll */
  .ys-nav-row { padding-bottom: 10px; }
  .ys-nav { gap: 8px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .ys-nav-btn { font-size: 15px; padding: 4px 4px; }
  .ys-nav-btn.is-pill { padding: 5px 10px; font-size: 13px; }
  .ys-nav-btn.is-pill .ys-star { font-size: 11px; }
  .ys-star { font-size: 12px; }

  /* MARKET cards — single horizontal scroll row, 2 cards visible */
  .ys-market { padding: 10px 0; }
  .ys-market-row { grid-template-columns: 1fr; gap: 8px; }
  .ys-market-cards {
    grid-template-columns: none;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
  }
  .ys-market-cards::-webkit-scrollbar { display: none; }
  .ys-mcard {
    flex: 0 0 calc(50% - 4px);
    display: grid !important;
    scroll-snap-align: start;
    min-width: 0;
  }
  .ys-mcard:nth-child(n+1) { display: grid !important; }
  .ys-market-cta { display: none; }

  /* HERO */
  .hero-ys { padding: 18px 0 8px; }
  .hys-tabs { gap: 8px; flex-wrap: wrap; }
  .hys-tab { font-size: 15px; }
  .poster-frame { aspect-ratio: 4/5; }
  .poster-title { font-size: clamp(28px, 9vw, 44px); }
  .poster-sub { font-size: 12.5px; }
  .poster-overlay { padding: 18px 18px 20px; }
  .poster-controls { height: 32px; }
  .ppg { font-size: 10px; }
  /* hide overflow numbers — show first 10 */
  .ppg:nth-child(n+11) { display: none; }
  .poster-tm { width: 44px; font-size: 11px; }

  /* Widgets — stack to 1 col */
  .hys-widgets { grid-template-columns: 1fr; gap: 10px; }
  .wcard { min-height: 0; }

  /* Spor poster smaller */
  .poster-sm .poster-frame { aspect-ratio: 4/4; }

  /* AUTHORS — single card per screen */
  .op-ys { padding: 28px 0; }
  .op-ys-title { font-size: 22px; }
  .op-ys-card { flex-basis: 86%; height: 380px; }
  .op-ys-h { font-size: 17px; -webkit-line-clamp: 3; }
  .op-ys-excerpt { font-size: 12.5px; -webkit-line-clamp: 4; }
  .op-ys-num { font-size: 150px; }
  .op-ys-surname { font-size: 24px; }
  .op-ys-photo { width: 55%; }

  /* FEATURED row */
  .fs-row { padding: 22px 0; }
  .fs-title { font-size: 18px; }
  .fs-body { font-size: 13.5px; }
  .tr-link { padding: 12px 14px; gap: 10px; }
  .tr-h { font-size: 13.5px; }
  .tr-num { font-size: 26px; }

  /* SPOR section */
  .spor-sect { padding: 22px 0; }
  .spor-title { font-size: 18px; }
  .spor-body { font-size: 13.5px; }
  .spor-arr {
    width: 36px; height: 52px;
    background: rgba(255,255,255,0.95);
    opacity: 1 !important;
  }
  .spor-arr-prev { left: 8px; }
  .spor-arr-next { right: 8px; }
  .spor-page-nums { gap: 12px; font-size: 14px; }

  /* FOOTER */
  .ys-footer { padding-bottom: 24px; }
  .ys-foot-logo { font-size: 30px; padding: 0 22px; }
  .ys-foot-links-row { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .ys-foot-link { font-size: 14px; }
  .ys-foot-brands { gap: 8px; padding: 14px 10px; }
  .ys-foot-brand-chip { font-size: 11px; padding: 4px 8px; }
  .ys-foot-contact { flex-direction: column; gap: 10px; font-size: 12px; }
  .ys-foot-faq summary { padding: 12px 14px; font-size: 12.5px; }
  .ys-foot-bottom { font-size: 11px; padding: 0 14px; }
  .ys-foot-apps { flex-direction: column; }
  .ys-app { width: 100%; }

  /* TVNET text always hidden on mobile */
  .ys-tvnet-text { display: none; }
}

/* === Tiny phones ≤ 380px === */
@media (max-width: 380px) {
  .ys-logo { height: 34px; }
  .poster-title { font-size: clamp(24px, 8vw, 36px); }
  .op-ys-card { flex-basis: 92%; height: 360px; }
}
