/* ============================================================
   News Digest Pages — Stylesheet
   Matches roboticscenter.ai design system (country-styles.css)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* --- Design tokens (mirrors country-styles.css :root) --- */
:root {
  --color-bg: #08090b;
  --color-bg-deep: #050608;
  --color-bg-elevated: #0e1014;
  --color-bg-card: #111318;
  --color-surface: #161a20;
  --color-surface-hover: #1c2129;
  --color-border: rgba(255, 255, 255, 0.07);
  --color-border-hover: rgba(255, 255, 255, 0.14);
  --color-border-glow: rgba(200, 245, 60, 0.2);
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-dim: #7a8fa8;
  --color-accent: #c8f53c;
  --color-accent-dim: rgba(200, 245, 60, 0.10);
  --color-accent-glow: rgba(200, 245, 60, 0.22);
  --color-success: #34d399;
  --font-display: 'Syne', 'SF Pro Display', sans-serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(200, 245, 60, 0.06);
  --shadow-glow: 0 0 24px rgba(200, 245, 60, 0.08);
}

/* --- Light mode override --- */
[data-theme="light"] {
  --color-bg: #f5f7fb;
  --color-bg-deep: #eff3f9;
  --color-bg-elevated: #ffffff;
  --color-bg-card: #ffffff;
  --color-surface: #edf2f8;
  --color-surface-hover: #e4ebf4;
  --color-border: rgba(15, 23, 42, 0.12);
  --color-border-hover: rgba(15, 23, 42, 0.22);
  --color-border-glow: rgba(37, 99, 235, 0.22);
  --color-text: #0f172a;
  --color-text-muted: #334155;
  --color-text-dim: #64748b;
  --color-accent: #2563eb;
  --color-accent-dim: rgba(37, 99, 235, 0.12);
  --color-accent-glow: rgba(37, 99, 235, 0.2);
  --color-success: #059669;
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.08);
  --shadow-card-hover: 0 16px 34px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(37, 99, 235, 0.1);
  --shadow-glow: 0 0 18px rgba(37, 99, 235, 0.12);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse 100% 100% at 50% 0%, rgba(200, 245, 60, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(200, 245, 60, 0.02) 0%, transparent 40%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated top accent bar */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #c8f53c 0%, #38bdf8 50%, #c8f53c 100%);
  background-size: 200% 100%;
  animation: accent-bar-shift 6s linear infinite;
  z-index: 10000;
  pointer-events: none;
}
[data-theme="light"] body::before {
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 50%, #2563eb 100%);
  background-size: 200% 100%;
}
@keyframes accent-bar-shift { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

a { color: inherit; text-decoration: none; }

/* ============================================================
   .nd-topbar — Sticky top navigation (mirrors .country-topbar)
   ============================================================ */
.nd-topbar {
  position: sticky;
  top: 3px;
  left: 0; right: 0;
  z-index: 100;
  padding: 0.75rem 2rem;
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
[data-theme="light"] .nd-topbar {
  background: rgba(245, 247, 251, 0.92);
}

.nd-topbar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nd-topbar__logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-hover);
  background: var(--color-bg-elevated);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.16);
  transition: border-color var(--transition);
}
.nd-topbar__logo:hover { border-color: var(--color-border-glow); }
.nd-topbar__logo span { color: var(--color-accent); }

.nd-topbar__back {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}
.nd-topbar__back:hover { color: var(--color-text); }

.nd-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nd-topbar__cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-accent) 48%, transparent);
  background: var(--color-accent-dim);
  transition: all var(--transition);
  white-space: nowrap;
}
.nd-topbar__cta:hover {
  color: var(--color-text);
  border-color: color-mix(in srgb, var(--color-accent) 72%, transparent);
  background: color-mix(in srgb, var(--color-accent) 20%, transparent);
  box-shadow: 0 6px 16px rgba(200, 245, 60, 0.16);
}

/* ============================================================
   .nd-breadcrumb
   ============================================================ */
.nd-breadcrumb {
  padding: 1rem 2rem 0;
  font-size: 0.82rem;
  color: var(--color-text-dim);
  max-width: 1200px;
  margin: 0 auto;
}
.nd-breadcrumb a { color: var(--color-text-muted); transition: color var(--transition); }
.nd-breadcrumb a:hover { color: var(--color-accent); }
.nd-breadcrumb__sep { margin: 0 0.4rem; opacity: 0.5; }

/* ============================================================
   .nd-hero — Section hero for feed pages
   ============================================================ */
.nd-hero {
  text-align: center;
  padding: 3.5rem 2rem 2.5rem;
  max-width: 800px;
  margin: 0 auto;
}
.nd-hero__badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  background: var(--color-accent-dim);
  border: 1px solid color-mix(in srgb, var(--color-accent) 24%, transparent);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
}
.nd-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.nd-hero__subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   .nd-tag-list — Horizontal scrollable tag filter pills
   ============================================================ */
.nd-tag-list {
  display: flex;
  gap: 0.5rem;
  padding: 0 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.nd-tag-list::-webkit-scrollbar { height: 4px; }
.nd-tag-list::-webkit-scrollbar-track { background: transparent; }
.nd-tag-list::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

.nd-tag-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  white-space: nowrap;
  transition: all var(--transition);
}
.nd-tag-pill:hover, .nd-tag-pill--active {
  color: var(--color-accent);
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  background: var(--color-accent-dim);
}

/* ============================================================
   .nd-grid — Responsive CSS grid of article cards
   ============================================================ */
.nd-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .nd-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .nd-grid { grid-template-columns: 1fr; padding: 0 1rem 2rem; }
}

/* ============================================================
   .nd-card — Article card
   ============================================================ */
.nd-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.nd-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.nd-card__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-accent-dim);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  margin-bottom: 0.7rem;
  align-self: flex-start;
}

.nd-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nd-card__title a { transition: color var(--transition); }
.nd-card__title a:hover { color: var(--color-accent); }

.nd-card__meta {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  margin-bottom: 0.6rem;
}
.nd-card__meta-sep { margin: 0 0.35rem; opacity: 0.4; }

.nd-card__desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.nd-card__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  transition: opacity var(--transition);
  margin-top: auto;
}
.nd-card__link:hover { opacity: 0.8; }

/* ============================================================
   .nd-article — Full article page layout
   ============================================================ */
.nd-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.nd-article__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-accent-dim);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 1rem;
}

.nd-article__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.nd-article__meta {
  font-size: 0.88rem;
  color: var(--color-text-dim);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.nd-article__meta a { color: var(--color-accent); }
.nd-article__meta a:hover { text-decoration: underline; }

.nd-article__body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.nd-article__read-source {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-bg);
  background: var(--color-accent);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  margin-bottom: 2.5rem;
}
.nd-article__read-source:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
[data-theme="light"] .nd-article__read-source { color: #fff; }

.nd-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.nd-article__tags .nd-tag-pill { font-size: 0.75rem; }

/* ============================================================
   .nd-country-cta — CTA box linking to country landing page
   ============================================================ */
.nd-country-cta {
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
  border-radius: var(--radius-lg);
  background: var(--color-accent-dim);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.nd-country-cta__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.nd-country-cta__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.nd-country-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  transition: opacity var(--transition);
}
.nd-country-cta__link:hover { opacity: 0.8; }

/* ============================================================
   .nd-pagination — Prev/next page links
   ============================================================ */
.nd-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nd-pagination__link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-accent);
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--color-accent) 36%, transparent);
  background: var(--color-accent-dim);
  transition: all var(--transition);
}
.nd-pagination__link:hover {
  background: color-mix(in srgb, var(--color-accent) 20%, transparent);
  box-shadow: 0 4px 12px rgba(200, 245, 60, 0.12);
}
.nd-pagination__link--disabled {
  opacity: 0.35;
  pointer-events: none;
}
.nd-pagination__info {
  font-size: 0.82rem;
  color: var(--color-text-dim);
}

/* ============================================================
   .nd-empty — Empty state
   ============================================================ */
.nd-empty {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}
.nd-empty__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}
.nd-empty__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.nd-empty__desc {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================================
   Footer links row
   ============================================================ */
.nd-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-dim);
}
.nd-footer a {
  color: var(--color-text-muted);
  transition: color var(--transition);
  margin: 0 0.5rem;
}
.nd-footer a:hover { color: var(--color-accent); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .nd-topbar { padding: 0.65rem 1rem; }
  .nd-hero { padding: 2.5rem 1rem 1.5rem; }
  .nd-breadcrumb { padding: 0.75rem 1rem 0; }
  .nd-tag-list { padding: 0 1rem 1rem; }
  .nd-article { padding: 1.5rem 1rem 3rem; }
}
@media (max-width: 480px) {
  .nd-topbar { padding: 0.55rem 0.75rem; }
  .nd-topbar__logo { font-size: 1rem; }
}
