/* ============================================================
   ROBO//NEWS — Engineer / Terminal Theme
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg:        #0a0e0a;
  --bg-panel:  #0d1117;
  --bg-card:   #111820;
  --bg-hover:  #162030;
  --border:    #1e3a2e;
  --border-hi: #00ff41;
  --green:     #00ff41;
  --green-dim: #00c832;
  --green-dk:  #007a20;
  --cyan:      #00d4ff;
  --cyan-dim:  #0099bb;
  --blue:      #4488ff;
  --yellow:    #ffe066;
  --red:       #ff4444;
  --text:      #c8ffc8;
  --text-dim:  #6aaa6a;
  --text-muted:#3a663a;
  --font-mono: 'JetBrains Mono', 'Share Tech Mono', 'Courier New', monospace;
  --radius:    2px;
  --transition: 0.15s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Scanlines ---------- */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,255,65,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  flex-wrap: wrap;
  position: relative;
}

/* Logo */
.logo-block {
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.logo-prompt { color: var(--green); font-size: 1.1rem; font-weight: 700; }
.logo-text {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.logo-sep { color: var(--cyan); }
.logo-cursor {
  color: var(--green);
  animation: blink 1s step-end infinite;
  font-size: 1.1rem;
}

/* Nav */
.nav-bar {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  transition: all var(--transition);
}
.nav-link::before { content: attr(data-cmd) " "; color: var(--text-muted); font-size: 0.7rem; }
.nav-link:hover, .nav-link.active {
  color: var(--green);
  border-color: var(--border-hi);
  background: rgba(0,255,65,0.04);
}

/* Header meta */
.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.header-date { color: var(--text-dim); font-size: 0.72rem; letter-spacing: 0.06em; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--green);
  transition: all var(--transition);
}

/* Command bar */
.cmd-bar {
  padding: 4px 24px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(0,255,65,0.06);
  display: flex;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}
.cmd-prefix { color: var(--green-dim); }
.cmd-text { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
.cmd-blink { color: var(--green); animation: blink 0.8s step-end infinite; }

/* ---------- Layout ---------- */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ---------- Date selector ---------- */
.date-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ds-label { color: var(--text-muted); font-size: 0.72rem; }
.date-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.date-tab {
  padding: 4px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  letter-spacing: 0.04em;
}
.date-tab:hover { border-color: var(--green-dim); color: var(--text); }
.date-tab.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0,255,65,0.06);
  box-shadow: 0 0 8px rgba(0,255,65,0.12);
}

/* ---------- Section headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-tag {
  color: var(--cyan);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}
.section-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: var(--radius);
  letter-spacing: 0.12em;
  animation: glow-red 2s infinite;
}
.feed-count { color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }

/* ---------- Featured Card ---------- */
.featured-section { margin-bottom: 40px; }

.featured-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 320px;
}

.featured-card:hover {
  border-color: var(--green);
  box-shadow: 0 0 30px rgba(0,255,65,0.08), inset 0 0 60px rgba(0,255,65,0.02);
}

.featured-img-wrap {
  position: relative;
  overflow: hidden;
}
.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.6) brightness(0.75);
  transition: filter var(--transition);
}
.featured-card:hover .featured-img-wrap img {
  filter: saturate(0.8) brightness(0.85);
}
.featured-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, var(--bg-card));
}

.featured-content {
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.featured-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.featured-label {
  font-size: 0.65rem;
  color: var(--cyan);
  letter-spacing: 0.14em;
  border: 1px solid var(--cyan-dim);
  padding: 2px 8px;
  border-radius: var(--radius);
}
.featured-source {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.featured-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Video badge on featured eyebrow */
.featured-video-badge {
  font-size: 0.62rem;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  padding: 2px 7px;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
  animation: glow-yellow 2s infinite;
}

/* Play button overlay on featured image */
.featured-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0,0,0,0.35);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  z-index: 2;
}
.featured-play-btn:hover { background: rgba(0,0,0,0.55); }
.play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  font-size: 1.6rem;
  background: rgba(0,0,0,0.5);
  box-shadow: 0 0 24px rgba(255,224,102,0.35);
  transition: all var(--transition);
}
.featured-play-btn:hover .play-icon {
  background: rgba(255,224,102,0.15);
  box-shadow: 0 0 40px rgba(255,224,102,0.55);
  transform: scale(1.08);
}
.play-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--yellow);
  letter-spacing: 0.14em;
}

.featured-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.featured-card:hover .featured-title { color: var(--green); }

.featured-summary {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.featured-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 0.62rem;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  transition: all var(--transition);
}
.tag:hover { border-color: var(--green-dk); color: var(--green-dim); }

.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.featured-cta::after { content: '>>'; animation: slide-x 1.2s infinite; }

/* ---------- News List ---------- */
.feed-section { margin-bottom: 32px; }

.news-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.news-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.news-item:hover { background: var(--bg-hover); }
.news-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--green);
  opacity: 0;
  transition: opacity var(--transition);
}
.news-item:hover::before { opacity: 1; }

.news-item-idx {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.62rem;
  color: var(--text-muted);
  z-index: 1;
  pointer-events: none;
}

.news-img-wrap {
  position: relative;
  overflow: hidden;
}
.news-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.5) brightness(0.7);
  transition: filter var(--transition);
  min-height: 90px;
}
.news-item:hover .news-img-wrap img {
  filter: saturate(0.7) brightness(0.85);
}

/* Video badge on list thumbnail */
.news-video-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.75);
  color: var(--yellow);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,224,102,0.5);
  pointer-events: none;
}

/* Video tag in news meta row */
.news-video-tag {
  font-size: 0.6rem;
  color: var(--yellow);
  border: 1px solid rgba(255,224,102,0.5);
  padding: 1px 5px;
  border-radius: var(--radius);
  letter-spacing: 0.08em;
}

.news-content {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.news-source {
  font-size: 0.65rem;
  color: var(--cyan-dim);
  letter-spacing: 0.06em;
}
.news-time {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.news-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  transition: color var(--transition);
}
.news-item:hover .news-title { color: var(--green); }

.news-summary {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-footer {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 0 8px;
}
.page-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 7px 18px;
  cursor: pointer;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 10px rgba(0,255,65,0.15);
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-prefix, .btn-suffix { color: var(--green); }
.page-info { display: flex; align-items: center; gap: 4px; }
.page-current { color: var(--green); font-size: 1rem; font-weight: 700; }
.page-sep { color: var(--text-muted); }
.page-total { color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overflow-y: auto;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-panel {
  width: 100%;
  max-width: 800px;
  background: var(--bg-panel);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(0,255,65,0.12);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.2s ease;
  margin: auto;
}
.modal-overlay.open .modal-panel { transform: translateY(0); }

.modal-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.modal-controls {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 0;
}
.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 12px;
  cursor: pointer;
  border-radius: var(--radius);
  letter-spacing: 0.08em;
  transition: all var(--transition);
}
.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
}
.modal-cmd-bar {
  padding: 6px 16px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}
.modal-cmd-bar .cmd-prefix { color: var(--green-dim); }

.modal-body { padding: 28px; }

.article-img-wrap {
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  position: relative;
}
.article-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.65) brightness(0.8);
}
.article-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg-panel), transparent);
}

.article-eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.article-label {
  font-size: 0.65rem;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 2px 8px;
  border-radius: var(--radius);
  letter-spacing: 0.12em;
}
.article-video-label {
  font-size: 0.62rem;
  color: var(--yellow);
  border: 1px solid rgba(255,224,102,0.5);
  padding: 2px 7px;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
}
.article-source { font-size: 0.72rem; color: var(--text-muted); }
.article-time { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }

.article-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.article-body {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.8;
  margin-bottom: 20px;
  border-left: 2px solid var(--green-dk);
  padding-left: 16px;
}

.article-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }

.article-actions {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  flex-wrap: wrap;
}
.btn-primary {
  background: rgba(0,255,65,0.08);
  border: 1px solid var(--green-dk);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover {
  background: rgba(0,255,65,0.14);
  box-shadow: 0 0 16px rgba(0,255,65,0.2);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
  transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--text-dim); color: var(--text); }

/* ---------- Video Player ---------- */

/* Generic wrapper used for both inline and modal players */
.video-player-wrap {
  width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

/* Force 16:9 aspect ratio */
.video-aspect {
  aspect-ratio: 16 / 9;
}

.video-player-wrap .inline-video,
.video-player-wrap .inline-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Modal video sits above the article text with bottom margin */
.modal-video {
  margin-bottom: 24px;
  border-color: var(--yellow);
  box-shadow: 0 0 20px rgba(255,224,102,0.1);
}

/* Error state inside player */
.video-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--red);
  font-size: 0.78rem;
  padding: 16px;
}

/* Inline player replacing featured image — full height of the grid cell */
.featured-img-wrap .video-player-wrap {
  height: 100%;
  border-radius: 0;
  border: none;
}

@keyframes glow-yellow {
  0%, 100% { box-shadow: 0 0 4px rgba(255,224,102,0.3); }
  50%        { box-shadow: 0 0 10px rgba(255,224,102,0.6); }
}

/* ---------- Skeleton ---------- */
.featured-skeleton {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  grid-column: 1 / -1;
}
.sk-line {
  height: 16px;
  background: linear-gradient(90deg, var(--bg-hover) 25%, rgba(0,255,65,0.04) 50%, var(--bg-hover) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
.sk-title { height: 28px; width: 75%; }
.sk-body { width: 100%; }
.sk-short { width: 55%; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  background: var(--bg-panel);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-txt { font-size: 0.68rem; color: var(--text-muted); }
.footer-status { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; color: var(--green-dim); }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }

/* ---------- Animations ---------- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%        { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50%        { opacity: 0.6; box-shadow: 0 0 12px var(--green); }
}
@keyframes glow-red {
  0%, 100% { box-shadow: 0 0 4px rgba(255,68,68,0.4); }
  50%        { box-shadow: 0 0 10px rgba(255,68,68,0.7); }
}
@keyframes slide-x {
  0%, 100% { transform: translateX(0); }
  50%        { transform: translateX(4px); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease both; }

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .featured-img-wrap {
    height: 220px;
  }
  .featured-img-overlay {
    background: linear-gradient(to bottom, transparent 50%, var(--bg-card));
  }
}

.modal-drag-bar {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--border-hi);
  border-radius: 2px;
  margin: 10px auto 0;
  opacity: 0.4;
}

@media (max-width: 640px) {
  .modal-drag-bar { display: block; }
}

/* ── Tablet ── */
@media (max-width: 640px) {

  /* Header */
  .header-inner { padding: 10px 16px; flex-wrap: nowrap; }
  .nav-bar {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 4px);
    right: 12px;
    width: 200px;
    background: var(--bg-panel);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    padding: 6px;
    z-index: 300;
    transform: translateY(-10px) scale(0.95);
    transform-origin: top right;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), opacity 0.15s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,255,65,0.08);
  }
  .nav-bar.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
  }
  .nav-link { font-size: 0.85rem; padding: 10px 16px; border-radius: 4px; }
  .nav-link::before { display: none; }
  .menu-toggle { display: flex; }
  .header-meta { gap: 8px; }
  .cmd-bar { display: none; }

  /* Date selector — horizontal scroll on mobile */
  .date-selector-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; gap: 8px; }
  .date-selector-bar::-webkit-scrollbar { display: none; }
  .date-tabs { flex-wrap: nowrap; }
  .date-tab { white-space: nowrap; padding: 6px 14px; font-size: 0.78rem; flex-shrink: 0; min-height: 36px; }

  /* Layout */
  .main-content { padding: 14px 12px 60px; }

  /* Featured */
  .featured-img-wrap { height: 200px; }
  .featured-content { padding: 16px 14px 18px; gap: 10px; }
  .featured-title { font-size: 1rem; line-height: 1.4; }
  .featured-summary { font-size: 0.78rem; }
  .featured-cta { font-size: 0.72rem; }
  .play-icon { width: 52px; height: 52px; font-size: 1.3rem; }
  .play-label { font-size: 0.65rem; }

  /* News list */
  .news-item { grid-template-columns: 96px 1fr; }
  .news-img-wrap { min-height: 80px; }
  .news-content { padding: 10px 12px; gap: 4px; }
  .news-title { font-size: 0.82rem; line-height: 1.4; }
  .news-summary { font-size: 0.72rem; -webkit-line-clamp: 2; }
  .news-meta { gap: 6px; }
  .news-footer { display: none; }  /* hide tags in list on mobile */

  /* Pagination */
  .pagination { gap: 12px; padding: 20px 0 6px; }
  .page-btn { padding: 8px 14px; font-size: 0.72rem; min-height: 40px; }
  .page-current { font-size: 0.9rem; }

  /* Modal — slide up from bottom */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-panel {
    margin: 0;
    border-radius: 12px 12px 0 0;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-header { position: sticky; top: 0; z-index: 10; }
  .modal-body { padding: 16px 14px 32px; }
  .article-img-wrap { height: 200px; }
  .article-title { font-size: 1.05rem; }
  .article-body { font-size: 0.82rem; padding-left: 12px; }
  .article-actions { gap: 10px; }
  .btn-primary, .btn-secondary { padding: 10px 16px; font-size: 0.75rem; min-height: 42px; flex: 1; justify-content: center; }
  .video-player-wrap.modal-video { margin-bottom: 16px; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-txt { font-size: 0.65rem; }
}

/* ── Very small (iPhone SE etc.) ── */
@media (max-width: 380px) {
  .logo-text { font-size: 1rem; }
  .logo-cursor { display: none; }
  .news-item { grid-template-columns: 80px 1fr; }
  .featured-title { font-size: 0.95rem; }
  .date-tab { padding: 5px 10px; font-size: 0.72rem; }
}


/* ============================================================
   Language Switcher
   ============================================================ */

.lang-switcher {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 3px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: border-color var(--transition), color var(--transition);
  max-width: 88px;
  direction: ltr;
  unicode-bidi: isolate;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%2366ff66' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  padding-right: 18px;
}
.lang-switcher:hover,
.lang-switcher:focus {
  border-color: var(--green-dim);
  color: var(--text-main);
  outline: none;
}
.lang-switcher option {
  background: var(--bg-panel);
  color: var(--text-main);
  direction: ltr;
}

@media (max-width: 640px) {
  .lang-switcher { font-size: 0.7rem; max-width: 100%; }
}

/* ============================================================
   RTL Support — ar-SA, ar-EG and future RTL locales
   Applied via body.rtl (set by I18n.setLocale)
   ============================================================ */

body.rtl {
  direction: rtl;
  text-align: right;
}

body.rtl .header-inner      { flex-direction: row-reverse; }
body.rtl .header-meta       { margin-left: 0; margin-right: auto; }
body.rtl .nav-bar           { flex-direction: row-reverse; }
body.rtl .cmd-bar           { flex-direction: row-reverse; }

body.rtl .date-selector-bar { flex-direction: row-reverse; }
body.rtl .date-tabs         { flex-direction: row-reverse; }

body.rtl .section-header    { flex-direction: row-reverse; }
body.rtl .section-line {
  background: linear-gradient(to left, var(--border), transparent);
}

/* Featured card */
body.rtl .featured-card         { direction: rtl; }
body.rtl .featured-img-overlay {
  background: linear-gradient(to left, transparent 60%, var(--bg-card));
}
body.rtl .featured-content      { text-align: right; }
body.rtl .featured-eyebrow      { flex-direction: row-reverse; }
body.rtl .featured-time         { margin-left: 0; margin-right: auto; }
body.rtl .featured-tags         { flex-direction: row-reverse; }

/* News list */
body.rtl .news-item             { direction: rtl; }
body.rtl .news-content          { text-align: right; }
body.rtl .news-meta             { flex-direction: row-reverse; }
body.rtl .news-time             { margin-left: 0; margin-right: auto; }
body.rtl .news-footer           { flex-direction: row-reverse; }

/* Article body (modal) */
body.rtl .article-body {
  border-left: none;
  border-right: 2px solid var(--green-dk);
  padding-left: 0;
  padding-right: 16px;
}
body.rtl .article-eyebrow       { flex-direction: row-reverse; }
body.rtl .article-time          { margin-left: 0; margin-right: auto; }
body.rtl .article-tags          { flex-direction: row-reverse; }
body.rtl .article-actions       { flex-direction: row-reverse; }

/* Pagination */
body.rtl .pagination            { flex-direction: row-reverse; }

/* Modal */
body.rtl .modal-header          { direction: rtl; }
body.rtl .modal-cmd-bar         { flex-direction: row-reverse; }
body.rtl .modal-controls        { margin-left: 0; margin-right: auto; }

/* Keep lang-switcher LTR regardless of page direction */
body.rtl .lang-switcher {
  direction: ltr;
  unicode-bidi: isolate;
}

@media (max-width: 640px) {
  body.rtl .nav-bar {
    left: 12px;
    right: auto;
    transform-origin: top left;
  }
}
