/* ===== Design tokens ===== */
:root {
  --ink: #171a21;
  --ink-soft: #454a56;
  --muted: #767c8a;
  --line: #e7e8ee;
  --paper: #ffffff;
  --bg: #f6f7fb;
  --accent: #5ddd33;
  --accent-dark: #46b322;
  --accent-soft: #eafce2;
  --header-bg: #1f2024;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(18, 20, 28, 0.07);
  --shadow-hover: 0 16px 40px rgba(18, 20, 28, 0.12);
  --font-head: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f0f1f5;
    --ink-soft: #cfd2dc;
    --muted: #9aa0b2;
    --line: #2a2d3a;
    --paper: #1a1c26;
    --bg: #121319;
    --accent: #ff4d6a;
    --accent-dark: #ff7a90;
    --accent-soft: #2c1620;
    --header-bg: #0b0c12;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.25; margin: 0 0 12px; color: var(--ink); }
p { margin: 0 0 14px; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1220px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: 10px 16px; z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ===== Topbar ===== */
.topbar { background: var(--header-bg); color: #c7cad6; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.topbar-tagline { color: var(--accent); font-weight: 600; letter-spacing: 0.02em; }

/* ===== Header ===== */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 16px; }
.logo { font-family: var(--font-head); font-weight: 900; font-size: 26px; letter-spacing: -0.01em; }
.logo::first-letter { color: var(--accent); }
.logo--image { display: block; }
.logo--image img { display: block; height: 48px; width: auto; }
.footer-brand .logo--image img { height: 32px; }

.header-search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; background: var(--bg); }
.header-search input { border: 0; background: transparent; padding: 9px 14px; width: 200px; font: inherit; color: var(--ink); outline: none; }
.header-search button { border: 0; background: transparent; padding: 9px 14px; font-size: 15px; }

.nav-toggle { display: none; flex-direction: column; gap: 4px; border: 0; background: none; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); display: block; }

.site-nav { background: var(--header-bg); }
.nav-wrap { display: flex; align-items: center; }
.site-nav ul { display: flex; flex-wrap: nowrap; align-items: stretch; margin: 0; padding: 0; list-style: none; }
#primaryNavList { flex: 1 1 auto; min-width: 0; }
.nav-more { position: relative; }
.site-nav li { flex: 0 0 auto; white-space: nowrap; }
.site-nav a { display: block; padding: 13px 16px; color: #e7e8ee; font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.site-nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.site-nav a.active { background: var(--accent); color: #171a21; }

.header-search { flex: 0 0 auto; height: 38px; margin-left: 18px; }
.header-search input { width: 150px; }

.nav-wrap { position: relative; }
.nav-more-toggle { display: flex; align-items: center; gap: 4px; height: 100%; padding: 13px 16px; border: 0; background: transparent; color: #e7e8ee; font: inherit; font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; }
.nav-more-toggle:hover, .nav-more.open .nav-more-toggle { color: #fff; background: rgba(255,255,255,0.06); }
.nav-more .nav-more-menu {
  display: block;
  position: absolute; top: 100%; right: 0; min-width: 200px;
  background: var(--paper); border-radius: 0 0 10px 10px; box-shadow: var(--shadow-hover);
  overflow: hidden; z-index: 60; padding: 0; margin: 0; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav-more-menu.open,
.nav-more:hover .nav-more-menu,
.nav-more:focus-within .nav-more-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-more-menu li { display: block; width: 100%; }
.nav-more-menu a { color: var(--ink); padding: 11px 18px; font-size: 13px; text-transform: none; letter-spacing: normal; }
.nav-more-menu a:hover { background: var(--accent-soft); color: var(--accent); }

/* ===== Hero ===== */
.hero-section { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; margin: 28px auto; }
.hero-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--accent-soft); }
.hero-thumb img { width: 100%; height: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hero-thumb .post-card-placeholder { width: 100%; height: 100%; font-size: 56px; }
.hero-body { padding: 24px 26px 28px; }
.hero-body h1 { font-size: clamp(24px, 3vw, 34px); margin: 10px 0; }
.hero-body h1 a:hover { color: var(--accent); }
.hero-body p { color: var(--ink-soft); }

.hero-side { display: flex; flex-direction: column; gap: 14px; }
.hero-side-item { display: grid; grid-template-columns: 90px 1fr; gap: 12px; background: var(--paper); border-radius: 10px; padding: 10px; box-shadow: var(--shadow); align-items: center; }
.hero-side-item img { border-radius: 6px; aspect-ratio: 4/3; object-fit: cover; }
.hero-side-cat { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.04em; }
.hero-side-item strong { display: block; font-size: 13.5px; line-height: 1.35; margin-top: 3px; }
.hero-side-item:hover strong { color: var(--accent); }

/* ===== Homepage sections ===== */
.home-section { margin: 40px auto; }
.home-section-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }
.home-section-head h2 { margin: 0; font-size: 21px; }
.view-all { color: var(--accent); font-weight: 700; font-size: 13px; white-space: nowrap; }

/* ===== Post grid / cards ===== */
.post-grid { display: flex; flex-wrap: wrap; gap: 22px; }
.post-grid--3 > .post-card { flex: 0 1 calc((100% - 44px) / 3); min-width: 240px; }
.post-grid--4 > .post-card { flex: 0 1 calc((100% - 66px) / 4); min-width: 200px; }

.post-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; display: flex; flex-direction: column; height: 100%; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-card-thumb { display: block; background: var(--accent-soft); aspect-ratio: 16/10; overflow: hidden; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-placeholder { display: grid; place-items: center; width: 100%; height: 100%; font: 900 40px var(--font-head); color: var(--accent); }
.post-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.post-card-category { color: var(--accent); font-weight: 800; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; align-self: flex-start; }
.post-card-title { font-size: 17px; margin: 0 0 8px; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt { color: var(--ink-soft); font-size: 14px; flex: 1; }
.post-card-meta { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; margin-top: auto; }
.post-card--compact .post-card-title { font-size: 15px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.post-card--compact .post-card-excerpt { display: none; }

/* ===== Page banner ===== */
.page-banner { padding: 38px 20px 26px; }
.page-banner .eyebrow { color: var(--accent); font-weight: 800; letter-spacing: 0.1em; font-size: 11px; text-transform: uppercase; }
.page-banner h1 { margin: 8px 0; font-size: clamp(28px, 4vw, 40px); }
.page-banner p { color: var(--muted); max-width: 640px; }

.list-page-head { padding: 34px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.list-page-head h1 { margin: 0 0 8px; font-size: clamp(26px, 3.6vw, 36px); }
.list-page-head p { margin: 0; color: var(--muted); max-width: 640px; }

/* ===== Content layout with sidebar ===== */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; padding-bottom: 60px; }
.content-main { min-width: 0; }

.empty-state { text-align: center; background: var(--paper); border-radius: var(--radius); padding: 60px 24px; box-shadow: var(--shadow); }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); }

/* ===== Sidebar ===== */
.sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 22px; }
.widget { background: var(--paper); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 14px; font-family: var(--font-body); font-weight: 800; }
.widget-search form { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.widget-search input { flex: 1; min-width: 0; border: 0; padding: 10px 12px; font: inherit; outline: none; }
.widget-search button { border: 0; background: var(--accent); color: #fff; padding: 0 16px; font-weight: 700; font-size: 13px; }

.recent-post { display: grid; grid-template-columns: 72px 1fr; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent-post:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-post img { border-radius: 6px; object-fit: cover; aspect-ratio: 4/3; }
.recent-post-noimg { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; border-radius: 6px; aspect-ratio: 4/3; }
.recent-post strong { display: block; font-size: 13px; line-height: 1.35; }
.recent-post small { color: var(--muted); font-size: 11px; }
.recent-post:hover strong { color: var(--accent); }

.widget-categories li { border-bottom: 1px solid var(--line); }
.widget-categories li:last-child { border-bottom: 0; }
.widget-categories a { display: block; padding: 9px 2px; font-size: 14px; font-weight: 600; }
.widget-categories a:hover { color: var(--accent); }

/* ===== Pagination ===== */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 34px 0 10px; }
.pagination a, .pagination span { padding: 9px 14px; border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); font-weight: 700; font-size: 13.5px; }
.pagination a.active { background: var(--accent); color: #fff; }
.pagination a:hover:not(.active) { background: var(--accent-soft); color: var(--accent); }

/* ===== Article page ===== */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; padding: 32px 20px 60px; align-items: start; }
.article-header { margin-bottom: 20px; }
.article-header h1 { font-size: clamp(26px, 4vw, 42px); margin: 10px 0 12px; }
.article-excerpt { color: var(--ink-soft); font-size: 17px; }
.article-featured { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }

.article-content { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 38px; font-size: 17px; line-height: 1.85; color: var(--ink-soft); }
.article-content > *:first-child { margin-top: 0; }
.article-content h2 { font-size: 27px; margin-top: 34px; color: var(--ink); }
.article-content h3 { font-size: 21px; margin-top: 26px; color: var(--ink); }
.article-content p { margin: 0 0 16px; }
.article-content ul, .article-content ol { padding-left: 22px; margin: 0 0 16px; }
.article-content li { margin: 6px 0; }
.article-content a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.article-content img { border-radius: 10px; margin: 22px auto; }
.article-content blockquote { margin: 26px 0; padding: 18px 22px; background: var(--accent-soft); border-left: 4px solid var(--accent); color: var(--ink); font-style: italic; }
.article-content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.article-content td, .article-content th { border: 1px solid var(--line); padding: 10px; text-align: left; }
.article-content th { background: var(--bg); }

.article-video { position: relative; padding-top: 56.25%; margin: 26px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.article-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.article-tags a { background: var(--accent-soft); color: var(--accent); padding: 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700; }
.article-tags a:hover { background: var(--accent); color: #fff; }

.article-faq, .article-products, .article-cta, .article-related {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 32px; margin-top: 26px;
}
.article-faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.article-faq details:first-of-type { border-top: 0; }
.article-faq summary { font-weight: 700; cursor: pointer; }
.article-faq p { color: var(--ink-soft); margin: 10px 0 0; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.product-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.product-card img { border-radius: 8px; margin: 0 auto 10px; }
.product-price { display: block; margin-top: 8px; color: var(--accent); font-weight: 800; }

.article-cta { background: linear-gradient(120deg, var(--accent-dark), var(--accent)); color: #fff; text-align: center; }
.article-cta h2 { color: #fff; }
.article-cta a { display: inline-block; background: #fff; color: var(--accent-dark); font-weight: 800; padding: 12px 26px; border-radius: 8px; margin-top: 10px; }

/* ===== Footer ===== */
.site-footer { background: var(--header-bg); color: #c7cad6; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; padding: 44px 20px 24px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { color: #c7cad6; }
.footer-brand p { color: #9ea3b3; margin-top: 10px; font-size: 14px; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-col li { margin-bottom: 9px; font-size: 14px; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 20px; font-size: 12.5px; color: #8b90a1; text-align: center; }
.footer-bottom a { color: #c7cad6; font-weight: 600; }
.footer-bottom a:hover { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-section { grid-template-columns: 1fr; }
  .content-layout, .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post-grid--4 > .post-card, .post-grid--3 > .post-card { flex: 0 1 calc((100% - 22px) / 2); min-width: 200px; }
  .article-content { padding: 26px 22px; }
}

@media (max-width: 700px) {
  .topbar-tagline { display: none; }
  .header-search input { width: 130px; }
  .nav-toggle { display: flex; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .nav-wrap { flex-direction: column; align-items: stretch; }
  .site-nav ul { flex-direction: column; flex-wrap: wrap; overflow: visible; }
  .site-nav li { white-space: normal; }
  .nav-more { display: none; }
  .header-search { margin: 8px 0; width: 100%; height: auto; }
  .header-search input { width: 100%; }
  .post-grid--4 > .post-card, .post-grid--3 > .post-card { flex-basis: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-side-item strong { font-size: 13px; }
}

@media (max-width: 480px) {
  .header-search { display: none; }
}
