/* Base variables and theming */
:root {
  --bg: #f6f7fb;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #ff6600;
  --primary-600: #e65c00;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 10px 20px rgba(0,0,0,.05);
}

html[data-theme="dark"] {
  --bg: #0b0f19;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #ff7a1a;
  --primary-600: #ff8c3a;
  --card: #111827;
  --border: #1f2937;
  --shadow: 0 10px 24px rgba(0,0,0,.35);
}

html[data-theme="system"] {
  color-scheme: light dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Links */
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--card);
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}
.site-header .logo a { color: var(--text); font-weight: 800; letter-spacing: .3px; }
.nav-links { list-style: none; display: flex; gap: 12px; margin: 0; padding: 0; align-items: center; }
.nav-links a { color: var(--text); padding: 8px 12px; border-radius: 10px; }
.nav-links a:hover { background: rgba(0,0,0,.05); }
.menu-icon, .close-menu, .theme-toggle {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
.menu-icon { display: none; }

/* Mobile nav */
@media (max-width: 900px) {
  .menu-icon { display: inline-block; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 90%); height: 100%;
    background: var(--card); box-shadow: var(--shadow);
    transform: translateX(100%); transition: transform .25s ease;
    flex-direction: column; align-items: stretch; padding: 16px;
  }
  .nav-links.active { transform: translateX(0); }
  .nav-links li { width: 100%; }
  .nav-links a, .nav-links button { width: 100%; text-align: left; }
}

/* Banner */
.banner { display: flex; justify-content: center; padding: 8px 12px; }
.banner-image { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }

/* Hero */
.hero {
  padding: 40px 20px; text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 40px); }
.hero p { color: var(--muted); margin: 0 0 20px; }
.btn, .btn-outline, .btn-reset {
  display: inline-block; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--primary);
}
.btn { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn:hover { background: var(--primary-600); }
.btn-outline { color: var(--primary); background: transparent; }
.btn-outline:hover { background: rgba(255,102,0,.08); }
.btn-reset { color: var(--muted); border-color: var(--border); }
.btn-reset:hover { background: rgba(0,0,0,.05); color: var(--text); }

/* Sections */
.news-section {
  background: var(--card); margin: 20px auto; padding: 20px;
  border: 1px solid var(--border); border-radius: 16px; width: min(1100px, 96%);
  box-shadow: var(--shadow);
}
.news-section h1, .news-section h2 { margin-top: 0; }

/* Filter form */
.filter-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.filter-form input[type="search"] {
  flex: 1 1 280px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
}

/* Cards grid */
.news-container {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
}
.news-card {
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
  overflow: clip;
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0,0,0,.07); }
.news-content { padding: 16px; text-align: left; }
.news-content img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 8px 0; }

.read-more {
  display: inline-block; margin-top: 8px; padding: 8px 12px; border-radius: 10px;
  background: var(--primary); color: #fff;
}
.read-more:hover { background: var(--primary-600); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.pagination ul { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
.pagination a { display: inline-block; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); }
.pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); }
.count { color: var(--muted); }

/* Loader */
.loader {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(0,0,0,.15); border-top-color: var(--primary);
  animation: spin 1s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.site-footer {
  text-align: center; padding: 24px; color: var(--muted);
}

/* Utilities */
.section-footer { text-align: center; margin-top: 14px; }