/* ─── RESET & BASE ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: #f8f7f4;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── VARIABLES ────────────────────────────────────────────────────── */
:root {
  --accent: #0a6e6e;
  --accent-light: #e0f2f2;
  --accent-dark: #074e4e;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-light: #999;
  --border: #e0ddd8;
  --bg: #f8f7f4;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-lg: 14px;
  --header-h: 64px;
  --breaking-red: #d32f2f;
}

/* ─── LAYOUT ────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ─── BREAKING BAR ─────────────────────────────────────────────────── */
.breaking-bar {
  background: var(--breaking-red);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 36px;
  overflow: hidden;
  font-size: 13px;
}
.breaking-label {
  background: #fff;
  color: var(--breaking-red);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.breaking-ticker {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

/* ─── HEADER ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-white);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top { height: var(--header-h); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 38px; height: 38px;
  background: var(--accent);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.logo-mark.small { width: 28px; height: 28px; font-size: 12px; border-radius: 4px; }
.logo-text strong { display: block; font-family: 'Playfair Display', serif; font-size: 17px; line-height: 1.1; }
.logo-text small { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { background: var(--accent-light); color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.search-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}
.search-toggle:hover { background: var(--bg); color: var(--accent); }
.btn-back {
  font-size: 14px;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  transition: all 0.2s;
}
.btn-back:hover { background: var(--accent); color: #fff; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}
.menu-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
}

.search-bar-wrap {
  border-top: 1px solid var(--border);
  padding: 12px 0;
  background: var(--bg-white);
}
.search-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
}
.search-inner svg { color: var(--text-muted); flex-shrink: 0; }
.search-inner input {
  flex: 1; border: none; background: none; padding: 10px 0;
  font-size: 15px; color: var(--text); outline: none;
}
#search-close { color: var(--text-muted); font-size: 16px; padding: 4px; }
#search-close:hover { color: var(--text); }

/* ─── HERO ──────────────────────────────────────────────────────────── */
.hero-section { padding: 28px 0 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  margin-bottom: 32px;
}
.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #222;
  cursor: pointer;
  transition: transform 0.3s;
}
.hero-card:hover { transform: translateY(-3px); }
.hero-card.main { grid-row: 1 / 3; }
.hero-card-img {
  width: 100%; height: 100%;
  min-height: 200px;
  object-fit: cover;
  display: block;
}
.hero-card-img-placeholder {
  width: 100%; min-height: 200px; background: #2a3a3a;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.hero-card.main .hero-card-img,
.hero-card.main .hero-card-img-placeholder { min-height: 420px; }
.hero-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  color: #fff;
}
.hero-card-category {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.hero-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  line-height: 1.25;
  color: #fff;
}
.hero-card.main .hero-card-title { font-size: 28px; }
.hero-card-meta { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 8px; }

/* ─── MAIN LAYOUT ───────────────────────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 28px 0 60px;
}

/* ─── FILTERS BAR ───────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filters-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-white);
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sort-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-white);
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.search-results-header {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-results-header strong { color: var(--text); }
#clear-search {
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}
#clear-search:hover { background: var(--accent); color: #fff; }

/* ─── ARTICLES GRID ─────────────────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.card-img-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, var(--accent-light), #d4e8e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  color: var(--accent);
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.badge-category {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 4px;
}
.badge-breaking {
  font-size: 11px; font-weight: 700;
  background: var(--breaking-red); color: #fff;
  padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-featured {
  font-size: 11px; font-weight: 600;
  background: #f59e0b; color: #fff;
  padding: 3px 8px; border-radius: 4px;
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
  margin-top: auto;
}
.card-author { font-weight: 500; }
.card-views { display: flex; align-items: center; gap: 4px; }

/* ─── LOADING / EMPTY ───────────────────────────────────────────────── */
.loading-state { text-align: center; padding: 60px 0; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-full {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}
.empty-state { text-align: center; padding: 80px 0; color: var(--text-muted); }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }

/* ─── PAGINATION ────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}
.page-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ─── SIDEBAR ───────────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.widget-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.category-item:last-child { border-bottom: none; }
.category-item:hover { color: var(--accent); }
.category-item .cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.category-item-left { display: flex; align-items: center; gap: 8px; }
.category-count {
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.trending-item {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.trending-item:last-child { border-bottom: none; }
.trending-num {
  font-size: 22px; font-weight: 700;
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
}
.trending-title { font-size: 13px; line-height: 1.4; color: var(--text); }
.trending-title:hover { color: var(--accent); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.tag-pill:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── ARTICLE PAGE ──────────────────────────────────────────────────── */
.article-page { padding-bottom: 60px; }
.article-hero {
  width: 100%;
  max-height: 520px;
  overflow: hidden;
  margin-bottom: 0;
}
.article-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}
.article-hero-caption {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 8px 20px;
  font-style: italic;
  background: var(--bg);
}
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding-top: 32px;
}
.article-header { margin-bottom: 28px; }
.article-meta-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.article-category-badge {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 12px; border-radius: 4px;
}
.breaking-badge {
  background: var(--breaking-red); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.article-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px; font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}
.article-summary {
  font-family: 'Source Serif 4', serif;
  font-size: 18px; font-weight: 300;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.byline-avatar {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.byline-author { font-weight: 600; display: block; }
.byline-date { color: var(--text-light); font-size: 13px; }
.article-stats { margin-left: auto; font-size: 13px; color: var(--text-light); }

.article-body {
  font-family: 'Source Serif 4', serif;
  font-size: 18px;
  line-height: 1.8;
  color: #2a2a2a;
}
.article-body p { margin-bottom: 1.4em; }
.article-body h2 { font-family: 'Playfair Display', serif; font-size: 26px; margin: 1.8em 0 0.8em; }
.article-body h3 { font-size: 20px; margin: 1.4em 0 0.6em; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.article-body img {
  width: 100%; border-radius: var(--radius);
  margin: 1.5em 0;
}
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 1.4em; }
.article-body li { margin-bottom: 0.4em; }
.article-body strong { font-weight: 700; }
.article-body em { font-style: italic; }
.article-body hr { border: none; border-top: 2px solid var(--border); margin: 2em 0; }

.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0; }
.article-share {
  display: flex; align-items: center; gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px; color: var(--text-muted);
  flex-wrap: wrap;
}
.share-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
}
.share-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.article-sidebar { display: flex; flex-direction: column; gap: 24px; }
.related-card {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.related-card:last-child { border-bottom: none; }
.related-img {
  width: 70px; height: 55px;
  border-radius: 6px; object-fit: cover; flex-shrink: 0;
}
.related-img-placeholder {
  width: 70px; height: 55px;
  background: var(--accent-light);
  border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.related-info .related-title { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text); }
.related-info .related-title:hover { color: var(--accent); }
.related-info .related-date { font-size: 11px; color: var(--text-light); margin-top: 4px; }

.not-found-page {
  text-align: center; padding: 120px 20px;
  color: var(--text-muted);
}
.not-found-page h1 { font-size: 80px; color: var(--border); font-family: 'Playfair Display', serif; }
.not-found-page p { font-size: 18px; margin: 12px 0 24px; }
.not-found-page a { color: var(--accent); text-decoration: underline; }

/* ─── FOOTER ────────────────────────────────────────────────────────── */
.site-footer {
  background: #111;
  color: #ccc;
  padding: 40px 0 20px;
  margin-top: 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
}
.footer-brand .logo-mark { background: var(--accent); }
.footer-brand strong { color: #fff; font-size: 15px; }
.footer-brand p { font-size: 13px; color: #888; margin-top: 2px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 14px; color: #888; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #222; padding-top: 16px; text-align: center; }
.footer-bottom p { font-size: 13px; color: #555; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card.main { grid-row: auto; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
}
@media (max-width: 640px) {
  .articles-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 26px; }
  .article-body { font-size: 16px; }
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
}
