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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #e63946;
  --accent-hover: #c1121f;
  --font: 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* HEADER */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

nav { display: flex; gap: 1rem; flex-wrap: wrap; }
nav a {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
nav a:hover { color: var(--text); background: var(--border); }

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* FEATURED */
#featured { margin-bottom: 0; }
.featured-card {
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}
.featured-card img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
}
.featured-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.92));
  padding: 3rem 2rem 2rem;
}
.featured-info h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  margin: 0.4rem 0 0.6rem;
  line-height: 1.25;
}
.featured-info p { color: #ccc; font-size: 0.95rem; max-width: 640px; }

/* CATEGORY BADGE */
.category {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

/* ARTICLES GRID */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.card-info { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-info h2 { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.card-info p { font-size: 0.85rem; color: var(--muted); flex: 1; }

.empty { color: var(--muted); padding: 2rem 0; }

/* ARTICLE PAGE */
.article-page { max-width: 800px; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.date { color: var(--muted); font-size: 0.85rem; }

.article-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.article-hero {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
  display: block;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #d0d0d0;
}
.article-body p { margin-bottom: 1.2rem; }
.article-body h2 { font-size: 1.4rem; margin: 2rem 0 0.8rem; color: var(--text); }
.article-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.6rem; color: var(--text); }
.article-body img { max-width: 100%; border-radius: 6px; margin: 1rem 0; }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.2rem; }
.article-body li { margin-bottom: 0.4rem; }

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  color: var(--accent);
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

.loading { color: var(--muted); }

/* FOOTER */
footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* RESPONSIVE */
@media (max-width: 640px) {
  .featured-card img { height: 280px; }
  .featured-info { padding: 2rem 1rem 1rem; }
  .articles-grid { grid-template-columns: 1fr; }
}
