:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #111827;
  --ink-muted: #4b5563;
  --border: #e5e7eb;
  --brand: #0f172a;
  --accent: #b91c1c;
  --accent-hover: #991b1b;
  --tag-bg: #eef2ff;
  --tag-ink: #1e3a8a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* Header */
.site-header {
  background: var(--brand);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #fff;
}

.brand:hover {
  text-decoration: none;
}

.brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-name span {
  color: #ef4444;
}

.brand-slogan {
  font-size: 13px;
  color: #cbd5e1;
  border-left: 1px solid #334155;
  padding-left: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
}

.search-form input {
  background: transparent;
  border: none;
  color: #fff;
  padding: 7px 12px;
  font-size: 14px;
  width: 210px;
  outline: none;
}

.search-form input::placeholder {
  color: #94a3b8;
}

.search-form button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.btn-outline {
  color: #e2e8f0;
  border: 1px solid #475569;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.btn-outline:hover {
  background: #1e293b;
  text-decoration: none;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn-accent:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

/* Nav */
.site-nav {
  background: #1e293b;
  border-top: 1px solid #334155;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 0;
}

.nav-links a {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* Main Layout */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 24px 0 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Hero card */
.hero-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

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

.hero-img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.hero-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  align-self: flex-start;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.3;
}

.hero-title a {
  color: var(--ink);
}

.hero-title a:hover {
  color: var(--accent);
}

.meta {
  font-size: 13px;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.excerpt {
  font-size: 14.5px;
  color: #374151;
  margin: 0;
}

/* News grid */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 14px;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 6px;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
}

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

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.news-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  display: block;
  background: #e5e7eb;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.card-title a {
  color: var(--ink);
}

.card-title a:hover {
  color: var(--accent);
}

.card-footer {
  margin-top: auto;
  padding-top: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 18px;
}

.widget h3 {
  margin: 0 0 12px;
  font-size: 16px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  background: #f3f4f6;
  color: var(--ink);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.tag-pill:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  color: var(--ink);
  font-weight: 500;
}

/* Article Page */
.article-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px;
}

.article-box h1 {
  margin: 6px 0 12px;
  font-size: 28px;
  line-height: 1.25;
}

.article-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 6px;
  margin: 14px 0 20px;
}

.article-intro {
  font-size: 17px;
  font-weight: 500;
  color: #374151;
  background: #f8fafc;
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 18px;
}

.article-content {
  font-size: 16.5px;
  line-height: 1.72;
  color: #1f2937;
  overflow-wrap: break-word;
}

.article-content img {
  border-radius: 6px;
  margin: 10px 0;
}

.article-content .imgl {
  float: left;
  margin: 0 18px 12px 0;
  max-width: 45%;
}

.article-content .imgr {
  float: right;
  margin: 0 0 12px 18px;
  max-width: 45%;
}

.article-content::after {
  content: "";
  display: table;
  clear: both;
}

.article-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.article-gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
}

/* Comments */
.comments-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin-top: 24px;
}

.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-head {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.comment-head strong {
  color: var(--ink);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14.5px;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 26px;
  flex-wrap: wrap;
}

.page-link {
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.page-link.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  background: var(--brand);
  color: #cbd5e1;
  padding: 28px 0;
  border-top: 3px solid var(--accent);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.site-footer a {
  color: #f87171;
}

.alert-ok {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}
