/* ═══════════════════════════════════════════════════════════════
   DICK網 — Main Stylesheet
   Sections: Variables → Reset → Topbar → Hero → Layout →
             Cards → Sidebar → Post-view → Tags → Footer →
             Dark Mode → Responsive
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Light theme */
  --bg:          #f5f4f0;
  --bg-2:        #eeede8;
  --surface:     rgba(255,255,255,0.72);
  --surface-2:   rgba(255,255,255,0.55);
  --border:      rgba(0,0,0,0.08);
  --border-2:    rgba(0,0,0,0.14);
  --text:        #1a1a1a;
  --text-2:      #555;
  --text-3:      #888;
  --accent:      #1a1a6e;       /* DICK navy */
  --accent-2:    #2d2db5;
  --accent-rgb:  26,26,110;
  --tag-bg:      rgba(26,26,110,0.08);
  --tag-hover:   rgba(26,26,110,0.16);
  --code-bg:     #1e1e2e;
  --code-text:   #cdd6f4;
  --shadow:      0 4px 32px rgba(0,0,0,0.08);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.14);
  --blur:        saturate(180%) blur(16px);
  --radius:      12px;
  --radius-sm:   6px;
  --topbar-h:    60px;
  --font-mono:   'JetBrains Mono', 'Space Mono', monospace;
  --font-sans:   'Noto Serif TC', serif;
  --font-brand:  'Space Mono', monospace;
  --transition:  0.22s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:          #0f0f14;
  --bg-2:        #16161f;
  --surface:     rgba(26,26,38,0.80);
  --surface-2:   rgba(26,26,38,0.60);
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);
  --text:        #e8e8f0;
  --text-2:      #aaa;
  --text-3:      #666;
  --accent:      #7b7bff;
  --accent-2:    #a0a0ff;
  --accent-rgb:  123,123,255;
  --tag-bg:      rgba(123,123,255,0.12);
  --tag-hover:   rgba(123,123,255,0.22);
  --shadow:      0 4px 32px rgba(0,0,0,0.32);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.48);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

img { max-width: 100%; height: auto; display: block; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

.glass-card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.glass-card:hover { box-shadow: var(--shadow-lg); }

/* ─── Loading Shimmer ────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg) 50%, var(--bg-2) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius);
  min-height: 120px;
}
.post-card-skeleton { height: 260px; }

/* ═══════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--topbar-h);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.topbar.scrolled { box-shadow: var(--shadow); }

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Brand */
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-letters {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--text);
}
.brand-sub {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
.nav-link {
  font-family: var(--font-brand);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--tag-bg);
}

/* Topbar controls */
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--accent); background: var(--tag-bg); }

/* Theme toggle: show/hide sun/moon */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Hamburger — mobile only */
.hamburger { display: none; }

/* Search bar */
.search-bar {
  position: absolute;
  top: var(--topbar-h);
  left: 0; right: 0;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(.4,0,.2,1), box-shadow var(--transition);
}
.search-bar.open {
  max-height: 72px;
  box-shadow: var(--shadow);
}
.search-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.search-icon { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
#searchInput {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-brand);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
}
#searchInput::placeholder { color: var(--text-3); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(.4,0,.2,1);
}
.mobile-nav.open { max-height: 300px; }
.mobile-nav-link {
  font-family: var(--font-brand);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: block;
  transition: color var(--transition), background var(--transition);
}
.mobile-nav-link:hover { color: var(--accent); background: var(--tag-bg); }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--topbar-h);
}

/* Animated grid background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
}
.hero-bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, var(--bg) 75%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
  animation: heroFadeUp 0.9s cubic-bezier(.4,0,.2,1) both;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-logo-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.hero-logo-letters {
  font-family: var(--font-brand);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

.hero-logo-expand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}
.hero-logo-expand span {
  font-family: var(--font-brand);
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  color: var(--text-2);
  letter-spacing: 0.03em;
}
.hero-logo-expand span em {
  font-style: normal;
  color: var(--text-3);
}

.hero-divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 0 auto 1.25rem;
  border-radius: 99px;
}

.hero-tagline {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.hero-sub {
  font-family: var(--font-brand);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-transform: uppercase;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-brand);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  animation: scrollBounce 2s ease-in-out infinite;
}
.hero-scroll-hint svg { width: 16px; height: 16px; }

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ═══════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.main-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.section-label {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-2);
}

/* ─── Daily Pick ─────────────────────────────────────────────── */
.daily-pick-card {
  padding: 1.75rem 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.daily-pick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.daily-pick-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 99px 0 0 99px;
}

.daily-badge {
  flex-shrink: 0;
  font-family: var(--font-brand);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
  background: var(--accent);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-top: 0.2rem;
}

.daily-content { flex: 1; }
.daily-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.daily-excerpt {
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.daily-meta {
  font-family: var(--font-brand);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

/* ─── Tag Filter Bar ─────────────────────────────────────────── */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.tag-pill {
  font-family: var(--font-brand);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-2);
  border-radius: 99px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--tag-bg); }
.tag-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Post Grid ──────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Post Card */
.post-card {
  padding: 1.5rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: cardIn 0.4s cubic-bezier(.4,0,.2,1) both;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.post-tag {
  font-family: var(--font-brand);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  background: var(--tag-bg);
  color: var(--accent);
  border-radius: 99px;
}

.post-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
}

.post-excerpt {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-brand);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.post-author { color: var(--accent); }

/* Search notice */
.search-notice {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--tag-bg);
  border-radius: var(--radius-sm);
}

/* No results */
.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font-brand);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-widget { padding: 1.25rem 1.4rem; }

.widget-title {
  font-family: var(--font-brand);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.widget-body {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.widget-body code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--tag-bg);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.widget-link {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.widget-link:hover { text-decoration: underline; }

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-cloud-item {
  font-family: var(--font-brand);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border-2);
  border-radius: 99px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.tag-cloud-item:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Recent list */
.recent-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.recent-list li a {
  font-size: 0.83rem;
  color: var(--text-2);
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
  line-height: 1.4;
}
.recent-list li a:hover { color: var(--accent); }
.recent-list li a span {
  display: block;
  font-family: var(--font-brand);
  font-size: 0.6rem;
  color: var(--text-3);
  margin-top: 0.15rem;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════
   POST VIEW PAGE (post.html)
   ═══════════════════════════════════════════════════════════════ */
.post-view-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 3rem) 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

/* Article header */
.article-header {
  margin-bottom: 2.5rem;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-brand);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.5rem;
  transition: color var(--transition);
}
.article-back:hover { color: var(--accent); }
.article-back svg { width: 14px; height: 14px; }

.article-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

.article-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 1rem;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-family: var(--font-brand);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-2);
}
.article-meta-bar .meta-author { color: var(--accent); font-weight: 700; }

/* Article body — Markdown rendered */
.article-body {
  line-height: 1.85;
  font-size: 1rem;
  color: var(--text);
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}
.article-body h1 { font-size: 1.9rem; }
.article-body h2 {
  font-size: 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-2);
}
.article-body h3 { font-size: 1.15rem; }
.article-body h4 { font-size: 1rem; }

.article-body p { margin: 0.9rem 0; }

.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--accent-2); }

.article-body ul, .article-body ol {
  margin: 0.9rem 0 0.9rem 1.5rem;
}
.article-body li { margin: 0.3rem 0; }

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--tag-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-style: italic;
}

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  overflow-x: auto;
  display: block;
}
.article-body th, .article-body td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-2);
  text-align: left;
}
.article-body th {
  background: var(--bg-2);
  font-family: var(--font-brand);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.article-body tr:nth-child(even) { background: var(--bg-2); }

.article-body hr {
  border: none;
  border-top: 2px solid var(--border-2);
  margin: 2rem 0;
}

/* ─── Code blocks ─────────────────────────────────────────────── */
/* Inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  padding: 0.15em 0.45em;
  border-radius: 3px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

/* Block code */
.article-body pre {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.article-body pre code {
  display: block;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.83rem;
  line-height: 1.7;
  border: none;
  border-radius: 0;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
  /* Syntax highlight color hints via CSS classes */
}

/* Code block top bar (language label + copy button) */
.code-block-wrapper {
  position: relative;
  margin: 1.5rem 0;
}
.code-block-wrapper pre { margin: 0; }

.code-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #13131f;
  padding: 0.45rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.code-lang-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}
.code-copy-btn {
  font-family: var(--font-brand);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.06);
  color: #888;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: all var(--transition);
}
.code-copy-btn:hover { background: rgba(255,255,255,0.12); color: #ccc; }
.code-copy-btn.copied { color: #89dceb; border-color: #89dceb; }

/* Remove double border-radius where topbar present */
.code-block-wrapper .code-topbar + pre code {
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Syntax token colors */
.article-body pre code .token-keyword   { color: #cba6f7; }
.article-body pre code .token-string    { color: #a6e3a1; }
.article-body pre code .token-comment   { color: #6c7086; font-style: italic; }
.article-body pre code .token-number    { color: #fab387; }
.article-body pre code .token-function  { color: #89b4fa; }
.article-body pre code .token-operator  { color: #89dceb; }
.article-body pre code .token-variable  { color: #f38ba8; }
.article-body pre code .token-class     { color: #f9e2af; }

/* Article sidebar (TOC) */
.article-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.toc-widget { padding: 1.25rem 1.4rem; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 0.1rem; }
.toc-item a {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
  display: block;
  padding: 0.3rem 0.5rem;
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all var(--transition);
  text-decoration: none;
}
.toc-item a:hover, .toc-item.active a {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--tag-bg);
}
.toc-item.h3 a { padding-left: 1.2rem; font-size: 0.65rem; }

/* ═══════════════════════════════════════════════════════════════
   ARCHIVE PAGE
   ═══════════════════════════════════════════════════════════════ */
.archive-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 3rem) 1.5rem 4rem;
}

.archive-year-group { margin-bottom: 2.5rem; }
.archive-year {
  font-family: var(--font-brand);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.archive-list { list-style: none; display: flex; flex-direction: column; }
.archive-item {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.archive-item:hover .archive-post-title { color: var(--accent); }
.archive-date {
  font-family: var(--font-brand);
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.archive-post-title {
  font-size: 0.95rem;
  color: var(--text);
  transition: color var(--transition);
}
.archive-post-author {
  font-family: var(--font-brand);
  font-size: 0.62rem;
  color: var(--text-3);
  margin-left: auto;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   TAGS PAGE
   ═══════════════════════════════════════════════════════════════ */
.tags-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 3rem) 1.5rem 4rem;
}

.tags-hero-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 3rem;
  justify-content: center;
}
.tags-cloud-big {
  font-family: var(--font-brand);
  font-size: clamp(0.7rem, 2vw, 1.1rem);
  letter-spacing: 0.06em;
  padding: 0.5rem 1.2rem;
  border: 1.5px solid var(--border-2);
  border-radius: 99px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
}
.tags-cloud-big:hover, .tags-cloud-big.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tags-results { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1rem; }

/* ═══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════ */
.about-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 3rem) 1.5rem 4rem;
}
.about-hero {
  text-align: center;
  margin-bottom: 3rem;
}
.about-logo {
  font-family: var(--font-brand);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.about-logo-sub { font-family: var(--font-sans); font-size: 1.1rem; color: var(--text-2); }
.about-expand {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0 2rem;
}
.about-expand-item {
  text-align: center;
  font-family: var(--font-brand);
}
.about-expand-letter { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.about-expand-word { font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

.about-body { font-size: 0.95rem; color: var(--text-2); line-height: 1.85; }
.about-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  font-family: var(--font-sans);
}
.about-body p { margin-bottom: 1rem; }
.about-body a { color: var(--accent); }
.about-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--tag-bg);
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* Deploy guide */
.deploy-guide {
  margin: 2rem 0;
  counter-reset: step;
}
.deploy-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  counter-increment: step;
}
.deploy-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 700;
}
.deploy-step-content { flex: 1; padding-top: 0.3rem; font-size: 0.88rem; color: var(--text-2); }
.deploy-step-content strong { color: var(--text); display: block; margin-bottom: 0.25rem; }
.deploy-step-content code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--tag-bg);
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER (for archive / tags / about)
   ═══════════════════════════════════════════════════════════════ */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-2);
}
.page-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.page-header p {
  font-family: var(--font-brand);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: 2rem 1.5rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.footer-copy {
  font-family: var(--font-brand);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-top: 0.5rem;
}
.footer-copy a { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE / MOBILE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post-view-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }

  .hero-logo-block { flex-direction: column; gap: 1rem; align-items: center; }
  .hero-logo-expand { align-items: center; text-align: center; }

  .daily-pick-card { flex-direction: column; gap: 0.75rem; }

  .post-grid { grid-template-columns: 1fr; }

  .about-expand { gap: 1rem; }

  .archive-item { flex-wrap: wrap; gap: 0.4rem; }
  .archive-post-author { margin-left: 0; }
}

@media (max-width: 480px) {
  .topbar-inner { padding: 0 1rem; }
  .main-layout { padding: 2rem 1rem 3rem; }
  .post-view-layout { padding: calc(var(--topbar-h) + 2rem) 1rem 3rem; }
  .article-body pre code { font-size: 0.75rem; padding: 1rem; }
  .archive-layout { padding: calc(var(--topbar-h) + 2rem) 1rem 3rem; }
  .tags-layout { padding: calc(var(--topbar-h) + 2rem) 1rem 3rem; }
  .about-layout { padding: calc(var(--topbar-h) + 2rem) 1rem 3rem; }
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  .topbar, .sidebar, .article-sidebar, .site-footer { display: none; }
  .post-view-layout { display: block; padding: 0; }
  .article-body { font-size: 11pt; }
}
