/* THEME VARIABLES */
:root {
  --brand-green: #16a34a;
  --bg: #f9fafb;
  --muted: #6b7280;
  --card-bg: #fff;
  --text-color: #111827;
}

[data-theme="dark"] {
  --brand-green: #22c55e;
  --bg: #0f172a;
  --muted: #9ca3af;
  --card-bg: #1e293b;
  --text-color: #f3f4f6;
}

/* Smooth transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: var(--bg);
  color: var(--text-color);
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
}

.page {
  width: 100%;
  max-width: 1100px;
  margin: 18px auto;
  padding: 16px;
}

/* Top bar */
.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.back-btn {
  background: transparent;
  border: 1px solid #e6e6e6;
  color: var(--text-color);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.page-title {
  font-size: 22px;
  color: var(--brand-green);
  font-weight: 700;
}

/* Main article container */
.main {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(16,24,40,0.04);
  border: 1px solid #eaeaea;
}

.main h1 {
  margin: 0 0 12px 0;
  color: var(--brand-green);
  font-size: 28px;
}

.meta {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 12px;
}

/* Responsive image styles */
.news-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 12px;
  margin: 14px 0;
  object-fit: cover;
  display: block;
}

/* News text block */
.news-text {
  font-size: 18px;
  line-height: 1.8;
  margin: 12px 0;
}

/* Markdown style block */
.markdown {
  background: #f0fdf4;
  border-left: 4px solid var(--brand-green);
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  color: #064e3b;
}

.markdown pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Sidebar (Latest News / Similar) */
.sidebar {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 20px rgba(16,24,40,0.04);
  border: 1px solid #eaeaea;
  margin: 16px 0;
}

.sidebar h2 {
  margin: 0 0 12px 0;
  color: var(--brand-green);
  font-size: 18px;
  text-align: center;
}

.other-list {
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.other-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #f1f1f1;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  background: var(--card-bg);
  min-width: 240px;
}

.other-item:hover {
  background: #f0fdf4;
  border-color: var(--brand-green);
  transform: translateY(-2px);
}

.other-thumb {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.other-meta {
  font-size: 15px;
  color: var(--text-color);
  font-weight: 600;
}

.other-sub {
  font-size: 13px;
  color: var(--muted);
}

.read-more-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--brand-green);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
}

/* Related section */
.more-row {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Responsive for mobile */
@media (max-width: 768px) {
  .main h1 {
    font-size: 24px;
  }

  .news-text,
  .markdown {
    font-size: 16px;
  }

  .sidebar h2 {
    font-size: 16px;
  }

  .other-thumb {
    width: 60px;
    height: 45px;
  }

  .other-item {
    min-width: 200px;
  }

  .page-title {
    font-size: 18px;
  }

  .read-more-btn {
    font-size: 14px;
    padding: 8px 10px;
  }
}
