/* ============================================================
   Taiwanese in Germany — 台勞在德國打工記
   Design: Apple Minimalist Style
   ============================================================ */

/* Noto Sans TC + Inter */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg:           #FFFFFF;
  --bg-secondary: #F5F5F7;
  --bg-card:      #FFFFFF;
  --primary:      #1D1D1F;
  --secondary:    #6E6E73;
  --tertiary:     #86868B;
  --accent:       #0066CC;
  --accent-hover: #0077ED;
  --border:       #D2D2D7;
  --border-light: #E8E8ED;
  --shadow-xs:    0 1px 3px rgba(0,0,0,.06);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.06);
  --shadow-md:    0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.10);

  --font:         'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang TC', sans-serif;
  --font-en:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-xs:   0.875rem;   /* 14px */
  --text-sm:   1rem;       /* 16px */
  --text-base: 1.125rem;   /* 18px */
  --text-md:   1.1875rem;  /* 19px */
  --text-lg:   1.375rem;   /* 22px */
  --text-xl:   1.625rem;   /* 26px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  2.5rem;     /* 40px */
  --text-4xl:  3.25rem;    /* 52px */
  --text-5xl:  4.25rem;    /* 68px */
  --text-hero: clamp(2.75rem, 7vw, 5.25rem);

  --container: 980px;
  --container-wide: 1200px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 300ms;

  --navbar-bg:         rgba(255,255,255,0.85);
  --navbar-border:     rgba(0,0,0,.08);
  --navbar-mobile-bg:  rgba(255,255,255,0.97);
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
  --bg:           #000000;
  --bg-secondary: #1C1C1E;
  --bg-card:      #1C1C1E;
  --primary:      #F5F5F7;
  --secondary:    #AEAEB2;
  --tertiary:     #8E8E93;
  --accent:       #2997FF;
  --accent-hover: #47ABFF;
  --border:       #3A3A3C;
  --border-light: #2C2C2E;
  --shadow-xs:    0 1px 3px rgba(0,0,0,.3);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.3);
  --shadow-md:    0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.5);
  --navbar-bg:    rgba(28,28,30,0.88);
  --navbar-border: rgba(255,255,255,.08);
  --navbar-mobile-bg: rgba(28,28,30,0.97);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-md);
  color: var(--primary);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px;
}
.container--wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- SIDEBAR ---------- */
body { padding-left: 64px; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  width: 64px;
  background: var(--navbar-bg, rgba(255,255,255,0.9));
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--navbar-border, rgba(0,0,0,.08));
  transition: width 0.28s var(--ease), background var(--duration) var(--ease), border-color var(--duration) var(--ease);
  overflow: hidden;
}
.sidebar:hover, .sidebar.open {
  width: 220px;
  box-shadow: var(--shadow-lg);
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 220px;
  padding: 20px 0;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  margin-bottom: 20px;
  color: var(--primary);
  white-space: nowrap;
}
.sidebar__logo-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.sidebar__logo-name {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.sidebar:hover .sidebar__logo-name,
.sidebar.open .sidebar__logo-name { opacity: 1; }

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--secondary);
  white-space: nowrap;
  transition: color var(--duration), background var(--duration);
}
.sidebar__link:hover { color: var(--primary); background: rgba(128,128,128,.1); }
.sidebar__link.active { color: var(--primary); font-weight: 500; background: rgba(128,128,128,.07); }

.sidebar__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar__label {
  font-size: var(--text-sm);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.sidebar:hover .sidebar__label,
.sidebar.open .sidebar__label { opacity: 1; }

.sidebar__bottom {
  padding: 8px 8px 0;
  border-top: 1px solid var(--border-light);
}

/* Dark mode toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--secondary);
  background: transparent;
  border: 1.5px solid var(--border);
  cursor: pointer;
  margin: 8px 4px;
  transition: background var(--duration), color var(--duration), border-color var(--duration);
  flex-shrink: 0;
}
.theme-toggle svg { display: block; }
.theme-toggle:hover {
  background: rgba(128,128,128,.1);
  color: var(--primary);
  border-color: var(--primary);
}

/* Mobile hamburger button */
.sidebar__hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--navbar-border);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.sidebar__hamburger span {
  width: 18px; height: 1.5px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--duration) var(--ease), opacity 150ms;
}
.sidebar__hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.sidebar__hamburger.open span:nth-child(2) { opacity: 0; }
.sidebar__hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 99;
}
.sidebar-overlay.visible { display: block; }

@media (max-width: 768px) {
  body { padding-left: 0; }
  .sidebar__hamburger { display: flex; }
  .sidebar {
    width: 0;
    overflow: hidden;
    border-right: none;
  }
  .sidebar.open {
    width: 240px;
    border-right: 1px solid var(--navbar-border);
    box-shadow: var(--shadow-lg);
  }
}

/* ---------- HERO ---------- */
.hero {
  padding-top: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.hero__inner {
  padding: 80px 0 100px;
  text-align: center;
}

.hero__eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.1s forwards;
}

.hero__title {
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--primary);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.2s forwards;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

/* 德國國旗三色：黑 / 紅 / 金 */
.de-flag-text {
  background: linear-gradient(
    180deg,
    #000000 0%,   #000000 33%,
    #CC0000 33%,  #CC0000 66%,
    #FFCE00 66%,  #FFCE00 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.3s forwards;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 980px;
  letter-spacing: -0.01em;
  transition: background var(--duration), transform var(--duration) var(--spring);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.4s forwards;
}
.hero__cta:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.hero__scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--tertiary);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1s forwards;
}
.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--border), transparent);
  animation: lineGrow 1.5s ease infinite;
}

/* ---------- SECTION ---------- */
.section {
  padding: 100px 0;
}
.section--gray { background: var(--bg-secondary); }

.section-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--primary);
  margin-bottom: 10px;
  line-height: 1.15;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--secondary);
  max-width: 520px;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

/* ---------- CATEGORY CARDS ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 48px;
}
@media (max-width: 860px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .categories-grid { grid-template-columns: 1fr; } }

.cat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: block;
  text-decoration: none;
  transition: transform var(--duration) var(--spring),
              box-shadow var(--duration) var(--ease);
  border: 1px solid var(--border-light);
}
.cat-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.cat-card__emoji {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 16px;
}
.cat-card__name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.cat-card__desc {
  font-size: var(--text-sm);
  color: var(--secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.cat-card__count {
  font-size: var(--text-xs);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- POST CARDS ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 48px;
}
@media (max-width: 860px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .posts-grid { grid-template-columns: 1fr; } }

.posts-grid--wide {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 640px) { .posts-grid--wide { grid-template-columns: 1fr; } }

.post-card {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.post-card.visible { opacity: 1; transform: translateY(0); }

.post-card__cover {
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
  position: relative;
}
.post-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.post-card:hover .post-card__cover img { transform: scale(1.04); }

.post-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-light);
}

.post-card__cat {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.post-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.45;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--duration);
}
.post-card:hover .post-card__title { color: var(--accent); }

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

.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}
.post-card__date {
  font-size: var(--text-xs);
  color: var(--tertiary);
  letter-spacing: -0.01em;
}
.post-card__more {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--duration), transform var(--duration);
}
.post-card:hover .post-card__more { opacity: 1; transform: translateX(0); }

/* ---------- TAG ---------- */
.tag {
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
  background: rgba(0,102,204,.07);
  padding: 3px 10px;
  border-radius: 980px;
  letter-spacing: -0.01em;
  transition: background var(--duration), color var(--duration);
}
.tag:hover { background: var(--accent); color: #fff; }

/* ---------- DIVIDER ---------- */
.divider { border: none; border-top: 1px solid var(--border-light); margin: 0; }

/* ---------- ABOUT ---------- */
.about-section {
  background: var(--primary);
  padding: 80px 0;
  color: #fff;
}
.about-section__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
@media (max-width: 768px) { .about-section__inner { grid-template-columns: 1fr; gap: 40px; } }

.about-section__eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}
.about-section__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.about-section__body {
  font-size: var(--text-md);
  color: rgba(255,255,255,0.65);
  line-height: 1.8;
}

.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.fact-item {
  background: rgba(255,255,255,0.05);
  padding: 24px;
  transition: background var(--duration);
}
.fact-item:hover { background: rgba(255,255,255,0.1); }
.fact-item__label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.fact-item__value {
  font-size: var(--text-base);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 48px 0 24px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
}
@media (max-width: 768px) { .footer__inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__inner { grid-template-columns: 1fr; } }

.footer__brand-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.footer__brand-desc {
  font-size: var(--text-sm);
  color: var(--secondary);
  line-height: 1.6;
  max-width: 280px;
}
.footer__col-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tertiary);
  margin-bottom: 14px;
}
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__link {
  font-size: var(--text-sm);
  color: var(--secondary);
  transition: color var(--duration);
  letter-spacing: -0.01em;
}
.footer__link:hover { color: var(--accent); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--tertiary);
}

/* ---------- CATEGORY PAGE ---------- */
.cat-hero {
  padding: 64px 0 48px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}
.cat-hero__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.cat-hero__title {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 10px;
}
.cat-hero__desc {
  font-size: var(--text-xl);
  color: var(--secondary);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.cat-hero__count {
  font-size: var(--text-sm);
  color: var(--tertiary);
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.filter-btn {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--secondary);
  padding: 10px 20px;
  border-radius: 980px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--duration);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--tertiary);
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}
.breadcrumb a { transition: color var(--duration); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { color: var(--border); }

/* ---------- POST PAGE ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 64px;
  height: 2px;
  background: var(--accent);
  z-index: 200;
  width: 0%;
  transition: width 50ms linear;
}

.post-layout {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 22px 120px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--accent);
  margin-bottom: 40px;
  letter-spacing: -0.01em;
  transition: gap var(--duration);
}
.back-btn:hover { gap: 8px; }

.post-header { margin-bottom: 48px; }
.post-header__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.post-header__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 20px;
}
.post-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--text-sm);
  color: var(--tertiary);
  letter-spacing: -0.01em;
  flex-wrap: wrap;
}
.post-header__sep { color: var(--border); }
.post-header__divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin-top: 32px;
}

/* Post content typography */
.post-content {
  font-size: 1.25rem;     /* 20px */
  line-height: 2.0;
  color: var(--primary);
  letter-spacing: 0.01em;
}
.post-content p { margin-bottom: 32px; }
.post-content h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin: 48px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.post-content h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--primary);
  margin: 36px 0 12px;
}
.post-content h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--primary);
  margin: 28px 0 8px;
}
.post-content ul, .post-content ol {
  padding-left: 24px;
  margin-bottom: 24px;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 8px; color: var(--secondary); }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--accent-hover); }
.post-content strong { font-weight: 600; color: var(--primary); }
.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 20px;
  margin: 24px 0;
  color: var(--secondary);
  font-size: var(--text-lg);
  font-style: italic;
  letter-spacing: -0.01em;
}
.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  color: #c7254e;
}
.post-content pre {
  background: var(--primary);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow-x: auto;
  margin: 24px 0;
}
.post-content pre code {
  background: none; color: #e8e8ed; padding: 0; font-size: var(--text-sm);
}
.post-content img {
  border-radius: var(--radius-md);
  margin: 32px auto;
  width: 100%;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 48px 0;
}
.post-content table {
  width: 100%; border-collapse: collapse; margin: 24px 0; font-size: var(--text-sm);
}
.post-content th, .post-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}
.post-content th { font-weight: 600; color: var(--primary); }
.post-content td { color: var(--secondary); }
.post-content figure { margin: 32px 0; }
.post-content figcaption {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--tertiary);
  margin-top: 8px;
}

.post-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}
.post-tags__label {
  font-size: var(--text-sm);
  color: var(--tertiary);
  letter-spacing: -0.01em;
}

.related { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--border-light); }
.related__title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
@media (max-width: 640px) { .related__grid { grid-template-columns: 1fr; } }

/* ---------- EMPTY STATE ---------- */
.empty-state { text-align: center; padding: 80px 22px; }
.empty-state__icon { font-size: 2.5rem; margin-bottom: 16px; }
.empty-state__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.empty-state p { color: var(--secondary); }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lineGrow {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50%       { transform: scaleY(0.5); opacity: 1; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Stagger */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 60ms; }
.stagger > *:nth-child(3) { transition-delay: 120ms; }
.stagger > *:nth-child(4) { transition-delay: 180ms; }
.stagger > *:nth-child(5) { transition-delay: 240ms; }
.stagger > *:nth-child(6) { transition-delay: 300ms; }

/* ---------- WordPress Button Block ---------- */
.wp-block-buttons {
  margin: 1.5em 0;
}
.wp-block-button {
  display: inline-block;
}
.wp-element-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff !important;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 14px 28px;
  border-radius: 50px;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0, 102, 204, 0.30);
  transition: background 0.2s var(--ease),
              box-shadow 0.2s var(--ease),
              transform 0.2s var(--spring);
  cursor: pointer;
}
.wp-element-button:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.40);
  transform: translateY(-2px);
  color: #fff !important;
  text-decoration: none !important;
}
.wp-element-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

/* ---------- WordPress Block Compatibility (dark-mode safe) ---------- */

/* Color helper classes — override any inline style="color:…" from WordPress */
.post-content .has-foreground-color          { color: var(--primary)    !important; }
.post-content .has-text-color                { color: var(--primary)    !important; }
.post-content .has-vivid-red-color           { color: #e53e3e           !important; }

/* Background helper classes */
.post-content .has-tertiary-background-color {
  background-color: var(--bg-secondary) !important;
  color: var(--primary) !important;
}

/* Headings with inline gradient backgrounds — replace with theme-aware bg */
.post-content .wp-block-heading.has-background {
  background: var(--bg-secondary) !important;
  padding: 0.4em 0.8em;
  border-radius: var(--radius-sm);
}

/* Two-column comparison layout */
.post-content .wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.post-content .wp-block-column {
  flex: 1;
  min-width: min(100%, 220px);
}
.post-content .wp-block-column[style*="border-style:dotted"] {
  border: 2px dotted var(--border) !important;
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .section-title { font-size: var(--text-2xl); }
  .cat-hero__title { font-size: var(--text-3xl); }
  .post-layout { padding-top: 60px; }
  .progress-bar { left: 0; }
}

/* ---------- Night Mode Toast ---------- */
.night-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 300px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.32s var(--ease);
}
.night-toast__icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}
.night-toast__body { flex: 1; min-width: 0; }
.night-toast__title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
}
.night-toast__sub {
  font-size: 0.8rem;
  color: var(--tertiary);
  margin-top: 3px;
  line-height: 1.4;
}
.night-toast__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.night-toast__btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
  font-family: var(--font);
  white-space: nowrap;
}
.night-toast__btn:hover { background: var(--accent-hover); }
.night-toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--tertiary);
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
  font-family: var(--font);
}
.night-toast__close:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}
.night-toast.fade-out {
  animation: toastOut 0.32s var(--ease) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(14px); }
}
@media (max-width: 768px) {
  .night-toast {
    bottom: 80px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
