/* Pata de Pato — Design System & Editorial Styling */
:root {
  --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border-light: #E2E8F0;
  --border-hover: #CBD5E1;
  --brand-primary: #2563EB;
  --brand-hover: #1D4ED8;
  --brand-accent: #E06D53;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --content-width: 1200px;
  --article-width: 740px;
}

[data-theme="dark"] {
  --bg-main: #0B0F19;
  --bg-card: #131B2E;
  --bg-elevated: #1E293B;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-light: #1E293B;
  --border-hover: #334155;
  --brand-primary: #3B82F6;
  --brand-hover: #60A5FA;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
img { max-width: 100%; height: auto; display: block; }

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563EB, #06B6D4);
  width: 0%;
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  width: 100%;
}
[data-theme="dark"] .site-header {
  background-color: rgba(19, 27, 46, 0.92);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-icon { font-size: 1.4rem; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-menu::-webkit-scrollbar { display: none; }

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--brand-primary);
  background-color: rgba(37, 99, 235, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.search-trigger-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.search-kbd {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-weight: 600;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
  border-color: var(--border-hover);
  transform: rotate(15deg);
}
[data-theme="dark"] .light-icon { display: inline-block; }
[data-theme="dark"] .dark-icon { display: none; }
:root:not([data-theme="dark"]) .light-icon { display: none; }
:root:not([data-theme="dark"]) .dark-icon { display: inline-block; }

.mobile-menu-btn {
  display: none;
}
.mobile-drawer-backdrop {
  display: none;
}

/* Hero Section */
.hero-section {
  padding: 32px 20px 20px;
  max-width: var(--content-width);
  margin: 0 auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: 200px 200px;
  gap: 18px;
  height: 420px;
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: block;
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
}
.hero-lead { grid-row: span 2; }
.hero-card-img { width: 100%; height: 100%; position: absolute; inset: 0; }
.hero-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.hero-card:hover .hero-card-img img { transform: scale(1.05); }

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.1) 0%, rgba(15,23,42,0.85) 100%);
  pointer-events: none;
}
.hero-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  z-index: 2;
  color: #FFFFFF;
}
.hero-lead .hero-card-title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 10px 0 6px;
  word-break: keep-all;
}
.hero-sub .hero-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 6px 0 4px;
  word-break: keep-all;
}
.hero-card-date { font-size: 0.85rem; opacity: 0.85; }

.category-pill {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Category Filter Bar */
.filter-bar-wrap {
  padding: 20px 0 16px;
  position: sticky;
  top: 64px;
  z-index: 40;
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
}
.filter-tabs-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 4px 4px;
  -webkit-overflow-scrolling: touch;
}
.filter-tabs-scroll::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.filter-tab:hover, .filter-tab.active {
  background: var(--text-primary);
  color: var(--bg-main);
  border-color: var(--text-primary);
}
.tab-count { font-size: 0.75rem; opacity: 0.7; margin-left: 4px; }

/* Stream Section */
.stream-section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px 60px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.card-image-link {
  display: block;
  overflow: hidden;
  height: 200px;
  background: var(--border-light);
  position: relative;
}
.card-thumb { width: 100%; height: 100%; }
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.post-card:hover .card-thumb img { transform: scale(1.04); }

/* Editorial Cover Fallback for posts without images */
.card-thumb-editorial {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.editorial-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 800;
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.editorial-title-snip {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  z-index: 2;
}
.editorial-watermark {
  position: absolute;
  bottom: -6px;
  right: 12px;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
  opacity: 0.06;
  letter-spacing: -0.04em;
  user-select: none;
}

.card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.category-pill-sm {
  font-size: 0.78rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; border: 1px solid;
}
.card-date { font-size: 0.8rem; color: var(--text-muted); }

.card-title {
  font-size: 1.15rem; font-weight: 700; line-height: 1.4; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: keep-all;
}
.card-title a:hover { color: var(--brand-primary); }

.card-excerpt {
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: auto;
  word-break: keep-all;
}

/* Load More Button */
.load-more-wrap {
  text-align: center;
  margin: 48px 0;
}
.btn-load-more {
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.btn-load-more:hover {
  background: var(--brand-primary);
  color: #FFF;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

/* Article Page */
.article-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.article-container {
  max-width: var(--article-width);
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--brand-primary); }

.article-header { margin-bottom: 28px; }
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid;
  margin-bottom: 14px;
}
.article-title {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  word-break: keep-all;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

/* TOC Box */
.article-toc-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0 36px;
  box-shadow: var(--shadow-sm);
}
.toc-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.toc-main { font-weight: 600; font-size: 0.95rem; }
.toc-sub { font-size: 0.88rem; color: var(--text-secondary); padding-left: 16px; }
.toc-list a:hover { color: var(--brand-primary); text-decoration: underline; }

/* Article Typography */
.article-content {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text-primary);
  word-break: keep-all;
  overflow-wrap: break-word;
}
.article-content p { margin: 1.4em 0; }
.article-h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 2.2em 0 0.8em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
  line-height: 1.35;
  word-break: keep-all;
}
.article-h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.8em 0 0.6em;
  line-height: 1.4;
  word-break: keep-all;
}
.article-lead-figure {
  margin: 0 0 32px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 100% !important;
}
.article-lead-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.lead-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 12px;
  background: var(--bg-card);
}

.article-content figure {
  margin: 2.2em 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 100% !important;
}
.article-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 12px;
  background: var(--bg-card);
}
.article-content ul, .article-content ol {
  margin: 1.2em 0;
  padding-left: 24px;
}
.article-content li { margin-bottom: 0.4em; }
.article-content blockquote {
  border-left: 4px solid var(--brand-primary);
  padding: 12px 20px;
  margin: 1.8em 0;
  background: var(--bg-card);
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  display: table;
}
.article-content th, .article-content td {
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  text-align: left;
}
.article-content th { background: var(--bg-card); font-weight: 700; }

/* Ad Boxes */
/* Ad Boxes - Clean & Non-intrusive */
.article-ad-box {
  margin: 40px auto;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
}
.ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  opacity: 0.6;
}

/* Share Bar */
.article-share-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin: 40px 0;
}
.btn-share {
  padding: 8px 18px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.btn-share:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Related Posts */
.related-section { margin-top: 48px; }
.section-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
}
.related-thumb { height: 130px; overflow: hidden; background: var(--border-light); }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.related-card:hover .related-thumb img { transform: scale(1.05); }
.related-meta { padding: 12px; }
.related-date { font-size: 0.75rem; color: var(--text-muted); }
.related-title {
  font-size: 0.95rem; font-weight: 700; line-height: 1.4; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Category Page Hero */
.category-hero {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: #FFFFFF;
  padding: 50px 20px;
  text-align: center;
  margin-bottom: 30px;
}
.cat-pill-large {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.cat-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 8px; }
.cat-subtitle { font-size: 1.05rem; opacity: 0.8; }

/* Search Modal */
.search-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px;
}
.search-modal-card {
  width: 90%; max-width: 600px; max-height: 80vh;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; overflow: hidden;
}
.search-input-wrap {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--border-light); gap: 12px;
}
.search-input {
  flex-grow: 1; border: none; background: transparent;
  font-size: 1.05rem; font-family: inherit; color: var(--text-primary); outline: none;
}
.search-close-btn {
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted);
}
.search-results-list {
  padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
}
.search-item {
  padding: 12px 14px; border-radius: var(--radius-md); display: block;
}
.search-item:hover { background: rgba(37, 99, 235, 0.08); }
.search-item-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.search-item-excerpt { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 48px 20px 24px;
}
.footer-inner {
  max-width: var(--content-width); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.footer-logo { font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.footer-tagline { font-size: 0.9rem; color: var(--text-secondary); max-width: 320px; }
.footer-links { display: flex; gap: 48px; }
.footer-heading { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.footer-column { display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.footer-column a:hover { color: var(--brand-primary); }
.footer-bottom {
  max-width: var(--content-width); margin: 36px auto 0;
  padding-top: 20px; border-top: 1px solid var(--border-light);
  text-align: center; font-size: 0.82rem; color: var(--text-muted);
}

/* ========================================================
   📱 MOBILE & TABLET RESPONSIVE PERFECTION (ANTI-SLOP)
   ======================================================== */
@media (max-width: 900px) {
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: auto;
  }
  .hero-card {
    height: 240px;
  }
}

@media (max-width: 768px) {
  /* Header Mobile */
  .header-inner {
    height: 58px;
    padding: 0 16px;
    gap: 8px;
  }
  .brand-logo {
    font-size: 1.15rem;
    gap: 6px;
  }
  .nav-menu {
    display: none !important; /* Hide desktop nav menu in mobile header to prevent overflow */
  }
  .search-trigger-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .search-btn-label, .search-kbd {
    display: none !important;
  }
  .theme-toggle-btn {
    width: 38px;
    height: 38px;
  }

  /* Mobile Menu Button */
  .mobile-menu-btn {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
  }
  .mobile-menu-btn:hover {
    border-color: var(--border-hover);
  }
  .mobile-menu-btn .bar {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
  }

  /* Mobile Drawer Backdrop & Panel */
  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: flex-end;
  }
  .mobile-drawer-panel {
    width: 82%;
    max-width: 320px;
    height: 100%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: -8px 0 25px rgba(0, 0, 0, 0.25);
    animation: drawerSlide 0.22s ease-out;
  }
  @keyframes drawerSlide {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
  }
  .drawer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 800;
  }
  .drawer-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 50%;
  }
  .drawer-close-btn:hover {
    color: var(--text-primary);
    background: var(--border-light);
  }
  .drawer-subhead {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 6px;
  }
  .drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
  }
  .drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.15s ease;
  }
  .drawer-link:hover, .drawer-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-primary);
  }
  .drawer-cat-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    background: var(--border-light);
    color: var(--text-secondary);
  }

  /* Filter bar */
  .filter-bar-wrap {
    top: 58px;
    padding: 12px 16px 10px;
    margin-bottom: 20px;
  }
  .filter-tab {
    padding: 6px 14px;
    font-size: 0.85rem;
  }

  /* Hero Mobile */
  .hero-section {
    padding: 16px 16px 8px;
  }
  .hero-card {
    height: 210px;
    border-radius: 14px;
  }
  .hero-card-content {
    padding: 16px;
  }
  .hero-lead .hero-card-title {
    font-size: 1.25rem;
    line-height: 1.35;
    margin: 6px 0;
  }
  .hero-sub .hero-card-title {
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 4px 0;
  }

  /* Stream / Posts Grid */
  .stream-section {
    padding: 0 16px 40px;
  }
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .post-card {
    border-radius: 14px;
  }
  .card-image-link {
    height: 190px;
  }
  .card-body {
    padding: 16px;
  }
  .card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 8px;
  }
  .card-excerpt {
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
  }

  /* Article Page Mobile */
  .article-wrapper {
    padding: 16px 16px 60px;
  }
  .article-header {
    margin-bottom: 20px;
  }
  .article-title {
    font-size: 1.55rem;
    line-height: 1.35;
    margin-bottom: 12px;
  }
  .article-meta {
    font-size: 0.85rem;
    gap: 6px;
  }
  .article-toc-box {
    padding: 14px 16px;
    margin: 18px 0 24px;
    border-radius: 10px;
  }
  .toc-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  .toc-main {
    font-size: 0.88rem;
  }
  .toc-sub {
    font-size: 0.82rem;
    padding-left: 12px;
  }
  .article-content {
    font-size: 1.05rem;
    line-height: 1.8;
  }
  .article-h2 {
    font-size: 1.35rem;
    margin: 1.8em 0 0.6em;
  }
  .article-h3 {
    font-size: 1.18rem;
    margin: 1.5em 0 0.5em;
  }
  .article-content figure {
    margin: 1.5em 0;
    width: 100% !important;
    max-width: 100% !important;
  }
  .article-content img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 10px;
  }
  .article-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.88rem;
  }
  .article-ad-box {
    margin: 28px auto;
    padding: 0;
  }
  .article-share-bar {
    margin: 28px 0;
    padding: 18px 0;
    justify-content: center;
  }
  .related-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .related-thumb {
    height: 110px;
  }

  /* Category Hero Mobile */
  .category-hero {
    padding: 36px 16px;
    margin-bottom: 20px;
  }
  .cat-title {
    font-size: 1.65rem;
  }
  .cat-subtitle {
    font-size: 0.95rem;
  }

  /* Footer Mobile */
  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }
  .footer-links {
    flex-direction: column;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 12px;
  }
  .brand-logo {
    font-size: 1.08rem;
  }
  .hero-section {
    padding: 12px 12px 6px;
  }
  .hero-card {
    height: 195px;
  }
  .hero-card-content {
    padding: 14px;
  }
  .hero-lead .hero-card-title {
    font-size: 1.15rem;
  }
  .stream-section {
    padding: 0 12px 36px;
  }
  .article-wrapper {
    padding: 14px 12px 50px;
  }
  .article-title {
    font-size: 1.45rem;
  }
}
