/* ==========================================================================
   jesvs' blog - Main Stylesheet
   Bold Editorial with Brutalist Edge
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg: #FAF8F5;
  --fg: #1A1A1A;
  --accent: #8B2635;
  --sage: #6B7B6C;
  --muted: #7A7A7A;
  --border: #E5E2DD;
  --card-bg: #FFFFFF;
  --muted: #6B6B6B;

  /* Typography */
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --container-max: 1200px;
  --content-max: 720px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* --------------------------------------------------------------------------
   Section-specific accent colors
   -------------------------------------------------------------------------- */
[data-section="insights"] {
  --section-accent: #8B2635;
}

[data-section="uncovered"] {
  --section-accent: #4A5568;
}

[data-section="tech"] {
  --section-accent: #2B6CB0;
}

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  margin-bottom: var(--space-lg);
}

a {
  color: var(--section-accent, var(--accent));
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

strong {
  font-weight: 600;
}

time {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1;
  width: 100%;
  max-width: 1920px;
  margin: auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(250, 248, 245, 0.95);
  margin-bottom: var(--space-lg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-lg);
}

.site-logo {
  display: flex;
  align-items: baseline;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--fg);
}

.logo-accent {
  color: var(--accent);
  font-weight: 400;
  font-style: italic;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--section-accent, var(--accent));
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--fg);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Language Switcher */
.language-switcher {
  display: flex;
  align-items: center;
}

.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 32px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background var(--transition-fast);
}

.lang-toggle:hover {
  background: var(--section-accent, var(--accent));
  color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--fg);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all var(--transition-fast);
}

.hamburger {
  top: 50%;
  transform: translate(-50%, -50%);
}

.hamburger::before {
  content: '';
  top: -8px;
}

.hamburger::after {
  content: '';
  top: 8px;
}

/* Mobile Menu Open State */
body.nav-open .site-nav {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

body.nav-open .site-nav .nav-link {
  padding: var(--space-sm) var(--space-md);
}

/* Hamburger animation to X */
body.nav-open .hamburger {
  background: transparent;
}

body.nav-open .hamburger::before {
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}

body.nav-open .hamburger::after {
  top: 0;
  transform: translateX(-50%) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--fg);
  color: var(--bg);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.copyright {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: var(--space-xs);
}

.footer-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  opacity: 0.6;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-md);
}

.footer-link {
  font-size: 0.875rem;
  color: inherit;
  opacity: 0.7;
  text-decoration: none;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.footer-link:hover {
  opacity: 1;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Homepage - Featured Section
   -------------------------------------------------------------------------- */
.featured-section {
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-lg);
}

.featured-post {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.featured-content {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.featured-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
}

.featured-title a {
  color: var(--fg);
}

.featured-title a:hover {
  color: var(--section-accent, var(--accent));
}

.featured-excerpt {
  color: var(--muted);
  font-size: 1.125rem;
  margin-bottom: var(--space-lg);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--section-accent, var(--accent));
}

.read-more svg {
  transition: transform var(--transition-fast);
}

.read-more:hover svg {
  transform: translateX(4px);
}

.featured-image {
  min-height: 300px;
  background: var(--border);
}

.featured-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--sage) 100%);
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Posts Grid
   -------------------------------------------------------------------------- */
.posts-section {
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-lg);
}

.section-title {
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--fg);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
}

.post-card:hover {
  border-color: var(--section-accent, var(--accent));
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.post-card-image {
  min-height: 180px;
  background: var(--border);
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  transition: transform var(--transition-base);
}

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

.post-card-gradient {
  background: linear-gradient(135deg, var(--sage) 0%, var(--accent) 100%);
}

.post-card-content {
  padding: var(--space-lg);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: 0.8125rem;
}

.reading-time {
  color: var(--muted);
  font-size: 0.8125rem;
}

.post-card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.post-card-title a {
  color: var(--fg);
}

.post-card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.post-card-title a:hover {
  color: var(--section-accent, var(--accent));
}

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Single Post
   -------------------------------------------------------------------------- */
.single-post {
  width: 100%;
}

.post-header {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.post-header-content {
  max-width: var(--content-max);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
}

.post-excerpt {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  color: var(--fg);
  padding-top: var(--space-lg);
  margin-top: var(--space-lg);
  margin-bottom: 0;
  border-top: 3px solid var(--accent);
}

/* Post Image */
.post-image-container {
  margin-bottom: var(--space-xl);
}

.post-image {
  margin: 0 auto;
  max-width: var(--container-max);
  padding: 0 var(--space-2xl) var(--space-2xl) var(--space-2xl);
}

.post-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

/* Post Layout with Sidebar */
.post-layout {
  margin-bottom: var(--space-2xl);
}

.post-layout-inner {
  display: block;
  position: relative;
}

/* Post Content */
.post-content {
  max-width: var(--content-max);
  font-size: 1.125rem;
  line-height: 1.8;
}

/* Lead paragraph - opening hook */
.post-content > p:first-of-type {
  font-family: var(--font-serif);
  font-size: 1.4em;
  line-height: 1.4;
  padding: 0 var(--space-xl);
  margin: var(--space-xl) 0;
  border-left: 3px solid var(--accent);
}

.post-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.post-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

.post-content li {
  margin-bottom: var(--space-sm);
}

.post-content blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-xl);
  border-left: 4px solid var(--section-accent, var(--accent));
  background: var(--card-bg);
  font-style: italic;
}

/* Pull Quote - centered emphasis for emotionally resonant moments */
.post-content .pullquote {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  text-align: center;
  margin: var(--space-2xl) auto;
  max-width: 85%;
  padding: var(--space-lg) var(--space-xl);
  position: relative;
  line-height: 1.5;
  color: var(--fg);
}

.post-content .pullquote::before {
  content: "\201C";  /* Opening curly quote */
  font-size: 4rem;
  color: var(--section-accent, var(--accent));
  line-height: 1;
  position: absolute;
  left: -0.25em;
  top: -0.5em;
  opacity: 0.4;
}

.post-content .pullquote::after {
  content: "\201D";  /* Closing curly quote */
  font-size: 4rem;
  color: var(--section-accent, var(--accent));
  line-height: 1;
  position: absolute;
  right: -0.25em;
  bottom: -0.5em;
  opacity: 0.4;
}

.post-content code {
  background: var(--border);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.post-content pre {
  background: var(--fg);
  color: var(--bg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* Post Footer */
.post-footer {
  border-top: 1px solid var(--border);
  padding-top: var(--space-xl);
}

/* Post Navigation - Previous/Next */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-decoration: none;
  min-height: 120px;
  justify-content: center;
}

.post-nav-link:hover {
  border-color: var(--section-accent, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-nav-prev {
  text-align: left;
}

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

.post-nav-direction {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.post-nav-prev .post-nav-direction::before {
  content: '←';
  font-size: 1.25rem;
}

.post-nav-next .post-nav-direction::after {
  content: '→';
  font-size: 1.25rem;
}

.post-nav-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
  transition: color var(--transition-fast);
}

.post-nav-link:hover .post-nav-title {
  color: var(--section-accent, var(--accent));
}

.post-share {
  margin-bottom: var(--space-2xl);
}

.post-related {
  margin-bottom: var(--space-2xl);
}

/* --------------------------------------------------------------------------
   Author Display
   -------------------------------------------------------------------------- */
/* Compact author display in post header */
.post-author {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding-left: var(--space-md);
  border-left: 1px solid var(--border);
}

.author-avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.author-name {
  font-weight: 500;
  color: var(--fg);
}

/* Full author bio card in footer */
.author-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.author-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.author-info {
  flex: 1;
}

.author-card .author-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--fg);
}

.author-bio {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Share Buttons
   -------------------------------------------------------------------------- */
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.share-label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: var(--space-sm);
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all var(--transition-fast);
}

.share-button:hover {
  border-color: currentColor;
  transform: translateY(-2px);
}

.share-twitter:hover {
  color: #000000;
  background: #000000;
  border-color: #000000;
}

.share-twitter:hover svg {
  color: white;
}

.share-facebook:hover {
  color: white;
  background: #1877F2;
  border-color: #1877F2;
}

.share-linkedin:hover {
  color: white;
  background: #0A66C2;
  border-color: #0A66C2;
}

.share-whatsapp:hover {
  color: white;
  background: #25D366;
  border-color: #25D366;
}

/* --------------------------------------------------------------------------
   Related Posts
   -------------------------------------------------------------------------- */
.related-posts {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.related-title {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.related-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  overflow: hidden;
}

.related-card:hover {
  border-color: var(--section-accent, var(--accent));
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.related-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.related-card-image {
  min-height: 160px;
  background: var(--border);
  overflow: hidden;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.related-card:hover .related-card-image img {
  transform: scale(1.05);
}

.related-card-gradient {
  background: linear-gradient(135deg, var(--sage) 0%, var(--accent) 100%);
}

.related-card-content {
  padding: var(--space-md);
}

.related-card-title {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  line-height: 1.4;
  color: var(--fg);
}

.related-card:hover .related-card-title {
  color: var(--section-accent, var(--accent));
}

.related-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   POST TAGS
   -------------------------------------------------------------------------- */
.post-tags {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tags-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.tag-pill:hover {
  background-color: var(--section-accent, var(--accent));
  border-color: var(--section-accent, var(--accent));
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 38, 53, 0.25);
}

/* --------------------------------------------------------------------------
   TAG PAGE
   -------------------------------------------------------------------------- */
.tag-page {
  padding: var(--space-3xl) 0;
}

.tag-page-header {
  text-align: center;
  padding: var(--space-3xl) 0;
  margin-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border);
}

.tag-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.tag-name {
  color: var(--section-accent, var(--accent));
}

.tag-count {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-xl);
}

.pagination a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg);
  transition: all var(--transition-fast);
}

.pagination a:hover {
  border-color: var(--section-accent, var(--accent));
  color: var(--section-accent, var(--accent));
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   List Page
   -------------------------------------------------------------------------- */
.list-page {
  padding-bottom: var(--space-2xl);
}

.list-header {
  padding: var(--space-2xl) 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.list-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.list-description {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 600px;
  margin: var(--space-md) auto 0;
}

/* --------------------------------------------------------------------------
   Desktop Only / Mobile Only Utilities
   -------------------------------------------------------------------------- */
.desktop-only {
  display: none;
}

.mobile-only {
  display: block;
}

/* --------------------------------------------------------------------------
   Responsive Styles
   -------------------------------------------------------------------------- */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .featured-post {
    grid-template-columns: 1fr 1fr;
  }

  .featured-content {
    order: 1;
  }

  .featured-image {
    order: 2;
    min-height: 400px;
  }

  .desktop-only {
    display: block;
  }

  .mobile-only {
    display: none;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .header-inner {
    height: 72px;
  }

  .post-content {
    width: 100%;
    margin: 0 auto;
    max-width: 65ch; /* Optimal for long-form reading */
  }

  .featured-image {
    min-height: 450px;
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--space-2xl);
  }

  .featured-section,
  .posts-section {
    padding: 0 var(--space-2xl);
  }

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

  .featured-content {
    padding: var(--space-2xl);
  }
}

/* Mobile Adjustments */
@media (max-width: 767px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .posts-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-navigation {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .post-nav-link {
    min-height: 100px;
  }

  .share-buttons {
    justify-content: flex-start;
  }

  .post-title {
    font-size: 1.75rem;
  }

  .featured-content {
    padding: var(--space-lg);
  }

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

  .author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .share-buttons,
  .related-posts,
  .pagination {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .post-content {
    max-width: 100%;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

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

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--section-accent, var(--accent));
  color: white;
  padding: var(--space-sm) var(--space-md);
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  animation: fadeIn 0.4s ease-out;
}

/* Stagger animation for grid items */
.posts-grid .post-card:nth-child(2),
.related-grid .post-card:nth-child(2) { animation-delay: 0.1s; }
.posts-grid .post-card:nth-child(3),
.related-grid .post-card:nth-child(3) { animation-delay: 0.2s; }
.posts-grid .post-card:nth-child(4),
.related-grid .post-card:nth-child(4) { animation-delay: 0.3s; }
.posts-grid .post-card:nth-child(5),
.related-grid .post-card:nth-child(5) { animation-delay: 0.4s; }
.posts-grid .post-card:nth-child(6),
.related-grid .post-card:nth-child(6) { animation-delay: 0.5s; }
.posts-grid .post-card:nth-child(7),
.related-grid .post-card:nth-child(7) { animation-delay: 0.6s; }
.posts-grid .post-card:nth-child(8),
.related-grid .post-card:nth-child(8) { animation-delay: 0.7s; }

/* --------------------------------------------------------------------------
   INLINE IMAGES - Editorial Illustration Style
   -------------------------------------------------------------------------- */

/* Base illustration styling */
.post-content img[alt="illustration"] {
  width: 100%;
  height: auto;
  display: block;
  margin: var(--space-xl) 0;
  border-radius: 0;
  filter: contrast(1.05) saturate(1.1);
  transition: all var(--transition-base);
  position: relative;
}

/* Create editorial frame effect with pseudo-element for sharp corners */
.post-content img[alt="illustration"] {
  padding: 3px;
  background: linear-gradient(135deg, var(--fg) 0%, var(--fg) 100%);
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.1);
}

/* Desktop: Full-width editorial presentation */
@media (min-width: 768px) {
  .post-content img[alt="illustration"] {
    margin: var(--space-2xl) calc(var(--space-xl) * -1);
    max-width: calc(100% + var(--space-2xl));
    width: calc(100% + var(--space-2xl));
    padding: 4px;
    box-shadow:
      0 1px 0 var(--fg),
      0 0 0 1px var(--fg),
      0 8px 32px rgba(26, 26, 26, 0.15);
  }

  /* Hover effect - subtle lift */
  .post-content img[alt="illustration"]:hover {
    transform: translateY(-4px);
    box-shadow:
      0 1px 0 var(--fg),
      0 0 0 1px var(--fg),
      0 16px 48px rgba(26, 26, 26, 0.2);
  }
}

/* Mobile: Edge-to-edge with frame */
@media (max-width: 767px) {
  .post-content img[alt="illustration"] {
    margin: var(--space-lg) calc(var(--space-lg) * -1);
    width: calc(100% + var(--space-2xl));
    max-width: calc(100% + var(--space-2xl));
    padding: 2px;
    box-shadow:
      0 1px 0 var(--fg),
      0 0 0 1px var(--fg),
      0 4px 16px rgba(26, 26, 26, 0.12);
  }
}

/* Figure/caption support for future use */
.post-content figure {
  margin: var(--space-xl) 0;
}

.post-content figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.post-content figure figcaption {
  margin-top: var(--space-md);
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--muted);
  text-align: left;
  font-family: var(--font-serif);
  padding-left: var(--space-md);
  border-left: 2px solid var(--accent);
}

/* --------------------------------------------------------------------------
   READING PROGRESS BAR
   -------------------------------------------------------------------------- */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--section-accent, var(--accent));
  transition: width 0.1s ease-out;
  z-index: 1000;
  pointer-events: none;
}

@media (max-width: 767px) {
  .reading-progress-bar {
    height: 4px; /* Thicker on mobile for visibility */
  }
}

/* --------------------------------------------------------------------------
   BACK TO TOP BUTTON
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--section-accent, var(--accent));
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
  transform: translateY(-2px);
}

/* Mobile: Larger, more accessible */
@media (max-width: 767px) {
  .back-to-top {
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 52px;
    height: 52px;
  }
}

/* --------------------------------------------------------------------------
   SCROLL ANIMATIONS
   -------------------------------------------------------------------------- */
.post-content > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}

.post-content > *.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger child elements for list items */
.post-content ul li,
.post-content ol li {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.post-content ul.in-view li,
.post-content ol.in-view li {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for list items */
.post-content ul.in-view li:nth-child(1) { transition-delay: 0.05s; }
.post-content ul.in-view li:nth-child(2) { transition-delay: 0.1s; }
.post-content ul.in-view li:nth-child(3) { transition-delay: 0.15s; }
.post-content ul.in-view li:nth-child(4) { transition-delay: 0.2s; }
.post-content ul.in-view li:nth-child(5) { transition-delay: 0.25s; }
.post-content ul.in-view li:nth-child(6) { transition-delay: 0.3s; }

/* Exclude from animation (first paragraph already handled separately) */
.post-content > p:first-of-type {
  opacity: 1;
  transform: none;
}

/* Images should have a slightly more dramatic animation */
.post-content img {
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  transform: translateY(40px) scale(0.98);
}

.post-content img.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .post-content > *,
  .post-content ul li,
  .post-content ol li,
  .post-content img {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   STICKY TABLE OF CONTENTS
   -------------------------------------------------------------------------- */
.toc-sidebar {
  display: none; /* Hidden on mobile by default */
}

@media (min-width: 1024px) {
  .post-layout-inner {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: var(--space-2xl);
  }

  .toc-sidebar {
    display: block;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-width: 200px;
  }

  .toc-sticky {
    position: sticky;
    top: 100px;
  }

  .toc-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: var(--space-md);
  }

  .toc-sidebar nav {
    border-left: 2px solid var(--border);
  }

  .toc-sidebar ul {
    list-style: none;
    padding-left: var(--space-md);
    margin: 0;
  }

  .toc-sidebar li {
    margin-bottom: var(--space-sm);
  }

  .toc-sidebar a {
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: block;
    padding-left: var(--space-sm);
    border-left: 2px solid transparent;
    margin-left: -2px;
  }

  .toc-sidebar a:hover,
  .toc-sidebar a.active {
    color: var(--section-accent, var(--accent));
    border-left-color: var(--section-accent, var(--accent));
  }

  /* Nested headings */
  .toc-sidebar ul ul {
    padding-left: var(--space-lg);
    margin-top: var(--space-sm);
  }
}

/* --------------------------------------------------------------------------
   LANDING PAGE - Editorial Showcase
   -------------------------------------------------------------------------- */

.landing-page {
  width: 100%;
}

/* Featured Articles Grid */
.featured-grid {
  padding: clamp(40px, 8vw, 80px) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.featured-grid__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.featured-grid__posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.featured-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.featured-card__link {
  display: block;
  text-decoration: none;
}

.featured-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--border);
}

.featured-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.featured-card:hover .featured-card__image img {
  transform: scale(1.05);
}

.featured-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--border) 0%, var(--muted) 100%);
}

.featured-card__content {
  padding: var(--space-md);
}

.featured-card__section {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: block;
  margin-bottom: var(--space-xs);
}

.featured-card__title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--fg);
  margin-bottom: var(--space-xs);
}

.featured-card__date {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Featured Grid Responsive */
@media (max-width: 1024px) {
  .featured-grid__posts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .featured-grid__posts {
    grid-template-columns: 1fr;
  }
}

/* Section Showcase */
.section-showcase {
  padding: clamp(60px, 10vw, 120px) var(--space-lg);
  background: var(--bg);
}

.section-showcase__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 6vw, 64px);
}

/* Section Cards */
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--section-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.section-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  border-color: var(--section-accent, var(--border));
}

.section-card:hover::before {
  opacity: 1;
}

.section-card__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.section-card__title-link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  text-decoration: none;
  transition: opacity var(--transition-base);
}

.section-card__title-link:hover {
  opacity: 0.7;
}

.section-card__number {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  line-height: 1;
  color: var(--section-accent, var(--accent));
  opacity: 0.5;
}

.section-card__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--fg);
}

.section-card__description {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Section Posts */
.section-card__posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.section-card__post {
  display: flex;
  gap: var(--space-md);
  text-decoration: none;
  color: inherit;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.section-card__post:hover {
  background: rgba(0, 0, 0, 0.02);
}

.section-card__post-image {
  width: 100px;
  height: 75px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--border);
}

.section-card__post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.section-card__post-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: block;
  margin-bottom: var(--space-xs);
}

.section-card__post-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--fg);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-card__post:hover .section-card__post-title {
  color: var(--section-accent, var(--accent));
}

/* Section Link */
.section-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--section-accent, var(--accent));
  text-decoration: none;
  transition: gap var(--transition-fast);
}

.section-card__link:hover {
  gap: var(--space-md);
}

.section-card__link svg {
  transition: transform var(--transition-fast);
}

.section-card__link:hover svg {
  transform: translateX(4px);
}

/* Section-specific card accents */
.section-card--insights {
  border-left: 4px solid transparent;
}

.section-card--insights:hover {
  border-left-color: #8B2635;
}

.section-card--uncovered {
  border-left: 4px solid transparent;
}

.section-card--uncovered:hover {
  border-left-color: #4A5568;
}

.section-card--tech {
  border-left: 4px solid transparent;
}

.section-card--tech:hover {
  border-left-color: #2B6CB0;
}

/* Tablet and above */
@media (min-width: 768px) {
  .section-card__post-image {
    width: 120px;
    height: 90px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .section-showcase__inner {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-card {
    padding: var(--space-xl);
  }

  .section-card__title-link {
    flex-direction: column;
    gap: var(--space-md);
  }

  .section-card__number {
    font-size: 3rem;
  }

  .section-card__title {
    font-size: 1.5rem;
  }

  .section-card__post {
    flex-direction: column;
  }

  .section-card__post-image {
    width: 100%;
    height: 140px;
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .featured-grid {
    padding: 80px var(--space-2xl);
  }

  .section-showcase {
    padding: 120px var(--space-2xl);
  }

  .section-card {
    padding: var(--space-2xl);
  }
}
