/*
Theme Name: ItsMeDuncan
Theme URI: https://itsmeduncan.com
Author: Duncan Grazier
Author URI: https://itsmeduncan.com
Description: A custom thought leadership theme for itsmeduncan.com. Built for AI & engineering leadership content with prominent email capture, featured posts, and clean typography.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: itsmeduncan
Tags: blog, one-column, custom-menu, featured-images, custom-logo, editor-style
*/

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  --accent: #0d9488;
  --accent-light: #f0fdfa;
  --accent-hover: #0f766e;
  --accent-alpha-10: rgba(13, 148, 136, 0.10);
  --accent-alpha-20: rgba(13, 148, 136, 0.20);
  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --dark-border: #334155;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --text-white: #f8fafc;
  --border: #e2e8f0;
  --bg-subtle: #f8fafc;
  --white: #ffffff;
  --font-heading: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --max-width: 960px;
  --content-width: 720px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

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

h1 { font-size: 2.75rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; }

p {
  margin-bottom: 1.25rem;
}

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

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ============================================
   NAVIGATION
   ============================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.nav-brand-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.nav-brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-menu a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
  color: var(--accent);
}

/* Dropdown submenus */
.nav-menu .menu-item-has-children {
  position: relative;
}

.nav-menu .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 5px;
  vertical-align: 1px;
}

.nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 100;
}

.nav-menu .menu-item-has-children:hover > .sub-menu {
  display: block;
}

.nav-menu .sub-menu li {
  padding: 0;
}

.nav-menu .sub-menu a {
  display: block;
  padding: 8px 16px;
  white-space: nowrap;
}

.nav-menu .sub-menu a:hover {
  background: var(--bg-soft);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-menu.active { display: flex; }
  .nav-menu li { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-menu li:last-child { border-bottom: none; }
  .nav-menu a { font-size: 16px; }
  .nav-menu .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
  }
  .nav-menu .menu-item-has-children > .sub-menu {
    display: block;
  }
  .nav-menu .sub-menu li {
    padding: 8px 0 0 16px;
    border-bottom: none;
  }
  .nav-menu .sub-menu a {
    padding: 0;
  }
  .nav-menu .menu-item-has-children > a::after {
    display: none;
  }
}

/* ============================================
   HERO SECTION (Front Page)
   ============================================ */
.hero {
  background: var(--dark-bg);
  padding: 80px 24px 72px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.08), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

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

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-alpha-20);
  color: var(--accent);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 2.75rem;
  color: var(--text-white);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-description {
  font-size: 17px;
  color: var(--text-light);
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: 0;
}

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(13, 148, 136, 0.2);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-links {
  display: flex;
  gap: 16px;
  margin-top: 28px;
}

.hero-links a {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.hero-links a:hover {
  color: var(--text-white);
}

@media (max-width: 768px) {
  .hero { padding: 48px 24px; }
  .hero-inner { flex-direction: column-reverse; gap: 32px; text-align: center; }
  .hero h1 { font-size: 2rem; }
  .hero-description { max-width: none; }
  .hero-photo { width: 120px; height: 120px; border-radius: 60px; }
  .hero-links { justify-content: center; }
  .email-capture { max-width: none; }
  .email-capture-form { flex-direction: column; }
}

/* ============================================
   EMAIL CAPTURE
   ============================================ */
.email-capture {
  margin-top: 32px;
  max-width: 420px;
}

.email-capture-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 500;
}

.email-capture-form {
  display: flex;
  gap: 8px;
}

.email-capture-form input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--dark-border);
  background: var(--dark-surface);
  color: var(--text-white);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}

.email-capture-form input[type="email"]:focus {
  border-color: var(--accent);
}

.email-capture-form input[type="email"]::placeholder {
  color: var(--text-secondary);
}

.btn-subscribe {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-heading);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.btn-subscribe:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  background: var(--accent-hover);
}

/* Jetpack subscribe form overrides */
.jetpack-subscribe-wrap .jetpack_subscription_widget {
  margin: 0;
  padding: 0;
}

.jetpack-subscribe-wrap .jetpack_subscription_widget > h2,
.jetpack-subscribe-wrap #subscribe-text {
  display: none;
}

.jetpack-subscribe-wrap form {
  display: flex;
  gap: 8px;
}

.jetpack-subscribe-wrap input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--dark-border);
  background: var(--dark-surface);
  color: var(--text-white);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}

.jetpack-subscribe-wrap input[type="email"]:focus {
  border-color: var(--accent);
}

.jetpack-subscribe-wrap input[type="email"]::placeholder {
  color: var(--text-secondary);
}

.jetpack-subscribe-wrap button,
.jetpack-subscribe-wrap .wp-block-button__link {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-heading);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.jetpack-subscribe-wrap button:hover,
.jetpack-subscribe-wrap .wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  background: var(--accent-hover);
}

.jetpack-subscribe-wrap #subscribe-submit {
  margin: 0;
}

.jetpack-subscribe-wrap #subscribe-email {
  flex: 1;
  margin: 0;
}

/* Jetpack success/error messages */
.jetpack-subscribe-wrap .jetpack_subscription_widget .success,
.jetpack-subscribe-wrap .jetpack_subscription_widget #subscribe-text p,
.jetpack-subscribe-wrap .wp-block-jetpack-subscriptions__container p {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.5;
  margin: 8px 0;
}

/* In the dark hero section */
.hero .jetpack-subscribe-wrap .success,
.hero .jetpack-subscribe-wrap p {
  color: var(--accent);
}

/* Light variant Jetpack overrides */
.email-capture--light .jetpack-subscribe-wrap input[type="email"] {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .jetpack-subscribe-wrap form {
    flex-direction: column;
  }
}

/* Light variant for non-hero sections */
.email-capture--light .email-capture-form input[type="email"] {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-primary);
}

.email-capture--light .email-capture-label {
  color: var(--text-secondary);
}

/* ============================================
   SECTION: FEATURED POSTS
   ============================================ */
.section-featured {
  padding: 64px 0 48px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-header h2 {
  margin-bottom: 0;
}

.section-header a {
  font-size: 13px;
  font-weight: 600;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.featured-card {
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.featured-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.08);
  transform: translateY(-2px);
}

.featured-card a {
  text-decoration: none;
  color: inherit;
}

.featured-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.category-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-alpha-10);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.category-badge--leadership {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.category-badge--insights {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.category-badge--founder {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.read-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.featured-card h3 {
  font-size: 19px;
  font-weight: 750;
  margin-bottom: 10px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.featured-card .excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
  flex: 1;
}

.featured-card .post-date {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================
   SECTION: RECENT POSTS
   ============================================ */
.section-recent {
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
}

.recent-list {
  list-style: none;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  gap: 16px;
}

.recent-item:hover {
  background: var(--bg-subtle);
  margin: 0 -12px;
  padding: 20px 12px;
  border-radius: 8px;
}

.recent-item-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

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

.recent-item h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.recent-item h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.recent-item h3 a:hover {
  color: var(--accent);
}

.recent-item-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.recent-item .category-badge {
  display: none;
}

.recent-item .post-date {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (min-width: 641px) {
  .recent-item .category-badge { display: inline-block; }
}

@media (max-width: 640px) {
  .recent-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .recent-item-right { padding-left: 22px; }
}

/* ============================================
   BOTTOM CTA SECTION
   ============================================ */
.section-bottom-cta {
  background: var(--accent-light);
  padding: 56px 24px;
  border-top: 1px solid rgba(13, 148, 136, 0.15);
  text-align: center;
}

.section-bottom-cta h2 {
  font-size: 1.625rem;
  margin-bottom: 12px;
}

.section-bottom-cta p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.section-bottom-cta .email-capture {
  max-width: 400px;
  margin: 0 auto;
}

.section-bottom-cta .email-capture-form input[type="email"] {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-primary);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--dark-bg);
  padding: 48px 24px;
  color: var(--text-light);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand {
  max-width: 360px;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-white);
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 0;
}

.footer-nav {
  display: flex;
  gap: 40px;
}

.footer-nav-group h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-nav-group ul {
  list-style: none;
}

.footer-nav-group li {
  margin-bottom: 8px;
}

.footer-nav-group a {
  font-size: 13px;
  color: var(--text-light);
}

.footer-nav-group a:hover {
  color: var(--text-white);
}

.footer-inner--expanded .footer-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--dark-surface);
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom-links {
  display: flex;
  gap: 16px;
}

.footer-bottom-links a {
  color: var(--text-secondary);
  font-size: 12px;
}

.footer-bottom-links a:hover {
  color: var(--text-white);
}

@media (max-width: 768px) {
  .footer-inner--expanded .footer-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-bottom-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; }
  .footer-inner--expanded .footer-nav {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   SINGLE POST
   ============================================ */
.post-header {
  padding: 48px 24px 32px;
  text-align: center;
}

.post-header .category-badge {
  margin-bottom: 16px;
  display: inline-block;
}

.post-header h1 {
  font-size: 2.25rem;
  max-width: 700px;
  margin: 0 auto 20px;
  letter-spacing: -0.03em;
}

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

.post-meta .separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
}

.post-featured-image {
  max-width: var(--content-width);
  margin: 0 auto 40px;
  padding: 0 24px;
}

.post-featured-image img {
  border-radius: 16px;
  width: 100%;
}

.post-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px 48px;
  font-size: 17px;
  line-height: 1.75;
}

.post-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

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

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(13, 148, 136, 0.3);
  text-underline-offset: 3px;
}

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

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

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

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

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

.post-content code {
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'IBM Plex Mono', monospace;
}

.post-content pre {
  background: var(--dark-bg);
  color: var(--text-white);
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 2rem 0;
}

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

.post-content img {
  border-radius: 12px;
  margin: 2rem 0;
}

/* Post Tags */
.post-tags {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags a {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.post-tags a:hover {
  background: var(--accent-alpha-10);
  color: var(--accent);
}

/* Post Cross-links */
.post-crosslinks {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px;
  background: var(--bg-subtle);
  border-radius: 12px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--text-secondary);
}

.post-crosslinks strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   AUTHOR BIO CARD
   ============================================ */
.author-card {
  max-width: var(--content-width);
  margin: 0 auto 48px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.author-card-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.author-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-card-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

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

.author-card-links {
  display: flex;
  gap: 12px;
}

.author-card-links a {
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .author-card { flex-direction: column; text-align: center; }
  .author-card-links { justify-content: center; }
}

/* ============================================
   MID-POST EMAIL CTA
   ============================================ */
.midpost-cta {
  background: var(--accent-light);
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 12px;
  padding: 28px 24px;
  margin: 2.5rem 0;
  text-align: center;
}

.midpost-cta p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.midpost-cta .email-capture {
  max-width: 380px;
  margin: 0 auto;
}

/* ============================================
   ARCHIVE / BLOG INDEX
   ============================================ */
.archive-header {
  padding: 48px 24px 24px;
  text-align: center;
}

.archive-header h1 {
  font-size: 2rem;
}

.archive-header p {
  color: var(--text-secondary);
  margin-top: 8px;
}

.archive-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.archive-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.archive-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.08);
  transform: translateY(-2px);
}

.archive-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--dark-bg);
  position: relative;
  display: block;
  text-decoration: none;
}

.archive-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 20px 16px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, transparent 100%);
}

.archive-card-overlay h3 {
  color: var(--text-white);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.archive-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.archive-card:hover .archive-card-image img {
  transform: scale(1.03);
}

.archive-card-body {
  padding: 24px;
}

.archive-card:hover .archive-card-overlay h3 {
  color: var(--white);
}

/* Fallback when no featured image */
.archive-card-image--no-thumb {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #1a2744 50%, var(--accent-hover) 100%);
  background-size: 200% 200%;
}

.archive-card-image--no-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  z-index: 1;
}

.archive-card-overlay--full {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: none;
  z-index: 2;
}

.archive-card-overlay--full h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  max-width: 90%;
}

.archive-card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
}

.archive-card-body .excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-card-body .post-meta {
  justify-content: flex-start;
  font-size: 12px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination a, .pagination span {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.pagination a {
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.pagination a:hover {
  background: var(--accent-alpha-10);
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .current {
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
}

/* ============================================
   PAGE TEMPLATE (About, Start Here, etc.)
   ============================================ */
.page-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px 64px;
  font-size: 17px;
  line-height: 1.75;
}

.page-content h1 {
  margin-bottom: 24px;
}

.page-content h2 {
  margin-top: 2.5rem;
}

.page-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(13, 148, 136, 0.3);
  text-underline-offset: 3px;
}

/* ============================================
   404
   ============================================ */
.error-404 {
  text-align: center;
  padding: 80px 24px;
}

.error-404 h1 {
  font-size: 6rem;
  color: var(--border);
  margin-bottom: 16px;
}

.error-404 p {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-404 a {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.error-404 a:hover {
  background: var(--accent-hover);
  color: var(--white);
}

/* ============================================
   WORDPRESS DEFAULTS
   ============================================ */
/* Hide Jetpack subscribe modal and carousel comments */
.jetpack-subscription-modal,
.jp-carousel-comment-form-container,
.jp-carousel-comments-loading,
#jp-carousel-comment-form-comment-field {
  display: none !important;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.alignwide {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.wp-block-image { margin: 2rem 0; }
.wp-block-image img { border-radius: 12px; }

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.post-toc {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 32px;
}

.post-toc-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-toc-title::before {
  content: '▸';
  transition: transform 0.2s;
}

.post-toc[open] > .post-toc-title::before {
  transform: rotate(90deg);
}

.post-toc-title::-webkit-details-marker {
  display: none;
}

.post-toc-list {
  margin-top: 12px;
  padding-left: 1.25rem;
}

.post-toc-list li {
  margin-bottom: 6px;
}

.post-toc-list a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

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

/* ============================================
   SOCIAL SHARE BAR
   ============================================ */
.share-bar {
  position: fixed;
  left: calc(50% - var(--content-width) / 2 - 64px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-decoration: none;
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.share-btn--copy.copied {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

@media (max-width: 1100px) {
  .share-bar { display: none; }
}

/* ============================================
   RELATED POSTS
   ============================================ */
.related-posts {
  margin-bottom: 40px;
}

.related-posts-title {
  font-size: 1.125rem;
  margin-bottom: 20px;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.related-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.related-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
  transform: translateY(-2px);
}

.related-card a {
  text-decoration: none;
  color: inherit;
}

.related-card h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0;
}

.related-card .featured-card-meta {
  margin-bottom: 10px;
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #334155;
    --bg-subtle: #1e293b;
    --white: #0f172a;
  }

  body {
    background: #0f172a;
  }

  .site-nav {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border);
  }

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

  .nav-toggle span { background: var(--text-primary); }

  @media (max-width: 768px) {
    .nav-menu {
      background: #0f172a;
      border-bottom-color: var(--border);
    }
    .nav-menu li { border-bottom-color: var(--border); }
  }

  .nav-menu .sub-menu {
    background: #1e293b;
    border-color: #334155;
  }

  .nav-menu .sub-menu a:hover {
    background: #334155;
  }

  .featured-card {
    background: #1e293b;
    border-color: #334155;
  }
  .featured-card:hover { border-color: var(--accent); }
  .featured-card h3 { color: #e2e8f0; }

  .recent-item:hover { background: #1e293b; }
  .recent-item h3 a { color: #e2e8f0; }
  .recent-item h3 a:hover { color: var(--accent); }

  .archive-card {
    background: #1e293b;
    border-color: #334155;
  }
  .archive-card:hover { border-color: var(--accent); }
  .archive-card-body h3 a { color: #e2e8f0; }

  .page-content h1,
  .page-content h2,
  .page-content h3 {
    color: #e2e8f0;
  }

  .post-header h1 { color: #e2e8f0; }
  .post-content h2,
  .post-content h3 {
    color: #e2e8f0;
  }
  .post-content strong { color: #e2e8f0; }
  .post-content blockquote { color: #94a3b8; }
  .post-content code { background: #1e293b; color: #e2e8f0; }

  .post-tags a { background: #1e293b; color: #94a3b8; }
  .post-tags a:hover { background: var(--accent-alpha-10); color: var(--accent); }

  .post-toc { background: #1e293b; border-color: #334155; }

  .related-card { background: #1e293b; border-color: #334155; }
  .related-card:hover { border-color: var(--accent); }
  .related-card h3 { color: #e2e8f0; }

  .author-card { border-color: #334155; }
  .author-card-name { color: #e2e8f0; }

  .share-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
  .share-btn:hover { border-color: var(--accent); color: var(--accent); }

  .section-bottom-cta { background: #1e293b; border-top-color: #334155; }
  .section-bottom-cta h2 { color: #e2e8f0; }

  .midpost-cta { background: #1e293b; border-color: #334155; }

  .email-capture--light .email-capture-form input[type="email"] {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
  }

  .error-404 h1 { color: #334155; }

  .pagination a { border-color: #334155; color: #94a3b8; }
  .pagination a:hover { border-color: var(--accent); }

  h1, h2, h3, h4, h5, h6 { color: #e2e8f0; }
}
