/* ==========================================================================
   Lanka Hit News - News Category & Listing Pages (Dark & Light Theme Support)
   ========================================================================== */

:root {
  --sl-bg: #060b17;
  --sl-text: #cbd5e1;
  --sl-heading: #ffffff;
  --sl-muted: #94a3b8;
  --sl-surface: #0c1527;
  --sl-surface-2: #0b1329;
  --sl-border: rgba(255, 255, 255, 0.08);
  --sl-border-strong: rgba(255, 255, 255, 0.14);
  --sl-card-bg: #0c1527;
  --sl-card-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  --sl-thumb-bg: #000000;
  --sl-btn-bg: rgba(255, 255, 255, 0.06);
  --sl-btn-hover: rgba(255, 255, 255, 0.12);
  --sl-red: #e11d48;
  --sl-red-accent: #f43f5e;
}

html[data-theme="light"] {
  --sl-bg: #f8fafc;
  --sl-text: #334155;
  --sl-heading: #0f172a;
  --sl-muted: #64748b;
  --sl-surface: #ffffff;
  --sl-surface-2: #ffffff;
  --sl-border: #e2e8f0;
  --sl-border-strong: #cbd5e1;
  --sl-card-bg: #ffffff;
  --sl-card-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  --sl-thumb-bg: #f1f5f9;
  --sl-btn-bg: #ffffff;
  --sl-btn-hover: #f1f5f9;
  --sl-red: #e11d48;
  --sl-red-accent: #e11d48;
}

.sl-news-page {
  background-color: var(--sl-bg) !important;
  color: var(--sl-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.sl-news-shell {
  max-width: 1360px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 20px 24px 60px !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   Header & Toolbar
   ========================================================================== */
.sl-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.sl-header-info {
  min-width: 0;
}

.sl-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 850;
  color: var(--sl-heading);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 6px;
}

.sl-page-subtitle {
  font-size: 14px;
  color: var(--sl-muted);
  line-height: 1.45;
  margin: 0;
}

.sl-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sl-sort-select {
  background: var(--sl-surface-2);
  border: 1px solid var(--sl-border-strong);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--sl-heading);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sl-sort-select:focus {
  border-color: var(--sl-red);
}

.sl-view-toggle {
  display: inline-flex;
  background: var(--sl-surface-2);
  border: 1px solid var(--sl-border-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sl-view-btn {
  width: 36px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--sl-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sl-view-btn + .sl-view-btn {
  border-left: 1px solid var(--sl-border);
}

.sl-view-btn:hover {
  color: var(--sl-heading);
  background: var(--sl-btn-hover);
}

.sl-view-btn.is-active,
.sl-view-btn[aria-pressed="true"] {
  background: rgba(225, 29, 72, 0.15);
  color: var(--sl-red);
}

/* ==========================================================================
   2-Column Layout
   ========================================================================== */
.sl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
  width: 100%;
}

.sl-main {
  min-width: 0;
  width: 100%;
}

/* ==========================================================================
   Article List View (Horizontal Rows)
   ========================================================================== */
.sl-articles-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sl-article-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--sl-border);
  align-items: center;
  transition: transform 0.2s ease;
}

.sl-article-row:first-child {
  padding-top: 0;
}

.sl-article-row:last-child {
  border-bottom: 0;
}

.sl-thumb-wrap {
  position: relative;
  width: 220px;
  height: 138px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sl-thumb-bg);
  border: 1px solid var(--sl-border);
  flex-shrink: 0;
  display: block;
}

.sl-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.sl-article-row:hover .sl-thumb-wrap img {
  transform: scale(1.05);
}

.sl-article-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sl-cat-time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
}

.sl-cat-badge {
  color: var(--sl-red-accent);
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sl-time-sep {
  color: var(--sl-muted);
  font-size: 10px;
}

.sl-time-text {
  color: var(--sl-muted);
  font-weight: 600;
}

.sl-title {
  margin: 0;
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 800;
  line-height: 1.35;
  color: var(--sl-heading);
}

.sl-title a {
  color: var(--sl-heading);
  text-decoration: none;
}

.sl-title a:hover {
  color: var(--sl-heading);
}

.sl-summary {
  margin: 0;
  color: var(--sl-muted);
  font-size: 13.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sl-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--sl-muted);
  font-weight: 600;
}

.sl-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sl-meta-item svg {
  width: 13px;
  height: 13px;
  opacity: 0.85;
}

/* ==========================================================================
   Article Grid View Mode
   ========================================================================== */
.sl-main.is-grid .sl-articles-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.sl-main.is-grid .sl-article-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--sl-card-bg);
  border: 1px solid var(--sl-border);
  border-radius: 12px;
  box-shadow: var(--sl-card-shadow);
  align-items: stretch;
}

.sl-main.is-grid .sl-thumb-wrap {
  width: 100%;
  height: 170px;
}

/* ==========================================================================
   Load More Button
   ========================================================================== */
.sl-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.sl-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sl-btn-bg);
  border: 1px solid var(--sl-border-strong);
  color: var(--sl-heading);
  font-size: 13px;
  font-weight: 750;
  padding: 10px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sl-load-more-btn:hover {
  background: var(--sl-btn-hover);
  border-color: var(--sl-red);
  transform: translateY(-1px);
}

.sl-load-more-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ==========================================================================
   Right Sidebar
   ========================================================================== */
.sl-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  position: sticky;
  top: 88px;
}

.sl-side-card {
  background: var(--sl-card-bg);
  border: 1px solid var(--sl-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--sl-card-shadow);
  position: relative;
  overflow: hidden;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.sl-side-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--sl-heading);
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

/* Card 1: Top Stories */
.sl-side-recent-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sl-side-recent-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.sl-side-recent-item:hover {
  transform: translateX(3px);
}

.sl-side-thumb {
  width: 74px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--sl-thumb-bg);
  border: 1px solid var(--sl-border);
  flex-shrink: 0;
}

.sl-side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sl-side-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sl-side-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sl-heading);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.sl-side-recent-item:hover .sl-side-item-title {
  color: var(--sl-heading);
}

.sl-side-item-time {
  font-size: 11px;
  color: var(--sl-muted);
  font-weight: 600;
}

.sl-side-view-all-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--sl-btn-bg);
  border: 1px solid var(--sl-border-strong);
  border-radius: 8px;
  padding: 9px;
  color: var(--sl-heading);
  font-size: 12.5px;
  font-weight: 750;
  margin-top: 14px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  box-sizing: border-box;
}

.sl-side-view-all-btn:hover {
  background: var(--sl-btn-hover);
  border-color: var(--sl-border-strong);
  color: var(--sl-heading);
}

/* Card 2: Sidebar Ad */
.sl-side-ad-card {
  padding: 0;
  background: #081122;
  overflow: hidden;
}

.sl-side-ad-card .sl-ad-link {
  display: block;
  line-height: 0;
}

.sl-side-ad-card .sl-ad-link img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  object-fit: cover;
}

html[data-theme="light"] .sl-side-ad-card {
  background: #0b1329;
}

.sl-ad-badge {
  position: absolute;
  top: 12px;
  left: 14px;
  background: rgba(0, 0, 0, 0.65);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 3;
  text-transform: uppercase;
}

.sl-ad-content {
  padding: 18px 20px 14px;
  position: relative;
  z-index: 2;
}

.sl-ad-title {
  font-size: 18px;
  font-weight: 850;
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 4px;
}

.sl-ad-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 12px;
}

.sl-ad-btn {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 6px;
  font-weight: 750;
  font-size: 12px;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s;
}

.sl-ad-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.sl-ad-banner-media {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.sl-ad-banner-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.sl-ad-sri-lanka-brand {
  position: absolute;
  bottom: 12px;
  left: 16px;
  z-index: 2;
  color: #ffffff;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card 3: Stay Connected Social Links */
.sl-side-social-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sl-social-box {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.sl-social-box:hover {
  transform: translateY(-2px) scale(1.06);
  filter: brightness(1.15);
}

.sl-soc-fb { background: #1877f2; }
.sl-soc-yt { background: #ff0000; }
.sl-soc-x  { background: #000000; border: 1px solid rgba(255, 255, 255, 0.3); }
.sl-soc-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.sl-soc-wa { background: #25d366; }

/* Card 4: Latest Videos */
.sl-side-head-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sl-side-head-flex .sl-side-title {
  margin: 0;
}

.sl-side-more-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--sl-muted);
  text-decoration: none;
}

.sl-side-more-link:hover {
  color: var(--sl-heading);
}

.sl-side-video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sl-side-video-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s;
}

.sl-side-video-item:hover {
  transform: translateX(3px);
}

.sl-side-vid-thumb {
  position: relative;
  width: 90px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--sl-thumb-bg);
  border: 1px solid var(--sl-border);
  flex-shrink: 0;
}

.sl-side-vid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sl-vid-play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  background: rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.sl-vid-duration {
  position: absolute;
  bottom: 3px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 9.5px;
  font-weight: 750;
  padding: 1px 4px;
  border-radius: 4px;
}

.sl-side-vid-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sl-heading);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sl-side-video-item:hover .sl-side-vid-title {
  color: var(--sl-heading);
}

/* Card 5: Special Offer Promo */
.sl-side-special-offer {
  background: linear-gradient(145deg, #1d0e40 0%, #2f0a59 50%, #150630 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 8px 26px rgba(76, 29, 149, 0.25);
  text-align: center;
}

.sl-offer-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
}

.sl-offer-close {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.sl-offer-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sl-offer-kicker {
  font-size: 11.5px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sl-offer-heading {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

.sl-offer-heading strong {
  color: #f43f5e;
  font-size: 30px;
}

.sl-offer-sub {
  font-size: 12.5px;
  color: #cbd5e1;
  margin: 4px 0 10px;
  font-weight: 600;
}

.sl-offer-coupon {
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  color: #ffffff;
  margin-bottom: 12px;
}

.sl-offer-btn {
  background: #e11d48;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 850;
  padding: 8px 26px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

.sl-offer-btn:hover {
  background: #be123c;
  transform: translateY(-1px);
}

.sl-offer-tnc {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 8px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .sl-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .sl-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .sl-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .sl-article-row {
    grid-template-columns: 1fr;
  }
  .sl-thumb-wrap {
    width: 100%;
    height: 180px;
  }
  .sl-main.is-grid .sl-articles-list {
    grid-template-columns: 1fr;
  }
}