/*
Theme Name: Kuwait Pulse
Theme URI: https://kw.q8google.com
Description: Bilingual Arabic/English dark media hub for Kuwait Pulse — بوابة الكويت. Five content categories, RTL/LTR switching, breaking news ticker, card-based layout.
Version: 1.0.0
Author: Atlas Digital KW
Author URI: https://atlasdigitalkw.com
Text Domain: kuwait-pulse
Tags: rtl-language, news, bilingual, dark, arabic
*/

/* ============================================
   IMPORTS & CSS VARIABLES
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Core palette */
  --bg-base:        #0D0F14;
  --bg-card:        #0A1628;
  --bg-card-hover:  #0f1e38;
  --bg-nav:         #080A10;
  --bg-ticker:      #0A0C12;
  --accent-gold:    #F5A623;
  --accent-gold-dim:#b87a18;
  --accent-red:     #E53E3E;
  --accent-blue:    #3B82F6;
  --text-primary:   #FFFFFF;
  --text-secondary: #C8D3E8;
  --text-muted:     #8B9BB4;
  --text-faint:     #4A5568;
  --border:         rgba(255,255,255,0.07);
  --border-strong:  rgba(255,255,255,0.14);
  --gold-glow:      rgba(245,166,35,0.15);

  /* Category colors */
  --cat-news:       #E53E3E;
  --cat-business:   #38A169;
  --cat-tech:       #3B82F6;
  --cat-lifestyle:  #9F7AEA;
  --cat-cars:       #F5A623;

  /* Typography */
  --font-ar:        'Noto Naskh Arabic', 'Arabic Typesetting', serif;
  --font-en:        'Inter', system-ui, sans-serif;
  --font-body:      var(--font-en);

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --gap:        20px;
  --container:  1280px;
}

/* RTL language override */
[lang="ar"], .rtl {
  --font-body: var(--font-ar);
  direction: rtl;
  text-align: right;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.lang-ar {
  font-family: var(--font-ar);
  direction: rtl;
}

body.lang-en {
  font-family: var(--font-en);
  direction: ltr;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ============================================
   BREAKING NEWS TICKER
   ============================================ */
.ticker-bar {
  background: var(--bg-ticker);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  height: 40px;
  overflow: hidden;
  position: relative;
  z-index: 100;
}

.ticker-label {
  background: var(--accent-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 2;
}

.ticker-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.ticker-track-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-track-wrap::before,
.ticker-track-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40px;
  z-index: 1;
  pointer-events: none;
}
.ticker-track-wrap::before { left: 0; background: linear-gradient(to right, var(--bg-ticker), transparent); }
.ticker-track-wrap::after  { right: 0; background: linear-gradient(to left, var(--bg-ticker), transparent); }

.ticker-track {
  display: flex;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 28px;
  font-size: 13px;
  color: var(--text-secondary);
  gap: 12px;
}

.ticker-item::after {
  content: '●';
  color: var(--accent-gold);
  font-size: 8px;
  opacity: 0.6;
}

.ticker-item a:hover { color: var(--accent-gold); }

/* ============================================
   NAVIGATION
   ============================================ */
.site-nav {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 32px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--accent-gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #000;
  font-family: var(--font-en);
  letter-spacing: -1px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-en {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-en);
  letter-spacing: -0.02em;
}

.logo-ar {
  font-size: 12px;
  color: var(--accent-gold);
  font-family: var(--font-ar);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active { color: #fff; background: var(--border); }

.nav-link .cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-en);
}

.lang-btn.active {
  background: var(--accent-gold);
  color: #000;
}

.lang-btn:hover:not(.active) { color: #fff; }

/* Search button */
.nav-search-btn {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
}
.nav-search-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-hamburger span {
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.2s;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 24px 0;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--gap);
}

.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  max-height: 460px;
  background: var(--bg-card);
}

.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-main:hover img { transform: scale(1.03); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 28px;
}

.hero-category-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: #fff;
}

body.lang-ar .hero-title { font-family: var(--font-ar); font-size: 28px; }

.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.hero-meta-dot { color: var(--accent-gold); }

/* Hero sidebar — latest list */
.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.sidebar-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}

.sidebar-item:hover .sidebar-item-title { color: var(--accent-gold); }

.sidebar-item-img {
  width: 72px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}

.sidebar-item-body { flex: 1; }

.sidebar-item-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sidebar-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-secondary);
  transition: color 0.2s;
}

body.lang-ar .sidebar-item-title { font-family: var(--font-ar); }

.sidebar-item-time {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 5px;
}

/* ============================================
   CATEGORY SECTION — reusable
   ============================================ */
.category-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 24px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-accent-bar {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}

.section-title-en {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-en);
  letter-spacing: -0.02em;
}

.section-title-ar {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-ar);
  margin-top: 1px;
}

.section-view-all {
  font-size: 13px;
  color: var(--accent-gold);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.2s;
}
.section-view-all:hover { gap: 9px; }

/* Card grid — 4 columns default */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* Featured + grid layout (first card large) */
.card-grid.featured-first .article-card:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.card-grid.featured-first .article-card:first-child .card-image {
  aspect-ratio: 4/3;
}

.card-grid.featured-first .article-card:first-child .card-title {
  font-size: 20px;
}

/* ============================================
   ARTICLE CARD
   ============================================ */
.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4), 0 0 0 1px rgba(245,166,35,0.08);
  background: var(--bg-card-hover);
}

.card-image-wrap {
  position: relative;
  overflow: hidden;
}

.card-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform 0.4s ease;
  background: var(--bg-base);
}

.article-card:hover .card-image { transform: scale(1.04); }

.card-cat-badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-source {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.lang-ar .card-title { font-family: var(--font-ar); font-size: 16px; }

.article-card:hover .card-title { color: var(--accent-gold); }

.card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.lang-ar .card-excerpt { font-family: var(--font-ar); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-time {
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-read-more {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.article-card:hover .card-read-more { opacity: 1; }

/* Category color system */
.cat-news      { background: var(--cat-news);      color: #fff; }
.cat-business  { background: var(--cat-business);  color: #fff; }
.cat-tech      { background: var(--cat-tech);       color: #fff; }
.cat-lifestyle { background: var(--cat-lifestyle);  color: #fff; }
.cat-cars      { background: var(--cat-cars);       color: #000; }

.dot-news      { background: var(--cat-news); }
.dot-business  { background: var(--cat-business); }
.dot-tech      { background: var(--cat-tech); }
.dot-lifestyle { background: var(--cat-lifestyle); }
.dot-cars      { background: var(--cat-cars); }

.bar-news      { background: var(--cat-news); }
.bar-business  { background: var(--cat-business); }
.bar-tech      { background: var(--cat-tech); }
.bar-lifestyle { background: var(--cat-lifestyle); }
.bar-cars      { background: var(--cat-cars); }

.text-news      { color: var(--cat-news); }
.text-business  { color: var(--cat-business); }
.text-tech      { color: var(--cat-tech); }
.text-lifestyle { color: var(--cat-lifestyle); }
.text-cars      { color: var(--cat-cars); }

/* ============================================
   AD ZONE PLACEHOLDER
   ============================================ */
.ad-zone {
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin: 32px 24px;
  max-width: var(--container);
  margin-inline: auto;
  margin-top: 32px;
}

.ad-zone-leaderboard { min-height: 90px; }
.ad-zone-rectangle   { min-height: 250px; max-width: 300px; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  background: var(--bg-nav);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 24px 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: 280px 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.7;
}

body.lang-ar .footer-brand p { font-family: var(--font-ar); }

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-links { display: flex; flex-direction: column; gap: 8px; }

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent-gold); }

body.lang-ar .footer-links a { font-family: var(--font-ar); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-faint);
}

.footer-bottom a { color: var(--accent-gold); }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(8px);
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.search-box {
  width: 100%;
  max-width: 620px;
  padding: 0 24px;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 18px;
  padding: 16px 20px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--accent-gold); }
.search-input::placeholder { color: var(--text-faint); }

.search-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

/* ============================================
   SINGLE POST PAGE
   ============================================ */
.post-hero {
  max-width: var(--container);
  margin: 32px auto 0;
  padding: 0 24px;
}

.post-hero-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.post-content-wrap {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 24px;
}

.post-header { margin-bottom: 28px; }

.post-category-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
  color: #fff;
}

body.lang-ar .post-title { font-family: var(--font-ar); font-size: 36px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.post-source-link {
  color: var(--accent-gold);
  font-weight: 500;
}

.post-content {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
}

body.lang-ar .post-content { font-family: var(--font-ar); font-size: 18px; }

.post-content p { margin-bottom: 1.4em; }
.post-content h2 { font-size: 24px; color: #fff; margin: 2em 0 0.8em; }
.post-content h3 { font-size: 20px; color: #fff; margin: 1.6em 0 0.6em; }
.post-content a { color: var(--accent-gold); }
.post-content blockquote {
  border-inline-start: 3px solid var(--accent-gold);
  padding-inline-start: 20px;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.source-attribution {
  margin-top: 32px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent-gold);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
}

.source-attribution a { color: var(--accent-gold); font-weight: 600; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid.featured-first .article-card:first-child { grid-column: span 3; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-sidebar { display: none; }
  .hero-main { max-height: 380px; }
  .nav-menu { display: none; }
  .nav-hamburger { display: flex; }
  .card-grid, .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .card-grid.featured-first .article-card:first-child { grid-column: span 2; }
}

@media (max-width: 600px) {
  .card-grid, .card-grid.featured-first { grid-template-columns: 1fr; }
  .card-grid.featured-first .article-card:first-child { grid-column: span 1; }
  .hero-title { font-size: 20px; }
  .post-title { font-size: 26px; }
  .section-title-en { font-size: 18px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  .ticker-pulse,
  .article-card,
  .card-image { animation: none; transition: none; }
}
