:root {
  --bg-start: #f0f6ff;
  --bg-end: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e5e7eb;
  --card: #ffffff;
  --accent: #2563eb;
  --shadow: 0 6px 20px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { color: var(--text); font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

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

/* Hero header */
.hero-header { position: relative; top: auto; background: #f0f6ff; z-index: 5; border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: "Spectral", serif; font-weight: 800; font-size: 30px; letter-spacing: .2px; color: #0f172a; text-decoration: none; }
.hero-right { display: flex; align-items: center; gap: 16px; }
.hero-nav a { color: var(--muted); text-decoration: none; margin-right: 12px; font-weight: 600; }
.hero-nav a:hover { color: var(--text); }
.desktop-only { display: flex; }
.mobile-only { display: none; }
.mobile-menu { display: none; background: var(--card); border-top: 1px solid var(--border); padding: 10px 24px; gap: 10px; }
.mobile-menu a { display: block; color: var(--text); text-decoration: none; padding: 6px 0; }
.mobile-menu.open { display: block; }
.hamburger { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 16px; }

/* Language toggle button */
.lang-toggle-btn { border: 1px solid #bfdbfe; border-radius: 8px; background: #dbeafe; color: #0f172a; padding: 6px 10px; font-weight: 600; cursor: pointer; }
.lang-toggle-btn:hover { background: #bfdbfe; }

/* Featured */
.featured-card { margin-top: 8px; }
.featured-inner { display: flex; gap: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; overflow: hidden; }
.featured-img { width: 44%; object-fit: cover; max-height: 360px; display: block; }
.featured-text { padding: 20px; display: flex; flex-direction: column; }
.featured-date { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.featured-title { font-family: "Playfair Display", serif; font-weight: 800; margin: 0 0 8px; font-size: 34px; line-height: 1.1; }
.featured-desc { color: var(--muted); font-size: 16px; }

/* Grid cards */
.grid-section { margin-top: 28px; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-link { text-decoration: none; color: inherit; }
.card-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.card-body { padding: 16px; }
.card-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.cat-chip { display: inline-block; font-size: 11px; text-transform: capitalize; background: #e6f0ff; color: #0f172a; border: 1px solid #d4e2ff; padding: 2px 8px; border-radius: 999px; }
.card-date { color: var(--muted); font-size: 12px; }
.card-meta .card-date { margin: 0; }
.card-title { font-family: "Playfair Display", serif; font-weight: 700; font-size: 20px; margin: 0 0 6px; line-height: 1.2; }
.card-desc { color: var(--muted); font-size: 14px; margin: 0; }

/* Article */
.article-wrap { max-width: 1000px; margin: 12px auto; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.article-hero { width: 100%; height: 420px; object-fit: cover; display: block; }
.article-header { padding: 24px; }
.article-date { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.article-title { font-family: "Playfair Display", serif; font-weight: 800; font-size: 36px; line-height: 1.15; margin: 0 0 8px; }
.article-subtitle { color: var(--muted); font-size: 16px; margin: 0 0 10px; }
.article-body { padding: 0 24px 24px; }
.article-body p { line-height: 1.7; margin: 16px 0; font-size: 18px; }
.article-body a { color: var(--accent); text-decoration: underline; }

/* Forms */
.search-form-inline { display: flex; gap: 8px; align-items: center; margin: 8px 0 16px; }
.search-form-inline input { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.search-form-inline .search-box { position: relative; flex: 1; }
.search-form-inline .search-box input { width: 100%; }
.search-form-inline button { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); background: #f8fafc; font-weight: 600; color: var(--text); }
.btn-link { color: var(--accent); text-decoration: none; }

/* Search suggestions dropdown */
.search-suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); z-index: 20; padding: 6px 0; max-height: 320px; overflow: auto; }
.search-suggestions .suggestion-item { display: block; padding: 10px 12px; color: var(--text); text-decoration: none; font-size: 14px; }
.search-suggestions .suggestion-item:hover { background: #f1f5f9; }
.search-suggestions strong { font-weight: 800; }

.page-title { font-family: "Playfair Display", serif; font-weight: 800; font-size: 28px; margin: 6px 0 12px; }
.footnote { color: var(--muted); font-size: 13px; }

/* Responsive */
@media (max-width: 960px) {
  .featured-inner { flex-direction: column; }
  .featured-img { width: 100%; max-height: 260px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .hero-inner { flex-direction: row; align-items: center; gap: 10px; justify-content: space-between; }
  .desktop-only { display: none; }
  .mobile-only { display: block; }
  .hero-nav.mobile-nav { display: flex; align-items: center; gap: 8px; }
  .lang-toggle-btn { padding: 6px 8px; font-size: 14px; }
  .card-grid { grid-template-columns: 1fr; }
  .article-hero { height: 240px; }
  .article-title { font-size: 28px; }
  .panel.popular { height: auto; }
  /* Hide submit and clear controls on mobile; Enter key submits */
  .search-form-inline button,
  .search-form-inline .btn-link { display: none; }

  /* Force all card descriptions to white on mobile */
  .card-desc { color: #ffffff !important; }

  /* Hero card: maximize usable space for text on mobile */
  .hero-overlay { top: 0; bottom: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: flex-end; }
  .hero-overlay .hero-title {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 24px;
    line-height: 1.2;
  }
  .hero-overlay .hero-desc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Homepage cards: image background with overlay title, no desc */
  .editor-grid .teaser-card,
  .editor-grid .mix-card { position: relative; height: 200px; border: none; border-radius: 12px; overflow: hidden; }
  .editor-grid .teaser-card .teaser-img,
  .editor-grid .mix-card .mix-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .editor-grid .teaser-card .card-body,
  .editor-grid .mix-card .card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.65)); color: #fff; }
  .editor-grid .teaser-card .card-title,
  .editor-grid .mix-card .card-title { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
  .editor-grid .teaser-card .card-meta .card-date,
  .editor-grid .mix-card .card-meta .card-date { color: #e5e7eb; }
  .editor-grid .teaser-card .cat-chip,
  .editor-grid .mix-card .cat-chip { background: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.9); color: #0f172a; }
  .editor-grid .card-desc { display: none; }
  /* Show teaser descriptions on mobile homepage and make them white */
  .editor-grid .teaser-card .card-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  }

  /* Ensure full-width and remove any left offsets */
  .editor-grid > a { grid-column: 1 / -1; margin-left: 0 !important; }
  .editor-grid .mix-wide { grid-column: 1 / -1; }

  /* Keep homepage overlay text white, but do not affect normal cards */
  .editor-grid .teaser-card .card-title,
  .editor-grid .mix-card .card-title { color: #ffffff; }
}

/* Editorial homepage grid */
.editor-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr;
  grid-auto-rows: minmax(120px, auto);
  grid-auto-flow: dense;
  gap: 18px;
}

.hero-card { position: relative; display: block; grid-column: span 2; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); color: inherit; text-decoration: none; height: 50vh; min-height: 260px; max-height: 66vh; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; background: linear-gradient(180deg, rgba(10,15,25,0.0), rgba(10,15,25,0.5), rgba(10,15,25,0.75)); color: #fff; }
.hero-title { font-family: "Playfair Display", serif; font-weight: 800; margin: 4px 0 6px; font-size: 34px; line-height: 1.1; }
.hero-desc { color: #e5e7eb; font-size: 15px; }
.hero-overlay .cat-chip { background: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.9); color: #0f172a; }
.hero-overlay .card-date { color: #e5e7eb; }

.panel.popular { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; height: 50vh; display: flex; flex-direction: column; }
.panel-title { font-family: "Playfair Display", serif; font-size: 22px; font-weight: 800; margin: 4px 0 10px; }
.popular-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; overflow: auto; flex: 1; }
.pop-card { list-style: none; }
.pop-link { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); color: inherit; text-decoration: none; }
.pop-img { width: 100%; height: 120px; object-fit: cover; display: block; }
.pop-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.65)); color: #fff; display: grid; gap: 4px; }
.pop-overlay .cat-chip { background: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.9); color: #0f172a; }
.popular-list .pop-title { font-weight: 700; }
.popular-list .pop-date { color: #e5e7eb; font-size: 12px; }

.teaser-card, .mix-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; display: block; color: inherit; text-decoration: none; }
.teaser-img, .mix-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.mix-wide { grid-column: span 2; }
.mix-tall .mix-img { height: 180px; }

@media (max-width: 980px) {
  .editor-grid { grid-template-columns: 1fr; }
  .hero-card { grid-column: span 1; }
}

/* Headline ticker */
.ticker { background: #eaf2ff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; white-space: nowrap; }
.ticker-inner { max-width: 1200px; margin: 0 auto; }
.ticker-track { display: inline-block; padding: 10px 0; animation: ticker-scroll 110s linear infinite; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; margin-right: 40px; color: #0f172a; text-decoration: none; }
.ticker-item .cat-chip { background: #dbe9ff; border-color: #cfe0ff; }
.ticker-dot { width: 6px; height: 6px; background: #94a3b8; border-radius: 50%; display: inline-block; }

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

/* Ticker text size for consistency */
.ticker-item { font-size: 14px; }
@media (max-width: 600px) { .ticker-item { font-size: 12px; } }

/* Stocks row (non-scrolling) */
.stocks-row { background: #eef4ff; border-bottom: 1px solid var(--border); }
.stocks-chipbar { background: #e6f0ff; border: 1px solid #d8e6ff; border-radius: 16px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: center; }
.stock-chip { display: inline-flex; gap: 8px; font-weight: 600; color: #0f172a; }
.stock-chip .sym { letter-spacing: 0.3px; }
.pct.chg-up { color: #16a34a; }
.pct.chg-down { color: #dc2626; }
.category-section { margin: 10px 0 24px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; }
.section-link { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Cluttered/asymmetrical feel */
.card-grid.clutter { grid-auto-rows: auto; align-items: start; }
.card-wide { grid-column: span 2; }
.card-tall .card-img { height: 260px; }
.cat-chip { width: max-content; }

/* Tame description height on desktop to avoid large gaps */
.editor-grid .card-desc,
.card-grid .card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Remove separated description classes */
