/* ====================================================
   Flâneur Blog - Custom Style & Pretendard Typography
   ==================================================== */

:root {
  --font-serif: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", sans-serif !important;
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", sans-serif !important;

  /* Legacy layout variable compatibility */
  --primary: #1a1a1a;
  --secondary: #64748b;
  --tertiary: #f1f5f9;
  --border: #e2e8f0;
  --entry: #f8fafc;
  --theme: #ffffff;
}

body {
  font-family: var(--font-sans) !important;
  font-weight: 400 !important;
  letter-spacing: -0.015em !important;
  line-height: 1.8 !important;
  color: #1a1a1a;
  background-color: #ffffff;
}

h1, h2, h3, h4, h5, h6,
.site-logo, .header-nav-link, .featured-title, .post-list-title,
.single-title, .gallery-title, .page-title, .post-card-title {
  font-family: var(--font-sans) !important;
  letter-spacing: -0.02em !important;
}

/* Post Typography Details */
.single-title {
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin-top: 0.6rem !important;
  margin-bottom: 1.2rem !important;
}

.post-content {
  font-family: var(--font-sans) !important;
  font-size: 1.05rem !important;
  line-height: 1.85 !important;
  color: #2b2b2b !important;
}

.post-content h2 {
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin-top: 2.4rem !important;
  margin-bottom: 1rem !important;
}

.post-content h3 {
  font-size: 1.22rem !important;
  font-weight: 650 !important;
  line-height: 1.45 !important;
  margin-top: 1.8rem !important;
  margin-bottom: 0.8rem !important;
}

.post-content p {
  margin-bottom: 1.5rem !important;
  word-break: keep-all !important;
}

/* 요약 박스 (Summary Box - Warm Cream & Soft Peach Accent) */
.summary-box,
.post-content .summary-box {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 1.8rem 0 !important;
  padding: 1.35rem 1.6rem !important;
  background-color: #FCF8EC !important;
  border: 1px solid #F4E3C9 !important;
  border-left: 6px solid #E5A968 !important;
  border-radius: 10px !important;
  font-size: 0.98rem !important;
  line-height: 1.75 !important;
  color: #333333 !important;
  box-shadow: 0 4px 12px rgba(244, 227, 201, 0.25) !important;
  word-break: keep-all !important;
  overflow-wrap: break-word !important;
}

.summary-box p,
.post-content .summary-box p {
  margin: 0 !important;
  color: inherit !important;
}

.summary-box p + p,
.post-content .summary-box p + p {
  margin-top: 0.75rem !important;
}

/* 기본 인용구 (Default Blockquote - Muted Slate Gray) */
.post-content blockquote,
.default-blockquote {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 1.8rem 0 !important;
  padding: 1.25rem 1.5rem !important;
  background-color: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-left: 5px solid #94A3B8 !important;
  border-radius: 10px !important;
  font-size: 0.98rem !important;
  line-height: 1.75 !important;
  color: #475569 !important;
  text-align: left !important;
  box-shadow: 0 2px 8px rgba(148, 163, 184, 0.08) !important;
}

.post-content blockquote p,
.post-content blockquote p span {
  font-family: var(--font-sans) !important;
  font-size: 0.98rem !important;
  font-weight: 400 !important;
  font-style: normal !important;
  line-height: 1.75 !important;
  color: #475569 !important;
  text-align: left !important;
  margin: 0 !important;
}

.post-content blockquote p + p {
  margin-top: 0.75rem !important;
}

/* GitHub Callout Palette System (TIP, NOTE, IMPORTANT, WARNING, CAUTION) */
.callout {
  display: block !important;
  margin: 1.8rem 0 !important;
  padding: 1.1rem 1.35rem !important;
  border-radius: 10px !important;
  border-style: solid !important;
  border-width: 1px 1px 1px 5px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

.callout-header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  margin-bottom: 0.6rem !important;
  line-height: 1.4 !important;
}

.callout-title {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
}

.callout-content p {
  margin: 0 !important;
  font-size: 0.96rem !important;
  line-height: 1.7 !important;
}

.callout-content p + p {
  margin-top: 0.6rem !important;
}

/* 1. TIP */
.callout-tip {
  background-color: #F4FBF7 !important;
  border-color: #D8F3E5 #D8F3E5 #D8F3E5 #52B788 !important;
  color: #2D6A4F !important;
}
.callout-tip .callout-header { color: #1B4332 !important; }

/* 2. NOTE */
.callout-note {
  background-color: #F5F8FF !important;
  border-color: #DCE6FF #DCE6FF #DCE6FF #5B8DEF !important;
  color: #2C4C87 !important;
}
.callout-note .callout-header { color: #1E3A8A !important; }

/* 3. IMPORTANT */
.callout-important {
  background-color: #FAF5FF !important;
  border-color: #F3E8FF #F3E8FF #F3E8FF #9D4EDD !important;
  color: #5A189A !important;
}
.callout-important .callout-header { color: #3C096C !important; }

/* 4. WARNING */
.callout-warning {
  background-color: #FFFDF5 !important;
  border-color: #FEF3C7 #FEF3C7 #FEF3C7 #E9A030 !important;
  color: #92400E !important;
}
.callout-warning .callout-header { color: #78350F !important; }

/* 5. CAUTION */
.callout-caution {
  background-color: #FFF5F5 !important;
  border-color: #FEE2E2 #FEE2E2 #FEE2E2 #E65B5B !important;
  color: #991B1B !important;
}
.callout-caution .callout-header { color: #7F1D1D !important; }

/* Recommendation Link Card Box (rel-card-box) */
.rel-card-box,
.post-content a.rel-card-box {
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 1.6rem 0 !important;
  padding: 0 !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  text-decoration: none !important;
  border-bottom: none !important;
  color: inherit !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
  clear: both !important;
}

.post-content p:has(> .rel-card-box) {
  margin-bottom: 0 !important;
}

.rel-card-box:hover,
.post-content a.rel-card-box:hover {
  transform: translateY(-2px) !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 8px 22px rgba(148, 163, 184, 0.22) !important;
  color: inherit !important;
  text-decoration: none !important;
}

.rel-card-image {
  flex: 0 0 190px !important;
  max-width: 190px !important;
  min-height: 125px !important;
  overflow: hidden !important;
  background-color: #f1f5f9 !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
}

.rel-card-image img,
.post-content .rel-card-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  transition: transform 0.3s ease !important;
}

.rel-card-box:hover .rel-card-image img {
  transform: scale(1.04) !important;
}

.rel-card-content {
  flex: 1 1 auto !important;
  padding: 1.1rem 1.4rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
}

.rel-card-badge {
  display: inline-block !important;
  align-self: flex-start !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  padding: 3px 9px !important;
  border-radius: 4px !important;
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  margin-bottom: 0.45rem !important;
}

.rel-card-title {
  margin: 0 0 0.35rem 0 !important;
  font-family: var(--font-sans) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: #0f172a !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  word-break: keep-all !important;
}

.rel-card-box:hover .rel-card-title {
  color: #1e293b !important;
}

.rel-card-desc {
  margin: 0 !important;
  font-family: var(--font-sans) !important;
  font-size: 0.9rem !important;
  line-height: 1.55 !important;
  color: #64748b !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  word-break: keep-all !important;
}

@media (max-width: 600px) {
  .rel-card-image {
    flex: 0 0 115px !important;
    max-width: 115px !important;
    min-height: 105px !important;
  }
  .rel-card-content {
    padding: 0.85rem 1rem !important;
  }
  .rel-card-title {
    font-size: 1rem !important;
    -webkit-line-clamp: 2 !important;
  }
  .rel-card-desc {
    display: none !important;
  }
}

/* TOC (목차) */
.toc {
  margin: 1.8rem 0 !important;
  padding: 1.1rem 1.35rem !important;
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
}

.toc summary {
  font-weight: 600 !important;
  font-size: 1.05rem !important;
  cursor: pointer !important;
}

.toc .inner {
  margin-top: 0.75rem !important;
  padding-left: 0.5rem !important;
}


/* ====================================================
   Home ABOUT Section Center Alignment
   ==================================================== */
.home-about-inner.home-about-centered {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  max-width: 680px !important;
  margin: 0 auto !important;
  grid-template-columns: none !important;
}

.home-about-inner.home-about-centered .home-about-text {
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.home-about-inner.home-about-centered .home-about-links {
  display: flex !important;
  justify-content: center !important;
}

/* ====================================================
   Footer Links Horizontal Row Alignment
   ==================================================== */
.flaneur-footer-links {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
  font-size: 0.85rem !important;
  line-height: 1.6 !important;
}

.flaneur-footer-links a {
  color: var(--color-text-muted, #888888) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  transition: color 0.2s ease !important;
}

.flaneur-footer-links a:hover {
  color: var(--color-text, #1a1a1a) !important;
}

.flaneur-footer-links span {
  opacity: 0.35 !important;
  color: var(--color-text-muted, #888888) !important;
  user-select: none !important;
}

/* ====================================================
   Share Buttons System (Side + Bottom)
   ==================================================== */
.share-layout-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-layout-side .share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border, #e8e8e8);
  background: #ffffff;
  color: var(--color-text-secondary, #555555);
  transition: all 0.2s ease;
  cursor: pointer;
  padding: 0;
}

.share-layout-side .share-btn:hover {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
  transform: translateY(-2px);
}

.single-share-bottom-wrapper {
  margin: 2.8rem 0 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border-light, #f0f0f0);
  border-bottom: 1px solid var(--color-border-light, #f0f0f0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.share-bottom-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text-muted, #888888);
}

.share-layout-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.share-layout-bottom .share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border, #e8e8e8);
  background: #ffffff;
  color: var(--color-text-secondary, #555555);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.share-layout-bottom .share-btn:hover {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* Toast Notification for URL Copy */
.share-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: #ffffff;
  padding: 11px 24px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  letter-spacing: -0.01em;
}

.share-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ====================================================
   Floating Scroll-to-Top Button
   ==================================================== */
.scroll-to-top-btn {
  position: fixed;
  bottom: 32px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  z-index: 900;
  padding: 0;
}

.scroll-to-top-btn.visible {
  opacity: 0.95;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top-btn:hover {
  opacity: 1;
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 42px;
    height: 42px;
  }
}

/* ====================================================
   Mobile Menu Overlay Layout Optimization
   ==================================================== */
@media (max-width: 768px) {
  .menu-panel {
    justify-content: flex-start !important;
    padding-top: calc(72px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .menu-close {
    top: calc(20px + env(safe-area-inset-top, 0px)) !important;
    right: 20px !important;
    font-size: 1.8rem !important;
    padding: 6px !important;
  }

  .menu-nav {
    gap: 4px !important;
  }

  .menu-link {
    padding: 11px 0 !important;
    gap: 14px !important;
  }

  .menu-link-num {
    font-size: 0.72rem !important;
    width: 22px !important;
  }

  .menu-link-text {
    font-family: var(--font-sans) !important;
    font-size: 1.55rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }

  .menu-footer {
    margin-top: 1.6rem !important;
    gap: 12px !important;
  }

  .menu-social {
    gap: 14px !important;
  }

  .menu-social a {
    font-size: 0.75rem !important;
  }
}

/* ====================================================
   Glossary Hub Post List Styling (Without Cover)
   ==================================================== */
.glossary-post-list .glossary-list-item.no-cover {
  grid-template-columns: 1fr !important;
  padding: 24px 0 !important;
}

.glossary-post-list .glossary-list-item.no-cover .post-list-content {
  width: 100% !important;
}

.glossary-post-list .glossary-list-item.no-cover .post-list-title {
  font-size: 1.25rem !important;
  margin: 6px 0 8px 0 !important;
}

/* ====================================================
   Glossary Category & Single Term Page Refinements
   ==================================================== */
.glossary-page-header .glossary-breadcrumb,
.term-breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--color-text-muted, #888888);
}

.glossary-page-header .glossary-breadcrumb a,
.term-breadcrumb a {
  color: var(--color-text-secondary, #555555);
  text-decoration: none;
  transition: color 0.2s ease;
}

.glossary-page-header .glossary-breadcrumb a:hover,
.term-breadcrumb a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.term-breadcrumb .sep {
  margin: 0 6px;
  color: #cbd5e1;
}

.term-breadcrumb .current {
  color: #1a1a1a;
  font-weight: 600;
}

.glossary-title-wrapper {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.glossary-total-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 12px;
  border-radius: 20px;
}

.glossary-content-wrap {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}

.glossary-card {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 12px !important;
  padding: 1.35rem !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.glossary-card:hover {
  transform: translateY(-3px) !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06) !important;
}

.card-term-title {
  font-family: var(--font-sans) !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  line-height: 1.35 !important;
}

.card-term-title a {
  color: #1a1a1a !important;
  text-decoration: none !important;
}

.card-term-title a:hover {
  color: #2b5aa7 !important;
}

.card-category-badge {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
}

.card-definition {
  font-size: 0.95rem !important;
  color: #475569 !important;
  line-height: 1.65 !important;
  margin: 10px 0 14px 0 !important;
}

.tag-chip {
  font-size: 0.78rem !important;
  color: #64748b !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  padding: 3px 9px !important;
  border-radius: 4px !important;
}

.card-detail-link {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.card-detail-link:hover {
  color: #2b5aa7 !important;
  transform: translateX(2px);
}

/* Single Term Page Article */
.term-single-article {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.term-header {
  margin-bottom: 2rem;
}

.term-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.term-en-badge {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 4px 12px !important;
  border-radius: 6px !important;
  letter-spacing: -0.01em !important;
}

.term-cat-badge {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  padding: 4px 12px !important;
  border-radius: 6px !important;
  letter-spacing: -0.01em !important;
}

.term-main-title {
  font-family: var(--font-sans) !important;
  font-size: 2.25rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  color: #1a1a1a !important;
  line-height: 1.25 !important;
  margin-top: 6px !important;
}

.term-summary-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 5px solid #1a1a1a !important;
  border-radius: 12px !important;
  padding: 1.5rem 1.6rem !important;
  margin-bottom: 2.2rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

.summary-box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.summary-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #1a1a1a;
}

.term-number-badge {
  background: #1a1a1a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.summary-box-body p {
  font-size: 1.02rem !important;
  color: #334155 !important;
  line-height: 1.7 !important;
  margin: 0 !important;
}

.term-deep-dive-section {
  margin-bottom: 2.5rem;
}

.deep-dive-title {
  font-family: var(--font-sans) !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin-bottom: 1rem !important;
  border-bottom: 2px solid #e8e8e8 !important;
  padding-bottom: 10px !important;
}

.deep-dive-card {
  background: #fafafa !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 12px !important;
  padding: 1.6rem 1.8rem !important;
  font-size: 1rem !important;
  line-height: 1.8 !important;
  color: #2b2b2b !important;
}

.related-terms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-term-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 8px 14px;
  border-radius: 8px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.related-term-chip:hover {
  border-color: #1a1a1a;
  background: #f8fafc;
  transform: translateY(-2px);
}

.term-tags-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.5rem 0;
}

.term-tag {
  font-size: 0.82rem;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
}

.term-footer-action {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #e2e8f0;
}

.back-to-list-btn {
  display: inline-block;
  color: #64748b;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.back-to-list-btn:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

/* ====================================================
   Author Bio Card & Google Preferred Source CTA
   ==================================================== */
.author-bio-card {
  margin-top: 2.8rem;
  margin-bottom: 2.5rem;
  padding: 24px 28px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.author-card-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.author-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.author-card-name-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.author-card-name {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
}

.author-card-handle {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.author-card-badges {
  display: flex;
  gap: 6px;
  font-size: 0.78rem;
  flex-wrap: wrap;
}

.author-badge {
  padding: 3px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

.author-card-bio {
  margin: 0 !important;
  font-family: var(--font-sans) !important;
  font-size: 0.94rem !important;
  line-height: 1.7 !important;
  color: #475569 !important;
  word-break: keep-all !important;
}

.author-card-bio a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.author-card-bio a:hover {
  color: #2b5aa7;
}

/* Google Preferred Source CTA Box */
.google-preferred-source-cta {
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #4285f4;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.06);
}

.google-cta-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #1e293b;
  line-height: 1.5;
  flex: 1 1 auto;
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.google-g-icon {
  flex-shrink: 0;
}

.google-preferred-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 24px;
  background: #1a73e8;
  color: #ffffff !important;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.25);
  border: none;
}

.google-preferred-source-btn:hover {
  background: #1557b0 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.35);
}

.author-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.85rem;
}

.author-profile-link {
  color: #1a1a1a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.author-profile-link:hover {
  color: #2b5aa7;
}

.author-card-ext-links {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #64748b;
  font-size: 0.84rem;
}

.author-card-ext-links a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.author-card-ext-links a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.author-card-ext-links .sep {
  opacity: 0.4;
}

@media (max-width: 640px) {
  .author-bio-card {
    padding: 18px 16px;
  }
  .google-preferred-source-cta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    flex-wrap: nowrap;
  }
  .google-cta-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.82rem;
    line-height: 1.42;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  .google-g-icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
  }
  .google-preferred-source-btn {
    width: auto !important;
    flex-shrink: 0;
    justify-content: center;
    padding: 7px 13px;
    font-size: 0.78rem;
    white-space: nowrap;
    box-sizing: border-box;
  }
}

@media (max-width: 380px) {
  .google-preferred-source-cta {
    padding: 10px 12px;
    gap: 8px;
  }
  .google-cta-text {
    font-size: 0.77rem;
    gap: 6px;
  }
  .google-preferred-source-btn {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
}

/* ====================================================
   Dark Mode & Theme Toggle System
   ==================================================== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px;
  color: var(--color-text, #1a1a1a);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  border-radius: 50%;
  margin-right: 4px;
}

.theme-toggle:hover {
  color: var(--color-link, #2b5aa7);
  transform: scale(1.1);
}

/* Toggle icon display: light shows moon, dark shows sun */
html:not([data-theme="dark"]) .theme-toggle .sun,
body:not(.dark) .theme-toggle .sun {
  display: none !important;
}

html[data-theme="dark"] .theme-toggle .moon,
body.dark .theme-toggle .moon {
  display: none !important;
}

html[data-theme="dark"] .theme-toggle .sun,
body.dark .theme-toggle .sun {
  display: block !important;
}

html:not([data-theme="dark"]) .theme-toggle .moon,
body:not(.dark) .theme-toggle .moon {
  display: block !important;
}

/* Dark Mode Color Palette & Variables */
[data-theme="dark"],
html.dark,
body.dark {
  --color-bg: #121316;
  --color-bg-alt: #18191d;
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-faint: #475569;
  --color-link: #60a5fa;
  --color-link-hover: #93c5fd;
  --color-border: #26272b;
  --color-border-light: #1f2024;
  --color-accent: #f8fafc;

  /* Legacy layout variable compatibility */
  --primary: #f1f5f9;
  --secondary: #94a3b8;
  --tertiary: #1f2024;
  --border: #26272b;
  --entry: #18191d;
  --theme: #121316;

  color-scheme: dark;
}

[data-theme="dark"] body,
body.dark {
  background-color: #121316 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .site-header,
body.dark .site-header {
  background: rgba(18, 19, 22, 0.95) !important;
  border-bottom-color: #26272b !important;
}

[data-theme="dark"] .site-logo,
body.dark .site-logo {
  color: #f8fafc !important;
}

[data-theme="dark"] .header-nav-link,
body.dark .header-nav-link {
  color: #94a3b8 !important;
}

[data-theme="dark"] .header-nav-link:hover,
[data-theme="dark"] .header-nav-link.active,
body.dark .header-nav-link:hover,
body.dark .header-nav-link.active {
  color: #f8fafc !important;
}

[data-theme="dark"] .icon-link,
body.dark .icon-link {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .icon-link:hover,
body.dark .icon-link:hover {
  color: #ffffff !important;
}

[data-theme="dark"] .menu-toggle span,
body.dark .menu-toggle span {
  background-color: #cbd5e1 !important;
}

[data-theme="dark"] .page-divider,
body.dark .page-divider {
  background-color: #26272b !important;
}

[data-theme="dark"] .section-label .label-line,
body.dark .section-label .label-line {
  background-color: #26272b !important;
}

[data-theme="dark"] .section-label .label-text,
body.dark .section-label .label-text {
  color: #94a3b8 !important;
}

/* Home Featured & List */
[data-theme="dark"] .featured-card,
body.dark .featured-card {
  border-color: #26272b !important;
  background-color: #18191d !important;
}

[data-theme="dark"] .featured-title,
body.dark .featured-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .featured-excerpt,
body.dark .featured-excerpt {
  color: #94a3b8 !important;
}

[data-theme="dark"] .featured-read,
body.dark .featured-read {
  color: #60a5fa !important;
}

[data-theme="dark"] .post-list-item,
body.dark .post-list-item {
  border-bottom-color: #26272b !important;
}

[data-theme="dark"] .post-list-item:hover,
body.dark .post-list-item:hover {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

[data-theme="dark"] .post-list-title,
body.dark .post-list-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .post-list-title a,
body.dark .post-list-title a {
  color: #f8fafc !important;
}

[data-theme="dark"] .post-list-excerpt,
body.dark .post-list-excerpt {
  color: #94a3b8 !important;
}

[data-theme="dark"] .post-list-tags span,
body.dark .post-list-tags span {
  background-color: #26272b !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .more-link,
body.dark .more-link {
  color: #60a5fa !important;
}

[data-theme="dark"] .home-gallery-item,
body.dark .home-gallery-item {
  border-color: #26272b !important;
}

[data-theme="dark"] .home-about,
body.dark .home-about {
  background-color: #16171a !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .home-about-title,
body.dark .home-about-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .home-about-desc,
body.dark .home-about-desc {
  color: #94a3b8 !important;
}

/* Post Content & Typography */
[data-theme="dark"] .single-title,
body.dark .single-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .single-excerpt,
body.dark .single-excerpt {
  color: #94a3b8 !important;
}

[data-theme="dark"] .single-date,
body.dark .single-date {
  color: #64748b !important;
}

[data-theme="dark"] .post-content,
body.dark .post-content {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .post-content h1,
[data-theme="dark"] .post-content h2,
[data-theme="dark"] .post-content h3,
[data-theme="dark"] .post-content h4,
body.dark .post-content h1,
body.dark .post-content h2,
body.dark .post-content h3,
body.dark .post-content h4 {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .post-content p,
body.dark .post-content p {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .post-content a,
body.dark .post-content a {
  color: #60a5fa !important;
}

[data-theme="dark"] .post-content hr,
body.dark .post-content hr {
  border-color: #26272b !important;
}

[data-theme="dark"] .post-content strong,
body.dark .post-content strong {
  color: #ffffff !important;
}

/* Post Elements: Summary, Quote, Callouts */
[data-theme="dark"] .summary-box,
[data-theme="dark"] .post-content .summary-box,
body.dark .summary-box,
body.dark .post-content .summary-box {
  background-color: rgba(229, 169, 104, 0.1) !important;
  border-color: rgba(229, 169, 104, 0.25) !important;
  border-left-color: #E5A968 !important;
  color: #fed7aa !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .post-content blockquote,
[data-theme="dark"] .default-blockquote,
body.dark .post-content blockquote,
body.dark .default-blockquote {
  background-color: #18191d !important;
  border-color: #26272b !important;
  border-left-color: #64748b !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .post-content blockquote p,
[data-theme="dark"] .post-content blockquote p span,
body.dark .post-content blockquote p,
body.dark .post-content blockquote p span {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .callout-tip, body.dark .callout-tip {
  background-color: rgba(82, 183, 136, 0.12) !important;
  border-color: rgba(82, 183, 136, 0.25) rgba(82, 183, 136, 0.25) rgba(82, 183, 136, 0.25) #52b788 !important;
  color: #b7e4c7 !important;
}
[data-theme="dark"] .callout-tip .callout-header, body.dark .callout-tip .callout-header { color: #d8f3e5 !important; }

[data-theme="dark"] .callout-note, body.dark .callout-note {
  background-color: rgba(91, 141, 239, 0.12) !important;
  border-color: rgba(91, 141, 239, 0.25) rgba(91, 141, 239, 0.25) rgba(91, 141, 239, 0.25) #5b8def !important;
  color: #c2d6ff !important;
}
[data-theme="dark"] .callout-note .callout-header, body.dark .callout-note .callout-header { color: #dce6ff !important; }

[data-theme="dark"] .callout-important, body.dark .callout-important {
  background-color: rgba(157, 78, 221, 0.12) !important;
  border-color: rgba(157, 78, 221, 0.25) rgba(157, 78, 221, 0.25) rgba(157, 78, 221, 0.25) #9d4edd !important;
  color: #e0aaff !important;
}
[data-theme="dark"] .callout-important .callout-header, body.dark .callout-important .callout-header { color: #f3e8ff !important; }

[data-theme="dark"] .callout-warning, body.dark .callout-warning {
  background-color: rgba(233, 160, 48, 0.12) !important;
  border-color: rgba(233, 160, 48, 0.25) rgba(233, 160, 48, 0.25) rgba(233, 160, 48, 0.25) #e9a030 !important;
  color: #fde68a !important;
}
[data-theme="dark"] .callout-warning .callout-header, body.dark .callout-warning .callout-header { color: #fef3c7 !important; }

[data-theme="dark"] .callout-caution, body.dark .callout-caution {
  background-color: rgba(230, 91, 91, 0.12) !important;
  border-color: rgba(230, 91, 91, 0.25) rgba(230, 91, 91, 0.25) rgba(230, 91, 91, 0.25) #e65b5b !important;
  color: #fca5a5 !important;
}
[data-theme="dark"] .callout-caution .callout-header, body.dark .callout-caution .callout-header { color: #fee2e2 !important; }

/* Relcard in Dark Mode */
[data-theme="dark"] .rel-card-box,
[data-theme="dark"] .post-content a.rel-card-box,
body.dark .rel-card-box,
body.dark .post-content a.rel-card-box {
  background-color: #18191d !important;
  border-color: #26272b !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .rel-card-box:hover,
[data-theme="dark"] .post-content a.rel-card-box:hover,
body.dark .rel-card-box:hover,
body.dark .post-content a.rel-card-box:hover {
  border-color: #475569 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .rel-card-image, body.dark .rel-card-image {
  background-color: #141416 !important;
}

[data-theme="dark"] .rel-card-badge, body.dark .rel-card-badge {
  background-color: #26272b !important;
  color: #cbd5e1 !important;
  border-color: #3f3f46 !important;
}

[data-theme="dark"] .rel-card-title, body.dark .rel-card-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .rel-card-desc, body.dark .rel-card-desc {
  color: #94a3b8 !important;
}

/* FAQ Box in Dark Mode */
[data-theme="dark"] .faq-box-container, body.dark .faq-box-container {
  background-color: #18191d !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .faq-box-header, body.dark .faq-box-header {
  border-bottom-color: #26272b !important;
}

[data-theme="dark"] .faq-box-header-title, body.dark .faq-box-header-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .faq-item-accordion, body.dark .faq-item-accordion {
  background-color: #141416 !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .faq-item-summary, body.dark .faq-item-summary {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .faq-item-body, body.dark .faq-item-body {
  background-color: #18191d !important;
  border-top-color: #26272b !important;
}

[data-theme="dark"] .faq-a-content, body.dark .faq-a-content {
  color: #cbd5e1 !important;
}

/* Author Card in Dark Mode */
[data-theme="dark"] .author-bio-card, body.dark .author-bio-card {
  background: #18191d !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .author-card-name, body.dark .author-card-name {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .author-card-handle, body.dark .author-card-handle {
  color: #94a3b8 !important;
}

[data-theme="dark"] .author-badge, body.dark .author-badge {
  background: #26272b !important;
  color: #cbd5e1 !important;
  border-color: #3f3f46 !important;
}

[data-theme="dark"] .author-card-bio, body.dark .author-card-bio {
  color: #94a3b8 !important;
}

[data-theme="dark"] .author-card-bio a, body.dark .author-card-bio a {
  color: #60a5fa !important;
}

[data-theme="dark"] .google-preferred-source-cta, body.dark .google-preferred-source-cta {
  background: #141416 !important;
  border-color: #26272b !important;
  border-left-color: #4285f4 !important;
}

[data-theme="dark"] .google-cta-text, body.dark .google-cta-text {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .author-card-footer, body.dark .author-card-footer {
  border-top-color: #26272b !important;
}

[data-theme="dark"] .author-profile-link, body.dark .author-profile-link {
  color: #60a5fa !important;
}

[data-theme="dark"] .author-card-ext-links a, body.dark .author-card-ext-links a {
  color: #94a3b8 !important;
}

[data-theme="dark"] .author-card-ext-links a:hover, body.dark .author-card-ext-links a:hover {
  color: #f1f5f9 !important;
}

/* Glossary in Dark Mode */
[data-theme="dark"] .glossary-card, body.dark .glossary-card {
  background: #18191d !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .glossary-card:hover, body.dark .glossary-card:hover {
  border-color: #475569 !important;
}

[data-theme="dark"] .card-term-title, body.dark .card-term-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .card-term-title a, body.dark .card-term-title a {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .card-definition, body.dark .card-definition {
  color: #94a3b8 !important;
}

[data-theme="dark"] .tag-chip,
[data-theme="dark"] .term-tag,
body.dark .tag-chip,
body.dark .term-tag {
  background: #26272b !important;
  color: #cbd5e1 !important;
  border-color: #3f3f46 !important;
}

[data-theme="dark"] .card-detail-link, body.dark .card-detail-link {
  color: #60a5fa !important;
}

[data-theme="dark"] #glossary-search-input, body.dark #glossary-search-input {
  background: #18191d !important;
  color: #f1f5f9 !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .glossary-sort-select, body.dark .glossary-sort-select {
  background: #18191d !important;
  color: #f1f5f9 !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .chip, body.dark .chip {
  background: #18191d !important;
  color: #94a3b8 !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .chip.active, body.dark .chip.active {
  background: #f1f5f9 !important;
  color: #121316 !important;
  border-color: #f1f5f9 !important;
}

[data-theme="dark"] .term-main-title, body.dark .term-main-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .term-summary-box, body.dark .term-summary-box {
  background: #18191d !important;
  border-color: #26272b !important;
  border-left-color: #60a5fa !important;
}

[data-theme="dark"] .summary-box-title, body.dark .summary-box-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .term-number-badge, body.dark .term-number-badge {
  background: #60a5fa !important;
  color: #121316 !important;
}

[data-theme="dark"] .summary-box-body p, body.dark .summary-box-body p {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .deep-dive-card, body.dark .deep-dive-card {
  background: #18191d !important;
  border-color: #26272b !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .deep-dive-title, body.dark .deep-dive-title {
  color: #f1f5f9 !important;
  border-bottom-color: #26272b !important;
}

[data-theme="dark"] .related-term-chip, body.dark .related-term-chip {
  background: #18191d !important;
  border-color: #26272b !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .related-term-chip:hover, body.dark .related-term-chip:hover {
  border-color: #60a5fa !important;
}

[data-theme="dark"] .back-to-list-btn, body.dark .back-to-list-btn {
  color: #94a3b8 !important;
}

[data-theme="dark"] .back-to-list-btn:hover, body.dark .back-to-list-btn:hover {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .term-en-badge, body.dark .term-en-badge {
  background: #26272b !important;
  color: #f1f5f9 !important;
  border-color: #3f3f46 !important;
}

[data-theme="dark"] .term-cat-badge, body.dark .term-cat-badge {
  background: #18191d !important;
  color: #cbd5e1 !important;
  border-color: #3f3f46 !important;
}

/* Share & Controls in Dark Mode */
[data-theme="dark"] .share-layout-side .share-btn,
[data-theme="dark"] .share-layout-bottom .share-btn,
body.dark .share-layout-side .share-btn,
body.dark .share-layout-bottom .share-btn {
  background: #18191d !important;
  border-color: #26272b !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .share-layout-side .share-btn:hover,
[data-theme="dark"] .share-layout-bottom .share-btn:hover,
body.dark .share-layout-side .share-btn:hover,
body.dark .share-layout-bottom .share-btn:hover {
  background: #f1f5f9 !important;
  color: #121316 !important;
  border-color: #f1f5f9 !important;
}

[data-theme="dark"] .scroll-to-top-btn,
body.dark .scroll-to-top-btn {
  background: #18191d !important;
  color: #f1f5f9 !important;
  border-color: #3f3f46 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .scroll-to-top-btn:hover,
body.dark .scroll-to-top-btn:hover {
  background: #f1f5f9 !important;
  color: #121316 !important;
  border-color: #f1f5f9 !important;
}

[data-theme="dark"] .share-toast,
body.dark .share-toast {
  background: #f1f5f9 !important;
  color: #121316 !important;
}

/* Gallery & Overlays */
[data-theme="dark"] .gallery-card, body.dark .gallery-card {
  background: #18191d !important;
  border-color: #26272b !important;
}

[data-theme="dark"] .gallery-card-title, body.dark .gallery-card-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .gallery-card-desc, body.dark .gallery-card-desc {
  color: #94a3b8 !important;
}

[data-theme="dark"] .menu-overlay, body.dark .menu-overlay {
  background: #121316 !important;
}

[data-theme="dark"] .menu-close, [data-theme="dark"] .search-close,
body.dark .menu-close, body.dark .search-close {
  color: #94a3b8 !important;
}

[data-theme="dark"] .menu-link-text, body.dark .menu-link-text {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .menu-link:hover .menu-link-text,
[data-theme="dark"] .menu-link.active .menu-link-text,
body.dark .menu-link:hover .menu-link-text,
body.dark .menu-link.active .menu-link-text {
  color: #60a5fa !important;
}

[data-theme="dark"] .search-overlay, body.dark .search-overlay {
  background: rgba(18, 19, 22, 0.98) !important;
}

[data-theme="dark"] .search-input, body.dark .search-input {
  background: transparent !important;
  color: #f1f5f9 !important;
  border-bottom-color: #26272b !important;
}

[data-theme="dark"] .search-result-item h3, body.dark .search-result-item h3 {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .search-result-item p, body.dark .search-result-item p {
  color: #94a3b8 !important;
}

/* Code & Tables */
[data-theme="dark"] pre, [data-theme="dark"] code,
body.dark pre, body.dark code {
  background: #141416 !important;
  border-color: #26272b !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .copy-code-btn, body.dark .copy-code-btn {
  background: #26272b !important;
  color: #e2e8f0 !important;
  border-color: #3f3f46 !important;
}

[data-theme="dark"] .related-posts, body.dark .related-posts {
  border-top-color: #26272b !important;
}

[data-theme="dark"] .related-card, body.dark .related-card {
  border-color: #26272b !important;
  background-color: #18191d !important;
}

[data-theme="dark"] .related-info h4, body.dark .related-info h4 {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .site-footer, body.dark .site-footer {
  background: #121316 !important;
  border-top-color: #26272b !important;
}

[data-theme="dark"] .flaneur-footer-links a, body.dark .flaneur-footer-links a {
  color: #94a3b8 !important;
}

[data-theme="dark"] .flaneur-footer-links a:hover, body.dark .flaneur-footer-links a:hover {
  color: #f8fafc !important;
}

[data-theme="dark"] .footer-bottom p, body.dark .footer-bottom p {
  color: #64748b !important;
}

/* ====================================================
   PWA Standalone Mode & Back Button Support
   ==================================================== */
.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pwa-back-btn {
  display: none; /* 일반 브라우저 창에서는 기본 숨김 */
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px 8px 6px 0;
  margin: 0;
  color: var(--color-text, #1e293b);
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pwa-back-btn:hover {
  opacity: 0.7;
}

.pwa-back-btn:active {
  transform: scale(0.92);
  opacity: 0.5;
}

.pwa-back-btn svg {
  display: block;
  stroke: currentColor;
}

/* PWA Standalone 모드 감지 (웹앱 홈 화면 추가 실행 시) */
@media all and (display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen) {
  .pwa-back-btn {
    display: inline-flex !important;
  }
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

/* iOS Safari PWA (navigator.standalone) 및 pwa-standalone 클래스 대응 */
.pwa-standalone .pwa-back-btn {
  display: inline-flex !important;
}

.pwa-standalone .site-header {
  padding-top: env(safe-area-inset-top, 0px);
}

.pwa-standalone .site-footer {
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

.pwa-standalone .scroll-to-top-btn {
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* 다크모드 대응 */
[data-theme="dark"] .pwa-back-btn,
body.dark .pwa-back-btn {
  color: #f1f5f9 !important;
}

/* ====================================================
   Single Post Cover Image (Posts & Archives)
   ==================================================== */
.single-cover {
  margin: var(--spacing-sm) auto var(--spacing-lg);
}

.single-cover .container {
  max-width: var(--container-width);
  padding: 0 var(--spacing-md);
}

.single-cover img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  display: block;
}

[data-theme="dark"] .single-cover img,
body.dark .single-cover img {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
