/* KabarLagi 3.6 — layout, typography, logos, WhatsApp-style story */

:root {
  --kl36-gap: clamp(16px, 2.2vw, 28px);
  --kl36-gap-lg: clamp(28px, 4vw, 56px);
  --kl36-radius: 16px;
  --kl36-ink: #121417;
  --kl36-muted: #5b616b;
  --kl36-line: rgba(18, 20, 23, 0.1);
  --kl36-paper: #fff;
  --kl36-accent: var(--mainColor, #f4511e);
  --kl36-title: clamp(1.2rem, 1.05rem + 0.7vw, 1.65rem);
  --kl36-hero: clamp(1.35rem, 1.1rem + 1.4vw, 2.15rem);
  --kl36-body: 1.0625rem;
}

html.dark-mode,
html.kl-v6-dark {
  --kl36-ink: #f4f1ec;
  --kl36-muted: #b7b3ab;
  --kl36-line: rgba(244, 241, 236, 0.14);
  --kl36-paper: #16181c;
}

/* ---------- Logo white / dark ---------- */
.kl-36-logo-link,
.kl-v4-logo-link {
  display: inline-flex;
  align-items: center;
  max-width: min(240px, 52vw);
}

.kl-v4-logo,
.kl-36-logo-light,
.kl-36-logo-white,
.kl-v6-drawer-logo {
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.kl-v4-logo-dark,
.kl-36-logo-white {
  display: none;
}

html.dark-mode .kl-v4-logo-light,
html.kl-v6-dark .kl-v4-logo-light,
html.dark-mode .kl-36-logo-light,
html.kl-v6-dark .kl-36-logo-light,
body.kl-dark-mode .kl-v4-logo-light,
.kl-mode-dark .kl-v4-logo-light {
  display: none !important;
}

html.dark-mode .kl-v4-logo-dark,
html.kl-v6-dark .kl-v4-logo-dark,
html.dark-mode .kl-36-logo-white,
html.kl-v6-dark .kl-36-logo-white,
body.kl-dark-mode .kl-v4-logo-dark,
.kl-mode-dark .kl-v4-logo-dark {
  display: inline-block !important;
}

html.light-mode .kl-v4-logo-dark,
html.kl-v6-light .kl-v4-logo-dark,
html.light-mode .kl-36-logo-white,
html.kl-v6-light .kl-36-logo-white {
  display: none !important;
}

html.light-mode .kl-v4-logo-light,
html.kl-v6-light .kl-v4-logo-light,
html.light-mode .kl-36-logo-light,
html.kl-v6-light .kl-36-logo-light {
  display: inline-block !important;
}

body.kl-36-has-logo .site-branding-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.kl-36-has-logo .site-title,
body.kl-36-has-logo h1.site-title {
  font-size: inherit;
}

/* ---------- Global breathing room ---------- */
body.kl-36 #page,
body.kl-36 .site {
  overflow-x: clip;
}

body.kl-36 .container,
body.kl-36 .site-content .container,
body.kl-36 #main > .container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
  padding-inline: 0;
}

body.kl-36 #main {
  padding-block: var(--kl36-gap);
}

body.kl-36 #main > .container {
  padding-block: 0;
}

body.kl-36 .main-row,
body.kl-36 .primary-row {
  gap: var(--kl36-gap);
}

body.kl-36 .site-header .container,
body.kl-36 .light-nav .container {
  min-height: 68px;
  padding-block: 10px;
}

body.kl-36 .site-title,
body.kl-36 h1.site-title {
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em;
  font-weight: 750;
  margin: 0;
}

body.kl-36 .site-description {
  font-size: 0.78rem;
  color: var(--kl36-muted);
  margin: 2px 0 0;
}

/* ---------- Homepage / section titles ---------- */
.kl-36-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kl36-accent);
}

body.kl-36 .kl-v6-section,
body.kl-36 .kl-v5-section,
body.kl-36 .kabarlagi-story,
body.kl-36 .kl-36-block {
  margin: 0 0 var(--kl36-gap-lg);
}

body.kl-36 .kl-v6-section-head,
body.kl-36 .kl-v5-section-head,
body.kl-36 .kabarlagi-story__header,
body.kl-36 .kl-36-block__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--kl36-line);
}

body.kl-36 .kl-v6-section-head h2,
body.kl-36 .kl-v5-section-head h2,
body.kl-36 .kabarlagi-story__header h2,
body.kl-36 .kl-36-block__head h2,
body.kl-36 .kl-breaking-news h2,
body.kl-36 .widget-title,
body.kl-36 .widgettitle {
  margin: 0;
  font-size: var(--kl36-title) !important;
  line-height: 1.2 !important;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--kl36-ink);
}

body.kl-36 .kl-hero-main .entry-title,
body.kl-36 .kl-hero-main h2,
body.kl-36 .kl-hero-main h3,
body.kl-36 article.kl-hero-main .entry-title a {
  font-size: var(--kl36-hero) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.03em;
  font-weight: 750;
}

body.kl-36 .entry-title,
body.kl-36 .kl-news-card .entry-title,
body.kl-36 .kl-v6-recent-card .entry-title {
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.2rem) !important;
  line-height: 1.3 !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body.kl-36 .entry-content,
body.kl-36 .article-body,
body.kl-36 .kl-card-excerpt,
body.kl-36 .taxonomy-description {
  font-size: var(--kl36-body);
  line-height: 1.7;
}

body.kl-36 .kl-v6-grid,
body.kl-36 .kl-news-grid {
  gap: var(--kl36-gap) !important;
}

body.kl-36 .qlm-list article,
body.kl-36 .kl-v6-archive-item {
  gap: 16px !important;
}

/* ---------- WhatsApp-style Story rail ---------- */
.kl-36-story {
  --wa-ring: conic-gradient(from 180deg, #f4511e, #ffb347, #f4511e);
}

.kl-36-story__header p:not(.kl-36-kicker) {
  display: none;
}

.kl-36-story__row,
.kl-36-story .kabarlagi-story__row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.kl-36-story__item {
  flex: 0 0 auto;
  width: 76px;
  scroll-snap-align: start;
}

.kl-36-story__ring,
.kl-36-story .kabarlagi-story__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.kl-36-story__avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 3px;
  border-radius: 999px;
  background: var(--wa-ring);
  box-shadow: 0 0 0 2px var(--kl36-paper);
}

.kl-36-story__avatar img,
.kl-36-story__fallback {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  background: #222;
  border: 2px solid var(--kl36-paper);
}

.kl-36-story__fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.kl-36-story__name,
.kl-36-story .kabarlagi-story__card-title {
  position: static;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 76px;
  max-height: none;
  padding: 0;
  background: none;
  color: var(--kl36-ink);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: center;
  text-shadow: none;
}

/* Hide leftover rectangular media from older CSS */
.kl-36-story .kabarlagi-story__media {
  display: none;
}

/* Full-screen WA viewer */
.kl-36-story__dialog,
.kl-36-story .kabarlagi-story__dialog {
  width: min(430px, 100vw);
  height: min(100dvh, 100vh);
  max-width: 100vw;
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
}

.kl-36-story__dialog::backdrop {
  background: rgba(0, 0, 0, 0.86);
}

.kl-36-story__shell,
.kl-36-story .kabarlagi-story__shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.kl-36-story__progress,
.kl-36-story .kabarlagi-story__progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 4px;
}

.kl-36-story__progress span {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
}

.kl-36-story__progress span > i {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

.kl-36-story__progress span.is-done > i {
  width: 100%;
}

.kl-36-story__progress span.is-active > i {
  animation: kl36-story-bar 5.5s linear forwards;
}

.kl-36-story.is-paused .kl-36-story__progress span.is-active > i {
  animation-play-state: paused;
}

@keyframes kl36-story-bar {
  from { width: 0; }
  to { width: 100%; }
}

.kl-36-story__top {
  position: absolute;
  top: 20px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kl-36-story__who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kl-36-story__who-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #333 center / cover no-repeat;
  flex: 0 0 32px;
}

.kl-36-story__who-name,
.kl-36-story .kabarlagi-story__eyebrow {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.kl-36-story__who-meta {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.78);
}

.kl-36-story__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

.kl-36-story__media,
.kl-36-story .kabarlagi-story__viewer-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kl-36-story__media img,
.kl-36-story .kabarlagi-story__viewer-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kl-36-story__copy,
.kl-36-story .kabarlagi-story__copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46%;
  padding: 72px 18px 28px;
  overflow: auto;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78) 38%);
}

.kl-36-story__copy h2,
.kl-36-story .kabarlagi-story__viewer-title {
  margin: 0;
  font-size: clamp(1.05rem, 4.4vw, 1.4rem);
  line-height: 1.25;
  color: #fff;
}

.kl-36-story__copy p,
.kl-36-story .kabarlagi-story__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.kl-36-story__cta,
.kl-36-story .kabarlagi-story__cta {
  align-self: flex-start;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--kl36-accent);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.kl-36-story__hit {
  position: absolute;
  top: 56px;
  bottom: 90px;
  z-index: 4;
  width: 36%;
  border: 0;
  background: transparent;
}

.kl-36-story__hit--prev { left: 0; }
.kl-36-story__hit--next { right: 0; }

.kl-36-story__controls {
  position: absolute;
  right: 12px;
  bottom: 18px;
  z-index: 5;
}

.kl-36-story__controls button {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.75rem;
}

/* ---------- Extra shortcode blocks ---------- */
.kl-36-block__list {
  display: grid;
  gap: var(--kl36-gap);
}

.kl-36-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kl-36-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kl-36-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kl-36-block--list .kl-36-block__list,
.kl-36-block--headline .kl-36-block__list {
  grid-template-columns: minmax(0, 1fr);
}

.kl-36-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--kl36-paper);
  border: 1px solid var(--kl36-line);
  border-radius: var(--kl36-radius);
  overflow: hidden;
}

.kl-36-block--list .kl-36-card,
.kl-36-block--headline .kl-36-card {
  flex-direction: row;
  align-items: stretch;
}

.kl-36-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: #ececec;
  overflow: hidden;
}

.kl-36-block--list .kl-36-card__media {
  flex: 0 0 168px;
  aspect-ratio: 4 / 3;
}

.kl-36-block--headline .kl-36-card__media {
  display: none;
}

.kl-36-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kl-36-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}

.kl-36-card__cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kl36-accent);
}

.kl-36-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.kl-36-card__title a {
  color: inherit;
  text-decoration: none;
}

.kl-36-card__excerpt,
.kl-36-card__meta {
  margin: 0;
  color: var(--kl36-muted);
  font-size: 0.88rem;
}

.kl-36-cats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.kl-36-cats__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--kl36-line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.kl-36-cats__item span {
  color: var(--kl36-muted);
  font-size: 0.8rem;
}

.kl-36-quote {
  margin: 0 0 var(--kl36-gap);
  padding: 18px 20px;
  border-left: 4px solid var(--kl36-accent);
  background: color-mix(in srgb, var(--kl36-accent) 8%, var(--kl36-paper));
}

.kl-36-infobox {
  margin: 0 0 var(--kl36-gap);
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--kl36-line);
}

.kl-36-infobox--warning { border-color: #e3a008; }
.kl-36-infobox--success { border-color: #2f9e44; }

.kl-36-cta { margin: 18px 0; }
.kl-36-cta__btn {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--kl36-accent);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}

.kl-36-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.kl-36-share a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--kl36-line);
  text-decoration: none;
  font-size: 0.82rem;
}

.kl-36-author {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--kl36-line);
  border-radius: var(--kl36-radius);
  margin: 0 0 var(--kl36-gap);
}

.kl-36-author img { border-radius: 999px; }

.kl-36-related ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.kl-36-timeline ol {
  margin: 0;
  padding-left: 20px;
}

.kl-36-timeline li {
  margin: 0 0 10px;
  padding-left: 6px;
}

@media (max-width: 900px) {
  .kl-36-cols-3,
  .kl-36-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body.kl-36 .container,
  body.kl-36 #main > .container {
    width: min(100% - 24px, 1180px);
  }

  .kl-36-cols-2,
  .kl-36-cols-3,
  .kl-36-cols-4 { grid-template-columns: minmax(0, 1fr); }

  .kl-36-block--list .kl-36-card {
    flex-direction: column;
  }

  .kl-36-block--list .kl-36-card__media {
    flex-basis: auto;
    aspect-ratio: 16 / 9;
  }

  body.kl-36 .kl-hero-main .entry-title,
  body.kl-36 .kl-hero-main h2,
  body.kl-36 .kl-hero-main h3 {
    font-size: clamp(1.2rem, 5.4vw, 1.7rem) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kl-36-story__progress span.is-active > i {
    animation: none;
    width: 100%;
  }
}
