/*
 * PkeLibrary Core Stylesheet — v1.5.0
 * Premium Editorial Design System inspired by Apple Newsroom & Apple Developer.
 * Clean, minimalist, cinematic typography and layout system.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Light Palette — Apple HIG inspired */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #fafafa;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-light: rgba(0, 113, 227, 0.09);
  --accent-light-hover: rgba(0, 113, 227, 0.15);
  --border: #e5e5ea;
  --border-strong: #d1d1d6;
  --code-bg: #161618;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --container-width: 1280px;
  --reading-width: 710px;
  --nav-height: 48px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.12);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.10);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 220ms var(--ease-in-out);
  --transition-fast: all 150ms var(--ease-in-out);
}

[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #111112;
  --bg-tertiary: #1c1c1e;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #2997ff;
  --accent-hover: #4da3ff;
  --accent-light: rgba(41, 151, 255, 0.10);
  --accent-light-hover: rgba(41, 151, 255, 0.18);
  --border: #2c2c2e;
  --border-strong: #3a3a3c;
  --code-bg: #0d0d0e;
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  font-size: 17px;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

a:hover { opacity: 0.85; }

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

ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1.5rem; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.content-container {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   SCROLL REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay classes */
.reveal-d1 { transition-delay: 0.05s; }
.reveal-d2 { transition-delay: 0.12s; }
.reveal-d3 { transition-delay: 0.19s; }
.reveal-d4 { transition-delay: 0.26s; }
.reveal-d5 { transition-delay: 0.33s; }
.reveal-d6 { transition-delay: 0.40s; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.35);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--border);
  opacity: 1;
  transform: translateY(-1px);
}

/* ============================================================
   NAVIGATION HEADER — Apple-style ultra-minimal
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
  background-color: rgba(0, 0, 0, 0.80);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .site-header.scrolled {
  background-color: rgba(0, 0, 0, 0.93);
}

.nav-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--nav-height);
  padding: 0 2rem;
  max-width: var(--container-width);
  margin: 0 auto;
}

.site-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 1;
  transition: opacity 0.2s;
}

.site-logo:hover { opacity: 0.75; }

.site-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Center nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  justify-content: center;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  position: relative;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  opacity: 1;
}

/* Right actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.nav-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
}

.nav-action-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

/* Mobile hamburger — hidden on desktop */
.mobile-menu-toggle {
  display: none;
}

/* ============================================================
   HERO SECTION — cinematic featured post
   ============================================================ */
.hero-section {
  padding: 2rem 0 1rem 0;
}

.hero-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1.2rem;
}

/* Full-width cinematic hero card */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
  min-height: 400px;
}

.hero-grid:hover {
  box-shadow: var(--shadow-md);
}

.hero-image-wrapper {
  overflow: hidden;
  position: relative;
  background-color: var(--bg-secondary);
  min-height: 360px;
}

.hero-image-wrapper a {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
  will-change: transform;
}

.hero-grid:hover .hero-image {
  transform: scale(1.04);
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 3.5rem;
}

.post-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.post-category {
  color: var(--accent);
  font-weight: 700;
}

.post-meta .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background-color: var(--text-tertiary);
  display: inline-block;
}

.hero-title {
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.hero-title a {
  color: inherit;
  transition: color 0.2s ease;
}

.hero-title a:hover {
  color: var(--accent);
  opacity: 1;
}

.hero-excerpt {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 2rem;
  line-height: 1.65;
  max-width: 400px;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  opacity: 0.9;
  transition: var(--transition-fast);
}

.section-link:hover { opacity: 1; }

.section-link svg { transition: transform 0.2s ease; }
.section-link:hover svg { transform: translateX(3px); }

/* ============================================================
   LATEST ARTICLES GRID
   ============================================================ */
.latest-section {
  padding: 3rem 0 1rem 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 4rem;
}

/* Post Card — Apple Newsroom style */
.post-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  transition: transform 0.3s var(--ease-out);
  will-change: transform;
}

.post-card:hover {
  transform: translateY(-3px);
}

.post-card-image-link {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
  background-color: var(--bg-secondary);
  margin-bottom: 1.1rem;
  width: 100%;
}

.post-card-placeholder-img {
  width: 100%;
  height: 100%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
  will-change: transform;
  display: block;
}

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

.post-card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 0;
}

/* Category label — Apple Newsroom style (small-caps) */
.post-card-category {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-category:hover {
  color: var(--accent);
  opacity: 1;
}

/* Title — large and bold, no underline */
.post-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 0.65rem;
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Date — small, below title */
.post-card-date {
  display: block;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: auto;
  padding-top: 0.4rem;
}

/* ============================================================
   EXPLORE LIBRARIES (CATEGORY CARDS)
   ============================================================ */
.categories-section {
  padding: 3.5rem 0 4rem 0;
}

.categories-section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.categories-section-header h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.categories-section-header p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 280px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background-color: #111;
  will-change: transform;
}

.category-card-bg-image-wrapper {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  overflow: hidden;
}

.category-card-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
  opacity: 0.85;
  will-change: transform;
}

.category-card-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 20%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0.82) 100%);
  z-index: 2;
  transition: var(--transition);
}

.category-card:hover .category-card-bg-image {
  transform: scale(1.08);
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.category-card:hover .category-card-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0) 10%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.88) 100%);
}

.category-card-content {
  position: relative;
  z-index: 3;
  padding: 1.6rem 1.8rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.category-card-tag {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.65);
}

.category-card-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.category-card-arrow {
  margin-top: 4px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
  color: rgba(255,255,255,0.8);
}

.category-card:hover .category-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   POPULAR RESOURCES SECTION
   ============================================================ */
.resources-section { padding: 0 0 2rem 0; }

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.resource-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s ease;
  box-shadow: var(--shadow-xs);
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.resource-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  background-color: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-light-hover);
}

.resource-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.resource-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 1.3rem;
  flex-grow: 1;
  line-height: 1.6;
}

.resource-download-link {
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  transition: gap 0.2s ease;
}

.resource-download-link svg { transition: transform 0.25s ease; }
.resource-card:hover .resource-download-link svg { transform: translateY(3px); }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter-container-section { padding: 1rem 0 0 0; }

.newsletter-section {
  position: relative;
  background: linear-gradient(145deg, #f0f4ff 0%, #f5f5f7 60%, #eef2ff 100%);
  border-radius: var(--radius-2xl);
  padding: 4rem 2rem;
  text-align: center;
  max-width: 760px;
  margin: 0 auto 5rem auto;
  border: 1px solid rgba(0, 113, 227, 0.15);
  box-shadow: 0 4px 24px rgba(0, 113, 227, 0.07), var(--shadow-sm);
  overflow: hidden;
}

/* Subtle accent glow top bar */
.newsletter-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #6366f1, var(--accent));
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

/* Dark mode — card becomes visible with a glowing border */
[data-theme="dark"] .newsletter-section {
  background: linear-gradient(145deg, #0d1525 0%, #111827 60%, #0d1525 100%);
  border-color: rgba(41, 151, 255, 0.2);
  box-shadow: 0 0 40px rgba(41, 151, 255, 0.08), 0 4px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .newsletter-section::before {
  background: linear-gradient(90deg, #2997ff, #818cf8, #2997ff);
  opacity: 0.9;
}

.newsletter-icon {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.newsletter-icon svg {
  opacity: 0.9;
}

.newsletter-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

[data-theme="dark"] .newsletter-title {
  color: #f5f5f7;
}

.newsletter-desc {
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 2rem auto;
  font-size: 15px;
  line-height: 1.65;
}

[data-theme="dark"] .newsletter-desc {
  color: #a1a1a6;
}

.newsletter-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 0.85rem;
}

.newsletter-form {
  display: flex;
  max-width: 440px;
  margin: 0 auto;
  gap: 10px;
}

.newsletter-input {
  flex-grow: 1;
  padding: 11px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-strong);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .newsletter-input {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

[data-theme="dark"] .newsletter-input::placeholder {
  color: #6e6e73;
}

.newsletter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Plugin form wrapper (WPForms / CF7) dark-mode fix */
.newsletter-plugin-form {
  max-width: 480px;
  margin: 0 auto;
}

[data-theme="dark"] .newsletter-plugin-form input[type="email"],
[data-theme="dark"] .newsletter-plugin-form input[type="text"] {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f5f5f7 !important;
}

[data-theme="dark"] .newsletter-plugin-form input::placeholder {
  color: #6e6e73 !important;
}



/* ============================================================
   SITE FOOTER — Apple-style minimal
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 2.5rem 0;
  background-color: var(--bg-secondary);
  font-size: 13px;
  color: var(--text-secondary);
}

[data-theme="dark"] .site-footer {
  background-color: var(--bg-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h4 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.footer-brand p {
  line-height: 1.7;
  max-width: 240px;
  font-size: 13px;
}

.footer-nav-col h5 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-links li { margin-bottom: 0.65rem; }

.footer-links a {
  color: var(--text-secondary);
  font-size: 13px;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-social-link {
  color: var(--text-tertiary);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

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

/* ============================================================
   SINGLE POST / ARTICLE PAGE
   ============================================================ */
.post-detail-container { padding: 0; }

.post-header {
  padding: 4rem 0 2.5rem 0;
  text-align: center;
}

.post-header-meta {
  margin-bottom: 1.5rem;
  justify-content: center;
}

.post-detail-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.post-author-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 2.5rem;
}

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

.author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.post-featured-image-wrapper {
  max-width: 960px;
  margin: 0 auto 3rem auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: var(--bg-secondary);
}

.post-featured-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Reading Progress Indicator */
.reading-progress-container {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 200;
  background-color: transparent;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.1s linear;
}

/* Post Layout: TOC sidebar + main content */
.post-layout-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 4rem;
  margin-bottom: 5rem;
  align-items: start;
}

.post-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
  align-self: start;
}

.post-toc-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.post-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-toc-item { }

.post-toc-link {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
  line-height: 1.5;
}

.post-toc-link:hover, .post-toc-link.active {
  color: var(--accent);
  background-color: var(--accent-light);
  opacity: 1;
}

/* ============================================================
   EDITORIAL CONTENT BODY — premium reading experience
   ============================================================ */
.post-body {
  font-size: 1.075rem;
  line-height: 1.85;
  color: var(--text-primary);
  width: 100%;
  max-width: var(--reading-width);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.post-body > * + * { margin-top: 1.75rem; }

.post-body p {
  margin-bottom: 1.75rem;
  color: var(--text-primary);
}

.post-body h2 {
  font-size: 1.6rem;
  margin-top: 3rem;
  margin-bottom: 1.1rem;
  letter-spacing: -0.025em;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-body h3 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  letter-spacing: -0.02em;
}

.post-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.7rem;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.post-body a:hover {
  color: var(--accent-hover);
  opacity: 1;
}

.post-body ul, .post-body ol {
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }

.post-body li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.post-body blockquote {
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--accent);
  background-color: var(--accent-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.post-body blockquote p { margin-bottom: 0; }

.post-body img, .post-body figure {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 2.5rem auto;
  box-shadow: var(--shadow-md);
}

.post-body figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
  font-style: italic;
}

.post-body iframe {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  max-width: 100%;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}

.post-body table th, .post-body table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-body table th {
  background-color: var(--bg-secondary);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-body table tr:nth-child(even) { background-color: var(--bg-tertiary); }

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Code blocks */
.post-body code {
  font-family: "SF Mono", "Fira Code", "Cascadia Mono", monospace;
  font-size: 0.875em;
  background-color: var(--bg-secondary);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.post-body pre {
  background-color: var(--code-bg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2rem 0;
  max-width: 100%;
}

.post-body pre code {
  background: none;
  border: none;
  color: #e8e8e8;
  font-size: 14px;
  line-height: 1.7;
  padding: 0;
}

/* Code block wrapper (injected by JS) */
.code-wrapper {
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e1e20;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.code-lang {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  font-family: "SF Mono", monospace;
}

.copy-btn {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
}

.code-wrapper pre {
  margin: 0;
  border-radius: 0;
  border: none;
  max-width: 100%;
  width: 100%;
  overflow-x: auto !important;
  box-sizing: border-box;
}

/* Mobile collapsible TOC */
.mobile-toc-details {
  display: none;
  margin-bottom: 2rem;
}

.mobile-toc-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  user-select: none;
}

.mobile-toc-summary::-webkit-details-marker { display: none; }
.mobile-toc-summary svg { transition: transform 0.25s ease; }
.mobile-toc-details[open] .mobile-toc-summary svg { transform: rotate(180deg); }

.mobile-toc-list {
  list-style: none;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background-color: var(--bg-primary);
}

.mobile-toc-list a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0;
  transition: color 0.2s ease;
}

.mobile-toc-list a:hover { color: var(--accent); opacity: 1; }

/* ============================================================
   POST NAVIGATION
   ============================================================ */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  margin-bottom: 4rem;
}

.nav-meta-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.nav-post-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color 0.2s ease;
}

.nav-post-title:hover { color: var(--accent); opacity: 1; }
.nav-next { text-align: right; }

/* ============================================================
   AUTHOR BOX
   ============================================================ */
.author-box {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  margin-bottom: 4rem;
}

.author-box-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.author-box-content h4 {
  font-size: 16px;
  margin-bottom: 0.5rem;
}

.author-box-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.author-box-socials { display: flex; gap: 0.75rem; }

.author-box-social-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  background-color: var(--accent-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.author-box-social-link:hover {
  background-color: var(--accent);
  color: #fff;
  opacity: 1;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.post-header .breadcrumbs {
  justify-content: center;
}

.breadcrumbs a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.breadcrumbs a:hover { color: var(--accent); opacity: 1; }
.breadcrumbs .sep { color: var(--text-tertiary); }
.breadcrumbs .current { color: var(--text-tertiary); }

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
/* ============================================================
   SEARCH OVERLAY — Hashnode-inspired compact modal
   ============================================================ */
.search-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  padding-left: 1rem;
  padding-right: 1rem;
}

[data-theme="dark"] .search-overlay {
  background-color: rgba(0, 0, 0, 0.75);
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* The white card container */
.search-form-container {
  width: 100%;
  max-width: 580px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transform: translateY(-12px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .search-form-container {
  background: #1a1f2e;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.search-overlay.open .search-form-container {
  transform: translateY(0);
}

/* Input row */
.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.search-input-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
  display: flex;
}

.search-input-field {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  border: none;
  background: none;
  color: var(--text-primary);
  outline: none;
  padding: 0;
  letter-spacing: 0;
  text-align: left;
}

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

.search-close-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: var(--transition-fast);
  flex-shrink: 0;
  letter-spacing: 0;
}

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

/* Quick links panel (shown when no query typed) */
.search-quick-links {
  padding: 16px 18px 8px;
}

.search-quick-links-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  display: block;
}

.search-quick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-quick-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.15s ease;
  text-decoration: none;
  opacity: 1;
}

.search-quick-item a:hover {
  background: var(--bg-secondary);
  opacity: 1;
}

.search-quick-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

[data-theme="dark"] .search-quick-icon {
  background: rgba(255,255,255,0.07);
}

.search-quick-item a:hover .search-quick-icon {
  background: var(--accent);
  color: #fff;
}

/* Live search results (shown when typing) */
.search-live-results {
  display: none;
  flex-direction: column;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  max-height: 320px;
  overflow-y: auto;
}

.search-live-results.active {
  display: flex;
}

.live-search-status {
  padding: 12px 8px;
  font-size: 14px;
  color: var(--text-tertiary);
  text-align: center;
}

.live-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s ease;
  opacity: 1;
}

.live-search-item:hover {
  background: var(--bg-secondary);
  opacity: 1;
}

.live-search-img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.live-search-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.live-search-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-search-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Search footer tip */
.search-tip {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 10px 18px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-tip kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: var(--font-sans);
  color: var(--text-secondary);
}



/* ============================================================
   ARCHIVE / CATEGORY / SEARCH / DEFAULT PAGES
   ============================================================ */
.archive-container,
.resources-page-container,
.search-container {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

@media (min-width: 769px) {
  .archive-container,
  .resources-page-container,
  .search-container {
    padding-top: 3rem;
    padding-bottom: 5rem;
  }
}

.archive-header,
.resources-page-header,
.page-header {
  padding: 1.5rem 0 0.5rem 0;
  border-bottom: none;
  margin-bottom: 0;
  text-align: left;
}

.post-header {
  padding: 2.5rem 0 1.5rem 0;
  text-align: center;
  border-bottom: none;
  margin-bottom: 0;
}

@media (min-width: 769px) {
  .archive-header,
  .resources-page-header,
  .page-header {
    padding: 3.5rem 0 0.5rem 0;
    margin-bottom: 0;
  }
  .post-header {
    padding: 3.5rem 0 2rem 0;
  }
}

/* ============================================================
   SEARCH & FILTER BAR LAYOUT
   ============================================================ */
.search-filter-bar-container {
  margin-bottom: 2rem;
  width: 100%;
}

.search-filter-bar-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem 0 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 769px) {
  .search-filter-bar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1rem 0 1.5rem 0;
  }
}

/* Search input wrapper with magnifying glass inside */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-input-wrapper .search-field {
  padding-left: 38px !important;
}

/* Category Filter Tags */
.category-filter-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: -4px;
  width: 100%;
}

@media (min-width: 769px) {
  .category-filter-tags {
    width: auto;
    max-width: 70%;
    justify-content: flex-end;
  }
}

/* Hide scrollbars for filter tags */
.category-filter-tags::-webkit-scrollbar {
  display: none;
}

.filter-tag-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-tag-btn:hover {
  background-color: var(--border);
  color: var(--text-primary);
  opacity: 1;
}

.filter-tag-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.archive-title,
.resources-page-title,
.page-title {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.archive-desc,
.resources-page-desc,
.page-desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 680px;
  margin-top: 0.5rem;
}

.archive-count {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.archive-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 3rem;
  flex-wrap: wrap;
}

@media (min-width: 769px) {
  .archive-pagination {
    margin-top: 5rem;
  }
}

.archive-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
  min-width: 36px;
  height: 36px;
  transition: all 0.2s ease;
}

.archive-pagination .page-numbers:hover {
  background-color: var(--border);
  color: var(--text-primary);
}

.archive-pagination .page-numbers.current {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  pointer-events: none;
}

.archive-pagination .page-numbers.prev,
.archive-pagination .page-numbers.next {
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
}

/* Page default layout */
.page-body {
  max-width: var(--reading-width);
  margin: 0 auto 3rem auto;
}

@media (min-width: 769px) {
  .page-body {
    margin-bottom: 5rem;
  }
}

/* ============================================================
   ADSENSE INTEGRATION
   ============================================================ */
.archive-ad-card {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  width: 100%;
}

.adsense-placeholder {
  width: 100%;
  max-width: 728px;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  box-sizing: border-box;
}

.adsense-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.adsense-inner {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.adsense-inner strong {
  color: var(--text-primary);
}

.post-ad-slot {
  margin: 2.5rem 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

@media (max-width: 768px) {
  .adsense-placeholder {
    padding: 1rem;
    margin: 1rem auto;
    border-radius: var(--radius-md);
  }
  .adsense-inner {
    font-size: 12px;
  }
}

/* ============================================================
   COMMENTS SECTION
   ============================================================ */
.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.comment-form textarea { min-height: 160px; resize: vertical; }

/* ============================================================
   RESPONSIVE — 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    border-radius: var(--radius-xl);
    min-height: auto;
  }

  .hero-image-wrapper {
    min-height: 280px;
    height: 300px;
  }

  .hero-content {
    padding: 2.5rem;
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-layout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .post-sidebar {
    display: none;
  }

  .mobile-toc-details {
    display: block;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* ============================================================
   RESPONSIVE — 768px
   ============================================================ */
@media (max-width: 768px) {
  body { font-size: 16px; }

  .container { padding: 0 1.25rem; }

  /* Nav: hide center links, show hamburger */
  .nav-container {
    grid-template-columns: 1fr auto;
    padding: 0 1.25rem;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background-color: var(--bg-primary);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    gap: 0.25rem;
    overflow-y: auto;
    z-index: 99;
    border-top: 1px solid var(--border);
  }

  /* Reset any ul/li injected by wp_nav_menu */
  .main-nav ul,
  .main-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  /* Flatten nested menu to single level */
  .main-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
  }

  .main-nav.open { display: flex; }

  .nav-link {
    font-size: 17px;
    font-weight: 600;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border-bottom: none;
    color: var(--text-primary);
  }

  .nav-link:hover, .nav-link.active {
    background-color: var(--bg-secondary);
  }

  .mobile-menu-toggle {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 6px;
    border-radius: var(--radius-md);
  }

  .mobile-menu-toggle:hover { background: var(--bg-secondary); }

  /* Hero */
  .hero-section { padding: 1.25rem 0 0.5rem 0; }

  .hero-content {
    padding: 1.75rem 1.5rem;
  }

  .hero-excerpt { display: none; }

  /* Articles */
  .latest-section { padding: 2rem 0 0.5rem 0; }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  /* Categories */
  .categories-section { padding: 2.5rem 0 3rem 0; }

  .categories-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    gap: 1rem;
  }

  .categories-grid::-webkit-scrollbar { height: 3px; }
  .categories-grid::-webkit-scrollbar-track { background: transparent; }
  .categories-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

  .category-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    height: 260px;
  }

  /* Article reading */
  .post-header { padding: 2rem 0 1.5rem 0; }

  .post-detail-title {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .post-body {
    font-size: 1rem;
    line-height: 1.75;
  }

  .post-body h2 { font-size: 1.35rem; }
  .post-body h3 { font-size: 1.15rem; }

  .post-featured-image-wrapper {
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
  }

  .post-navigation {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .nav-next { text-align: left; align-items: flex-start; }

  .author-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 1.75rem;
    gap: 1.25rem;
  }

  .author-box-socials { justify-content: center; }

  /* Newsletter */
  .newsletter-form { flex-direction: column; }
  .newsletter-input { border-radius: var(--radius-full); }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Comments */
  .comment-form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }

  .post-navigation { grid-template-columns: 1fr; gap: 1rem; }
  .nav-next { text-align: left; }

  .hero-content { padding: 1.5rem; }

  .articles-grid { gap: 1.25rem; }

  .post-card-title { font-size: 17px; }
}

/* ============================================================
   NEWSLETTER PLUGIN FORM INTEGRATION
   Styles plugin-injected forms (WPForms, CF7, Mailchimp, etc.)
   ============================================================ */
.newsletter-icon {
  margin-bottom: 1.2rem;
}

.newsletter-plugin-form {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}

/* WPForms overrides */
.newsletter-plugin-form .wpforms-form .wpforms-field {
  margin-bottom: 0.75rem !important;
  padding: 0 !important;
}

.newsletter-plugin-form .wpforms-form input[type="email"],
.newsletter-plugin-form .wpforms-form input[type="text"] {
  width: 100% !important;
  padding: 12px 18px !important;
  border-radius: var(--radius-full) !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

.newsletter-plugin-form .wpforms-form input[type="email"]:focus,
.newsletter-plugin-form .wpforms-form input[type="text"]:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-light) !important;
}

.newsletter-plugin-form .wpforms-form .wpforms-submit,
.newsletter-plugin-form .wpforms-form button[type="submit"] {
  width: 100% !important;
  padding: 12px 24px !important;
  background-color: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius-full) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: var(--font-sans) !important;
  transition: background-color 0.2s ease !important;
  margin-top: 0.5rem !important;
}

.newsletter-plugin-form .wpforms-form .wpforms-submit:hover {
  background-color: var(--accent-hover) !important;
}

/* Contact Form 7 overrides */
.newsletter-plugin-form .wpcf7-form p {
  margin-bottom: 0.75rem;
}

.newsletter-plugin-form .wpcf7-form input[type="email"],
.newsletter-plugin-form .wpcf7-form input[type="text"] {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
}

.newsletter-plugin-form .wpcf7-form .wpcf7-submit {
  width: 100%;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

/* Mailchimp for WP overrides */
.newsletter-plugin-form .mc4wp-form input[type="email"] {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 0.5rem;
}

.newsletter-plugin-form .mc4wp-form input[type="submit"] {
  width: 100%;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

/* Hint text below form */
.newsletter-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* Admin plugin tip — only visible to logged-in admins in front end */
.newsletter-plugin-tip {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1.5rem;
}

/* ============================================================
   ARTICLE PAGE — Comprehensive Mobile Responsiveness Fixes
   Ensures all content elements inside .post-body are contained
   ============================================================ */

/* Prevent any block-level element from overflowing */
.post-detail-container,
.post-header,
.post-body,
.post-layout-grid,
.post-navigation,
.author-box {
  max-width: 100%;
  overflow-x: hidden;
}

/* Responsive embeds: YouTube, Twitter, Vimeo, Google Maps, etc. */
.post-body .wp-block-embed,
.post-body .wp-block-embed__wrapper,
.post-body .embed-responsive {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.post-body .wp-block-embed iframe,
.post-body iframe,
.post-body embed,
.post-body object {
  max-width: 100%;
  width: 100%;
  border-radius: var(--radius-md);
}

/* Gutenberg wide/full aligned images — contain on mobile */
.post-body .alignwide,
.post-body .alignfull {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Gutenberg columns block */
.post-body .wp-block-columns {
  flex-wrap: wrap;
  gap: 1rem;
}

/* All images inside post body */
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent table overflow */
.post-body .wp-block-table,
.post-body table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}

/* Prevent pre/code overflow */
.post-body pre,
.post-body .wp-block-code {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}

/* Fix any inline styles that set explicit widths */
.post-body * {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* But don't constrain inline text or icon elements */
.post-body span,
.post-body a,
.post-body strong,
.post-body em,
.post-body code:not(pre code),
.post-body svg {
  max-width: none !important;
}

@media (max-width: 768px) {


  /* Gutenberg columns → stack */
  .post-body .wp-block-columns > .wp-block-column {
    flex-basis: 100% !important;
    min-width: 0 !important;
  }

  /* Gutenberg gallery → 2 columns on mobile */
  .post-body .wp-block-gallery {
    gap: 0.75rem;
  }

  /* Reduce h2 padding on mobile */
  .post-body h2 {
    padding-top: 1rem;
    margin-top: 2rem;
  }

  .post-body blockquote {
    padding: 1.2rem 1.2rem;
    margin: 1.5rem 0;
  }

  /* Remove article max-width constraint on small phones */
  .post-layout-grid {
    margin-bottom: 3rem;
  }
}

/* ============================================================
   ARCHIVE / BLOG LOCAL SEARCH BAR
   ============================================================ */
.archive-search-form {
  margin-top: 0;
  max-width: 420px;
  width: 100%;
}

.archive-search-form .search-form {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.archive-search-form .search-field {
  width: 100%;
  padding: 10px 42px 10px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.archive-search-form .search-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.archive-search-form .search-submit-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 0.2s ease;
}

.archive-search-form .search-submit-btn:hover {
  color: var(--accent);
}

/* ============================================================
   12. ABOUT US PAGE PREMIUM STYLES
   ============================================================ */
.about-hero {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.about-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0.75rem 0 1.25rem;
  color: var(--text-primary);
}

@media (min-width: 769px) {
  .about-hero {
    padding: 5rem 0 2rem;
  }
  .about-hero h1 {
    font-size: 3rem;
  }
}

.about-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 800px;
  margin: 3rem auto;
  text-align: center;
  padding: 0 1rem;
}

@media (min-width: 480px) {
  .about-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 0;
  }
}

.about-stat-card {
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.about-evolution {
  margin: 3.5rem 0;
  padding: 0 1rem;
}

.about-evolution h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 2rem;
}

.about-evolution-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (min-width: 600px) {
  .about-evolution-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.about-evolution-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.about-evolution-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.about-vision-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 3.5rem 0;
  padding: 1.75rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (min-width: 769px) {
  .about-vision-box {
    grid-template-columns: 1fr 1fr;
    padding: 2.5rem;
  }
}

.about-founder-box {
  margin: 4rem 0;
  padding: 3rem 1rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Timeline Layout */
.about-timeline {
  position: relative;
  max-width: 710px;
  margin: 3.5rem auto;
  padding: 0 1rem 0 1.5rem;
}

.about-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background-color: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 30px;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  position: absolute;
  left: -16px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background-color: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 2;
}

.timeline-year {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
  display: block;
}

.timeline-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

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

/* Card-style Single Article Container */
body.single-post {
  background-color: #f5f5f7;
}

body.single-post .post-card-container {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.015);
  max-width: 860px;
  margin: 1.5rem auto 3rem auto;
}

@media (min-width: 769px) {
  body.single-post .post-card-container {
    padding: 3.5rem;
    margin: 3rem auto 5rem auto;
    border-radius: 28px;
  }
}

[data-theme="dark"] body.single-post {
  background-color: #07090e;
}

[data-theme="dark"] body.single-post .post-card-container {
  background-color: #121824;
  border-color: #212c41;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

/* Post excerpt/subtitle */
.post-detail-excerpt {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 710px;
  margin: 0 auto 1.5rem auto;
  text-align: center;
  font-weight: 400;
}

@media (max-width: 768px) {
  .post-detail-excerpt {
    font-size: 1.05rem;
    margin-bottom: 1rem;
  }
}

/* Author Introduction Card below Featured Image */
.post-intro-author {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background-color: #f5f5f7;
  margin-bottom: 2.5rem;
  text-align: left;
  box-sizing: border-box;
}

[data-theme="dark"] body.single-post .post-intro-author {
  background-color: #192233;
  border-color: #26344d;
}

.intro-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.intro-author-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.intro-author-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.intro-author-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.intro-author-role {
  color: var(--text-tertiary);
  font-size: 13px;
}

.intro-author-socials {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.intro-author-socials a {
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.intro-author-socials a:hover {
  color: var(--accent);
}

.intro-author-bio {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

@media (max-width: 600px) {
  .post-intro-author {
    flex-direction: row;
    align-items: flex-start;
    padding: 1rem;
  }
}

/* Floating Mobile Contents Pill */
@media (max-width: 1024px) {
  .mobile-toc-details {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    max-width: 280px;
    overflow: hidden;
  }

  .mobile-toc-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
  }

  .mobile-toc-summary::-webkit-details-marker {
    display: none;
  }

  .mobile-toc-details[open] {
    border-radius: var(--radius-lg);
  }

  .mobile-toc-details[open] .mobile-toc-summary {
    border-bottom: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-toc-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 12px 16px;
    margin: 0;
    list-style: none;
    font-size: 13px;
  }

  .mobile-toc-list li {
    margin-bottom: 10px;
  }

  .mobile-toc-list li:last-child {
    margin-bottom: 0;
  }

  .mobile-toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
  }

  .mobile-toc-list a:hover {
    color: var(--accent);
  }
}



