/* ============================================================================
   FLAVOR THEME — Dark Editorial Blog CSS
   A cinematic dark blog theme inspired by Dan Koe's "future/proof" Substack.
   Designed for Gridea Pro.
   ============================================================================ */


/* ============================================================================
   § 1. CSS CUSTOM PROPERTIES
   ============================================================================ */

:root {
  /* ── Colors ── */
  --color-bg: #000000;
  --color-surface: #111111;
  --color-border: #222222;
  --color-border-light: #1a1a1a;
  --color-border-hover: #444444;
  --color-text-primary: #ffffff;
  --color-text-secondary: #999999;
  --color-text-muted: #666666;
  --color-text-body: #e0e0e0;
  --color-accent: #54675e;
  --color-accent-hover: #FFFF00;
  --color-badge-gold: #e8c547;

  /* ── Typography (Apple-style system font stack) ── */
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
  --font-size-base: 16px;
  --line-height-base: 1.58824;

  /* ── Layout ── */
  --max-width: 1200px;
  --content-width: 900px;
  --sidebar-width: 280px;
  --grid-gap: 48px;

  /* ── Spacing ── */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 80px;

  /* ── Transitions ── */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;

  /* ── Header heights ── */
  --top-bar-height: 56px;
  --header-total: 56px;
}


/* ============================================================================
   § 2. RESET & BASE
   ============================================================================ */

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

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  word-break: break-word;
  overflow-wrap: break-word;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

mark {
  background-color: rgba(255, 255, 0, 0.25);
  color: var(--color-accent-hover);
  padding: 1px 2px;
  border-radius: 2px;
  white-space: nowrap;
}

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

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

h1 {
  font-size: 2.2rem;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}


/* ============================================================================
   § 3. SCROLLBAR STYLING
   ============================================================================ */

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: var(--color-bg);
}

body::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

/* Firefox */
body {
  scrollbar-width: thin;
  scrollbar-color: #333333 var(--color-bg);
}


/* ============================================================================
   § 4. UTILITY CLASSES
   ============================================================================ */

/* ── Container ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-section + .container {
  margin-top: 40px;
}

/* ── Meta text ── */
.meta-text {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.007em;
  font-weight: 400;
}

/* ── Line clamp ── */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Mobile-only visibility ── */
.mobile-only {
  display: none !important;
}


/* ============================================================================
   § 5. SITE HEADER
   ============================================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

/* ── Top Bar ── */
.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--top-bar-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.site-avatar-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.site-name-link {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  white-space: nowrap;
  text-decoration: none;
}

.site-name-link:hover {
  color: var(--color-text-primary);
}

.top-bar__nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast),
    background-color var(--transition-fast);
  cursor: pointer;
}

.search-btn:hover {
  color: var(--color-text-primary);
  background-color: var(--color-surface);
}

.search-btn svg {
  width: 18px;
  height: 18px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.nav-toggle:hover {
  color: var(--color-text-primary);
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: var(--top-bar-height);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  color: var(--color-text-primary);
}

.nav-item--active {
  color: var(--color-text-primary);
}

/* ── Apple-style Hamburger ── */
.hamburger {
  width: 16px;
  height: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger__line {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: var(--color-text-primary);
  border-radius: 1px;
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity 0.2s ease;
  transform-origin: center;
}

.hamburger__line--top {
  position: absolute;
  top: 1px;
}

.hamburger__line--bottom {
  position: absolute;
  bottom: 1px;
}

.hamburger.is-active .hamburger__line--top {
  transform: translateY(4.5px) rotate(45deg);
}

.hamburger.is-active .hamburger__line--bottom {
  transform: translateY(-4.5px) rotate(-45deg);
}

/* ── Header Spacer ── */
.header-spacer {
  height: var(--header-total);
}

.main-content-wrapper {
  margin-top: var(--header-total);
}


/* ============================================================================
   § 6. CONTENT GRID (Main + Sidebar)
   ============================================================================ */

.content-grid {
  display: flex;
  gap: var(--grid-gap);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.main-content {
  flex: 1;
  min-width: 0;
}


/* ============================================================================
   § 7. HERO SECTION
   ============================================================================ */

.hero-section {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.3) 50%,
      transparent 100%);
  z-index: 1;
}

.hero-content {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
  z-index: 2;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--color-text-primary);
  line-height: 1.1;
  max-width: 600px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-top: 8px;
  max-width: 600px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--color-text-primary);
  text-decoration: none;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.hero-cta .meta-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-cta:hover {
  color: var(--color-text-primary);
  opacity: 0.8;
}

.hero-cta__icon {
  display: inline-block;
  animation: hero-arrow-bounce 1.2s ease-in-out infinite;
}

@keyframes hero-arrow-bounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

.hero-cta svg {
  width: 16px;
  height: 16px;
}


/* ============================================================================
   § 8. SECTION HEADERS
   ============================================================================ */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.section-more {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.section-more:hover {
  color: var(--color-text-primary);
}


/* ============================================================================
   § 9. COMPACT POST GRID
   ============================================================================ */

.compact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: var(--color-border);
  margin-bottom: 48px;
}


/* ============================================================================
   § 10. COMPACT POST CARD
   ============================================================================ */

.post-card--compact {
  background-color: var(--color-bg);
  padding: 20px;
}

.post-card--compact .post-card__inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.post-card--compact .post-card__body {
  flex: 1;
  min-width: 0;
}

.post-card--compact .post-card__title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  line-height: 1.32;
  transition: color var(--transition-fast);
}

.post-card--compact .post-card__meta {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.post-card__thumb-square {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.4s ease;
}

.post-card__inner:hover .post-card__thumb-square {
  transform: scale(1.06);
}

.post-card--compact .post-card__inner:hover .post-card__title {
  color: var(--color-accent-hover);
}


/* ============================================================================
   § 11. LIST POST CARD
   ============================================================================ */

.post-card--list {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.post-card--list .post-card__body {
  flex: 1;
  min-width: 0;
}

.post-card--list .post-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1.25;
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

.post-card__title-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card__title-link:hover .post-card__title {
  color: var(--color-accent-hover);
}

.post-card--list .post-card__excerpt {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  text-decoration: none;
  display: block;
}

.post-card--list .post-card__meta {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Badge: Pinned / Top ── */
.badge--top {
  display: inline-block;
  background-color: var(--color-badge-gold);
  color: var(--color-bg);
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* ── Post thumbnail ── */
.post-card__thumb-link {
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  border-radius: 8px;
}

.post-card__thumb {
  width: 200px;
  height: 134px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.post-card__thumb-link:hover .post-card__thumb {
  transform: scale(1.06);
}


/* ============================================================================
   § 12. SIDEBAR
   ============================================================================ */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 120px;
}

.sidebar__section {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.sidebar__section:first-child {
  padding-top: 0;
}

.sidebar__section:last-child {
  border-bottom: none;
}

.sidebar__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}

.sidebar__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.sidebar__desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.sidebar__section-title {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.sidebar__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar__link {
  display: block;
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.sidebar__link:hover {
  color: var(--color-text-primary);
}


/* ============================================================================
   § 13. TAG PILL
   ============================================================================ */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 10px;
  padding: 16px 0;
}

.tag-pill {
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: border-color var(--transition-fast),
    color var(--transition-fast);
}

.tag-pill:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.tag-pill--lg {
  padding: 6px 16px;
  font-size: 13px;
  gap: 6px;
}

.tag-pill--lg .tag-pill__name {
  margin-right: 6px;
}

.tag-pill--lg .tag-pill__count {
  font-size: 12px;
  color: var(--color-text-muted);
}


/* ============================================================================
   § 14. ARTICLE PAGE
   ============================================================================ */

/* ── Article Container ── */
.article-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 64px 24px 80px;
}

/* ── Article Header ── */
.article-header {
  margin-bottom: 32px;
  text-align: left;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-text-primary);
  line-height: 1.06;
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.article-meta__category {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.article-meta__category:hover {
  color: var(--color-accent-hover);
}

.article-meta__sep {
  margin: 0 8px;
  color: var(--color-text-muted);
}

.article-meta__item {
  color: var(--color-text-secondary);
}

/* ── Article Feature Image ── */
.article-feature {
  margin-bottom: 32px;
}

.article-feature img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

/* ── Article Content ── */
.article-content {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  color: var(--color-text-body);
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-text-primary);
  margin: 2.5em 0 0.8em;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text-primary);
  margin: 2em 0 0.6em;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.article-content h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-text-primary);
  margin: 1.8em 0 0.5em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.article-content p {
  margin-bottom: 1.4em;
}

.article-content a {
  color: var(--color-accent-hover);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.article-content a:hover {
  color: var(--color-text-primary);
}

.article-content strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

.article-content em {
  font-style: italic;
}

.article-content blockquote {
  border-left: 3px solid #333333;
  padding-left: 20px;
  color: var(--color-text-secondary);
  font-style: italic;
  margin: 2em 0;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content pre {
  background-color: var(--color-surface);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}

.article-content pre code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0;
  background: none;
  color: inherit;
  border-radius: 0;
}

.article-content code {
  font-family: var(--font-mono);
  background-color: #1a1a1a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Ensure inline code inside pre doesn't double-style */
.article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875em;
}

.article-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 2em 0;
  display: block;
}

.article-content figure {
  margin: 2em 0;
}

.article-content figcaption {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
  text-align: center;
}

.article-content ul {
  padding-left: 1.5em;
  margin-bottom: 1.8em;
  list-style: disc;
}

.article-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.8em;
  list-style: decimal;
}

.article-content li {
  margin-bottom: 0.6em;
  line-height: 1.9;
}

.article-content li>ul,
.article-content li>ol {
  margin-top: 0.5em;
  margin-bottom: 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5em 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.9em;
}

.article-content th,
.article-content td {
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  text-align: left;
}

.article-content th {
  background-color: var(--color-surface);
  font-weight: 400;
  color: var(--color-text-primary);
}

.article-content td {
  color: var(--color-text-body);
}

/* ── Article Tags Bar (between double lines) ── */
.article-tags-bar {
  margin-top: 48px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 0;
}

.article-tags-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Article Header Tags ── */
.article-header__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* ── Post Navigation (Prev/Next) ── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.post-nav-card {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 120px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.post-nav-card:hover {
  border-color: var(--color-border-hover);
  background-color: #161616;
  color: inherit;
}

.post-nav-card--empty {
  border: 1px dashed var(--color-border);
  background: none;
}

.post-nav-card--empty:hover {
  border-color: var(--color-border);
  background: none;
}

.post-nav-card__empty-text {
  font-size: 13px;
  color: var(--color-text-muted);
}

.post-nav-card__img {
  width: 120px;
  flex-shrink: 0;
  overflow: hidden;
}

.post-nav-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-nav-card:hover .post-nav-card__img img {
  transform: scale(1.05);
}

.post-nav-card__body {
  flex: 1;
  min-width: 0;
  padding: 16px 36px 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.post-nav-card--prev .post-nav-card__body {
  padding: 16px 20px 16px 36px;
}

.post-nav-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.post-nav-card__title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav-card__arrow {
  position: absolute;
  top: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.post-nav-card--prev .post-nav-card__arrow {
  left: 12px;
}

.post-nav-card--next .post-nav-card__arrow {
  right: 12px;
}

.post-nav-card--next {
  text-align: right;
}

.post-nav-card--next .post-nav-card__body {
  align-items: flex-end;
}

.post-nav-card:hover .post-nav-card__arrow {
  color: var(--color-text-primary);
}

.post-nav-card--prev:hover .post-nav-card__arrow {
  transform: translateX(-3px);
}

.post-nav-card--next:hover .post-nav-card__arrow {
  transform: translateX(3px);
}

/* ── View More Button ── */
.view-more {
  text-align: center;
  margin-top: 40px;
}

/* ── Pagination Info ── */
.pagination__info {
  font-size: 14px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
}


/* ============================================================================
   § 15. SEARCH MODAL
   ============================================================================ */

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.search-overlay--hidden {
  display: none;
}

.search-modal {
  width: 600px;
  max-width: calc(100vw - 32px);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.2s ease;
}

.search-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.search-icon svg {
  width: 100%;
  height: 100%;
}

.search-input {
  flex: 1;
  background: none;
  border: none !important;
  color: var(--color-text-primary);
  font-size: 16px;
  font-family: var(--font-body);
  outline: none !important;
  box-shadow: none !important;
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}

.search-input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.search-close:hover {
  color: var(--color-text-primary);
}

.search-close svg {
  width: 18px;
  height: 18px;
}

.search-results {
  overflow-y: auto;
  padding: 8px 0;
}

.search-result-item {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color var(--transition-fast);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--color-border-light);
}

.search-result-item__title {
  font-size: 15px;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-item__title mark {
  white-space: nowrap;
}

.search-arrow {
  float: right;
  margin-left: 8px;
}

.search-result-item__excerpt {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.search-result-item__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.search-result-item__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.search-result-item__tag {
  font-size: 11px;
  color: var(--color-primary, #4a6ee0);
  background: color-mix(in srgb, var(--color-primary, #4a6ee0) 8%, transparent);
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.4;
}

.search-result-item__tag--hit {
  color: #FFFF00;
  background: rgba(255, 255, 0, 0.25);
}

.search-result-item__date {
  font-size: 11px;
  color: #444444;
  margin-left: auto;
}

.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding: 2px 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  line-height: 1;
}

.search-arrow {
  float: right;
  margin-left: 8px;
  color: var(--color-text-muted);
  font-size: 14px;
  transition: color var(--transition-fast);
}

.search-result-item:hover .search-arrow {
  color: var(--color-text-primary);
}


/* ============================================================================
   § 16. PAGINATION
   ============================================================================ */

.pagination {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 40px 0;
  margin-top: 16px;
}

.pagination a,
.pagination span {
  transition: all var(--transition-fast);
}


/* ============================================================================
   § 17. BUTTONS
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  line-height: 1.4;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ── Secondary ── */
.btn--secondary {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  border-color: var(--color-border-hover);
  background-color: var(--color-border-light);
  color: var(--color-text-primary);
}

/* ── Primary ── */
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-text-primary);
  border: 1px solid var(--color-accent);
}

.btn--primary:hover {
  background-color: #6a7d73;
  border-color: #6a7d73;
  color: var(--color-text-primary);
}

/* ── Ghost ── */
.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid transparent;
}

.btn--ghost:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border);
}


/* ============================================================================
   § 18. PAGE LAYOUT (About, Archives, Tags, Friends, Memos, Tag, 404)
   ============================================================================ */

.page-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.page-header {
  padding-top: 64px;
  margin-bottom: 40px;
}

.page-subtitle {
  margin-top: 12px;
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--color-text-primary);
}

.page-description {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}


/* ============================================================================
   § 19. ARCHIVE LIST
   ============================================================================ */


.archive-year {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-top: 40px;
  margin-bottom: 16px;
}

.archive-year:first-child {
  margin-top: 0;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
}

.archive-item__date {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  width: 80px;
  font-family: var(--font-body);
}

.archive-item__title {
  font-size: 15px;
  color: var(--color-text-body);
}

.archive-item__title a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

.archive-item__title a:hover {
  color: var(--color-accent);
}


/* ============================================================================
   § 20. TAGS CLOUD
   ============================================================================ */

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-card {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.tag-card:hover {
  border-color: var(--color-border-hover);
  background-color: var(--color-border-light);
}

.tag-card__name {
  font-size: 15px;
  color: var(--color-text-primary);
  margin-right: 8px;
}

.tag-card__count {
  font-size: 13px;
  color: var(--color-text-muted);
}


/* ============================================================================
   § 21. MEMOS TIMELINE
   ============================================================================ */

.memo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.memo-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.memo-item:first-child {
  padding-top: 0;
}

.memo-item:last-child {
  border-bottom: none;
}

.memo-item__content {
  font-size: 15px;
  color: var(--color-text-body);
  line-height: 1.6;
}

.memo-item__content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.memo-item__content a:hover {
  color: var(--color-accent-hover);
}

.memo-item__date {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 8px;
}


/* ============================================================================
   § 22. FRIENDS GRID
   ============================================================================ */

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.link-card {
  padding: 20px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.link-card:hover {
  border-color: var(--color-border-hover);
  background-color: #161616;
}

.link-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.link-card__avatar-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.link-card__avatar-wrap img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.link-card__avatar-text {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.link-card__info {
  flex: 1;
  min-width: 0;
}

.link-card__name {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.link-card__arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--color-border);
  color: var(--color-text-secondary);
  transition: background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.link-card:hover .link-card__arrow {
  background-color: var(--color-text-primary);
  color: #000;
  transform: translateX(2px);
}

.link-card__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  padding-left: 58px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ============================================================================
   § 23. EMPTY STATE
   ============================================================================ */

.empty-state {
  padding: 80px 20px;
  text-align: center;
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
  display: block;
}

.empty-state__text {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1.5;
}


/* ============================================================================
   § 24. 404 ERROR PAGE
   ============================================================================ */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 24px;
}

.error-code {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 500;
  color: var(--color-border);
  line-height: 1;
}

.error-message {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.error-link {
  margin-top: 24px;
}


/* ============================================================================
   § 25. FOOTER
   ============================================================================ */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}

.footer-nav__link {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-nav__link:hover {
  color: var(--color-text-primary);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.footer-social__link {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.footer-social__link:hover {
  color: var(--color-text-primary);
}

.footer-social__link svg {
  width: 20px;
  height: 20px;
}

.footer-copyright {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.footer-powered {
  font-size: 12px;
  color: #444;
}

.footer-powered a {
  color: var(--color-text-muted);
  text-underline-offset: 2px;
}

.footer-powered a:hover {
  color: var(--color-text-primary);
}


/* ============================================================================
   § 26. ANIMATIONS & KEYFRAMES
   ============================================================================ */

/* ── Fade In ── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ── Slide Down ── */
@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Global interactive transitions ── */
a,
button,
input,
.post-card__title,
.tag-pill,
.tag-card,
.link-card,
.btn,
.nav-item,
.search-btn,
.search-close {
  transition: color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}


/* ============================================================================
   § 27. RESPONSIVE — TABLET (max-width: 768px)
   ============================================================================ */

@media (max-width: 768px) {

  /* ── Navigation ── */
  .nav-toggle {
    display: flex;
  }

  .mobile-only {
    display: flex !important;
  }

  .top-bar__nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--top-bar-height);
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
      opacity 0.3s ease;
  }

  .top-bar__nav--open {
    max-height: 400px;
    opacity: 1;
  }

  .top-bar__nav .nav-item {
    padding: 14px 24px;
    height: auto;
    border-bottom: 1px solid var(--color-border-light);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .top-bar__nav--open .nav-item {
    opacity: 1;
    transform: translateY(0);
  }

  .top-bar__nav--open .nav-item:nth-child(1) { transition-delay: 0.05s; }
  .top-bar__nav--open .nav-item:nth-child(2) { transition-delay: 0.1s; }
  .top-bar__nav--open .nav-item:nth-child(3) { transition-delay: 0.15s; }
  .top-bar__nav--open .nav-item:nth-child(4) { transition-delay: 0.2s; }
  .top-bar__nav--open .nav-item:nth-child(5) { transition-delay: 0.25s; }
  .top-bar__nav--open .nav-item:nth-child(6) { transition-delay: 0.3s; }
  .top-bar__nav--open .nav-item:nth-child(7) { transition-delay: 0.35s; }

  .top-bar__nav .nav-item:hover,
  .top-bar__nav .nav-item--active {
    background-color: var(--color-surface);
  }

  .top-bar__nav .nav-item:last-child {
    border-bottom: none;
  }

  /* ── Content Grid ── */
  .content-grid {
    flex-direction: column;
    gap: 32px;
  }

  /* ── Sidebar ── */
  .sidebar {
    display: none;
  }

  /* ── Search overlay: closer to top on mobile ── */
  .search-overlay {
    padding-top: 60px;
  }

  /* ── Search kbd shortcut ── */
  .search-kbd {
    display: none;
  }

  /* ── Compact Grid ── */
  .compact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ── List Post Card Thumbnail ── */
  .post-card__thumb {
    width: 120px;
    height: auto;
    aspect-ratio: 3 / 2;
  }

  /* ── Article Title ── */
  .article-title {
    font-size: 1.8rem;
  }

  /* ── Post Nav ── */
  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-card {
    height: 100px;
  }

  .post-nav-card--empty {
    height: 60px;
  }

  .post-nav-card__img {
    width: 90px;
  }

  /* ── Hero Section ── */
  .hero-section {
    height: 280px;
  }

  .hero-content {
    bottom: 24px;
    padding: 0 16px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  /* ── Header Spacer (collapsed — no section bar visible) ── */
  .main-content-wrapper {
    margin-top: var(--top-bar-height);
  }

  /* ── Container padding ── */
  .container {
    padding: 0 16px;
  }

  .content-grid {
    padding: 0 16px;
  }

  /* ── Page layout ── */
  .page-container {
    padding: 0 16px 60px;
  }

  .article-container {
    padding: 40px 16px 60px;
  }

  .page-header {
    padding-top: 40px;
  }

  /* ── Footer ── */
  .footer-inner {
    padding: 0 16px;
  }
}


/* ============================================================================
   § 28. RESPONSIVE — SMALL MOBILE (max-width: 480px)
   ============================================================================ */

@media (max-width: 480px) {

  /* ── Compact Grid: single column ── */
  .compact-grid {
    grid-template-columns: 1fr;
  }

  /* ── List Post Card: stack vertically ── */
  .post-card--list {
    flex-direction: column;
    gap: 16px;
  }

  .post-card--list .post-card__thumb-link {
    order: -1;
    width: 100%;
  }

  .post-card--list .post-card__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    order: -1;
  }

  /* ── Hero ── */
  .hero-content {
    bottom: 20px;
    padding: 0 16px;
  }

  .hero-title {
    font-size: 1.3rem;
  }

  /* ── Article ── */
  .article-title {
    font-size: 1.6rem;
  }

  .article-content {
    font-size: 16px;
  }

  /* ── Error Page ── */
  .error-code {
    font-size: 5rem;
  }

  /* ── Friends Grid ── */
  .links-grid {
    grid-template-columns: 1fr;
  }

  /* ── Page title ── */
  .page-title {
    font-size: 1.6rem;
  }
}


/* ============================================================================
   § 29. PRINT STYLES
   ============================================================================ */

@media print {

  /* ── Hide non-content elements ── */
  .site-header,
  .site-footer,
  .sidebar,
  .search-overlay,
  .search-modal,
  .nav-toggle,
  .search-btn,
  .section-bar,
  .pagination,
  .article-tags,
  .btn {
    display: none !important;
  }

  /* ── Reset background and colors ── */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.6;
  }

  /* ── Remove top margin from header spacer ── */
  .main-content-wrapper {
    margin-top: 0 !important;
  }

  .header-spacer {
    display: none !important;
  }

  /* ── Article content ── */
  .article-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .article-content {
    color: #000000 !important;
    font-size: 12pt;
  }

  .article-content h2,
  .article-content h3,
  .article-content h4 {
    color: #000000 !important;
  }

  .article-title {
    color: #000000 !important;
    font-size: 24pt;
  }

  .article-byline__author,
  .article-byline__date {
    color: #333333 !important;
  }

  .article-content a {
    color: #000000 !important;
    text-decoration: underline;
  }

  .article-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666666;
  }

  .article-content blockquote {
    border-left-color: #cccccc !important;
    color: #333333 !important;
  }

  .article-content pre {
    background: #f5f5f5 !important;
    border: 1px solid #cccccc;
  }

  .article-content code {
    background: #f0f0f0 !important;
    color: #333333 !important;
  }

  .article-content th {
    background: #f0f0f0 !important;
    color: #000000 !important;
  }

  .article-content td {
    color: #000000 !important;
  }

  .article-content th,
  .article-content td {
    border-color: #cccccc !important;
  }

  .article-content img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* ── Page breaks ── */
  h2,
  h3,
  h4 {
    page-break-after: avoid;
  }

  p,
  li,
  blockquote {
    orphans: 3;
    widows: 3;
  }

  pre {
    page-break-inside: avoid;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* ── Page container ── */
  .page-container {
    max-width: 100%;
    padding: 0;
    color: #000000 !important;
  }

  .page-title {
    color: #000000 !important;
  }

  .page-description {
    color: #333333 !important;
  }

  /* ── Archive ── */
  .archive-year {
    color: #000000 !important;
  }

  .archive-item__title {
    color: #000000 !important;
  }

  .archive-item__date {
    color: #333333 !important;
  }
}


/* ============================================================================
   § 30. SELECTION HIGHLIGHT
   ============================================================================ */

::selection {
  background-color: var(--color-accent);
  color: var(--color-text-primary);
}

::-moz-selection {
  background-color: var(--color-accent);
  color: var(--color-text-primary);
}


/* ============================================================================
   § 31. FOCUS STYLES (Accessibility)
   ============================================================================ */

*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Remove focus ring for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================================
   § 32. IMAGE LOADING & PLACEHOLDERS
   ============================================================================ */

img {
  background-color: var(--color-surface);
}

img[loading="lazy"] {
  opacity: 1;
  transition: opacity var(--transition-normal), transform 0.4s ease;
}


/* ============================================================================
   § 33. GRIDEA PRO CONTENT OVERRIDES
   ============================================================================ */

/* Gridea outputs .post-content for article bodies — alias to article-content */
.post-content {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  color: var(--color-text-body);
}

.post-content h2 {
  font-size: 1.5rem;
  color: var(--color-text-primary);
  margin: 2em 0 1em;
  font-weight: 400;
}

.post-content h3 {
  font-size: 1.25rem;
  color: var(--color-text-primary);
  margin: 1.5em 0 0.75em;
  font-weight: 400;
}

.post-content p {
  margin-bottom: 1.5em;
}

.post-content a {
  color: var(--color-accent-hover);
  text-decoration: none;
}

.post-content a:hover {
  color: var(--color-text-primary);
}

.post-content blockquote {
  border-left: 3px solid #333333;
  padding-left: 20px;
  color: var(--color-text-secondary);
  font-style: italic;
  margin: 1.5em 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content pre {
  background-color: var(--color-surface);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-content pre code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0;
  background: none;
  color: inherit;
}

.post-content code {
  font-family: var(--font-mono);
  background-color: #1a1a1a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5em 0;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.post-content li {
  margin-bottom: 0.5em;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.post-content th,
.post-content td {
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  text-align: left;
}

.post-content th {
  background-color: var(--color-surface);
  font-weight: 400;
}


/* ============================================================================
   § 34. CONTENT SECTION SPACING
   ============================================================================ */

.content-section {
  margin-bottom: 48px;
}

.content-section:last-child {
  margin-bottom: 0;
}


/* ============================================================================
   § 35. SUBSCRIBE / NEWSLETTER BLOCK (Optional)
   ============================================================================ */

.subscribe-block {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  margin: 48px 0;
}

.subscribe-block__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.subscribe-block__desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.subscribe-block__form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.subscribe-block__input {
  flex: 1;
  padding: 10px 16px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 14px;
  transition: border-color var(--transition-fast);
}

.subscribe-block__input::placeholder {
  color: var(--color-text-muted);
}

.subscribe-block__input:focus {
  border-color: var(--color-accent);
}

@media (max-width: 480px) {
  .subscribe-block__form {
    flex-direction: column;
  }

  .subscribe-block {
    padding: 24px 16px;
  }
}


/* ============================================================================
   § 36. TABLE OF CONTENTS (Optional — Article sidebar)
   ============================================================================ */

.toc {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.toc__title {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc__item {
  margin-bottom: 6px;
}

.toc__item--h3 {
  padding-left: 16px;
}

.toc__link {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.5;
  transition: color var(--transition-fast);
}

.toc__link:hover,
.toc__link--active {
  color: var(--color-text-primary);
}


/* ============================================================================
   § 38. COMMENTS SECTION (Generic wrapper)
   ============================================================================ */

.comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.comments-section__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: 24px;
}


/* ============================================================================
   § 39. LOADING STATES
   ============================================================================ */

.skeleton {
  background: linear-gradient(90deg,
      var(--color-surface) 25%,
      var(--color-border) 50%,
      var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton--text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton--title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton--thumb {
  width: 72px;
  height: 72px;
  border-radius: 4px;
}


/* ============================================================================
   § 40. VISUALLY HIDDEN (Screen reader only)
   ============================================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ============================================================================
   § COMMENT SECTION
   ============================================================================ */

.comment-section {
  border-top: 1px solid var(--color-border);
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-2xl);
}

.comment-section__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
}

/* ── Waline dark overrides ── */
.comment-section .wl-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* ── Valine dark overrides ── */
.comment-section .v {
  color: var(--color-text-body);
}
.comment-section .v .vwrap {
  border-color: var(--color-border) !important;
}
.comment-section .v .vwrap .vheader .vinput {
  background: transparent !important;
  border-color: var(--color-border) !important;
  color: var(--color-text-primary) !important;
}
.comment-section .v .vwrap .vedit textarea {
  background: transparent !important;
  color: var(--color-text-primary) !important;
}
/* 提交 & 加载更多按钮 */
.comment-section .v .vbtn {
  background-color: var(--color-surface) !important;
  color: var(--color-text-primary) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 6px !important;
}
.comment-section .v .vbtn:hover {
  border-color: var(--color-border-hover) !important;
  background-color: var(--color-border-light) !important;
  color: var(--color-text-primary) !important;
}
/* 评论卡片分割线 */
.comment-section .v .vcard .vh {
  border-bottom: 1px dashed var(--color-border) !important;
}
.comment-section .v .vcard:last-child .vh {
  border-bottom: none !important;
}
/* 子评论前的竖线 */
.comment-section .v .vquote {
  border-left: 1px dashed var(--color-border) !important;
}
/* 头像边框 & 占位 */
.comment-section .v .vimg {
  border: 1px solid var(--color-border) !important;
  background-color: var(--color-surface) !important;
}
/* 回复按钮 — 气泡 icon */
.comment-section .v .vmeta .vat {
  font-size: 0 !important;
  color: var(--color-text-muted) !important;
  transition: color var(--transition-fast);
}
.comment-section .v .vmeta .vat::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: var(--color-text-muted);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  vertical-align: middle;
  transition: background-color var(--transition-fast);
}
.comment-section .v .vmeta .vat:hover::before {
  background-color: var(--color-text-primary);
}

/* ── Gitalk dark overrides ── */
.comment-section .gt-container {
  color: var(--color-text-body);
}
.comment-section .gt-container .gt-header-textarea {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}
.comment-section .gt-container .gt-btn {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}
.comment-section .gt-container .gt-btn:hover {
  border-color: var(--color-border-hover);
  background-color: var(--color-border-light);
  color: var(--color-text-primary);
}
.comment-section .gt-container .gt-btn-loadmore {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}
.comment-section .gt-container .gt-btn-loadmore:hover {
  border-color: var(--color-border-hover);
  background-color: var(--color-border-light);
}
.comment-section .gt-container .gt-comment {
  border-color: var(--color-border);
}
.comment-section .gt-container .gt-comment-body {
  color: var(--color-text-body);
}
.comment-section .gt-container .gt-comment-reply {
  border-left-color: var(--color-border);
}
.comment-section .gt-container .gt-avatar img {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
}
.comment-section .gt-container a {
  color: var(--color-accent);
}
.comment-section .gt-container a:hover {
  color: var(--color-accent-hover);
}

/* ── Disqus dark overrides ── */
.comment-section #disqus_thread {
  color-scheme: dark;
}

/* ── Twikoo dark overrides ── */
.comment-section .tk-comments {
  color: var(--color-text-body);
}

/* ── Giscus responsive ── */
.comment-section .giscus,
.comment-section .giscus-frame {
  width: 100%;
}

/* ── Cusdis responsive ── */
.comment-section #cusdis_thread iframe {
  width: 100% !important;
  color-scheme: dark;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .comment-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
  }
}


/* ============================================================================
   END OF FLAVOR THEME CSS
   ============================================================================ */