/* ─── Brand ─────────────────────────────────────────────────────────────── */
:root {
  --brand:        #2FC076;   /* Pagewiz green — accent only */
  --brand-dark:   #25a062;
  --blue:         #1a8cff;   /* Blue accent for links / highlights */
  --blue-light:   #e8f4ff;   /* Very light blue tint */
  --text:         #1a2332;
  --muted:        #6b7280;
  --bg:           #ffffff;
  --white:        #ffffff;
  --border:       #e5e7eb;
  --sidebar-w:    260px;
  --radius:       8px;
  --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.65; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ─── Header — white, logo visible ──────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 30px; }
.header-nav { display: flex; align-items: center; gap: 20px; }
.header-nav a { color: var(--text); font-size: .9rem; }
.header-nav a:hover { color: var(--blue); text-decoration: none; }
.btn-header {
  background: var(--brand); color: #fff !important;
  padding: 6px 18px; border-radius: 20px;
  font-weight: 600; font-size: .85rem;
}
.btn-header:hover { background: var(--brand-dark); text-decoration: none; }

/* ─── Hero — background image, title right-aligned ──────────────────────── */
.hero {
  background: url('./images/hero.jpg') top center/cover no-repeat;
  border-bottom: 1px solid var(--border);
  padding: 52px 0 44px;
}
.hero .container { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.hero h1 {
  font-size: 2rem; font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.45);
}

/* ─── Search input in hero ───────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  width: 100%; max-width: 560px;
  display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 16px;
  font-size: 1rem; color: #999; pointer-events: none;
}
#search-input {
  width: 100%;
  background: rgba(255,255,255,0.95);
  border: none; outline: none;
  border-radius: 8px;
  padding: 14px 44px 14px 42px;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  color: var(--text);
  font-family: var(--font);
}
#search-input::placeholder { color: #999; }
#search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 14px;
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: #999; line-height: 1;
  padding: 4px;
}
.search-clear:hover { color: var(--text); }

/* ─── Search results panel (white, below hero) ───────────────────────────── */
.search-results-panel {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 48px;
}
.search-result-item {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover .search-result-title { color: var(--blue); }
.search-result-title { font-weight: 600; font-size: 1rem; color: var(--text); margin-bottom: 4px; }
.search-result-excerpt { font-size: .875rem; color: var(--muted); line-height: 1.55; }
.search-result-excerpt mark { background: #fff3b0; color: inherit; border-radius: 2px; padding: 0 2px; }
.search-empty { color: var(--muted); font-size: .95rem; padding: 20px 0; }

/* ─── Breadcrumbs ────────────────────────────────────────────────────────── */
.breadcrumbs {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 10px 0; font-size: .85rem; color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs span { margin: 0 6px; }

/* ─── Main layout ────────────────────────────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 40px;
  padding-top: 36px;
  padding-bottom: 60px;
  align-items: start;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 72px; }
.sidebar-category { margin-bottom: 20px; }
.sidebar-category > a {
  display: block; font-weight: 600; font-size: .9rem;
  color: var(--text); padding: 4px 0;
  border-left: 3px solid transparent;
}
.sidebar-category.active > a {
  color: var(--blue);
  border-left-color: var(--blue);
  padding-left: 10px;
}
.sidebar-sections { list-style: none; margin-top: 6px; padding-left: 12px; }
.sidebar-sections li a {
  display: block; padding: 4px 8px; font-size: .875rem;
  color: var(--muted); border-radius: 4px;
}
.sidebar-sections li a:hover { color: var(--blue); text-decoration: none; background: var(--blue-light); }
.sidebar-sections li.active > a { color: var(--blue); font-weight: 500; }

.sidebar-articles { list-style: none; margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--border); }
.sidebar-articles li a {
  display: block; padding: 3px 8px; font-size: .82rem;
  color: var(--text); border-radius: 4px;
}
.sidebar-articles li a:hover { color: var(--blue); background: var(--blue-light); }
.sidebar-articles li.active a { color: var(--blue); font-weight: 600; }

/* ─── Content area ───────────────────────────────────────────────────────── */
.content { min-width: 0; }

/* ─── Page header ────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 32px; padding-bottom: 20px; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.page-header .lead { color: var(--muted); margin-top: 8px; font-size: 1.05rem; }
.section-meta { font-size: .8rem; color: var(--brand); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }

/* ─── Section blocks (category page) ────────────────────────────────────── */
.section-block {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px;
  margin-bottom: 20px;
}
.section-block h2 { font-size: 1.1rem; margin-bottom: 14px; }
.section-block h2 a { color: var(--text); }
.section-block h2 a:hover { color: var(--blue); text-decoration: none; }

/* ─── Article lists ──────────────────────────────────────────────────────── */
.article-list { list-style: none; }
.article-list li { border-bottom: 1px solid var(--border); }
.article-list li:last-child { border-bottom: none; }
.article-list li a { display: block; padding: 8px 0; font-size: .9rem; color: var(--muted); }
.article-list li a:hover { color: var(--blue); text-decoration: none; }

.article-list--lg li a {
  padding: 12px 16px; border-radius: 6px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px;
  font-size: .95rem; color: var(--text);
  background: var(--white); border: 1px solid var(--border);
}
.article-list--lg li a:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.article-list--lg { border: none !important; }
.article-list--lg li { border: none !important; }

/* ─── Article ────────────────────────────────────────────────────────────── */
.article-header { margin-bottom: 28px; padding-bottom: 20px; }
.article-meta { font-size: .8rem; color: var(--brand); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.article-header h1 { font-size: 1.75rem; font-weight: 700; }

.article-body { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 36px; }
.article-body h2 { font-size: 1.2rem; margin: 28px 0 12px; }
.article-body h3 { font-size: 1.05rem; margin: 24px 0 10px; }
.article-body p  { margin-bottom: 14px; }
.article-body ul, .article-body ol { margin: 12px 0 16px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body img { margin: 20px 0; }
.article-body code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: .875em; }
.article-body pre  { background: #1e1e2e; color: #cdd6f4; padding: 20px; border-radius: var(--radius); overflow-x: auto; margin: 16px 0; }
.article-body a { color: var(--blue); font-weight: 500; }
.article-body strong { font-weight: 600; }
.article-body blockquote { border-left: 4px solid var(--blue); background: var(--blue-light); padding: 12px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; }

.article-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .875rem; color: var(--muted); }
.article-footer a { color: var(--blue); }

/* ─── Home page (category grid) ─────────────────────────────────────────── */
.home-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.cat-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; transition: box-shadow .2s, border-color .2s;
}
.cat-card:hover { box-shadow: 0 4px 16px rgba(26,140,255,.1); border-color: var(--blue); text-decoration: none; }
.cat-card h2 { font-size: 1.1rem; color: var(--text); margin-bottom: 6px; }
.cat-card p  { font-size: .875rem; color: var(--muted); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: #f0f2f5; border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 24px 0; font-size: .85rem; text-align: center;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--blue); }

/* ─── Video embeds ───────────────────────────────────────────────────────── */
.video-embed { margin: 20px 0; }
.video-embed iframe { max-width: 100%; display: block; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero h1 { font-size: 1.4rem; }
  .article-body { padding: 20px; }
}
