/* Khabarnama Newsroom UI refresh — v1.2 */

:root {
  --base-font-size: 16px;
  --body-font-weight: 400;
  --heading-font-weight: 800;
  --header-bg: #fff;
  --header-text: #142235;
  --topbar-bg: #f5f8fa;
  --footer-bg: #101c28;
  --footer-text: #c7d2dc;
  --footer-heading: #fff;
  --masthead-height: 88px;
  --header-logo-width: 250px;
  --mobile-logo-width: 170px;
  --footer-logo-width: 220px;
  --shadow-card: 0 1px 2px rgba(15, 31, 48, .035), 0 10px 30px rgba(15, 31, 48, .055);
  --shadow-card-hover: 0 4px 10px rgba(15, 31, 48, .06), 0 18px 45px rgba(15, 31, 48, .10);
}

html {
  font-size: calc(var(--base-font-size) + var(--font-step));
  scrollbar-gutter: stable;
}

body {
  font-weight: var(--body-font-weight);
  background:
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 32rem),
    var(--bg);
  letter-spacing: -.006em;
}

h1, h2, h3, h4, h5, h6,
.news-row__title,
.brand-mark__text strong,
.section-header h2,
.widget-title,
.widget-title-row h2 {
  font-weight: var(--heading-font-weight);
}

.container {
  width: min(calc(100% - 40px), var(--container));
}

.card {
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: var(--shadow-card);
  transition: box-shadow .22s ease, border-color .22s ease, transform .22s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 17%, var(--border));
}

/* Replace clipped pseudo-element tooltips with one fixed viewport tooltip. */
[data-tooltip]::before,
[data-tooltip]::after {
  display: none !important;
  content: none !important;
}

.khabarnama-tooltip {
  position: fixed;
  z-index: 100000;
  display: grid;
  gap: 5px;
  width: max-content;
  max-width: min(340px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(12, 24, 37, .97);
  color: #f7fbfd;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .28);
  font-size: .72rem;
  line-height: 1.65;
  direction: rtl;
  text-align: right;
  white-space: pre-line;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(.985);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
  backdrop-filter: blur(14px);
}

.khabarnama-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.khabarnama-tooltip.is-news {
  max-width: min(390px, calc(100vw - 24px));
  padding: 13px 14px;
}

.khabarnama-tooltip__title {
  display: block;
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.7;
}

.khabarnama-tooltip__title[hidden] {
  display: none;
}

.khabarnama-tooltip__text {
  color: rgba(241, 248, 252, .82);
}

.khabarnama-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  background: rgba(12, 24, 37, .97);
  transform: translateX(-50%) rotate(45deg);
}

.khabarnama-tooltip[data-placement="top"]::after {
  bottom: -5px;
  border-right: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.khabarnama-tooltip[data-placement="bottom"]::after {
  top: -5px;
  border-left: 1px solid rgba(255, 255, 255, .1);
  border-top: 1px solid rgba(255, 255, 255, .1);
}

/* Buttons */
.icon-button,
.tool-button,
.button {
  border-color: color-mix(in srgb, var(--border) 90%, transparent);
  box-shadow: 0 1px 2px rgba(15, 31, 48, .04);
}

.icon-button,
.tool-button {
  border-radius: 11px;
}

.icon-button:hover,
.tool-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 13%, transparent);
}

.button {
  min-height: 44px;
  border-radius: 11px;
}

/* Header */
.site-header {
  color: var(--header-text);
  background: var(--header-bg);
  border-bottom: 0;
}

.has-header-shadow .site-header {
  box-shadow: 0 8px 30px rgba(15, 31, 48, .06);
}

.has-sticky-header .site-header {
  position: sticky;
  top: 0;
  z-index: 80;
}

.topbar {
  background: var(--topbar-bg);
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
}

.topbar__inner {
  min-height: 36px;
}

.topbar__date {
  font-size: .72rem;
}

.topbar__notice {
  color: color-mix(in srgb, var(--header-text) 82%, var(--muted));
  font-size: .74rem;
}

.masthead {
  background: color-mix(in srgb, var(--header-bg) 96%, transparent);
}

.masthead__inner {
  min-height: var(--masthead-height);
  gap: clamp(18px, 2vw, 34px);
}

.site-branding {
  min-width: min(28vw, var(--header-logo-width));
}

.configured-logo--header,
.custom-logo {
  width: auto;
  max-width: var(--header-logo-width);
  max-height: calc(var(--masthead-height) - 22px);
}

.configured-logo--footer {
  width: auto;
  max-width: var(--footer-logo-width);
  max-height: 76px;
}

.brand-mark__symbol {
  width: 50px;
  height: 45px;
  border-radius: 14px;
  box-shadow: 0 9px 23px color-mix(in srgb, var(--accent) 24%, transparent), inset 0 0 0 1px rgba(255,255,255,.24);
}

.brand-mark__text strong {
  font-size: clamp(1.35rem, 2vw, 1.72rem);
}

.utility-nav {
  justify-self: center;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
}

.utility-nav a {
  padding: 8px 13px;
  border-radius: 9px;
  font-size: .8rem;
}

.utility-nav a:hover {
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(15, 31, 48, .07);
}

.search-open {
  width: 44px;
  height: 44px;
  color: var(--header-text);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

.category-nav-wrap {
  top: 0;
  background: color-mix(in srgb, var(--header-bg) 91%, transparent);
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: 0 5px 18px rgba(15, 31, 48, .035);
}

.category-nav__menu {
  justify-content: center;
}

.category-nav__menu > li > a {
  padding: 12px 13px 11px;
  font-size: .82rem;
  border-bottom-width: 3px;
}

.category-nav__menu > li > a:hover,
.category-nav__menu > li.current-menu-item > a,
.category-nav__menu > li.current-category-ancestor > a {
  background: transparent;
}

.hot-tags {
  min-height: 42px;
  border-bottom-color: color-mix(in srgb, var(--border) 78%, transparent);
}

.hot-tags__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hot-tags__label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.hot-tags a {
  border: 1px solid transparent;
}

.hot-tags a:hover {
  border-color: var(--border);
  background: var(--surface);
}

.breaking-strip {
  box-shadow: inset 0 1px rgba(255,255,255,.14), inset 0 -1px rgba(0,0,0,.1);
}

/* Homepage hero */
.lead-grid {
  gap: 18px;
  padding-block: 22px 18px;
}

.lead-story {
  min-height: 360px;
  border: 0;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--accent-soft)), var(--surface));
}

.lead-story:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.lead-story__media {
  position: relative;
}

.lead-story__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 58%, rgba(3, 16, 25, .13));
  pointer-events: none;
}

.lead-story__content {
  padding: clamp(24px, 3.2vw, 39px);
}

.lead-story__content h1 {
  font-size: clamp(1.5rem, 2.45vw, 2.25rem);
  line-height: 1.62;
}

.lead-story__content > p {
  max-width: 62ch;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
}

.eyebrow {
  color: var(--accent-strong);
  font-weight: 750;
}

.lead-brief {
  padding: 16px 17px 14px;
  border-right: 3px solid transparent;
}

.lead-brief:hover {
  transform: translateX(-3px);
  border-right-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.lead-brief::before {
  display: none;
}

.lead-brief h2 {
  font-size: .92rem;
  line-height: 1.82;
}

/* Main news layout */
.content-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.content-layout__main {
  gap: 20px;
}

.news-section,
.archive-card,
.category-popular {
  overflow: clip;
}

.section-header {
  min-height: 58px;
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, var(--accent-soft)), var(--surface));
}

.section-header h2 {
  font-size: 1.01rem;
}

.section-header h2::before {
  width: 5px;
  border-radius: 99px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.section-header > a {
  padding: 5px 8px;
  border-radius: 7px;
}

.section-header > a:hover {
  background: var(--accent-soft);
}

.news-row {
  position: relative;
  gap: 13px;
  padding: 14px 16px;
  border-bottom-color: color-mix(in srgb, var(--border) 80%, transparent);
  isolation: isolate;
}

.news-row::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: calc(var(--radius) - 5px);
  background: transparent;
  transition: background-color .18s ease, transform .18s ease;
}

.news-row:hover {
  background: transparent;
}

.news-row:hover::before,
.news-row:focus-within::before {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
  transform: scale(.996);
}

.news-row__thumb {
  width: 112px;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(15,31,48,.08);
}

.news-row__title {
  font-size: .91rem;
  line-height: 1.85;
}

.news-row__title a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color .16s ease, text-decoration-color .16s ease;
}

.news-row__title a:hover {
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.news-row__excerpt {
  color: color-mix(in srgb, var(--text) 60%, var(--muted));
}

.news-row__meta {
  gap: 7px;
}

.news-row__meta > span {
  padding: 2px 0;
}

.news-row__meta .source-name {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
}

.post-actions .icon-button {
  min-width: 33px;
  height: 33px;
  border-color: transparent;
  background: transparent;
}

.post-actions .icon-button:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  background: var(--surface);
}

/* Sidebar */
.widget {
  padding: 17px;
}

.sticky-widget {
  top: 68px;
}

.widget-title-row,
.widget-title {
  position: relative;
}

.widget-title::after,
.widget-title-row::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -11px;
  width: 42px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}

.mini-news-list a {
  position: relative;
  padding: 10px 13px 10px 0;
}

.mini-news-list a::before {
  content: "";
  position: absolute;
  right: 0;
  top: 18px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 72%, var(--muted));
}

.mini-news-list a:hover span,
.ranked-list a:hover {
  color: var(--accent-strong);
}

.ranked-list li::before {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.newsletter-box {
  border-color: color-mix(in srgb, var(--accent) 19%, var(--border));
  background:
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent) 8%, var(--surface)));
}

/* Search */
.search-dialog {
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(5, 18, 28, .25);
}

.live-search-form__field {
  border-radius: 13px;
  background: var(--surface-2);
}

.search-result {
  border-radius: 10px;
}

.search-result:hover {
  background: var(--accent-soft);
}

/* Single and archive */
.page-header,
.single-header {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, var(--accent-soft)), var(--surface));
}

.single-news {
  box-shadow: var(--shadow-card);
}

.single-header h1 {
  line-height: 1.68;
}

.entry-content {
  line-height: 2.05;
}

.entry-content p {
  margin-bottom: 1.35em;
}

.source-panel {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
}

.category-popular__grid article {
  transition: background-color .18s ease;
}

.category-popular__grid article:hover {
  background: var(--accent-soft);
}

/* Footer */
.site-footer {
  position: relative;
  margin-top: 26px;
  background: var(--footer-bg);
  color: var(--footer-text);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 19%, transparent), transparent 25rem),
    linear-gradient(140deg, transparent, rgba(255,255,255,.015));
  pointer-events: none;
}

.footer-grid,
.footer-bottom {
  position: relative;
}

.site-footer h2,
.site-footer .brand-mark__text strong {
  color: var(--footer-heading);
}

.footer-socials a {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
}

.footer-socials a:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, rgba(255,255,255,.15));
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.back-to-top {
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: 0 14px 35px rgba(5,18,28,.18);
}

/* Comfortable density */
body.is-comfortable .news-row {
  padding-block: 17px;
}

body.is-comfortable .news-row__title {
  font-size: .96rem;
}

body.is-comfortable .lead-brief {
  padding-block: 18px;
}

/* Dark mode refinements */
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34rem),
    var(--bg);
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .masthead,
html[data-theme="dark"] .category-nav-wrap {
  --header-bg: var(--surface);
  --header-text: var(--ink);
}

html[data-theme="dark"] .lead-story__media::after {
  background: linear-gradient(90deg, transparent 58%, rgba(0, 0, 0, .28));
}

/* Responsive */
@media (max-width: 1100px) {
  .utility-nav a:first-child { display: none; }
  .content-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .container { width: min(calc(100% - 28px), var(--container)); }
}

@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
  .content-layout__aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .sticky-widget { position: static; }
  .category-nav__menu { justify-content: flex-start; }
}

@media (max-width: 767px) {
  .container { width: min(calc(100% - 20px), var(--container)); }
  .masthead__inner { min-height: 68px; gap: 10px; }
  .site-branding { min-width: 0; }
  .configured-logo--header,
  .custom-logo { max-width: var(--mobile-logo-width); max-height: 49px; }
  .lead-grid { padding-block: 12px; }
  .lead-story { min-height: 0; }
  .lead-story:hover,
  .lead-brief:hover { transform: none; }
  .lead-story__media::after { display: none; }
  .content-layout__aside { grid-template-columns: 1fr; }
  .news-row__thumb { width: 88px; }
  .news-row__title { font-size: .87rem; }
  .section-header { min-height: 52px; padding-inline: 14px; }
  .khabarnama-tooltip { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .lead-brief,
  .icon-button,
  .tool-button,
  .khabarnama-tooltip {
    transition: none !important;
  }
}
