/* Khabarnama Newsroom UI — v1.3 */

:root {
  --body-line-height: 1.85;
  --heading-line-height: 1.55;
  --news-title-size: 16px;
  --live-accent: #ef3340;
  --ease-spring: cubic-bezier(.2,.75,.2,1);
  --shadow-soft: 0 2px 5px rgba(15, 31, 48, .025), 0 14px 42px rgba(15, 31, 48, .055);
  --shadow-medium: 0 6px 16px rgba(15, 31, 48, .06), 0 22px 54px rgba(15, 31, 48, .09);
  --shadow-strong: 0 10px 28px rgba(15, 31, 48, .10), 0 32px 70px rgba(15, 31, 48, .13);
}

body {
  line-height: var(--body-line-height);
  background:
    radial-gradient(circle at 92% -8rem, color-mix(in srgb, var(--accent) 10%, transparent), transparent 36rem),
    radial-gradient(circle at 8% 30rem, color-mix(in srgb, var(--accent) 5%, transparent), transparent 30rem),
    var(--bg);
}

h1, h2, h3, h4, h5, h6 { line-height: var(--heading-line-height); }
.news-row__title { font-size: var(--news-title-size); }

.site-scroll-progress {
  position: fixed;
  z-index: 100001;
  inset: 0 0 auto;
  height: 3px;
  background: transparent;
  pointer-events: none;
}
.site-scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #fff));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 48%, transparent);
  transition: width .08s linear;
}

/* Global surface styles */
.card-shadow-none .card { box-shadow: none; }
.card-shadow-soft .card { box-shadow: var(--shadow-soft); }
.card-shadow-medium .card { box-shadow: var(--shadow-medium); }
.card-shadow-strong .card { box-shadow: var(--shadow-strong); }
.card-border-none .card { border-color: transparent; }
.card-border-visible .card { border-color: var(--border-strong); }

.ui-style-soft .card {
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 98%, #fff), var(--surface));
}
.ui-style-glass .card {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-color: color-mix(in srgb, var(--border) 65%, transparent);
}
.has-backdrop-blur.ui-style-glass .card,
.has-backdrop-blur .search-dialog,
.has-backdrop-blur.is-scrolled .site-header {
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.ui-style-flat .card { box-shadow: none; background: var(--surface); }

.has-hover-lift .news-row:hover,
.has-hover-lift .lead-brief:hover,
.has-hover-lift .category-popular__grid article:hover,
.has-hover-lift .widget:hover,
.has-hover-lift .live-item__card:hover {
  transform: translateY(-3px);
}

.reduce-theme-motion *,
.reduce-theme-motion *::before,
.reduce-theme-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .001ms !important;
}

.has-rounded-images img { border-radius: min(calc(var(--radius) - 3px), 18px); }
.lead-story__media img,
.single-featured img { border-radius: 0; }

.button-style-solid .button:not(.button--ghost-light) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button-style-outline .button:not(.button--primary):not(.button--light):not(.button--ghost-light) {
  background: transparent;
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

/* Header refinements */
.site-header {
  transition: box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}
.is-scrolled.has-sticky-header .site-header {
  box-shadow: 0 12px 42px rgba(15, 31, 48, .09);
}
.has-header-blur .site-header,
.has-backdrop-blur.is-scrolled .site-header {
  background: color-mix(in srgb, var(--header-bg) 88%, transparent);
}
.topbar__clock {
  min-width: 72px;
  direction: ltr;
  color: var(--accent-strong);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.header-layout-centered .masthead__inner {
  grid-template-columns: 1fr auto 1fr;
}
.header-layout-centered .site-branding { grid-column: 2; justify-self: center; }
.header-layout-centered .utility-nav { grid-column: 1; grid-row: 1; justify-self: start; }
.header-layout-centered .search-open { grid-column: 3; justify-self: end; }
.header-layout-compact .masthead__inner { min-height: min(var(--masthead-height), 70px); }
.header-layout-compact .brand-mark__text small { display: none; }
.header-layout-compact .brand-mark__symbol { width: 42px; height: 39px; }

/* Softer controls and cards */
.icon-button, .tool-button, .button, .filter-chip {
  transition: transform .2s var(--ease-spring), box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.icon-button:hover, .tool-button:hover, .button:hover, .filter-chip:hover {
  transform: translateY(-2px);
}
.news-row {
  position: relative;
  margin-inline: 8px;
  border-radius: calc(var(--radius) - 3px);
  transition: transform .22s var(--ease-spring), background-color .2s ease, box-shadow .2s ease;
}
.news-row::before {
  content: "";
  position: absolute;
  inset: 12px 0 12px auto;
  width: 3px;
  border-radius: 9px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(.35);
  transition: opacity .2s ease, transform .2s ease;
}
.news-row:hover::before { opacity: 1; transform: scaleY(1); }
.news-row:hover {
  background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--surface-2) 40%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}
.news-row__meta { gap: 12px; }
.news-row__meta span { display: inline-flex; align-items: center; gap: 4px; }

.section-header {
  position: relative;
  padding-bottom: 15px;
}
.section-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 72px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent));
}

/* Homepage latest strip */
.latest-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: var(--shadow-soft);
}
.latest-strip__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 17px;
  background: var(--ink);
  color: var(--surface);
  font-size: .8rem;
  font-weight: 850;
}
.latest-strip__track {
  display: flex;
  gap: 4px;
  overflow: auto hidden;
  scrollbar-width: none;
  padding: 6px;
}
.latest-strip__track::-webkit-scrollbar { display: none; }
.latest-strip__track a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  max-width: 360px;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 650;
}
.latest-strip__track a:hover { background: var(--accent-soft); }
.latest-strip__track time { color: var(--accent-strong); font-size: .7rem; font-weight: 800; }

.hero-style-overlay .lead-story {
  position: relative;
  display: block;
  min-height: 430px;
}
.hero-style-overlay .lead-story__media { position: absolute; inset: 0; }
.hero-style-overlay .lead-story__media::after {
  background: linear-gradient(90deg, rgba(5,13,20,.08), rgba(5,13,20,.86));
}
.hero-style-overlay .lead-story__content {
  position: relative;
  z-index: 2;
  width: min(62%, 720px);
  min-height: 430px;
  justify-content: flex-end;
  color: #fff;
}
.hero-style-overlay .lead-story__content h1,
.hero-style-overlay .lead-story__content h1 a { color: #fff; }
.hero-style-overlay .lead-story__content p,
.hero-style-overlay .lead-story__footer { color: rgba(255,255,255,.78); }
.hero-style-minimal .lead-story { grid-template-columns: 1fr; }
.hero-style-minimal .lead-story__media { max-height: 260px; }
.hero-style-minimal .lead-story__content { padding: 24px; }

.content-layout--full { grid-template-columns: minmax(0, 1fr); }
.sidebar-right .content-layout { grid-template-columns: 320px minmax(0, 1fr); }
.sidebar-right .content-layout__aside { order: -1; }
.has-sticky-sidebar .content-layout__aside { position: sticky; top: calc(var(--header-offset) + 24px); align-self: start; }

.newsletter-box {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 12rem),
    var(--surface) !important;
}
.newsletter-box::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  left: -60px;
  bottom: -75px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.newsletter-box__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 13px;
  border-radius: 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

/* Single article polish */
.single-card { overflow: visible; }
.single-header { position: relative; }
.single-header::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 48px;
  height: 4px;
  border-radius: 8px;
  background: var(--accent);
}
.single-meta { row-gap: 8px; }
.single-meta > span {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--surface-2);
}
.single-content { font-size: clamp(1rem, 1.15vw, 1.12rem); }
.single-content p { margin-bottom: 1.35em; }
.source-panel {
  background: linear-gradient(145deg, var(--surface-2), color-mix(in srgb, var(--accent) 5%, var(--surface)));
}

/* Mobile bottom navigation */
.mobile-bottom-nav { display: none; }

/* Live newsroom */
.live-page {
  background:
    radial-gradient(circle at 84% 8rem, color-mix(in srgb, var(--live-accent) 8%, transparent), transparent 30rem),
    var(--bg);
}
.live-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr);
  gap: clamp(24px, 5vw, 70px);
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border-radius: calc(var(--radius) + 12px);
  color: #fff;
  background:
    linear-gradient(125deg, color-mix(in srgb, var(--live-accent) 82%, #70121a), #111f2e 62%, #08131e);
  box-shadow: 0 28px 80px color-mix(in srgb, var(--live-accent) 18%, rgba(8,20,30,.30));
}
.live-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, #000, transparent 80%);
}
.live-hero__glow {
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  left: -150px;
  top: -220px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  filter: blur(10px);
}
.live-hero__content { align-self: center; }
.live-hero__status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-size: .82rem;
  font-weight: 850;
}
.live-hero__status small {
  margin-right: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.08);
  font-weight: 600;
}
.live-hero__status small[data-state="offline"] { color: #ffd1d4; background: rgba(60,0,0,.25); }
.live-hero__status small[data-state="paused"] { color: #ffe9a8; }
.live-pulse {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
}
.live-pulse i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.6);
  animation: live-ring 1.8s infinite;
}
@keyframes live-ring { 70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.live-hero h1 {
  max-width: 760px;
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 4rem);
  letter-spacing: -.045em;
}
.live-hero__content > p {
  max-width: 680px;
  margin-bottom: 23px;
  color: rgba(255,255,255,.76);
  font-size: clamp(.96rem, 1.3vw, 1.12rem);
}
.live-hero__actions { display: flex; flex-wrap: wrap; gap: 9px; }
.button--light {
  border-color: #fff;
  background: #fff;
  color: #142235;
}
.button--ghost-light {
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #fff;
}
.button--ghost-light:hover,
.button--ghost-light.is-active { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.38); color: #fff; }
.live-stats {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.live-stat {
  display: grid;
  gap: 4px;
  min-height: 100px;
  padding: 17px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 17px;
  background: rgba(255,255,255,.085);
  backdrop-filter: blur(12px);
}
.live-stat span { color: rgba(255,255,255,.64); font-size: .74rem; }
.live-stat strong { align-self: end; color: #fff; font-size: clamp(1.15rem, 2vw, 1.6rem); font-variant-numeric: tabular-nums; }
.live-stat--countdown strong { font-size: 1rem; }

.live-workspace { margin-top: 22px; }
.live-toolbar {
  position: sticky;
  top: calc(var(--header-offset) + 10px);
  z-index: 25;
  overflow: hidden;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--surface) 93%, transparent) !important;
  backdrop-filter: blur(18px);
}
.live-toolbar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 10px;
}
.live-toolbar__title { display: flex; align-items: center; gap: 10px; }
.live-toolbar__title > div { display: grid; line-height: 1.4; }
.live-toolbar__title strong { color: var(--ink); }
.live-toolbar__title small { color: var(--muted); font-size: .7rem; }
.live-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 340px);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}
.live-filter-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.live-filter-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.live-filters { padding: 5px 18px 14px; }
.live-progress { height: 3px; background: var(--surface-3); }
.live-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--live-accent), color-mix(in srgb, var(--live-accent) 55%, #ffcf6b)); }
.filter-chip.is-active { color: #fff; border-color: var(--live-accent); background: var(--live-accent); box-shadow: 0 7px 20px color-mix(in srgb, var(--live-accent) 23%, transparent); }

.live-new-banner {
  position: sticky;
  z-index: 24;
  top: calc(var(--header-offset) + 145px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--live-accent);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--live-accent) 34%, transparent);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
}
.live-new-banner[hidden] { display: none; }

.live-feed-shell { overflow: hidden; padding: clamp(15px, 2vw, 24px); }
.live-feed { position: relative; max-width: 1050px; margin-inline: auto; }
.live-feed::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  right: 94px;
  width: 2px;
  background: linear-gradient(var(--live-accent), var(--border) 12%, var(--border) 88%, transparent);
}
.live-feed.is-loading { opacity: .62; }
.live-item {
  position: relative;
  display: grid;
  grid-template-columns: 78px 32px minmax(0, 1fr);
  gap: 0;
  padding: 7px 0;
}
.live-item__rail { grid-column: 2; position: relative; display: grid; place-items: start center; padding-top: 24px; }
.live-item__dot {
  position: relative;
  z-index: 2;
  width: 13px;
  height: 13px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--live-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live-accent) 22%, transparent);
}
.live-item__time {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  align-content: start;
  gap: 1px;
  padding-top: 17px;
  text-align: left;
}
.live-item__time strong { color: var(--ink); font-size: .88rem; font-variant-numeric: tabular-nums; }
.live-item__time small { color: var(--muted); font-size: .66rem; }
.live-item__card {
  grid-column: 3;
  display: flex;
  gap: 15px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  transition: transform .24s var(--ease-spring), box-shadow .24s ease, border-color .24s ease, background-color .24s ease;
}
.live-item__card:hover { border-color: color-mix(in srgb, var(--live-accent) 24%, var(--border)); box-shadow: var(--shadow-medium); }
.live-item.is-new .live-item__card {
  animation: live-new-item 1.1s var(--ease-spring) both;
  border-color: color-mix(in srgb, var(--live-accent) 55%, var(--border));
  background: color-mix(in srgb, var(--live-accent) 5%, var(--surface));
}
.live-item.is-new .live-item__dot { animation: live-dot-pop 1s ease 2; }
@keyframes live-new-item { from { opacity: 0; transform: translateY(-14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes live-dot-pop { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--live-accent) 0%, transparent); } }
.live-item__thumb { flex: 0 0 160px; height: 110px; overflow: hidden; border-radius: calc(var(--radius) - 3px); }
.live-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.live-item__content { min-width: 0; flex: 1; }
.live-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 7px; }
.live-item__meta .source-name { color: var(--muted); font-size: .72rem; }
.live-item h2 { margin: 0; font-size: clamp(.98rem, 1.4vw, 1.18rem); line-height: 1.75; }
.live-item h2 a { color: var(--ink); }
.live-item h2 a:hover { color: var(--live-accent); }
.live-item__content > p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.live-item__footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; color: var(--muted); font-size: .7rem; }
.live-item__footer > span { display: inline-flex; align-items: center; gap: 5px; }
.live-item__footer .post-actions { opacity: .45; transition: opacity .2s ease; }
.live-item__card:hover .post-actions { opacity: 1; }
.is-spinning .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }

/* Redux/admin-inspired small responsiveness fixes */
@media (max-width: 1100px) {
  .live-hero { grid-template-columns: 1fr; }
  .live-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .header-layout-centered .masthead__inner { display: flex; }
  .sidebar-right .content-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .sidebar-right .content-layout__aside { order: initial; }
}

@media (max-width: 780px) {
  body.has-mobile-bottom-nav { padding-bottom: 72px; }
  .container { width: min(calc(100% - 24px), var(--container)); }
  .latest-strip { grid-template-columns: 1fr; }
  .latest-strip__label { justify-content: center; }
  .hero-style-overlay .lead-story__content { width: 100%; }
  .live-hero { padding: 25px 20px; border-radius: calc(var(--radius) + 5px); }
  .live-hero h1 { font-size: clamp(1.7rem, 10vw, 2.6rem); }
  .live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-stat { min-height: 82px; padding: 13px; }
  .live-toolbar { position: relative; top: auto; }
  .live-toolbar__top { align-items: stretch; flex-direction: column; }
  .live-filter-search { width: 100%; }
  .live-new-banner { top: 10px; }
  .live-feed::before { right: 12px; }
  .live-item { grid-template-columns: 26px minmax(0, 1fr); }
  .live-item__rail { grid-column: 1; }
  .live-item__time { grid-column: 2; grid-row: 1; display: flex; gap: 8px; padding: 0 10px 5px; text-align: right; }
  .live-item__card { grid-column: 2; grid-row: 2; padding: 14px; }
  .live-item__thumb { flex-basis: 100px; height: 88px; }
  .live-item__footer .post-actions { display: none; }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 95;
    right: 10px;
    left: 10px;
    bottom: 9px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 59px;
    padding: 5px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: 0 15px 45px rgba(10,24,38,.18);
    backdrop-filter: blur(18px) saturate(1.2);
  }
  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    font-size: .64rem;
    cursor: pointer;
  }
  .mobile-bottom-nav .icon { width: 20px; height: 20px; }
  .mobile-bottom-nav__live { color: var(--live-accent) !important; }
  .mobile-bottom-nav__live .live-dot { position: absolute; top: 5px; right: calc(50% + 8px); }
  .back-to-top { bottom: 84px; }
}

@media (max-width: 520px) {
  .live-hero__actions .button { flex: 1 1 calc(50% - 8px); padding-inline: 9px; font-size: .72rem; }
  .live-stat strong { font-size: 1.1rem; }
  .live-item__card { display: block; }
  .live-item__thumb { display: block; width: 100%; height: 150px; margin-bottom: 12px; }
  .live-item__content > p { display: none; }
  .live-feed-shell { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-pulse i, .live-item.is-new .live-item__card, .live-item.is-new .live-item__dot { animation: none !important; }
}
