/* ─── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --accent: #f59e0b;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all .2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary-light: #1e3a8a;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.3);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .3s, color .3s;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: var(--font); }

/* ─── Typography ─────────────────────────────────────────────────────────────── */
h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: clamp(1rem, 2vw, 1.375rem); font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.125rem; font-weight: 600; }

/* ─── Utilities ──────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-sm { font-size: .875rem; } .text-xs { font-size: .75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: .25rem .625rem;
  border-radius: 9999px; font-size: .75rem; font-weight: 600;
  white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: #fef3c7; color: #d97706; }
.badge-gray { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red { background: #fee2e2; color: #dc2626; }

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.25rem; border-radius: var(--radius); font-size: .9375rem;
  font-weight: 600; border: none; transition: var(--transition); white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text); }
.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn-lg { padding: .875rem 2rem; font-size: 1rem; }
.btn-icon { padding: .5rem; border-radius: var(--radius); }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-body { padding: 1.25rem; }

/* ─── Article Card ───────────────────────────────────────────────────────────── */
.article-card { display: flex; flex-direction: column; height: 100%; }
.article-card .card-img {
  position: relative; overflow: hidden; aspect-ratio: 16/9; background: var(--bg-secondary);
}
.article-card .card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.article-card:hover .card-img img { transform: scale(1.04); }
.article-card .card-img .badge-cat {
  position: absolute; top: .75rem; left: .75rem;
}
.article-card .card-body { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.article-card .card-title { font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--text); }
.article-card .card-title:hover { color: var(--primary); }
.article-card .card-excerpt { font-size: .875rem; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.article-card .card-meta {
  display: flex; align-items: center; gap: .75rem;
  font-size: .75rem; color: var(--text-muted); margin-top: auto; padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.article-card .card-meta .dot::before { content: '·'; margin-right: .75rem; }

/* Article Card Horizontal */
.article-card-h { display: flex; gap: 1rem; align-items: flex-start; }
.article-card-h .card-img-h { width: 120px; min-width: 120px; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; }
.article-card-h .card-img-h img { width: 100%; height: 100%; object-fit: cover; }
.article-card-h .card-body-h { flex: 1; }
.article-card-h .card-title-h { font-size: .9375rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.article-card-h .card-title-h:hover { color: var(--primary); }
.article-card-h .card-meta-h { font-size: .75rem; color: var(--text-muted); margin-top: .375rem; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
#site-header {
  background: var(--bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-top { display: flex; align-items: center; justify-content: space-between; padding: .875rem 0; }
.logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.logo img { height: 36px; width: auto; }
.logo-text { font-size: 1.375rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.logo-text span { color: var(--text); }
.header-search { flex: 1; max-width: 400px; margin: 0 1.5rem; position: relative; }
.header-search input {
  width: 100%; padding: .5rem 1rem .5rem 2.5rem;
  border: 1.5px solid var(--border); border-radius: 9999px;
  background: var(--bg-secondary); color: var(--text); font-size: .875rem;
  transition: var(--transition);
}
.header-search input:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.header-search .search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.theme-toggle { background: var(--bg-secondary); border: 1.5px solid var(--border); color: var(--text); width: 36px; height: 36px; border-radius: 9999px; font-size: 1rem; }
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* Nav */
.header-nav { border-top: 1px solid var(--border); }
.nav-list { display: flex; gap: 0; list-style: none; }
.nav-list li a {
  display: block; padding: .625rem 1rem; font-size: .9375rem; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent; transition: var(--transition);
}
.nav-list li a:hover, .nav-list li a.active { color: var(--primary); border-bottom-color: var(--primary); }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; padding: .25rem; }

/* ─── Hero / Featured ────────────────────────────────────────────────────────── */
.hero-featured {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 16/7; background: var(--bg-secondary);
}
.hero-featured img { width: 100%; height: 100%; object-fit: cover; }
.hero-featured .hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 50%, transparent 100%);
}
.hero-featured .hero-content {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 2rem;
  color: #fff;
}
.hero-featured .hero-cat { background: var(--primary); color: #fff; }
.hero-featured .hero-title { font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 800; margin: .5rem 0; }
.hero-featured .hero-meta { font-size: .875rem; opacity: .8; }

/* ─── Section Headers ────────────────────────────────────────────────────────── */
.section { padding: 2.5rem 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.section-title { font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; gap: .625rem; }
.section-title::before { content: ''; width: 4px; height: 1.25em; background: var(--primary); border-radius: 2px; }
.section-link { font-size: .875rem; font-weight: 600; color: var(--primary); }
.section-link:hover { text-decoration: underline; }

/* ─── Layout: Main + Sidebar ─────────────────────────────────────────────────── */
.content-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 80px; }
.sidebar-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.sidebar-widget-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 2px solid var(--primary); }

/* ─── Tags Cloud ─────────────────────────────────────────────────────────────── */
.tags-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-chip {
  padding: .3rem .75rem; border-radius: 9999px; font-size: .8125rem; font-weight: 500;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  color: var(--text-secondary); transition: var(--transition);
}
.tag-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Pagination ─────────────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: .375rem; margin: 2rem 0; }
.page-btn {
  min-width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 600; border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text); transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ─── Breadcrumb ─────────────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .375rem; font-size: .8125rem; color: var(--text-muted); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); }

/* ─── Article Content ────────────────────────────────────────────────────────── */
.article-header { margin-bottom: 2rem; }
.article-header .article-title { font-size: clamp(1.5rem, 3.5vw, 2.5rem); font-weight: 800; margin: .75rem 0; line-height: 1.2; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; font-size: .875rem; color: var(--text-secondary); margin: 1rem 0; }
.article-meta .sep::before { content: '·'; margin: 0 .25rem; }
.article-thumbnail { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; aspect-ratio: 16/9; }
.article-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Table of Contents */
.toc {
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 2rem;
  border-left: 4px solid var(--primary);
}
.toc-title { font-weight: 700; margin-bottom: .75rem; }
.toc ul { list-style: none; display: flex; flex-direction: column; gap: .375rem; }
.toc li a { font-size: .875rem; color: var(--text-secondary); transition: var(--transition); }
.toc li a:hover { color: var(--primary); }
.toc li.toc-h3 { padding-left: 1rem; }
.toc li.toc-h4 { padding-left: 2rem; }

/* Article body */
.article-body { font-size: 1.0625rem; line-height: 1.8; color: var(--text); }
.article-body h2 { font-size: 1.625rem; font-weight: 800; margin: 2rem 0 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--border); }
.article-body h3 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 .75rem; }
.article-body h4 { font-size: 1.0625rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.article-body p { margin-bottom: 1.25rem; }
.article-body img { border-radius: var(--radius); margin: 1.5rem auto; box-shadow: var(--shadow-md); }
.article-body figure { margin: 1.5rem 0; }
.article-body figcaption { text-align: center; font-size: .8125rem; color: var(--text-muted); margin-top: .5rem; }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body blockquote {
  border-left: 4px solid var(--primary); padding: 1rem 1.5rem;
  background: var(--bg-secondary); border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0; color: var(--text-secondary); font-style: italic;
}
.article-body pre {
  background: #1e293b; color: #e2e8f0; padding: 1.25rem; border-radius: var(--radius);
  overflow-x: auto; font-family: var(--font-mono); font-size: .875rem; margin: 1.5rem 0;
}
.article-body code { font-family: var(--font-mono); font-size: .875em; background: var(--bg-secondary); padding: .15em .375em; border-radius: 4px; }
.article-body pre code { background: none; padding: 0; font-size: inherit; }
.article-body ul, .article-body ol { margin: 1rem 0 1.25rem 1.5rem; }
.article-body li { margin-bottom: .375rem; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.article-body th, .article-body td { padding: .625rem 1rem; border: 1px solid var(--border); text-align: left; }
.article-body th { background: var(--bg-secondary); font-weight: 700; }
.article-body iframe { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); }
.article-body hr { border: none; border-top: 2px solid var(--border); margin: 2rem 0; }

/* Info/Warning boxes */
.info-box, .warning-box {
  padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1.5rem 0;
  display: flex; gap: .75rem; align-items: flex-start;
}
.info-box { background: #dbeafe; border-left: 4px solid #2563eb; color: #1e3a8a; }
.warning-box { background: #fef3c7; border-left: 4px solid #d97706; color: #78350f; }
.info-box .box-icon, .warning-box .box-icon { font-size: 1.25rem; flex-shrink: 0; }

/* FAQ */
.faq-item { border: 1.5px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
.faq-question { padding: 1rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--bg-secondary); }
.faq-question:hover { background: var(--border); }
.faq-answer { padding: 0 1rem; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease; }
.faq-item.open .faq-answer { max-height: 500px; padding: 1rem; }
.faq-item.open .faq-icon { transform: rotate(180deg); }
.faq-icon { transition: transform .3s; }

/* Share buttons */
.share-buttons { display: flex; gap: .75rem; flex-wrap: wrap; margin: 2rem 0; }
.share-btn { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 9999px; font-size: .875rem; font-weight: 600; border: none; color: #fff; }
.share-wa { background: #25d366; } .share-tg { background: #229ed9; } .share-fb { background: #1877f2; }
.share-btn:hover { opacity: .85; transform: translateY(-1px); }

/* Article Tags */
.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0; }
.article-tag { padding: .3rem .75rem; background: var(--bg-secondary); border: 1.5px solid var(--border); border-radius: 9999px; font-size: .8125rem; color: var(--text-secondary); transition: var(--transition); }
.article-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Comments */
.comments-section { margin-top: 3rem; }
.comments-section h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }
.comment-form { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; }
.comment-form h4 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .375rem; color: var(--text-secondary); }
.form-control {
  width: 100%; padding: .625rem .875rem; border: 1.5px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-size: .9375rem; font-family: var(--font); transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.comment-list { display: flex; flex-direction: column; gap: 1rem; }
.comment-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.comment-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .625rem; }
.comment-author { font-weight: 700; font-size: .9375rem; }
.comment-date { font-size: .75rem; color: var(--text-muted); }
.comment-text { font-size: .9375rem; color: var(--text); line-height: 1.6; }

/* ─── Search ─────────────────────────────────────────────────────────────────── */
.search-header { padding: 2rem 0; text-align: center; }
.search-input-lg { max-width: 600px; margin: 0 auto; position: relative; }
.search-input-lg input {
  width: 100%; padding: .875rem 1.25rem .875rem 3rem;
  border: 2px solid var(--primary); border-radius: 9999px;
  background: var(--bg); color: var(--text); font-size: 1.0625rem;
}
.search-input-lg input:focus { outline: none; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.search-input-lg .search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--primary); }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem; margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-brand .logo-text { font-size: 1.25rem; margin-bottom: .75rem; }
.footer-desc { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.footer-social { display: flex; gap: .625rem; margin-top: 1rem; }
.footer-social a { width: 36px; height: 36px; border-radius: 9999px; background: var(--border); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: var(--transition); }
.footer-social a:hover { background: var(--primary); color: #fff; }
.footer-col h4 { font-size: .9375rem; font-weight: 700; margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul li a { font-size: .875rem; color: var(--text-secondary); }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { font-size: .8125rem; color: var(--text-muted); }

/* ─── Ad Slots ───────────────────────────────────────────────────────────────── */
.ad-slot { text-align: center; padding: .5rem; margin: 1.25rem 0; }
.ad-slot-label { font-size: .625rem; color: var(--text-muted); margin-bottom: .25rem; letter-spacing: .08em; text-transform: uppercase; }
.ad-sticky-bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: var(--bg); border-top: 1px solid var(--border); text-align: center; padding: .5rem; }
.ad-floating { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--bg-card); border: 1px solid var(--border); overflow: hidden; }
.ad-floating .close-float { position: absolute; top: .375rem; right: .375rem; background: rgba(0,0,0,.5); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: .75rem; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }

/* ─── Cookie Consent ─────────────────────────────────────────────────────────── */
#cookie-consent {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  width: min(90vw, 560px); background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; box-shadow: var(--shadow-lg);
  z-index: 400; display: none;
}
#cookie-consent.show { display: block; }
#cookie-consent p { font-size: .875rem; color: var(--text-secondary); margin-bottom: 1rem; }
#cookie-consent .cookie-actions { display: flex; gap: .625rem; flex-wrap: wrap; }

/* ─── Bookmark ───────────────────────────────────────────────────────────────── */
.bookmark-btn { background: none; border: 2px solid var(--border); border-radius: var(--radius); padding: .5rem .875rem; font-size: .875rem; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: .375rem; transition: var(--transition); }
.bookmark-btn:hover, .bookmark-btn.active { border-color: var(--accent); color: var(--accent); }
.bookmark-btn.active { background: #fef3c7; }

/* ─── Back to Top ────────────────────────────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 5.5rem; right: 1.5rem; width: 44px; height: 44px;
  background: var(--primary); color: #fff; border-radius: 9999px; border: none;
  font-size: 1.125rem; display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); z-index: 200; transition: var(--transition);
}
#back-to-top.show { display: flex; }
#back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ─── Skeleton Loading ───────────────────────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%); background-size: 200% 100%; animation: skeleton-loading 1.4s infinite; border-radius: var(--radius); }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-title { height: 1.5rem; margin-bottom: .75rem; }
.sk-text { height: 1rem; margin-bottom: .5rem; }
.sk-text.w-75 { width: 75%; }
.sk-img { aspect-ratio: 16/9; }

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 500; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1.25rem; box-shadow: var(--shadow-lg); font-size: .9375rem;
  display: flex; align-items: center; gap: .625rem; min-width: 260px;
  animation: slideIn .25s ease;
}
.toast-success { border-left: 4px solid #16a34a; } .toast-error { border-left: 4px solid #dc2626; }
.toast-info { border-left: 4px solid var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── 404 / 500 ──────────────────────────────────────────────────────────────── */
.error-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-page .error-code { font-size: 7rem; font-weight: 900; color: var(--primary); line-height: 1; opacity: .15; }
.error-page .error-msg { font-size: 1.5rem; font-weight: 700; margin: .5rem 0 1rem; }
.error-page p { color: var(--text-secondary); margin-bottom: 2rem; }

/* ─── Maintenance ────────────────────────────────────────────────────────────── */
.maintenance-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.maintenance-icon { font-size: 5rem; margin-bottom: 1.5rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .header-search { display: none; }
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .nav-list { flex-direction: column; display: none; }
  .nav-list.open { display: flex; }
  .nav-list li a { border-bottom: 1px solid var(--border); padding: .75rem 0; border-right: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .ad-floating { bottom: 5rem; right: 1rem; }
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .article-card-h .card-img-h { width: 90px; min-width: 90px; }
}
