/* ══════════════════════════════════════════════════════
   NewsHub Greece & Europe — Main Stylesheet
   Clean, fast, ad-optimized. Mobile-first.
   ══════════════════════════════════════════════════════ */

:root {
  --primary: #1a56db;
  --primary-dark: #1239a8;
  --accent: #e3342f;
  --text: #1a202c;
  --text-muted: #6b7280;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --greece: #0d63c9;
  --europe: #003399;
  --world: #16a34a;
  --politics: #7c3aed;
  --economy: #b45309;
  --conflict: #dc2626;
  --technology: #0891b2;
  --environment: #16a34a;
  --health: #db2777;
  --sports: #ea580c;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; }
.logo-text { color: var(--primary); }
.logo-sub { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }

.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg); color: var(--primary); }
.nav-link.active { background: var(--primary); color: white; }

.header-search {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px 4px 4px 14px;
  flex: 1;
  max-width: 280px;
}
.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font);
  font-size: 0.875rem;
  width: 100%;
}
.header-search button {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: background 0.2s;
}
.header-search button:hover { background: var(--primary-dark); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ── TICKER ─────────────────────────────────────────────────────────────── */
.ticker-bar {
  background: var(--primary);
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex;
  gap: 60px;
  animation: ticker 60s linear infinite;
  padding-left: 100%;
}
.ticker-item {
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.ticker-item:hover { opacity: 0.8; }
.ticker-label {
  background: var(--accent);
  padding: 1px 7px;
  border-radius: 3px;
  margin-right: 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ── CATEGORY BAR ────────────────────────────────────────────────────────── */
.category-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.category-pills {
  display: flex;
  gap: 8px;
  min-width: max-content;
  padding: 0 16px;
}
.pill {
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: white;
  transition: all 0.2s;
  white-space: nowrap;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ── MAIN LAYOUT ─────────────────────────────────────────────────────────── */
.site-main { padding: 24px 16px; }

.content-layout, .article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  margin-top: 24px;
}

/* ── ADS ─────────────────────────────────────────────────────────────────── */
.ad-unit {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  min-height: 90px;
}
.ad-leaderboard { margin-bottom: 24px; min-height: 90px; }
.ad-infeed { margin: 24px 0; min-height: 280px; }
.ad-rectangle { min-height: 250px; margin-bottom: 24px; }
.sticky-ad { position: sticky; top: 80px; }

/* ── HERO ────────────────────────────────────────────────────────────────── */
.hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.hero-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16/9;
  background: #1e293b;
}
.hero-main img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.hero-main:hover img { transform: scale(1.03); }
.hero-main .hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 20px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.hero-main .hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.hero-main h2 {
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 6px;
}
.hero-main .hero-meta { color: rgba(255,255,255,0.7); font-size: 0.78rem; }

.hero-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-small {
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.hero-small:hover { box-shadow: var(--shadow-hover); }
.hero-small img {
  width: 100%; height: 90px;
  object-fit: cover;
}
.hero-small .small-body { padding: 10px 12px; flex: 1; }
.hero-small h3 { font-size: 0.88rem; font-weight: 700; line-height: 1.3; }
.hero-small .small-meta { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }

/* ── ARTICLES SECTION ────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 1.2rem; font-weight: 800; }
.article-count { color: var(--text-muted); font-size: 0.82rem; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #e2e8f0;
}
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.card-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}
.badge-region-greece { background: #dbeafe; color: var(--greece); }
.badge-region-europe { background: #e0e7ff; color: var(--europe); }
.badge-region-world  { background: #dcfce7; color: var(--world); }
.badge-cat-politics    { background: #ede9fe; color: var(--politics); }
.badge-cat-economy     { background: #fef3c7; color: var(--economy); }
.badge-cat-conflict    { background: #fee2e2; color: var(--conflict); }
.badge-cat-technology  { background: #cffafe; color: var(--technology); }
.badge-cat-environment { background: #dcfce7; color: var(--environment); }
.badge-cat-health      { background: #fce7f3; color: var(--health); }
.badge-cat-sports      { background: #ffedd5; color: var(--sports); }
.badge-cat-general     { background: #f1f5f9; color: var(--text-muted); }

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
  flex: 1;
}
.card-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.card-source { font-weight: 600; }
.card-views::before { content: '👁 '; }

/* ── PLACEHOLDER CARD ────────────────────────────────────────────────────── */
.card-placeholder .card-image-ph {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.card-placeholder .ph-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}
.card-placeholder .ph-line.short { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── LOAD MORE ───────────────────────────────────────────────────────────── */
.load-more-wrap { text-align: center; margin-top: 24px; }
.load-more-btn {
  padding: 12px 40px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar-widget {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 20px;
}
.widget-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.2s;
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover { color: var(--primary); }
.trending-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  width: 24px;
  opacity: 0.5;
}
.trending-title { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }
.trending-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.region-links { display: flex; flex-direction: column; gap: 8px; }
.region-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--bg);
  transition: all 0.2s;
}
.region-link:hover { background: var(--primary); color: white; }

/* ── ARTICLE FULL ────────────────────────────────────────────────────────── */
.article-full { background: var(--surface); border-radius: var(--radius); padding: 28px; border: 1px solid var(--border); }

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 16px;
  cursor: pointer;
}
.article-back:hover { text-decoration: underline; }

.article-badges { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.article-full h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.article-meta-bar strong { color: var(--text); }

.article-hero-img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 20px;
  max-height: 420px;
  object-fit: cover;
}

/* AD inside article */
.ad-in-article {
  margin: 24px 0;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #374151;
}
.article-body p { margin-bottom: 1.2em; }

.article-tags {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.tag-chip:hover { background: var(--primary); color: white; border-color: var(--primary); }

.source-credit {
  margin-top: 20px;
  padding: 12px 16px;
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.source-credit a { color: var(--primary); font-weight: 600; }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer { background: #1e293b; color: #94a3b8; margin-top: 48px; padding: 40px 0 0; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-brand { color: white; }
.footer-brand p { margin-top: 8px; font-size: 0.85rem; color: #94a3b8; line-height: 1.5; }
.footer-links h4 { color: white; font-size: 0.9rem; margin-bottom: 12px; }
.footer-links a {
  display: block;
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.footer-links a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid #334155;
  padding: 16px 0;
  text-align: center;
  font-size: 0.8rem;
}

/* ── LOADING ─────────────────────────────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.loading-overlay.active { display: flex; }
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }

/* ── MOBILE ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: white;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 999;
  }
  .mobile-menu-btn { display: block; }
  .header-search { display: none; }

  .hero-section { grid-template-columns: 1fr; }
  .hero-stack { flex-direction: row; }
  .hero-small img { height: 70px; }

  .content-layout, .article-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  .articles-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .article-full { padding: 16px; }
  .article-full h1 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero-stack { flex-direction: column; }
}
