:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --text: #1a1d26;
  --text-muted: #5c6370;
  --border: #e4e7ec;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --nature: #c41e3a;
  --jmai: #0d9488;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-serif: "Merriweather", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.header__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.header__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.header__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.lang-switch,
.filter {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.lang-switch__btn,
.filter__btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-switch__btn:hover,
.filter__btn:hover {
  color: var(--text);
}

.lang-switch__btn--active,
.filter__btn--active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Main */
.main {
  flex: 1;
  padding: 2rem 1.25rem 3rem;
}

.status {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.status--error {
  color: #b91c1c;
}

/* Articles */
.articles {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.article-card:hover {
  border-color: #cdd3dc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-card__badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card__badge--nature {
  background: #fce8ec;
  color: var(--nature);
}

.article-card__badge--jmai {
  background: #ccfbf1;
  color: var(--jmai);
}

.article-card__date {
  font-variant-numeric: tabular-nums;
}

.article-card__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}

.article-card__title a {
  color: inherit;
  text-decoration: none;
}

.article-card__title a:hover {
  color: var(--accent);
}

.article-card__summary {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.article-card__link {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.article-card__link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-top: auto;
}

.footer__inner {
  text-align: center;
}

.footer__text,
.footer__updated {
  margin: 0.25rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .header__inner {
    flex-direction: column;
  }

  .header__controls {
    width: 100%;
    justify-content: flex-start;
  }

  .article-card {
    padding: 1rem 1.1rem;
  }
}
