/* ==========================================================================
   Kuku News: widget styles
   Every widget sizes itself to the area it is dropped in (container queries),
   so the same widget works in a sidebar, a main column or a full-width band.
   ========================================================================== */

.kw { container-type: inline-size; min-width: 0; }

/* ---- Headings ---------------------------------------------------------- */
.widget-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.widget-head .widget-title { border: 0; margin: 0; padding-bottom: 8px; }
.widget-head .widget-title::after { bottom: -2px; }
.widget-head .more { font-size: 12px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }

/* ---- Home areas -------------------------------------------------------- */
.home-area .widget { margin-bottom: 36px; }
.home-top { padding-top: 6px; }
.home-bottom .widget { margin-bottom: 0; }
.home-bottom { padding-bottom: 8px; }
.home-bottom .widget:not([class*="kw-bg-"]) { padding-block: 24px; }

/* ---- Background panels (any widget: Background setting) ---------------- */
.kw-bg-light, .kw-bg-dark, .kw-bg-accent, .kw-bg-outline { padding: 22px; border-radius: var(--radius-img); }
.kw-bg-light   { --band: var(--bg-alt);     background: var(--band); }
.kw-bg-dark    { --band: var(--header-bg);  background: var(--band); color: #fff; }
.kw-bg-accent  { --band: var(--accent);     background: var(--band); color: #fff; }
.kw-bg-outline { border: 1px solid var(--line); }

.kw-bg-dark a:hover, .kw-bg-accent a:hover { color: #fff; }
.kw-bg-dark .section-head, .kw-bg-dark .widget-head, .kw-bg-accent .section-head, .kw-bg-accent .widget-head { border-color: rgba(255, 255, 255, .28); }
.kw-bg-dark .section-head h2, .kw-bg-dark .widget-title, .kw-bg-accent .section-head h2, .kw-bg-accent .widget-title { color: #fff; }
.kw-bg-accent .section-head h2::before { background: #fff; }
.kw-bg-dark .meta, .kw-bg-accent .meta, .kw-bg-dark .card-excerpt, .kw-bg-accent .card-excerpt, .kw-bg-dark .when { color: rgba(255, 255, 255, .72); }
.kw-bg-dark .card--compact, .kw-bg-dark .most-read li, .kw-bg-dark .widget .kw-headlines li { border-color: rgba(255, 255, 255, .14); }
.kw-bg-accent .card--compact, .kw-bg-accent .most-read li, .kw-bg-accent .widget .kw-headlines li { border-color: rgba(255, 255, 255, .26); }
.kw-bg-accent .cat-label, .kw-bg-accent .more { color: #fff; }
.kw-bg-accent .card--overlay .cat-label { background: #fff; color: var(--accent); }
.kw-bg-accent .most-read li::before { color: #fff; }
.kw-bg-dark .most-read li::before { color: #ff5b73; }

/* Coloured panels in "Home: Bottom" stretch edge to edge. */
.home-bottom .kw-bg-light, .home-bottom .kw-bg-dark, .home-bottom .kw-bg-accent {
  border-radius: 0; padding: 40px 0; background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax);
}
.home-bottom .kw-bg-outline { padding: 28px; }

/* ---- Shared list pieces ------------------------------------------------ */
.kw-stack { display: flex; flex-direction: column; }
.card--compact.no-thumb, .card--row.no-thumb { grid-template-columns: minmax(0, 1fr); }
.kw-rows .card--row:last-child { border-bottom: 0; }

/* ---- Card grid / opinion / gallery ------------------------------------- */
.kw-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 24px; }
@container (max-width: 640px) { .kw-grid { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); } }
@container (max-width: 340px) { .kw-grid { grid-template-columns: minmax(0, 1fr); } }

.kw-gallery { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 8px; }
@container (max-width: 640px) { .kw-gallery { grid-template-columns: repeat(min(var(--cols, 4), 3), minmax(0, 1fr)); } }
@container (max-width: 380px) { .kw-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card--tile .tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-img); background: var(--bg-alt); }
.card--tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card--tile .tile:hover img, .card--tile .tile:focus-visible img { transform: scale(1.08); }
.card--tile .tile-title {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px; color: #fff; font-weight: 700; font-size: 13.5px; line-height: 1.25;
  background: linear-gradient(to top, rgba(6, 10, 16, .88), rgba(6, 10, 16, 0)); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
}
.card--tile .tile:hover .tile-title, .card--tile .tile:focus-visible .tile-title { opacity: 1; transform: none; }
@media (hover: none) { .card--tile .tile-title { opacity: 1; transform: none; font-size: 12px; } }

/* ---- Numbered, headlines, timeline ------------------------------------- */
.kw-headlines { list-style: none; margin: 0; padding: 0; }
.widget .kw-headlines li { position: relative; padding: 11px 0 11px 22px; border-bottom: 1px solid var(--line); }
.widget .kw-headlines li:last-child { border-bottom: 0; }
.widget .kw-headlines li::before { content: "→"; position: absolute; left: 0; top: 11px; color: var(--accent); font-weight: 900; }
.kw-headlines a { font-weight: 600; line-height: 1.35; display: block; }
.kw-headlines .when { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }

.kw-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.kw-timeline::before { content: ""; position: absolute; left: 62px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.kw-timeline li { display: grid; grid-template-columns: 52px 1fr; gap: 26px; padding: 9px 0; position: relative; }
.kw-timeline li::before { content: ""; position: absolute; left: 58px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); z-index: 1; }
.kw-timeline li.is-fresh::before { background: var(--accent); border-color: var(--accent); animation: kuku-pulse 1.4s infinite; }
.kw-timeline .t { font-weight: 800; font-size: 13px; color: var(--accent); padding-top: 2px; font-variant-numeric: tabular-nums; }
.kw-timeline a { font-weight: 600; line-height: 1.35; }
@keyframes kuku-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }

/* ---- Lead + list, overlays, category block ----------------------------- */
.kw-feature .card--overlay { aspect-ratio: 16 / 10; }
.kw-feature .kw-stack { margin-top: 16px; }
.kw-overlays { display: grid; gap: 14px; }
.kw-overlays .card--overlay { aspect-ratio: 16 / 9; }
@container (min-width: 700px) { .kw-overlays { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kw-overlays .card--overlay { aspect-ratio: 4 / 3; } }
.kw-catblock .card--overlay { min-height: 340px; }
@container (max-width: 560px) { .kw-catblock { grid-template-columns: minmax(0, 1fr); } .kw-catblock .card--overlay { min-height: 260px; } }

/* ---- Hero mosaic ------------------------------------------------------- */
.kw-mosaic { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, minmax(210px, 1fr)); min-height: 440px; }
.kw-mosaic > :first-child { grid-row: 1 / 3; }
.kw-mosaic .card--overlay .card-title { font-size: 17px; }
.kw-mosaic > :first-child .card-title { font-size: clamp(24px, 3vw, 34px); }
.kw-mosaic .card--overlay .card-body { padding: 16px 18px; }
.kw-mosaic > :first-child .card-body { padding: 24px 26px; }
.kw-mosaic .card--overlay .meta { display: none; }
.kw-mosaic > :first-child .meta { display: flex; }
.kw-mosaic.kw-count-1 { grid-template-columns: 1fr; grid-template-rows: auto; }
.kw-mosaic.kw-count-1 > :first-child, .kw-mosaic.kw-count-2 > :first-child { grid-row: auto; }
.kw-mosaic.kw-count-2, .kw-mosaic.kw-count-3 { grid-template-columns: 2fr 1fr; }
.kw-mosaic.kw-count-3 > :first-child { grid-row: 1 / 3; }
@container (max-width: 720px) {
  .kw-mosaic, .kw-mosaic[class*="kw-count-"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; min-height: 0; }
  .kw-mosaic > :first-child { grid-column: 1 / -1; grid-row: auto; min-height: 320px; }
  .kw-mosaic .card--overlay { min-height: 190px; }
}
@container (max-width: 420px) { .kw-mosaic, .kw-mosaic[class*="kw-count-"] { grid-template-columns: minmax(0, 1fr); } }

/* ---- Slider ------------------------------------------------------------ */
.kw-slider { position: relative; }
.kw-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius-img); overscroll-behavior-x: contain; }
.kw-slides::-webkit-scrollbar { display: none; }
.kw-slide { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.kw-slide .card--overlay { height: clamp(320px, 46vw, 540px); border-radius: 0; }
.kw-slide .card--overlay .card-body { padding: clamp(18px, 3vw, 40px); padding-inline: clamp(18px, 7vw, 84px); padding-bottom: 54px; }
.kw-slide .card--overlay .card-title { font-size: clamp(24px, 3.6vw, 44px); max-width: 24ch; }
.kw-dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 8px; z-index: 3; pointer-events: none; }
.kw-dots button { pointer-events: auto; width: 9px; height: 9px; padding: 0; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .5); cursor: pointer; transition: width .25s, background .25s; }
.kw-dots button.is-active { width: 28px; background: #fff; }
.kw-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .92); color: #111; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  display: flex; align-items: center; justify-content: center; padding: 0 0 3px; transition: background .2s, transform .2s;
}
.kw-nav:hover { background: var(--accent); color: #fff; }
.kw-prev { left: 12px; } .kw-next { right: 12px; }
@container (max-width: 480px) { .kw-nav { display: none; } .kw-slide .card--overlay .card-excerpt { display: none; } }

/* ---- Carousel ---------------------------------------------------------- */
.kw-carousel { position: relative; }
.kw-track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.kw-track::-webkit-scrollbar { display: none; }
.kw-track > .card { flex: 0 0 calc((100% - (var(--cols, 3) - 1) * 18px) / var(--cols, 3)); scroll-snap-align: start; min-width: 0; }
@container (max-width: 640px) { .kw-track > .card { flex-basis: calc((100% - 18px) / 2); } }
@container (max-width: 360px) { .kw-track > .card { flex-basis: 82%; } }
.kw-carousel .kw-nav { top: 34%; }

/* ---- Video playlist ---------------------------------------------------- */
.kw-video-inner { background: #0b1119; color: #fff; border-radius: var(--radius-img); padding: 16px; }
.kw-video-inner .card-title a, .kw-video-inner .card-title a:hover { color: #fff; }
.kw-video-inner .kw-stack { margin-top: 14px; }
.kw-video-inner .card--compact { border-color: rgba(255, 255, 255, .12); }
.kw-video-inner .meta { color: #a9b3c4; }
.kw-video-inner .card--overlay { aspect-ratio: 16 / 9; }
.kw-video-inner .card--overlay .thumb::after {
  content: "▶"; position: absolute; inset: 0; margin: auto; width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 92%, transparent); color: #fff; font-size: 22px; padding-left: 4px; box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
}
.kw-video-inner .badge-play { display: none; }
@container (min-width: 620px) {
  .kw-video-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .kw-video-inner .kw-stack { margin-top: 0; }
}

/* ---- Spotlight --------------------------------------------------------- */
.kw-spot .thumb { margin-bottom: 14px; aspect-ratio: 16 / 9; }
.kw-spot .card-title { font-size: clamp(24px, 3.2vw, 32px); line-height: 1.15; margin-bottom: 10px; }
.kw-spot .card-title a:hover { color: var(--ink); }
.kw-spot .card-excerpt { color: var(--ink-2); font-size: 16px; margin: 0 0 12px; }
.kw-spot .btn { margin-top: 14px; }

/* ---- Tabs -------------------------------------------------------------- */
.kw-tabs-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.kw-tabs-nav button { background: none; border: 0; padding: 9px 14px; font-weight: 800; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; border-radius: 6px 6px 0 0; transition: background .2s, color .2s; }
.kw-tabs-nav button:hover { color: var(--accent); }
.kw-tabs-nav button.is-active { background: var(--accent); color: #fff; }
.kw-panel[hidden] { display: none; }
.kw-bg-dark .kw-tabs-nav { border-color: rgba(255, 255, 255, .28); }
.kw-bg-dark .kw-tabs-nav button { color: rgba(255, 255, 255, .75); }

/* ---- Categories -------------------------------------------------------- */
.kw-cats { list-style: none; margin: 0; padding: 0; }
.kw-cats a { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kw-cats em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.widget .kw-cats li { padding: 0; border: 0; }
.kw-cats--list a { padding: 10px 0; font-weight: 600; }
.kw-cats--list a:hover span { color: var(--accent); }
.kw-cats--pills { display: flex; flex-wrap: wrap; gap: 8px; }
.kw-cats--pills a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; font-size: 13.5px; gap: 8px; }
.kw-cats--pills a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.kw-cats--pills a:hover em { color: #fff; }
.kw-cats--tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kw-cats--tiles a { background: var(--header-bg); color: #fff; padding: 16px 14px; border-radius: var(--radius-img); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; border-left: 4px solid var(--accent); transition: transform .2s, background .2s; }
.kw-cats--tiles a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.kw-cats--tiles em { color: rgba(255, 255, 255, .7); }
@container (min-width: 560px) { .kw-cats--tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- Writers ----------------------------------------------------------- */
.kw-authors-list { list-style: none; margin: 0; padding: 0; counter-reset: kw-a; }
.widget .kw-authors-list li { padding: 0; border-bottom: 1px solid var(--line); }
.widget .kw-authors-list li:last-child { border-bottom: 0; }
.kw-authors-list a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0 10px 18px; position: relative; font-weight: 700; }
.kw-authors-list a::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--accent); border-radius: 50%; }
.kw-authors-list em { font-style: normal; font-weight: 500; font-size: 12.5px; color: var(--muted); }

/* ---- Advert ------------------------------------------------------------ */
.kw-ad { text-align: center; }
.kw-ad-label { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.kw-ad a, .kw-ad-media { display: block; }
.kw-ad-media { overflow: hidden; border-radius: var(--radius-img); background: var(--bg-alt); }
.kw-ad-media img { width: 100%; height: 100%; object-fit: cover; }
.kw-ad-code { display: flex; justify-content: center; overflow: hidden; max-width: 100%; }

/* ---- Promo + newsletter looks ------------------------------------------ */
.kw-promo-box { padding: 26px; border-radius: var(--radius-img); }
.kw-promo-box h3 { font-size: 22px; margin-bottom: 8px; color: inherit; }
.kw-promo-box p { margin-bottom: 16px; opacity: .92; }
.kw-promo-box .btn { background: #fff; color: var(--accent); }
.kw-promo-box .btn:hover { background: var(--header-bg); color: #fff; }
.kw-promo--accent { background: var(--accent); color: #fff; }
.kw-promo--dark { background: var(--header-bg); color: #fff; }
.kw-promo--dark .btn { background: var(--accent); color: #fff; }
.kw-promo--light { background: var(--bg-alt); }
.kw-promo--light .btn { background: var(--accent); color: #fff; }
.kw-promo--outline { border: 2px solid var(--accent); }
.kw-promo--outline .btn { background: var(--accent); color: #fff; }

.newsletter-box { border-radius: var(--radius-img); }
.nl--accent { background: var(--accent); }
.nl--accent p { color: rgba(255, 255, 255, .9); }
.nl--accent button { background: var(--header-bg); }
.nl--light { background: var(--bg-alt); color: var(--ink); }
.nl--light h3 { color: var(--ink); }
.nl--light p { color: var(--ink-2); }
.nl--light input[type="email"] { border: 1px solid var(--line); }

/* ---- Social ------------------------------------------------------------ */
.social-follow--icons { display: flex; flex-wrap: wrap; gap: 10px; }
.social-follow--icons a { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; font-size: 18px; }
.social-follow--icons a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.social-follow--icons a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Search ------------------------------------------------------------ */
.kwid-search .search-form { max-width: none; }

/* ---- Header template: centered ----------------------------------------- */
.masthead--centered .container { flex-direction: column; gap: 16px; text-align: center; }
.masthead--centered .brand { display: flex; flex-direction: column; align-items: center; }
.masthead--centered .site-title { font-size: clamp(38px, 6vw, 64px); }
.masthead--centered .header-ad { flex: none; width: 100%; text-align: center; }
.masthead--centered .header-ad .ad-slot, .masthead--centered .header-ad > * { margin-inline: auto !important; }

/* ---- Footer credit ----------------------------------------------------- */
.footer-bottom .credit { justify-content: center; padding-top: 0; font-size: 12.5px; opacity: .85; }
.footer-bottom .credit a { text-decoration: underline; text-underline-offset: 3px; }
.plain-sidebar { position: static; }

@media (prefers-reduced-motion: reduce) {
  .kw-timeline li.is-fresh::before { animation: none; }
  .kw-slides, .kw-track { scroll-behavior: auto; }
}

/* ---- Narrow areas (sidebars, small columns): compact versions ----------- */
@container (max-width: 520px) {
  .kw .card--row { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 14px 0; }
  .kw .card--row .card-title { font-size: 16px; }
  .kw .card--row .card-excerpt { display: none; }
  .kw .card--row .thumb { aspect-ratio: 4 / 3; }
}
@container (max-width: 420px) {
  .kw .card--overlay.is-lead .card-title { font-size: 21px; }
  .kw .card--overlay.is-lead .card-excerpt { display: none; }
  .kw .card--overlay .card-body { padding: 16px; }
  .kw-feature .card--overlay { aspect-ratio: auto; min-height: 270px; }
  .kw-slide .card--overlay { height: 340px; }
  .kw-slide .card--overlay .card-title { font-size: 22px; }
  .kw-slide .card--overlay .card-body { padding-inline: 18px; padding-bottom: 46px; }
  .kw-spot .card-title { font-size: 22px; }
}
@container (max-width: 520px) { .kw-video-inner .card--overlay { aspect-ratio: auto; min-height: 240px; } }
