/* ────────────────────────────────────────────────────────────────────────────
   Hue Mơ Homestay — Blog Stylesheet
   Phase 36: Public Blog Pages
   ──────────────────────────────────────────────────────────────────────────── */

/* 0. Google Fonts — matches main site (EB Garamond + Inter) */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Inter:wght@400;500&display=swap');

/* 1. Design Tokens */
:root {
  --hue-cream: #FBF8F1;
  --hue-wood: #C08844;
  --hue-moss: #3D8B65;
  --hue-ink: #1C1A17;
  --hue-white: #FFFFFF;
  --hue-red: #DC2626;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'EB Garamond', Georgia, serif;

  --text-primary: var(--hue-ink);
  --text-secondary: rgba(28, 26, 23, 0.6);
  --text-tertiary: rgba(28, 26, 23, 0.4);

  --border-subtle: rgba(28, 26, 23, 0.06);
  --border-medium: rgba(28, 26, 23, 0.12);

  --shadow-card: 0 2px 12px 0 rgba(28, 26, 23, 0.08);
  --shadow-card-hover: 0 4px 20px 0 rgba(28, 26, 23, 0.12);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 9999px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --header-height: 60px;
  --container-max: 1080px;
  --article-max: 720px;
  --toc-width: 240px;
}

/* 2. Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  html { scroll-padding-top: 60px; }
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--hue-cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--hue-wood);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 3. Header — matches main site design */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 60px;
  transition: background-color 300ms cubic-bezier(0.25,0.46,0.45,0.94),
              color 300ms cubic-bezier(0.25,0.46,0.45,0.94),
              box-shadow 300ms cubic-bezier(0.25,0.46,0.45,0.94);
  background: var(--hue-cream);
  box-shadow: 0 1px 0 0 rgba(28,26,23,0.08), 0 4px 16px 0 rgba(28,26,23,0.06);
  color: var(--hue-ink);
}

@media (min-width: 768px) {
  .site-header { height: 72px; }
}

.site-header.header-scrolled {
  background: var(--hue-cream);
  box-shadow: 0 1px 0 0 rgba(28,26,23,0.08), 0 4px 16px 0 rgba(28,26,23,0.06);
  color: var(--hue-ink);
}

.header-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .header-inner { padding: 0 40px; }
}

@media (min-width: 1024px) {
  .header-inner { padding: 0 64px; }
}

/* Logo */
.header-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  gap: 3px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.header-logo:hover {
  opacity: 0.9;
  text-decoration: none;
}

.logo-main {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.logo-sub {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
}

/* Desktop nav */
.header-nav {
  display: none;
  align-items: center;
  gap: 32px;
}

@media (min-width: 768px) {
  .header-nav { display: flex; }
}

@media (min-width: 1024px) {
  .header-nav { gap: 40px; }
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.nav-link-active {
  font-weight: 600;
}

.nav-cta {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 20px;
  border: 1.5px solid var(--hue-wood);
  border-radius: 2px;
  color: var(--hue-wood);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.nav-cta:hover {
  background: var(--hue-wood);
  color: var(--hue-cream);
  text-decoration: none;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
}

.lang-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: inherit;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.lang-btn:hover {
  opacity: 0.75;
  text-decoration: none;
}

.lang-active {
  font-weight: 500;
  opacity: 1;
  cursor: default;
}

.lang-sep {
  margin: 0 8px;
  opacity: 0.3;
  font-size: 13px;
  user-select: none;
}

/* Mobile controls */
.header-mobile {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (min-width: 768px) {
  .header-mobile { display: none; }
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(4.25px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* Mobile nav dropdown */
.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--hue-cream);
  box-shadow: 0 8px 32px 0 rgba(28,26,23,0.12), 0 2px 8px 0 rgba(28,26,23,0.08);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  visibility: hidden;
}

.mobile-nav.mobile-nav-open {
  max-height: calc(100vh - 60px);
  visibility: visible;
}

.mobile-nav-link {
  display: block;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--hue-ink);
  text-align: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(28, 26, 23, 0.08);
  text-decoration: none;
  transition: background-color 0.2s;
}

.mobile-nav-link:hover {
  background: rgba(28, 26, 23, 0.04);
  text-decoration: none;
}

.mobile-nav-active {
  font-weight: 600;
}

.mobile-nav-cta-wrap {
  padding: 16px 24px;
  display: flex;
  justify-content: center;
}

/* 4. Footer — matches main site design */
.site-footer {
  background: var(--hue-ink);
  padding: 64px 0 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .footer-inner { padding: 0 40px; }
}

@media (min-width: 1024px) {
  .footer-inner { padding: 0 64px; }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer-col-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

@media (min-width: 768px) {
  .footer-col-logo { align-items: flex-start; }
}

.footer-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  gap: 3px;
}

.footer-logo .logo-main {
  font-size: clamp(20px, 2.5vw, 24px);
  color: var(--hue-cream);
}

.footer-logo .logo-sub {
  color: var(--hue-cream);
}

.footer-tagline {
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(251, 248, 241, 0.8);
  text-align: center;
  max-width: 220px;
}

@media (min-width: 768px) {
  .footer-tagline { text-align: left; }
}

.footer-col-nav {
  display: none;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .footer-col-nav { display: flex; }
}

.footer-heading {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--hue-cream);
  margin-bottom: 4px;
}

.footer-link {
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(251, 248, 241, 0.7);
  text-decoration: none;
  transition: color 0.2s;
  width: fit-content;
}

.footer-link:hover {
  color: var(--hue-cream);
  text-decoration: none;
}

.footer-col-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

@media (min-width: 768px) {
  .footer-col-contact { align-items: flex-start; }
}

.footer-address {
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(251, 248, 241, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-address { text-align: left; }
}

.footer-address a {
  color: rgba(251, 248, 241, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-address a:hover {
  color: var(--hue-cream);
  text-decoration: none;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: rgba(251, 248, 241, 0.6);
  transition: color 0.2s;
}

.footer-social-icon svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.footer-social-icon:hover {
  color: var(--hue-cream);
}

.footer-bottom {
  border-top: 1px solid rgba(251, 248, 241, 0.1);
  margin-top: 64px;
  padding: 32px 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (min-width: 768px) {
  .footer-bottom { flex-direction: row; }
}

.footer-bottom p {
  font-family: var(--font-sans);
  font-size: 12px;
  color: rgba(251, 248, 241, 0.5);
}

/* 4b. Floating Action Buttons (MFB) — hit-testing mirrors the homepage React
   FAB (FloatingActionButtons.tsx): root container is pointer-events-none while
   closed / auto while open (.fab-open moves to #fabTrigger in generate.php's
   inline JS), each hidden item wrapper adds invisible + pointer-events-none,
   and the visible "+" trigger keeps pointer-events-auto so it stays tappable
   in both states. Without these guards the invisible stack pinned bottom-right
   intercepts taps on page content under its box (footer social icons). */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  pointer-events: none;
}

.fab-menu.fab-menu-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  /* Re-enable hit-testing for the whole menu subtree while open (overrides
     the closed-state guard above regardless of ancestor values). */
  pointer-events: auto;
}

.fab-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fab-tooltip {
  margin-right: 12px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(28, 26, 23, 0.9);
  color: white;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  white-space: nowrap;
}

.fab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--hue-wood);
  color: white;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.fab-btn:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transform: scale(1.05);
  text-decoration: none;
}

.fab-btn:active {
  transform: scale(0.95);
}

.fab-btn svg {
  width: 20px;
  height: 20px;
}

.fab-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--hue-wood);
  color: white;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.2s;
  margin-top: 12px;
  /* Stay tappable even while the container is closed (pointer-events:none). */
  pointer-events: auto;
}

.fab-trigger:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transform: scale(1.05);
}

.fab-trigger:active {
  transform: scale(0.95);
}

.fab-trigger.fab-open {
  transform: rotate(45deg);
}

.fab-trigger.fab-open:hover {
  transform: rotate(45deg) scale(1.05);
}

.fab-trigger svg {
  width: 20px;
  height: 20px;
}

/* 5. Page Container */
.page-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: calc(60px + var(--space-2xl)) var(--space-lg) var(--space-3xl);
  flex: 1;
  width: 100%;
}

@media (min-width: 768px) {
  .page-container {
    padding-top: calc(72px + var(--space-2xl));
  }
}

/* 6. Page Title */
.page-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.page-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--hue-wood);
  margin: var(--space-sm) auto 0;
  border-radius: 2px;
}

/* 7. Category Pills */
.category-pills {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: var(--space-md) 0 var(--space-lg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 400;
  color: rgba(28, 26, 23, 0.7);
  background: transparent;
  border: 1px solid var(--border-medium);
  text-decoration: none;
  white-space: nowrap;
  transition: all 150ms ease;
}

.pill:hover {
  background: rgba(192, 136, 68, 0.08);
  text-decoration: none;
}

.pill-active {
  background: var(--hue-wood);
  color: var(--hue-white);
  border-color: var(--hue-wood);
}

.pill-active:hover {
  background: var(--hue-wood);
  color: var(--hue-white);
}

/* 8. Featured Card */
.featured-card {
  display: block;
  background: var(--hue-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: var(--space-2xl);
  transition: box-shadow 200ms ease, transform 200ms ease;
  text-decoration: none;
  color: inherit;
}

.featured-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.featured-image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.featured-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-label {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hue-white);
  background: rgba(192, 136, 68, 0.9);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.featured-content {
  padding: var(--space-lg);
}

.featured-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  margin: var(--space-sm) 0;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-excerpt {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 9. Post Grid & Cards */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.post-card {
  display: block;
  background: var(--hue-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms ease;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: var(--space-md);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: var(--space-xs) 0;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.card-meta {
  display: flex;
  gap: var(--space-md);
  font-size: 14px;
  color: var(--text-tertiary);
}

/* 10. Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: transparent;
  text-decoration: none;
  transition: background 150ms ease;
}

a.page-btn:hover {
  background: rgba(192, 136, 68, 0.1);
  text-decoration: none;
}

.page-active {
  background: var(--hue-wood);
  color: var(--hue-white);
}

.page-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* 11. Post Detail Header */
.post-header {
  margin-bottom: var(--space-xl);
}

.post-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
  margin: var(--space-sm) 0;
}

.post-meta {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.meta-date,
.meta-reading {
  font-size: 14px;
  color: var(--text-secondary);
}

.category-badge {
  display: inline-block;
  background: rgba(192, 136, 68, 0.12);
  color: var(--hue-wood);
  font-size: 14px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

/* 12. Article Body (Markdown) */
.article-layout {
  display: flex;
  gap: var(--space-xl);
  max-width: calc(var(--article-max) + var(--toc-width) + var(--space-xl));
  margin: 0 auto;
}

.article-body {
  flex: 1;
  max-width: var(--article-max);
  font-size: 16px;
  line-height: 1.6;
}

.article-body h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  scroll-margin-top: 80px;
}

.article-body h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  scroll-margin-top: 80px;
}

.article-body p {
  margin-bottom: var(--space-md);
}

.article-body img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
}

.article-body blockquote {
  border-left: 3px solid var(--hue-wood);
  padding-left: var(--space-md);
  color: var(--text-secondary);
  margin: var(--space-md) 0;
}

.article-body code {
  background: rgba(28, 26, 23, 0.05);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.article-body pre {
  background: rgba(28, 26, 23, 0.05);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-md) 0;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body a {
  color: var(--hue-wood);
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

.article-body ul,
.article-body ol {
  padding-left: var(--space-lg);
  margin: var(--space-md) 0;
}

.article-body li {
  margin-bottom: var(--space-xs);
}

.article-body hr {
  border: none;
  height: 1px;
  background: var(--border-medium);
  margin: var(--space-xl) 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
}

.article-body th,
.article-body td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.article-body thead th {
  background: rgba(28, 26, 23, 0.05);
  font-weight: 600;
}

/* 13. TOC Sidebar */
.toc-sidebar {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  align-self: flex-start;
}

.toc {
  background: var(--hue-white);
  border-left: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.toc-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.toc ul {
  list-style: none;
  padding: 0;
}

.toc li {
  padding: var(--space-xs) 0 var(--space-xs) 12px;
  border-left: 2px solid transparent;
}

.toc li a {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
}

.toc li a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.toc li.toc-h3 a {
  padding-left: 12px;
}

/* 14. Related Posts */
.related-posts {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.related-heading {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

/* 15. 404 Page */
.error-page {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.error-title {
  font-size: 72px;
  font-weight: 600;
  color: var(--hue-red);
  line-height: 1;
  margin-bottom: var(--space-md);
}

.error-message {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.error-back-link {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  color: var(--hue-wood);
  text-decoration: none;
}

.error-back-link:hover {
  text-decoration: underline;
}

/* 16. Empty States */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-tertiary);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* 17. Responsive Breakpoints */
@media (max-width: 1023px) {
  .toc-sidebar {
    display: none;
  }

  .article-layout {
    max-width: var(--article-max);
  }

  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .post-grid {
    grid-template-columns: 1fr;
  }

  .featured-title {
    font-size: 22px;
  }

  .page-container {
    padding: 120px var(--space-md) var(--space-2xl);
  }

  .post-title {
    font-size: 24px;
  }

  .article-body h2 {
    font-size: 24px;
  }

  .article-body table {
    display: block;
    overflow-x: auto;
  }
}

/* Focus / Accessibility */
a:focus-visible,
.pill:focus-visible,
.page-btn:focus-visible {
  outline: 2px solid var(--hue-wood);
  outline-offset: 2px;
}
