:root {
  --green: #4CAF50;
  --green-dark: #2e7d32;
  --ink: #14181a;
  --muted: #5b6670;
  --bg: #f6f8f6;
  --card: #ffffff;
  --border: #e3e8e4;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  background: var(--ink);
  color: #fff;
  padding: 16px 0;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.15rem; color: #fff;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.brand img { height: 30px; width: auto; max-width: 160px; object-fit: contain; border-radius: 4px; }
.brand:hover { text-decoration: none; }
.site-header nav a {
  color: #d8ded9; margin-left: 18px; font-size: 0.95rem;
}
.site-header nav a:hover { color: #fff; }
.header-right { display: flex; align-items: center; }

/* search trigger button */
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #d8ded9; padding: 7px 12px; border-radius: 8px; font-size: 0.88rem;
  cursor: pointer; font-family: inherit;
}
.search-trigger:hover { background: rgba(255,255,255,.15); color: #fff; }
.search-trigger kbd {
  background: rgba(255,255,255,.15); border-radius: 4px; padding: 1px 6px;
  font-size: 0.78rem; font-family: inherit;
}
@media (max-width: 560px) {
  .search-trigger span { display: none; }
}

/* instant search overlay */
.search-overlay {
  position: fixed; inset: 0; background: rgba(20,24,26,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 20px 0; z-index: 100;
}
.search-panel {
  background: #fff; width: 100%; max-width: 620px; border-radius: 14px;
  overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.search-input-row {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); color: var(--muted);
}
.search-input-row input {
  flex: 1; border: none; outline: none; font-size: 1.02rem; font-family: inherit; color: var(--ink);
}
.search-input-row button {
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  border-radius: 6px; padding: 4px 9px; font-size: 0.8rem; cursor: pointer;
}
.search-results { max-height: 60vh; overflow-y: auto; }
.search-result {
  display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.search-result:hover, .search-result.active { background: var(--bg); text-decoration: none; }
.search-result img {
  width: 64px; height: 44px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #dfe6e0;
}
.search-result-body { min-width: 0; }
.search-result-cat {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--green-dark);
  letter-spacing: .02em;
}
.search-result-body strong { display: block; font-size: 0.95rem; margin: 2px 0 3px; }
.search-result-body p {
  margin: 0; font-size: 0.85rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-empty { padding: 24px 18px; color: var(--muted); text-align: center; font-size: 0.9rem; }

/* clickable thumbnail */
.thumb-link { display: block; }

/* hero */
.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff;
  padding: 56px 0 44px;
  text-align: center;
}
.hero h1 { font-size: 2rem; margin: 0 0 12px; }
.hero p { max-width: 640px; margin: 0 auto; color: #eaf6ea; font-size: 1.05rem; }

/* category filter */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 28px 0 8px;
}
.filters a {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--ink); font-size: 0.88rem;
}
.filters a.active, .filters a:hover {
  background: var(--green); color: #fff; border-color: var(--green); text-decoration: none;
}

/* article grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 24px 0 56px;
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.card .thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #dfe6e0;
}
.card .body { padding: 16px 18px 20px; }
.card .cat {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--green-dark); margin-bottom: 8px;
}
.card h3 { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.35; }
.card h3 a { color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* article detail */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px 70px; }
.article-wrap .cat { color: var(--green-dark); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; }
.article-wrap h1 { font-size: 1.9rem; margin: 10px 0 6px; }
.article-wrap .meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.article-wrap .cover { border-radius: var(--radius); margin-bottom: 26px; }
.article-content { font-size: 1.02rem; }
.article-content img { border-radius: 10px; margin: 18px 0; }
.article-content h2, .article-content h3 { color: var(--ink); margin-top: 1.6em; }
.article-content p { margin: 1em 0; }
.article-content blockquote {
  border-left: 4px solid var(--green); margin: 1.4em 0; padding: 4px 18px;
  color: var(--muted); background: #f0f6f0; border-radius: 0 10px 10px 0;
}
.related { margin-top: 48px; }
.related h2 { font-size: 1.2rem; }

.back-link { display: inline-block; margin-bottom: 18px; font-size: 0.9rem; }

/* footer */
.site-footer {
  background: var(--ink); color: #9aa39c; text-align: center;
  padding: 26px 0; font-size: 0.85rem;
}
.site-footer a { color: #cfe9cf; }

@media (max-width: 560px) {
  .hero h1 { font-size: 1.5rem; }
  .site-header nav a { margin-left: 12px; font-size: 0.85rem; }
}
