/* ==========================================================================
   Kerala Pulse — Public site styles. Mobile-first, Red theme.
   ========================================================================== */

:root {
  --red-900: #6e0d1e;
  --red-800: #8f0c20;
  --red-700: #a80f27;
  --red-600: #c8102e;
  --red-500: #e0142f;
  --red-100: #fbe3e6;
  --red-50:  #fff5f6;
  --red-600-rgb: 200, 16, 46;
  --ink-900: #1a1a1a;
  --ink-700: #3a3a3a;
  --ink-500: #6b6b6b;
  --ink-300: #b3b3b3;
  --ink-100: #e8e8e8;
  --ink-50:  #f7f7f7;
  --white:   #ffffff;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --font-body: 'Anek Malayalam', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: 'Anek Malayalam', Georgia, "Times New Roman", serif;
  --hero-col-height: 420px;
  --hero-sponsor-gap: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--ink-50);
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; color: var(--ink-900); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 28px; }

/* ---- Top bar ---- */
.topbar {
  background: var(--ink-900);
  color: var(--ink-100);
  font-size: 12.5px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; min-height: 34px; flex-wrap: wrap; gap: 4px 12px; padding-top: 4px; padding-bottom: 4px; }
.topbar a { color: var(--ink-100); opacity: .85; flex-shrink: 0; }
.topbar a:hover { opacity: 1; }
.topbar .dates { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar .date { opacity: .7; }
.topbar .date-hijri { opacity: .7; }
.topbar .date-hijri::before { content: '·'; margin-right: 10px; opacity: .6; }
@media (max-width: 480px) {
  .topbar .date-hijri::before { display: none; }
  .topbar .dates { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ---- Header / Logo ---- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--red-600);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}
.brand-logo-img { width: 300px; height: auto; max-width: 100%; object-fit: contain; flex-shrink: 0; }
@media (max-width: 480px) {
  .brand-logo-img { width: 180px; }
}
@media (min-width: 481px) and (max-width: 780px) {
  .brand-logo-img { width: 220px; }
}

/* ---- Mobile header: black topbar hidden, logo centered, date + a
   manually-swipeable category icon slider below the logo instead ---- */
.mobile-header-extra { display: none; }
@media (max-width: 780px) {
  .topbar { display: none; }
  .site-header .header-inner { position: relative; justify-content: flex-end; }
  .site-header .brand { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .mobile-header-extra { display: block; padding-bottom: 10px; }
}
@media (min-width: 781px) {
  /* Desktop already has the dedicated Contact button in the header, so
     don't show it a second time in the nav bar. */
  .contact-nav-item { display: none; }
}
.mobile-date {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  font-size: 12px; color: var(--ink-500); padding: 2px 0 10px;
}
.mobile-date .date-hijri::before { content: '·'; margin-right: 10px; }
.mobile-cat-slider {
  display: flex; gap: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none; -ms-overflow-style: none;
}
.mobile-cat-slider::-webkit-scrollbar { display: none; }
.mobile-cat-pill {
  scroll-snap-align: start; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.mobile-cat-pill:hover, .mobile-cat-pill:active { background: var(--red-600); border-color: var(--red-600); color: #fff; text-decoration: none; }
.mobile-cat-pill .pill-icon { font-size: 22px; line-height: 1; }

/* ---- Header right side (category pills + search + mobile nav toggle) ---- */
.header-right { display: flex; align-items: center; gap: 18px; }

.header-cat-pills {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 46vw;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.header-cat-pills::-webkit-scrollbar { display: none; }
.header-cat-pill {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  color: var(--ink-700);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.header-cat-pill:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; text-decoration: none; }
.header-cat-pill .pill-icon { font-size: 26px; line-height: 1; }
@media (max-width: 999px) {
  .header-cat-pills { display: none; }
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.header-contact-btn {
  display: inline-flex; align-items: center;
  background: var(--red-600); color: #fff;
  font-size: 13.5px; font-weight: 700;
  padding: 9px 16px; border-radius: var(--radius);
  white-space: nowrap;
}
.header-contact-btn:hover { background: var(--red-700); color: #fff; text-decoration: none; }
@media (max-width: 780px) {
  /* No room for a text button next to the centered logo at this width —
     "Contact" moves into the hamburger nav instead (see .contact-nav-item). */
  .header-contact-btn { display: none; }
}

.search-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ink-100);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-700);
  cursor: pointer;
}
.search-toggle-btn:hover { background: var(--red-50); border-color: var(--red-100); color: var(--red-700); }
.search-toggle-label { font-size: 13.5px; font-weight: 600; }

/* ---- Nav ---- */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { content:''; }
.nav-toggle .bars { position: relative; width: 20px; height: 2px; background: var(--ink-900); }
.nav-toggle .bars::before, .nav-toggle .bars::after { position:absolute; left:0; width:20px; height:2px; background:var(--ink-900); content:''; }
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }

.main-nav {
  background: var(--red-600);
}
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
}
.main-nav a {
  display: block;
  color: #fff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.main-nav a:hover, .main-nav a.active { background: var(--red-800); text-decoration: none; }

.main-nav li { position: relative; }
.main-nav li.has-children > a::after { content: '\25BE'; font-size: 10px; margin-left: 5px; display: inline-block; }
.main-nav .sub-nav {
  list-style: none; margin: 0; padding: 0;
  display: none;
  position: absolute; left: 0; top: 100%; min-width: 190px; z-index: 20;
  background: var(--red-800);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.main-nav li.has-children:hover > .sub-nav,
.main-nav li.has-children:focus-within > .sub-nav { display: block; }
.main-nav .sub-nav a { text-transform: none; letter-spacing: normal; padding: 10px 16px; white-space: nowrap; }

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav .sub-nav { display: block; position: static; box-shadow: none; background: rgba(0,0,0,.12); }
  .main-nav .sub-nav a { padding-left: 30px; }
  .main-nav li.has-children > a::after { display: none; }
  .search-toggle-btn { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
  .search-toggle-label { display: none; }
}
@media (min-width: 781px) {
  .nav-toggle { display: none; }
}

/* ---- Search bar ---- */
.search-bar { background: var(--red-800); padding: 10px 0; display: none; }
.search-bar.open { display: block; }
.search-bar form { display: flex; gap: 8px; }
.search-bar input[type="search"] {
  flex: 1; padding: 10px 12px; border-radius: var(--radius); border: none; font-size: 15px;
}
.search-bar button {
  background: var(--ink-900); color: #fff; border: none; padding: 0 16px; border-radius: var(--radius); cursor: pointer;
}

/* ---- Breaking / marquee strip ---- */
.breaking {
  background: var(--red-50);
  border-bottom: 1px solid var(--red-100);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
}
.breaking .container { display:flex; align-items:center; gap:12px; overflow: hidden; }
.breaking .tag {
  background: var(--red-600); color: #fff; padding: 3px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; flex-shrink: 0;
}
.breaking-viewport { overflow: hidden; flex: 1; min-width: 0; -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.breaking .items {
  display: flex; gap: 40px; white-space: nowrap; width: max-content;
  animation: breaking-marquee 22s linear infinite;
}
.breaking:hover .items { animation-play-state: paused; }
.breaking .items a { color: var(--ink-700); }
.breaking .items span { color: var(--ink-700); }
@keyframes breaking-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .breaking .items { animation: none; }
  .breaking-viewport { overflow-x: auto; }
}

/* ---- Ad slider (sidebar widget: Categories, then this, then Most Read) ---- */
.widget-ad-slider { padding-bottom: 12px; }
.ad-slider { position: relative; }
/* Absolute-stacked crossfade carousel (see hero-slider comment above for why). */
.ad-slider-track { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--ink-900); }
.ad-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none; padding: 0;
  cursor: pointer; display: block; opacity: 0; visibility: hidden; transition: opacity .5s ease;
}
.ad-slide.active { opacity: 1; visibility: visible; z-index: 1; }
.ad-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ad-slide:hover img { transform: scale(1.03); }
.ad-slide-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
  color: #fff; font-weight: 700; font-size: 13px; text-align: left;
}
.ad-slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255,255,255,.9);
  color: var(--ink-900); font-size: 13px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
}
.ad-slider-arrow:hover { background: var(--red-600); color: #fff; }
.ad-slider-prev { left: 8px; }
.ad-slider-next { right: 8px; }
.ad-slider-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.ad-slider-dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--ink-100); cursor: pointer; padding: 0; }
.ad-slider-dot.active { background: var(--red-600); width: 18px; border-radius: 5px; }
@media (max-width: 899px) {
  .ad-slider-track { aspect-ratio: 16/9; }
}

/* ---- Ad popup (opened from the slider, no page navigation) ---- */
.ad-popup-overlay {
  display: none; position: fixed; inset: 0; z-index: 950; background: rgba(10,10,10,.75);
  align-items: center; justify-content: center; padding: 20px;
}
.ad-popup-overlay.open { display: flex; }
.ad-popup-box {
  position: relative; background: var(--white); border-radius: var(--radius);
  max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.ad-popup-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink-900); color: #fff; border: none; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.ad-popup-close:hover { background: var(--red-600); }
.ad-popup-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ad-popup-body { grid-template-columns: 1.1fr 1fr; } }
.ad-popup-main-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
@media (min-width: 640px) { .ad-popup-main-img { border-radius: var(--radius) 0 0 0; } }
.ad-popup-thumbs { display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; }
.ad-popup-thumbs img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer;
  opacity: .6; border: 2px solid transparent;
}
.ad-popup-thumbs img.active, .ad-popup-thumbs img:hover { opacity: 1; border-color: var(--red-600); }
.ad-popup-info { padding: 20px; }
.ad-popup-info h3 { margin: 10px 0; font-size: 20px; }
.ad-popup-desc { color: var(--ink-700); font-size: 14.5px; line-height: 1.6; margin-bottom: 14px; }
.ad-popup-fullpage-link { margin-top: 6px; }

/* ---- Layout ---- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: 24px 0 48px;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 2.4fr 1fr; }
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-img { aspect-ratio: 16/9; overflow: hidden; background: var(--ink-100); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; }
.card .category-pill {
  display: inline-block; background: var(--red-100); color: var(--red-700);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; margin-bottom: 8px; letter-spacing: .03em;
}
.card h2, .card h3 { margin-bottom: 6px; }
.card h2 a, .card h3 a { color: var(--ink-900); }
.card h2 a:hover, .card h3 a:hover { color: var(--red-700); text-decoration: none; }
.card .meta { font-size: 12.5px; color: var(--ink-500); }
.card .excerpt { color: var(--ink-700); font-size: 14.5px; margin-top: 6px; }

/* ---- Hero slider (featured articles) ----
   Absolute-stacked crossfade carousel (not transform+flex sliding) — more
   robust across browsers/GPUs than translateX sliding of flex siblings. */
.hero-slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-slider-track { position: relative; aspect-ratio: 4/3; background: var(--ink-900); }

/* ---- Hero section wrapper: slider (left) + 3 recent articles (right) ---- */
.hero-section { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 36px; }
@media (min-width: 700px) {
  .hero-section { grid-template-columns: 1.6fr 1fr; align-items: stretch; }
  /* On desktop the slider stretches to match the height of the 3 stacked
     recent-article cards on the right, instead of using its own aspect-ratio
     (which left a gap when the two columns' natural heights didn't match).
     Sizing is handled by .hero-slider-col's flex layout (see below). */
  .hero-slider-track { aspect-ratio: auto; height: 100%; min-height: var(--hero-col-height); }
}
.hero-recent-col { display: flex; flex-direction: column; gap: 16px; }

/* Sponsor marquee: vertical (bottom-to-top) on desktop where the column is
   tall and narrow; horizontal (right-to-left) on mobile where it's short
   and wide. The list is rendered twice in the track so translating by -50%
   loops seamlessly (same trick as .breaking .items / .ad-marquee-track). */
.hero-sponsor-col { overflow: hidden; }
.hero-sponsor-track {
  display: flex; flex-direction: column; gap: var(--hero-sponsor-gap);
  animation: hero-sponsor-scroll-y 16s linear infinite;
}
.hero-sponsor-col:hover .hero-sponsor-track { animation-play-state: paused; }
@keyframes hero-sponsor-scroll-y {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.hero-sponsor-banner {
  position: relative; display: block; flex-shrink: 0;
  aspect-ratio: 4 / 1.5;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-sponsor-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-sponsor-banner .badge-sponsored { position: absolute; top: 8px; left: 8px; }
@media (min-width: 700px) {
  /* Fixed to the same height as the slider, sized so exactly 3 banners
     (plus their 2 gaps) fill it — the aspect-ratio above is dropped here
     since height now comes from this column-height math instead. */
  .hero-sponsor-col { height: var(--hero-col-height); }
  .hero-sponsor-banner {
    aspect-ratio: auto;
    flex-basis: calc((var(--hero-col-height) - 2 * var(--hero-sponsor-gap)) / 3);
  }
}
@media (max-width: 699px) {
  .hero-sponsor-track {
    flex-direction: row; width: max-content; gap: 14px;
    animation-name: hero-sponsor-scroll-x;
  }
  .hero-sponsor-track .hero-sponsor-banner { width: 220px; }
  @keyframes hero-sponsor-scroll-x {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-sponsor-track { animation: none; }
  .hero-sponsor-col { overflow: auto; }
}
.hero-slide {
  position: absolute; inset: 0; display: block;
  opacity: 0; visibility: hidden; transition: opacity .5s ease;
}
.hero-slide.active { opacity: 1; visibility: visible; z-index: 1; }
.hero-slide-img { width: 100%; height: 100%; overflow: hidden; }
.hero-slide-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Mobile: show each slide at its own true (uncropped) height instead of a
   fixed box. This means slides are no longer stacked/cross-fadeable (they'd
   need matching heights for that), so on mobile only the active slide is
   in the layout at all — swapped instantly instead of faded. */
@media (max-width: 699px) {
  .hero-slider-track { aspect-ratio: auto; height: auto; background: none; }
  .hero-slide {
    position: static; inset: auto; display: none;
    opacity: 1; visibility: visible; transition: none;
  }
  .hero-slide.active { display: block; }
  .hero-slide-img { height: auto; }
  .hero-slide-img img { height: auto; object-fit: contain; }
}
.hero-slide-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,0));
  padding: 40px 20px 18px;
}
.hero-slide-body h1 { color: #fff; font-size: 22px; margin-bottom: 6px; }
@media (min-width: 700px) { .hero-slide-body h1 { font-size: 28px; } }
.hero-slide-body .meta { color: #eee; }
.hero-slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255,255,255,.9);
  color: var(--ink-900); font-size: 16px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
}
.hero-slider-arrow:hover { background: var(--red-600); color: #fff; }
.hero-slider-prev { left: 16px; }
.hero-slider-next { right: 16px; }
.hero-slider-dots { position: absolute; right: 16px; bottom: 16px; z-index: 2; display: flex; gap: 8px; }
.hero-slider-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.hero-slider-dot.active { background: var(--red-600); width: 24px; border-radius: 6px; }
.hero-slider-col { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 700px) { .hero-slider-col { height: 100%; } }
.hero-slider-col .hero-slider { flex: 1; min-height: 0; }
.hero-slider-dots-outside { position: static; justify-content: center; padding: 4px 0; }
.hero-slider-dots-outside .hero-slider-dot { background: var(--ink-100); }
.hero-slider-dots-outside .hero-slider-dot.active { background: var(--red-600); }

/* ---- Ad marquee (all-sponsors strip, homepage, below the hero) ---- */
.ad-marquee-section { margin-bottom: 36px; }
.ad-marquee-section .section-heading { margin-bottom: 16px; }
.ad-marquee-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
/* When main.js takes over (.js-scroll), the strip becomes a real scroller:
   swipe/drag works and JS drives the slow auto-drift via scrollLeft. */
.ad-marquee-viewport.js-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ad-marquee-viewport.js-scroll::-webkit-scrollbar { display: none; }
.ad-marquee-viewport.js-scroll .ad-marquee-track { animation: none; }
.ad-marquee-track {
  display: flex; gap: 20px; width: max-content;
  animation: ad-marquee-scroll 55s linear infinite;
}
.ad-marquee-viewport:hover .ad-marquee-track { animation-play-state: paused; }
.ad-marquee-item {
  flex-shrink: 0; width: 220px; aspect-ratio: 16/10; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: block; background: var(--ink-100);
}
.ad-marquee-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.ad-marquee-item:hover img { transform: scale(1.05); }
@keyframes ad-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ad-marquee-track { animation: none; }
  .ad-marquee-viewport { overflow-x: auto; }
}
@media (max-width: 640px) {
  /* Two sponsors per row, with a sliver of the third peeking in as a swipe hint. */
  .ad-marquee-item { width: calc(50vw - 24px); }
  .ad-marquee-track { gap: 12px; }
  .ad-marquee-viewport {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }
}

/* ---- Grid of article cards ---- */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .article-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Homepage "Latest News": full-width, no sidebar, 3 cards per row ---- */
.homepage-latest { padding: 24px 0 48px; }
@media (min-width: 640px) { .article-grid-3col { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .article-grid-3col { grid-template-columns: repeat(3, 1fr); } }
.article-grid-3col .excerpt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- Homepage "Browse by Category": all top-level categories as buttons ---- */
.all-categories-section { padding-top: 0; }
.all-categories-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .all-categories-grid { grid-template-columns: repeat(4, 1fr); } }
.all-categories-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  color: var(--ink-700); font-weight: 600; font-size: 14.5px;
}
.all-categories-btn:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; text-decoration: none; }
.all-categories-btn .pill-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }

/* ---- Sidebar ---- */
.widget { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 20px; }
.widget h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 3px solid var(--red-600); padding-bottom: 8px; margin-bottom: 12px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px dashed var(--ink-100); font-size: 14px; }
.widget li:last-child { border-bottom: none; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { background: var(--ink-50); border: 1px solid var(--ink-100); padding: 5px 11px; border-radius: 999px; font-size: 12.5px; color: var(--ink-700); }
.tag-cloud a:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; text-decoration: none; }
.category-list a { display:flex; justify-content: space-between; color: var(--ink-700); }
.category-list a:hover { color: var(--red-700); text-decoration: none; }
.category-list .count { color: var(--ink-300); }
.category-sublist { margin-top: 6px; padding-left: 16px; border-left: 2px solid var(--ink-100); }
.category-sublist li { padding: 6px 0; font-size: 13px; }

/* ---- Article page ---- */
.article-header { margin-bottom: 16px; }
.article-header .category-pill { margin-bottom: 10px; }
.article-header h1 { font-size: 28px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink-500); font-size: 13.5px; margin-bottom: 16px; }
.article-source { font-style: italic; max-width: 100%; overflow-wrap: anywhere; }
.article-source a { color: var(--red-700); font-style: normal; }
.article-featured-img { border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow); }
.article-body { background: var(--white); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 17px; line-height: 1.75; }
.article-body p { margin: 0 0 1.1em; }
.article-body img { border-radius: var(--radius); margin: 1em 0; cursor: zoom-in; }
.article-featured-img img { cursor: zoom-in; }

/* ---- Inline video embed (YouTube/Shorts link inserted between paragraphs) ---- */
.video-embed {
  position: relative; display: block; margin: 1em 0; border-radius: var(--radius);
  overflow: hidden; cursor: pointer; background: var(--ink-900); aspect-ratio: 16/9;
}
.video-embed .video-thumb-img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; cursor: pointer; }
.video-embed .video-play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; background: rgba(var(--red-600-rgb), .9); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; padding-left: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); transition: transform .15s ease, background .15s ease;
}
.video-embed:hover .video-play-btn { background: var(--red-600); transform: translate(-50%, -50%) scale(1.08); }
.video-embed-generic { background: var(--ink-100); aspect-ratio: auto; padding: 24px; display: flex; align-items: center; gap: 14px; }
.video-embed-generic .video-play-btn { position: static; transform: none; flex-shrink: 0; width: 48px; height: 48px; font-size: 18px; }
.video-embed-generic .video-fallback-label { color: var(--ink-700); font-weight: 600; }

/* ---- Inline sponsor embed (added via the "Add Sponsor" editor button) ---- */
.sponsor-embed {
  position: relative; display: block; margin: 1em 0; border-radius: var(--radius);
  overflow: hidden; cursor: pointer; background: var(--ink-900); aspect-ratio: 16/9;
}
.sponsor-embed-img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; transition: transform .3s ease; }
.sponsor-embed:hover .sponsor-embed-img { transform: scale(1.03); }
.sponsor-embed-badge {
  position: absolute; top: 10px; left: 10px; background: #fff4e0; color: #a8660f; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px;
}
.sponsor-embed-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
  color: #fff; font-weight: 700; font-size: 15px;
}

/* ---- Image / video lightbox ---- */
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,10,10,.92); padding: 24px;
  align-items: center; justify-content: center;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 100%; max-height: 90vh; border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,.5); cursor: default; margin: 0;
}
.lightbox-video-wrap {
  display: none; width: min(100%, 960px); aspect-ratio: 16/9;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); border-radius: var(--radius); overflow: hidden;
}
.lightbox-video-wrap.show { display: block; }
.lightbox-video-wrap iframe { width: 100%; height: 100%; border: none; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%;
  background: #fff; color: var(--ink-900); border: none; font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.4); z-index: 1;
}
.lightbox-close:hover { background: var(--red-600); color: #fff; }
.article-tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Share buttons ---- */
.share-box {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ink-100);
  position: relative;
}
.share-label { font-size: 13.5px; font-weight: 600; color: var(--ink-700); }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--ink-500); transition: transform .12s ease, filter .12s ease; padding: 0;
}
.share-btn:hover { filter: brightness(1.1); transform: translateY(-2px); text-decoration: none; }
.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-x { background: #111111; }
.share-telegram { background: #229ED9; }
.share-linkedin { background: #0A66C2; }
.share-email { background: var(--ink-500); }
.share-copy { background: var(--red-600); }
.share-native { background: var(--ink-900); }
.share-native[hidden] { display: none; }
.share-copied-msg {
  display: none; position: absolute; left: 0; bottom: -22px;
  font-size: 12.5px; color: var(--red-700); font-weight: 600;
}
.share-copied-msg.show { display: inline-block; }

/* ---- Sponsored ad card (shown below an article) ---- */
.badge-sponsored {
  display: inline-block; background: #fff4e0; color: #a8660f; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px;
}
.sponsored-card {
  background: var(--white); border: 1px dashed var(--ink-100); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-top: 24px;
}
.sponsored-card-body { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
@media (min-width: 560px) { .sponsored-card-body { flex-direction: row; align-items: center; } }
.sponsored-card-img { flex-shrink: 0; display: block; border-radius: var(--radius); overflow: hidden; width: 100%; max-width: 220px; aspect-ratio: 16/10; }
.sponsored-card-img img { width: 100%; height: 100%; object-fit: cover; }
.sponsored-card-text h3 { margin-bottom: 6px; }
.sponsored-card-text h3 a { color: var(--ink-900); }
.sponsored-card-text h3 a:hover { color: var(--red-700); text-decoration: none; }
.sponsored-card-text p { color: var(--ink-700); font-size: 14px; margin-bottom: 10px; }

/* ---- Related / Recent article sections (below article content) ---- */
.related-section { margin-top: 28px; }
.section-heading { border-bottom: 3px solid var(--red-600); padding-bottom: 8px; font-size: 20px; }

/* ---- Homepage "Just In" strip: latest 10 articles, image + gradient + title.
   Slow, continuously-scrolling marquee (same doubled-list/-50% technique as
   .ad-marquee-track and .hero-sponsor-track). */
.latest-strip-section { margin-bottom: 36px; }
.latest-strip-section .section-heading { margin-bottom: 16px; }
.latest-strip-viewport { overflow: hidden; }
.latest-strip {
  display: flex; gap: 14px; width: max-content;
  animation: latest-strip-scroll 55s linear infinite;
}
.latest-strip-viewport:hover .latest-strip { animation-play-state: paused; }
@keyframes latest-strip-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .latest-strip { animation: none; }
  .latest-strip-viewport { overflow-x: auto; }
}
@media (max-width: 780px) {
  /* overflow:hidden blocks touch-drag entirely, so on mobile swap the
     auto-scrolling marquee for a manually swipeable strip instead
     (same approach as .mobile-cat-slider). */
  .latest-strip { animation: none; }
  .latest-strip-viewport { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.latest-strip-card {
  position: relative; display: block; flex-shrink: 0;
  width: 200px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
@media (min-width: 640px) { .latest-strip-card { width: 230px; } }
.latest-strip-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.latest-strip-card:hover img { transform: scale(1.05); }
.latest-strip-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.4) 45%, transparent 75%);
}
.latest-strip-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px 16px;
}
.latest-strip-card .category-pill {
  display: inline-block; background: var(--red-600); color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 6px;
}
.latest-strip-card h3 {
  margin: 0;
  color: #fff; font-size: 14px; font-weight: 700; line-height: 1.4;
  /* max-height is a hard backstop: -webkit-line-clamp alone can let an extra
     line bleed past it for long titles. Padding now lives on the parent
     .latest-strip-body (not here), so this max-height is pure text-height —
     no need to account for box-sizing:border-box pulling padding out of it. */
  max-height: calc(1.4em * 3);
  overflow: hidden; overflow-wrap: break-word; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}

/* ---- Mini article listing (compact, e.g. Recent Articles) ---- */
.mini-article-list { list-style: none; margin: 0; padding: 0; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.mini-article-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ink-100); }
.mini-article-list li:last-child { border-bottom: none; }
.mini-article-thumb { flex-shrink: 0; width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; display: block; }
.mini-article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-article-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mini-article-title {
  color: var(--ink-900); font-weight: 600; font-size: 14.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-article-title:hover { color: var(--red-700); text-decoration: none; }
.mini-article-meta { color: var(--ink-500); font-size: 12px; }

/* ---- Ad detail page ---- */
.ad-detail h1 { margin-top: 10px; font-size: 26px; }
.ad-hero { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 16px 0 20px; aspect-ratio: 16/8; }
.ad-hero img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ad-detail-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 800px) { .ad-detail-layout { grid-template-columns: 2fr 1fr; } }
.ad-description {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; font-size: 16px; line-height: 1.7; color: var(--ink-700); margin-bottom: 24px;
}
.ad-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ad-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); cursor: zoom-in; box-shadow: var(--shadow); }
.ad-contact-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; align-self: start; }
.ad-contact-card h3 { margin-top: 0; border-bottom: 3px solid var(--red-600); padding-bottom: 8px; }
.ad-contact-list { list-style: none; margin: 0; padding: 0; }
.ad-contact-list li { padding: 10px 0; border-bottom: 1px dashed var(--ink-100); font-size: 14.5px; }
.ad-contact-list li:last-child { border-bottom: none; }
.ad-contact-list a { color: var(--ink-700); font-weight: 600; }
.ad-contact-list a:hover { color: var(--red-700); text-decoration: none; }
.ad-address { color: var(--ink-500); }

/* ---- Contact page ---- */
.contact-info-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.contact-info-item {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; color: var(--ink-700); font-weight: 600; font-size: 14.5px;
}
.contact-info-item:hover { color: var(--red-700); text-decoration: none; }
.contact-info-item svg { color: var(--red-600); flex-shrink: 0; }
.contact-form-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* ---- Comments ---- */
.comments { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 24px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--ink-100); }
.comment .name { font-weight: 700; }
.comment .date { color: var(--ink-300); font-size: 12px; margin-left: 8px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ink-100); border-radius: var(--radius);
  font-family: inherit; font-size: 14.5px; margin-bottom: 12px;
}
.btn {
  display: inline-block; background: var(--red-600); color: #fff; border: none;
  padding: 11px 22px; border-radius: var(--radius); font-weight: 600; cursor: pointer; font-size: 14.5px;
}
.btn:hover { background: var(--red-800); text-decoration: none; color:#fff; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); font-size: 14px; color: var(--ink-700);
}
.pagination a:hover { background: var(--red-600); color: #fff; text-decoration: none; }
.pagination .current { background: var(--red-600); color: #fff; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14.5px; }
.alert-success { background: #e6f7ec; color: #1c7a3f; border: 1px solid #b8e6c8; }
.alert-error { background: var(--red-50); color: var(--red-800); border: 1px solid var(--red-100); }

/* ---- Footer ---- */
.site-footer { background: var(--ink-900); color: var(--ink-100); margin-top: 40px; }
.site-footer .container { padding: 32px 16px 20px; display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 700px) { .site-footer .container { grid-template-columns: repeat(4, 1fr); } }
.site-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.site-footer a { color: var(--ink-300); }
.site-footer a:hover { color: #fff; }
.footer-tag-cloud {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-height: 62px; overflow: hidden;
}
.footer-tag-cloud a {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
}
.footer-tag-cloud a:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; text-decoration: none; }
.site-footer .bottom {
  border-top: 1px solid rgba(255,255,255,.1); text-align:center; padding: 16px;
  font-size: 12.5px; color: var(--ink-300);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px;
}
.site-footer .bottom .powered-by::before { content: '·'; margin-right: 10px; color: var(--ink-500); }
.site-footer .bottom .powered-by a { color: #f59e0b; font-weight: 600; }
.site-footer .bottom .powered-by a:hover { color: #fbbf24; }
.social-links { display: flex; gap: 10px; margin-top: 10px; }
.social-links a { width: 34px; height:34px; border-radius: 50%; background: rgba(255,255,255,.08); display:flex; align-items:center; justify-content:center; }
.social-links a:hover { background: var(--red-600); text-decoration:none; }

.footer-about p { color: var(--ink-300); font-size: 13.5px; line-height: 1.6; }
.footer-logo-img { max-height: 40px; width: auto; max-width: 180px; object-fit: contain; margin-bottom: 10px; }

.footer-link-list { list-style: none; margin: 0; padding: 0; }
.footer-link-list li { margin-bottom: 4px; }
.footer-link-list a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 0; position: relative; text-decoration: none;
  transition: color .15s ease, padding-left .15s ease;
}
.footer-link-list a::before {
  content: ''; width: 0; height: 1px; background: var(--red-600);
  transition: width .15s ease; margin-right: 0;
}
.footer-link-list a:hover { color: #fff; padding-left: 4px; }
.footer-link-list a:hover::before { width: 8px; margin-right: 6px; }
.footer-link-list .ext-icon { font-size: 11px; opacity: .7; }

.footer-whatsapp {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  color: #25D366; font-weight: 600; font-size: 13.5px;
}
.footer-whatsapp:hover { color: #2fe077; text-decoration: none; }

/* ---- Empty state ---- */
.empty-state { text-align:center; padding: 40px 16px; color: var(--ink-500); }
