/*
Theme Name: Nabd
Theme URI: https://nabd.ma
Author: Nabd Team
Author URI: https://nabd.ma
Description: RTL Arabic news theme matching the visual identity of modern Moroccan portals — royal-blue brand band, light nav band, image-overlay cards, dark video band, live match ticker, full-width weather band, mixed "chosen for you" rows, vote-arrows comments, newsletter band with app badges. Original code, no third-party theme code.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nabd
Tags: news, rtl-language-support, custom-menu, featured-images, threaded-comments, dark-mode
*/

/* ==========================================================================
   1. Tokens (light) + night overrides
   ========================================================================== */
:root {
  --primary:      #1e22b4;
  --secondary:    #0051ff;
  --pink:         #eb4273;
  --danger:       #dc3545;
  --success:      #28a745;

  --body-bg:      #f1eeee;
  --surface:      #ffffff;
  --surface-2:    #f7f7f7;

  --text:         #000000;
  --text-2:       #333333;
  --muted:        #727272;
  --heading:      #232323;

  --border:       #e7e6f7;
  --border-soft:  #f6f3f3;

  --brand-bg:     #1e22b4;
  --brand-txt:    #ffffff;
  --nav-bg:       #f7f7f7;
  --nav-link:     #000000;
  --nav-link-active: var(--primary);

  --band-bg:      #1e22b4;   /* dark video band */
  --band-txt:     #ffffff;

  --footer-bg:    #1e22b4;
  --footer-bottom-bg: #f7f7f7;
  --newsletter-bg: #1e22b4;
  --weather-bg:   #f7f7f7;

  --input-bg:     #f6f9fc;
  --comment-even: #e7e7e7;
  --comment-odd:  #f6f9fc;

  --card-title:   #000000;

  --font-base:    "Almarai", "Cairo", sans-serif;
  --font-heading: "Cairo", "Almarai", sans-serif;

  --shadow-sm:    0 1px 3px rgba(0, 0, 0, .08);
  --shadow-md:    0 4px 14px rgba(0, 0, 0, .1);

  --maxw:         1320px;
  --radius-s:     4px;
  --radius-m:     8px;
  --radius-pill:  999px;

  --t-fast:       .18s ease;
  --t-normal:     .3s cubic-bezier(.4, 0, .2, 1);
}

:where(.night-mode) {
  --body-bg:      #0d1323;
  --surface:      #141c2f;
  --surface-2:    #141c2f;

  --text:         #f0f0f0;
  --text-2:       #a6b3d4;
  --muted:        #8391b2;
  --heading:      #f0f0f0;

  --border:       #293554;
  --border-soft:  #293554;

  --brand-bg:     #293554;
  --nav-bg:       #141c2f;
  --nav-link:     #f0f0f0;
  --nav-link-active: #ebb013;

  --band-bg:      #101725;
  --band-txt:     #f0f0f0;

  --footer-bg:    #101725;
  --footer-bottom-bg: #141c2f;
  --newsletter-bg: #141c2f;
  --weather-bg:   #141c2f;

  --input-bg:     #293554;
  --comment-even: #293554;
  --comment-odd:  #141c2f;

  --card-title:   #f0f0f0;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--body-bg);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--t-normal), color var(--t-normal);
}

a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary); }
.night-mode a:hover { color: var(--secondary); }

img { max-width: 100%; height: auto; display: block; }
input, textarea, select, button { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px; overflow: hidden;
}

/* Ad placeholders */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-s);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.ad-leaderboard { min-height: 180px; margin: 1.2rem auto; }
.ad-square { min-height: 430px; }

/* ==========================================================================
   3. Header — brand band + nav band
   ========================================================================== */
.brand-bar {
  background: var(--brand-bg);
  color: var(--brand-txt);
  transition: background-color var(--t-normal);
}
.brand-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .7rem;
  padding-bottom: .7rem;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--brand-txt);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.nabd-dot { color: var(--pink); }

.brand-actions { display: flex; align-items: center; gap: .7rem; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--brand-txt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { transform: scale(1.08); background: rgba(255, 255, 255, .12); }

.lang-btn {
  min-width: 34px;
  height: 26px;
  padding: 0 .5rem;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius-pill);
  color: var(--brand-txt);
  font-size: .72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lang-btn:hover, .lang-btn.is-active { background: var(--brand-txt); color: var(--brand-bg); }

.nav-bar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--t-normal);
}
.nav-bar .container { display: flex; align-items: center; gap: .6rem; }

.nav-social {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex-shrink: 0;
  padding-inline-end: .3rem;
  border-inline-end: 1px solid var(--border);
  margin-inline-end: .3rem;
}
.nav-social a {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nav-link);
  border-radius: 50%;
}
.nav-social a:hover { color: var(--primary); background: rgba(30, 34, 180, .08); }

.main-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav li a {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .95rem;
  padding: .75rem .8rem;
  color: var(--nav-link);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.main-nav li a:hover,
.main-nav li.current-menu-item > a,
.main-nav li.current_page_item > a {
  color: var(--nav-link-active);
  border-bottom-color: var(--nav-link-active);
}

.nav-search { margin-inline-start: auto; flex-shrink: 0; }
.nav-search form { display: flex; align-items: center; gap: .45rem; }
.nav-search input {
  border: 0; outline: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  width: 46px;
  height: 36px;
  padding: 0 1rem;
  font-size: .85rem;
  transition: width var(--t-normal), background var(--t-normal);
}
.nav-search input:focus { width: 200px; background: var(--input-bg); }
.night-mode .nav-search input { background: var(--surface-2); color: var(--text); }
.nav-search .search-ico {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.night-mode .nav-search .search-ico { background: var(--surface-2); }

.menu-toggle { display: none; }

/* Offcanvas drawer */
.drawer {
  position: fixed; top: 0; right: -320px;
  width: 300px; max-width: 84vw; height: 100dvh;
  background: var(--surface);
  z-index: 1200;
  box-shadow: var(--shadow-md);
  padding: 1.1rem;
  overflow-y: auto;
  transition: right var(--t-normal);
}
.drawer.open { right: 0; }
.drawer-title {
  font-family: var(--font-heading);
  font-weight: 800;
  padding-bottom: .8rem;
  margin-bottom: .8rem;
  border-bottom: 2px solid var(--border);
  color: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.night-mode .drawer-title { color: var(--secondary); }
.drawer-close { font-size: 1.6rem; line-height: 1; color: var(--muted); }
.drawer ul li a {
  display: block;
  padding: .6rem .4rem;
  font-weight: 700;
  font-size: .92rem;
  border-bottom: 1px solid var(--border-soft);
}
.drawer ul li a:hover { color: var(--primary); padding-inline-start: .7rem; }
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 8, 18, .55);
  opacity: 0; visibility: hidden;
  z-index: 1100;
  transition: opacity var(--t-normal), visibility var(--t-normal);
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

/* ==========================================================================
   4. Match ticker (tabs + scroll + arrows + live card)
   ========================================================================== */
.ticker-band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--t-normal);
}
.ticker-inner {
  display: flex;
  align-items: center;
  gap: .9rem;
}
.ticker-tabs {
  display: flex;
  gap: .3rem;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 3px;
  flex-shrink: 0;
}
.ticker-tabs button {
  padding: .32rem .85rem;
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
  border-radius: var(--radius-pill);
  transition: background var(--t-fast), color var(--t-fast);
}
.ticker-tabs button.is-active { background: var(--primary); color: #fff; }
.night-mode .ticker-tabs button.is-active { background: var(--secondary); }

.ticker-scroll-wrap { position: relative; flex: 1; min-width: 0; }
.ticker-clamp { overflow: hidden; }
.ticker-scroll {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.ticker-scroll::-webkit-scrollbar { display: none; }

.ticker-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .95rem;
  border-inline-end: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.ticker-club {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .6rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ticker-team { font-size: .82rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.ticker-when { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ticker-time {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: .85rem;
  color: var(--primary);
}
.night-mode .ticker-time { color: var(--secondary); }
.ticker-date { font-size: .64rem; color: var(--muted); }

.ticker-navs {
  display: flex;
  flex-shrink: 0;
}
.ticker-navs button {
  width: 30px; height: 30px;
  margin-inline-start: .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}
.ticker-navs button:hover { color: var(--primary); border-color: var(--primary); }

.ticker-live {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 1rem;
  border-inline: 1px solid var(--border);
  flex-shrink: 0;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--danger);
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  padding: .12rem .5rem;
  border-radius: var(--radius-pill);
}
.live-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: nabdPulse 1.2s infinite;
}
@keyframes nabdPulse { 50% { opacity: .25; } }
.ticker-live .ticker-score {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--primary);
}
.night-mode .ticker-live .ticker-score { color: var(--secondary); }

/* ==========================================================================
   5. Section titles + main layout
   ========================================================================== */
.section-head {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-bottom: 1.15rem;
}
.section-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary);
  white-space: nowrap;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -0.42rem;
  width: 3.2rem;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.night-mode .section-title { color: var(--secondary); }
.night-mode .section-title::after { background: var(--secondary); }
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-head-inverse .section-title { color: var(--band-txt); }
.section-head-inverse .section-title::after { background: var(--pink); }
.section-head-inverse::after { background: rgba(255, 255, 255, .18); }
.night-mode .section-head-inverse .section-title { color: var(--band-txt); }

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  margin-top: 1.4rem;
  margin-bottom: 3rem;
}
@media (max-width: 991px) {
  .main-layout { grid-template-columns: 1fr; }
}

.band-link {
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-pill);
  color: var(--band-txt);
  font-size: .78rem;
  font-weight: 800;
  padding: .3rem .9rem;
  white-space: nowrap;
}
.band-link:hover { background: rgba(255, 255, 255, .15); color: #fff; }

/* ==========================================================================
   6. Overlay cards (default grid / mini variant)
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}
@media (max-width: 991px)  { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)   { .cards-grid { grid-template-columns: 1fr; } }

.news-card { position: relative; }

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: #10142e;
  display: flex;
  flex-direction: column;
}
.card-media > img,
.card-media .card-media-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.card-media-fallback { background: linear-gradient(135deg, var(--primary), #10142e); }
.news-card:hover .card-media img { transform: scale(1.05); }

.card-scrim {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(0deg, #000, rgba(0, 0, 0, .3), transparent);
  pointer-events: none;
}

.card-caption {
  position: relative;
  margin-top: auto;
  padding: .7rem .8rem .75rem;
  display: flex;
  align-items: flex-end;
  gap: .55rem;
  color: #fff;
  z-index: 2;
}
.card-text { min-width: 0; }
.card-chip {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  padding: .1rem .5rem;
  border-radius: var(--radius-s);
  margin-bottom: .3rem;
}
.card-date {
  display: block;
  font-size: .72rem;
  color: rgba(255, 255, 255, .85);
  margin-bottom: .2rem;
}
.card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card:hover .card-title { color: var(--pink); }

/* play states: outline (default) / filled red (mini cards) */
.card-play {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, .25);
  transition: background var(--t-fast), transform var(--t-fast);
}
.news-card:hover .card-play {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}
.night-mode .news-card:hover .card-play { background: var(--secondary); border-color: var(--secondary); }

.cards-mini .card-media { aspect-ratio: 16 / 9; }
.cards-mini .card-title { font-size: .9rem; }
.cards-mini .card-play { background: var(--danger); border-color: var(--danger); width: 34px; height: 34px; }
.cards-mini .news-card:hover .card-play { background: var(--danger); border-color: var(--danger); }

/* videos band */
.video-band {
  background: var(--band-bg);
  color: var(--band-txt);
  padding: 2rem 0 2.4rem;
  margin: 2.2rem 0;
  transition: background-color var(--t-normal);
}
.video-band .cards-grid { gap: 1rem; }

/* "المزيد" pink pill */
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: 1.3rem;
  background: var(--pink);
  color: #fff;
  font-weight: 800;
  font-size: .88rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-s);
}
.more-btn:hover { background: #d63662; color: #fff; }

/* Pagination */
.pagination-row { margin-top: 2rem; display: flex; justify-content: center; }
.pagination-row .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  margin: 0 .2rem;
  padding: 0 .6rem;
  border-radius: var(--radius-s);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
}
.pagination-row .page-numbers.current,
.pagination-row .page-numbers:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.night-mode .pagination-row .page-numbers.current,
.night-mode .pagination-row .page-numbers:hover { background: var(--secondary); border-color: var(--secondary); }

/* ==========================================================================
   7. Lead block (big story + "آخر الأخبار" text panel)
   ========================================================================== */
.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.2rem;
  margin-top: 1.2rem;
}
@media (max-width: 991px) { .lead-grid { grid-template-columns: 1fr; } }

.lead-story .card-media { aspect-ratio: 16 / 8.6; }
.lead-story .card-title { font-size: 1.28rem; -webkit-line-clamp: 3; }

.lead-panel {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 1rem 1.1rem;
  transition: background-color var(--t-normal);
}
.lead-panel-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .45rem;
  padding-bottom: .55rem;
  margin-bottom: .7rem;
  border-bottom: 2px solid var(--border);
}
.night-mode .lead-panel-title { color: var(--secondary); }
.lead-panel-title .live-pill { margin-inline-start: auto; }
.lead-list li {
  display: flex;
  gap: .6rem;
  padding-bottom: .6rem;
  margin-bottom: .6rem;
  border-bottom: 1px dashed var(--border);
}
.lead-list li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.lead-time {
  color: var(--danger);
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  height: fit-content;
}
.lead-link { font-size: .86rem; font-weight: 700; line-height: 1.5; }
.lead-link:hover { color: var(--primary); }
.night-mode .lead-link:hover { color: var(--secondary); }

/* ==========================================================================
   8. Weather band
   ========================================================================== */
.weather-band {
  background: var(--weather-bg);
  border-block: 1px solid var(--border);
  padding: 1.3rem 0;
  margin: 2.2rem 0;
  transition: background-color var(--t-normal);
}
.weather-inner {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.w-head {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  white-space: nowrap;
}
.night-mode .w-head { color: var(--secondary); }

.w-now { display: flex; align-items: center; gap: .9rem; }
.w-temp {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--text);
}
.w-emoji { font-size: 2.1rem; }
.w-desc { font-size: .85rem; color: var(--muted); }

.w-days { display: flex; gap: .55rem; margin-inline-start: auto; overflow-x: auto; scrollbar-width: none; }
.w-days::-webkit-scrollbar { display: none; }
.w-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: .45rem .65rem;
  text-align: center;
  min-width: 72px;
  flex-shrink: 0;
  transition: background-color var(--t-normal);
}
.w-day .d-name { display: block; font-size: .7rem; font-weight: 800; color: var(--muted); }
.w-day .d-ico { display: block; font-size: 1rem; margin: .15rem 0; }
.w-day .d-vals { display: block; font-size: .74rem; font-weight: 800; color: var(--text); }
.w-day .d-vals .d-lo { color: var(--muted); font-weight: 600; }

.weather-select {
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--input-bg);
  color: var(--text);
}

/* ==========================================================================
   9. Row cards ("اخترنا لكم" mixed rows)
   ========================================================================== */
.rows-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .8rem 1.6rem;
}
@media (max-width: 640px) { .rows-list { grid-template-columns: 1fr; } }

.row-card a {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border-soft);
}
.row-text { min-width: 0; flex: 1; }
.row-cat {
  display: block;
  color: var(--danger);
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 800;
  margin-bottom: .2rem;
}
.row-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-card a:hover .row-title { color: var(--primary); }
.night-mode .row-card a:hover .row-title { color: var(--secondary); }

.row-thumb {
  width: 132px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-s);
  flex-shrink: 0;
  background: #10142e;
}

/* ==========================================================================
   10. Sidebar widgets
   ========================================================================== */
.sidebar-col { display: flex; flex-direction: column; gap: 1.4rem; }

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 1.05rem;
  transition: background-color var(--t-normal);
}
.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  padding-bottom: .55rem;
  margin-bottom: .95rem;
}
.widget-title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary);
}
.night-mode .widget-title { color: var(--secondary); }

.flash-list li {
  display: flex;
  gap: .65rem;
  padding-bottom: .65rem;
  margin-bottom: .65rem;
  border-bottom: 1px solid var(--border-soft);
}
.flash-list li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.flash-time {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 800;
  height: fit-content;
  white-space: nowrap;
}
.night-mode .flash-time { color: var(--secondary); }
.flash-link { font-size: .88rem; font-weight: 700; line-height: 1.55; }

.rank-list li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding-bottom: .6rem;
  margin-bottom: .6rem;
  border-bottom: 1px solid var(--border-soft);
}
.rank-list li:last-child { border-bottom: 0; }
.rank-num {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--pink);
  line-height: 1.1;
  min-width: 1.4rem;
  text-align: center;
}
.rank-link { font-size: .88rem; font-weight: 700; }
.rank-thumb { width: 72px; height: 52px; border-radius: var(--radius-s); object-fit: cover; flex-shrink: 0; }

.tag-cloud-wrap { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag-cloud-wrap a,
.tags-line a {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: .22rem .7rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-2);
}
.tag-cloud-wrap a:hover,
.tags-line a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.night-mode .tag-cloud-wrap a:hover,
.night-mode .tags-line a:hover { background: var(--secondary); border-color: var(--secondary); }

/* ==========================================================================
   11. Single article
   ========================================================================== */
.article-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 1.6rem;
  transition: background-color var(--t-normal);
}
.article-breadcrumb { font-size: .8rem; margin-bottom: .55rem; color: var(--muted); }
.article-breadcrumb a { color: var(--primary); font-weight: 700; }
.night-mode .article-breadcrumb a { color: var(--secondary); }

.article-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.45;
  margin-bottom: .65rem;
  color: var(--heading);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  color: var(--muted);
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.article-cat-badge {
  color: var(--primary);
  font-weight: 800;
}
.night-mode .article-cat-badge { color: var(--secondary); }
.article-featured img { border-radius: var(--radius-s); margin-bottom: 1.2rem; width: 100%; }

.article-prose { font-size: 1.04rem; line-height: 1.9; color: var(--text); }
.article-prose p { margin-bottom: 1.1rem; }
.article-prose h2, .article-prose h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--heading);
  margin: 1.4rem 0 .7rem;
}
.article-prose blockquote {
  border-inline-start: 4px solid var(--primary);
  background: var(--surface-2);
  padding: .8rem 1.1rem;
  margin: 1.2rem 0;
  border-radius: var(--radius-s);
}
.night-mode .article-prose blockquote { border-inline-start-color: var(--secondary); }
.article-prose img { border-radius: var(--radius-s); }

/* Floating share rail */
.share-rail {
  display: flex;
  gap: .45rem;
  margin: 1.2rem 0 0;
  flex-wrap: wrap;
}
@media (min-width: 1200px) {
  .share-rail {
    position: sticky;
    top: 90px;
    float: left;
    flex-direction: column;
    margin: 0 0 0 -4.2rem;
    z-index: 5;
  }
}
.share-rail a {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.share-wa { background: #25d366; }
.share-tg { background: #24a1de; }
.share-x  { background: #1a1a1a; }
.share-fb { background: #1877f2; }
.share-in { background: #0a66c2; }

/* Subscribe CTAs */
.channel-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  margin: 1.4rem 0;
}
@media (max-width: 560px) { .channel-cta { grid-template-columns: 1fr; } }
.channel-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: .9rem;
  color: #fff;
}
.channel-wa { background: #25d366; }
.channel-wa:hover { background: #1fb955; color: #fff; }
.channel-tg { background: #24a1de; }
.channel-tg:hover { background: #1e8dbe; color: #fff; }

.tags-line {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  border-top: 1px solid var(--border);
  margin-top: 1.4rem;
  padding-top: 1.1rem;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  margin-top: 1.4rem;
}
.post-nav a {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: .7rem .9rem;
  font-size: .86rem;
  font-weight: 700;
  color: var(--text);
}
.post-nav a:hover { border-color: var(--primary); }
.post-nav-next { text-align: left; }

/* Related */
.related-block { margin-top: 2.2rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 991px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .related-grid { grid-template-columns: 1fr; } }
.related-grid .card-title { font-size: .88rem; }
.related-grid .card-media { aspect-ratio: 16 / 9; }

/* Static page */
.page-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 1.6rem;
}

/* ==========================================================================
   12. Comments — numbered cards, votes, quote, sort
   ========================================================================== */
.comments-block { margin-top: 2.4rem; border-top: 2px solid var(--border); padding-top: 1.4rem; }
.comments-block > h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: .9rem;
}
.comment-note {
  font-size: .74rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.comment-sort {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  margin-bottom: 1.1rem;
  font-size: .8rem;
  color: var(--muted);
}
.comment-sort select {
  padding: .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--input-bg);
  color: var(--text);
}

.comment-form-box { margin-bottom: 2rem; }
.comment-form-box .logged-in-as,
.comment-form-box .comment-notes { font-size: .82rem; color: var(--muted); margin-bottom: .8rem; }
.comment-form-box > p { margin-bottom: .9rem; }
.comment-form-box label { font-size: .85rem; font-weight: 700; }
.comment-form-box input:not([type="submit"]):not([type="checkbox"]),
.comment-form-box textarea {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--input-bg);
  color: var(--text);
}
.comment-form-box input:focus,
.comment-form-box textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.night-mode .comment-form-box input:focus,
.night-mode .comment-form-box textarea:focus { outline-color: var(--secondary); }
.comment-form-box .submit {
  background: var(--pink);
  color: #fff;
  font-weight: 800;
  padding: .55rem 1.5rem;
  border-radius: var(--radius-s);
  cursor: pointer;
}
.comment-form-box .submit:hover { background: #d63662; }

.comments-list { counter-reset: cc; }
.comments-list > li { counter-increment: cc; }
.comments-list .children { counter-reset: cc-child; }

.comments-list > li:nth-child(even) > .comment-body-box,
.comments-list .children > li:nth-child(odd) .comment-body-box {
  background: var(--comment-even);
}
.comments-list > li:nth-child(odd) > .comment-body-box,
.comments-list .children > li:nth-child(even) .comment-body-box {
  background: var(--comment-odd);
}
.comment-body-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: .95rem 1.05rem;
  margin-bottom: .85rem;
}
.comment-owner { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.comment-owner::before {
  content: counter(cc, decimal);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: .95rem;
  color: var(--primary);
  min-width: 1.3rem;
}
.night-mode .comment-owner::before { color: var(--secondary); }
.comment-owner .avatar { border-radius: 50%; }
.comment-owner b { font-size: .9rem; color: var(--primary); }
.night-mode .comment-owner b { color: var(--secondary); }
.comment-owner .cdate { font-size: .73rem; color: var(--muted); }
.comment-entry { font-size: .92rem; line-height: 1.7; }
.comment-entry p { margin-bottom: .4rem; }

.comment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: .65rem;
  padding-top: .55rem;
  border-top: 1px dashed rgba(0, 0, 0, .12);
}
.night-mode .comment-foot { border-top-color: rgba(255, 255, 255, .14); }
.comment-votes { display: flex; align-items: center; gap: .35rem; }
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .82rem;
  font-weight: 800;
  color: var(--primary);
  padding: .15rem .5rem;
  border-radius: var(--radius-s);
}
.night-mode .vote-btn { color: var(--secondary); }
.vote-btn:hover { background: rgba(30, 34, 180, .1); }
.night-mode .vote-btn:hover { background: rgba(255, 176, 19, .15); }
.vote-btn.is-voted { opacity: .45; pointer-events: none; }
.vote-btn.vote-down { color: var(--muted); }

.comment-actions { display: flex; align-items: center; gap: .9rem; }
.comment-actions a,
.quote-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
}
.comment-actions a:hover,
.quote-btn:hover { color: var(--primary); }
.night-mode .comment-actions a:hover,
.night-mode .quote-btn:hover { color: var(--secondary); }
.children { margin-inline-start: 1.4rem; border-inline-start: 2px solid var(--border); padding-inline-start: 1rem; }

/* ==========================================================================
   13. Newsletter bar + footer
   ========================================================================== */
.newsletter-bar { background: var(--newsletter-bg); color: #fff; transition: background-color var(--t-normal); }
.newsletter-bar .container {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  flex-wrap: wrap;
}
.nl-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}
.newsletter-bar form {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  min-width: 260px;
}
.newsletter-bar input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0; outline: 0;
  border-radius: var(--radius-pill);
  padding: 0 1.2rem;
  background: #fff;
  color: #111;
  direction: ltr;
  text-align: right;
}
.newsletter-bar button {
  height: 42px;
  padding: 0 1.6rem;
  border-radius: var(--radius-pill);
  background: var(--pink);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}
.newsletter-bar button:hover { background: #d63662; }
.nl-msg { font-size: .8rem; opacity: .9; width: 100%; }

.site-footer {
  background: var(--footer-bg);
  color: #fff;
  margin-top: auto;
  transition: background-color var(--t-normal);
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 2rem;
  padding-top: 2.6rem;
  padding-bottom: 2.2rem;
}
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr; }
}
.footer-col h3.col-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: .85rem;
}
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { font-size: .86rem; color: rgba(255, 255, 255, .78); }
.footer-col ul li a:hover { color: #fff; }

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .95rem;
}
.f-logo {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.footer-social { display: flex; gap: .55rem; }
.footer-social a {
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background var(--t-fast);
}
.footer-social a:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* App badges */
.app-badges { display: flex; gap: .55rem; flex-wrap: wrap; }
.app-badges a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-s);
  padding: .35rem .7rem;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
}
.app-badges a:hover { background: rgba(255, 255, 255, .14); }
.app-badges svg { flex-shrink: 0; }

.footer-bottom-band {
  background: var(--footer-bottom-bg);
  color: var(--text);
  padding: .95rem 1rem;
  font-size: .8rem;
  transition: background-color var(--t-normal), color var(--t-normal);
}
.footer-bottom-band .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-quick { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.footer-quick a { color: var(--muted); font-weight: 700; }
.footer-quick a:hover { color: var(--primary); }

/* Back to top */
.back-top {
  position: fixed;
  inset-inline-end: 1.2rem;
  bottom: 1.2rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 800;
}
.night-mode .back-top { background: var(--secondary); }
.back-top.show { display: flex; }

/* Empty states */
.empty-box {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-s);
  padding: 2.4rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

/* ==========================================================================
   14. Responsive
   ========================================================================== */
@media (max-width: 991px) {
  .menu-toggle {
    display: inline-flex;
    color: var(--nav-link);
    width: 36px; height: 36px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .main-nav { display: none; }
  .nav-social { display: none; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .date-today { display: none; }
  .article-wrap, .page-wrap { padding: 1.15rem; }
  .post-nav { grid-template-columns: 1fr; }
  .ticker-tabs button { padding: .3rem .55rem; }
  .w-days { margin-inline-start: 0; width: 100%; }
  .ticker-navs { display: none; }
}
