/* Warm Dark Editorial Design System */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* New Warm Dark Palette - No Pure Black or White */
  --page-bg: #11100F;
  --navbar-bg: #141210;
  --section-bg: #181512;
  --card-bg: #1D1916;
  --primary-text: #F2ECE6;
  --secondary-text: #C7BBB0;
  --muted-text: #9E9085;
  --accent-primary: #D7B9A8;
  --accent-hover: #CDA895;
  --button-text: #171310;
  --border-color: #2A2420;

  /* Legacy Support - Map old variables to new */
  --warm-black: #11100F;
  --warm-white: #F2ECE6;
  --warm-off-white: #181512;
  --color-text: #F2ECE6;
  --color-text-muted: #C7BBB0;
  --color-bg: #11100F;
  --color-bg-elevated: #1D1916;
  --color-border: #2A2420;
  --color-border-subtle: #2A2420;
  --color-link: #D7B9A8;
  --color-link-hover: #CDA895;
  --color-primary: #D7B9A8;
  --color-accent: #CDA895;
  --espresso: #171310;

  /* Typography - Lora + Inter */
  --font-serif: 'Lora', 'Charter', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;

  /* Spacing System - Exact Values */
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-72: 72px;
  --space-120: 120px;

  /* Legacy spacing mapped to new system */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 72px;
  --space-3xl: 120px;

  /* Typography Scale - Exact Sizes */
  --text-xs: 13px;
  --text-sm: 15px;
  --text-base: 17px;
  --text-md: 18px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 40px;
  --text-4xl: 48px;

  /* Shadows - Soft Depth */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-medium: 0 10px 15px rgba(0, 0, 0, 0.5);

  /* Borders */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 10px;

  /* Transitions */
  --transition-smooth: all 0.2s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.7;
  color: var(--primary-text);
  background-color: var(--page-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  padding: 0;
}

/* Add subtle noise texture for warmth */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.015;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography - Editorial Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--primary-text);
  margin-top: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1.1;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 500;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 500;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 500;
}

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
  color: var(--secondary-text);
  line-height: 1.7;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
  border-bottom: 1px solid transparent;
}

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

a:focus {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip to main content - Accessibility */
.skip-to-main {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent-primary);
  color: var(--button-text);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  z-index: 10000;
  font-weight: 600;
  border-radius: 0 0 var(--border-radius-sm) 0;
}

.skip-to-main:focus {
  top: 0;
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* Navigation - 80px height, polished */
.site-nav {
  background: var(--navbar-bg);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0 var(--space-32);
  height: 80px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border: none;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-text);
}

.site-logo:hover {
  border: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: var(--border-radius-sm);
}

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

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

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-32);
  align-items: center;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: var(--secondary-text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.01em;
  border: none;
  transition: var(--transition-smooth);
  font-family: var(--font-sans);
}

.nav-links a:hover {
  color: var(--primary-text);
  border: none;
}

.nav-links a.active {
  color: var(--primary-text);
  border-bottom: 2px solid var(--accent-primary);
}

/* Subscribe CTA button in nav - matches primary button */
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 16px 28px;
  background: var(--accent-primary);
  color: var(--button-text);
  border-radius: var(--border-radius-lg);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  transition: var(--transition-smooth);
  font-family: var(--font-sans);
}

.nav-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  border: none;
  color: var(--button-text);
}

/* Hero Section - Reduced height, gradient background, radial glow */
.hero-editorial {
  background: linear-gradient(180deg, #11100F 0%, #181512 100%);
  padding: 72px var(--space-32);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow behind headline */
.hero-editorial::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(183, 134, 111, 0.08) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-editorial > * {
  position: relative;
  z-index: 1;
}

/* Buttons - Premium styling */
.btn,
.read-more {
  display: inline-flex;
  align-items: center;
  padding: 16px 28px;
  background: var(--accent-primary);
  color: var(--button-text);
  border: none;
  border-radius: var(--border-radius-lg);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn:hover,
.read-more:hover {
  background: var(--accent-hover);
  color: var(--button-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  border: none;
}

.btn:focus,
.read-more:focus {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
}

.btn-secondary {
  background: transparent;
  color: var(--primary-text);
  border: 1px solid #6E5C50;
  padding: 16px 28px;
  border-radius: var(--border-radius-lg);
  font-size: 17px;
}

.btn-secondary:hover {
  background: rgba(215, 185, 168, 0.06);
  border-color: #A88978;
  color: var(--primary-text);
  transform: translateY(-1px);
}

.btn-secondary:focus {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
}

/* Sections - Tonal depth with layered backgrounds */
.section {
  padding: var(--space-120) var(--space-32);
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
  margin-top: 0;
  font-weight: 500;
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--secondary-text);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Blog Grid - Refined Cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-xl);
  padding: 0 var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
}

.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(124, 58, 237, 0.15);
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 58, 237, 0.4);
  border-color: var(--accent-primary);
}

.blog-card h2 {
  font-size: var(--text-xl);
  margin: 0 0 var(--space-md);
  border: none;
  padding: 0;
  line-height: 1.3;
}

.blog-card h2 a {
  color: var(--primary-text);
  border: none;
}

.blog-card h2 a:hover {
  color: var(--accent-primary);
}

.blog-card p {
  color: var(--secondary-text);
  font-size: var(--text-sm);
  line-height: 1.7;
  flex-grow: 1;
  margin-bottom: var(--space-lg);
}

/* Post Image in Blog Cards */
.post-image {
  margin: 0 0 var(--space-lg) 0;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.post-image a {
  display: block;
  border: none;
}

.post-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  margin: 0;
  transition: var(--transition-smooth);
}

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

/* Post Metadata */
.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  font-family: var(--font-sans);
  font-weight: 500;
}

.post-meta > * {
  display: flex;
  align-items: center;
}

.post-meta .separator {
  color: var(--border-color);
  margin: 0 0.125rem;
}

.post-meta time {
  font-feature-settings: 'tnum';
}

/* Tags - Understated */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-sm) 0;
}

.tag {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted-text);
  transition: var(--transition-smooth);
  text-transform: lowercase;
  font-family: var(--font-sans);
}

.tag:hover {
  background: var(--card-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Article Content */
.article-content,
.post-content,
.post-body {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  font-size: var(--text-md);
  line-height: 1.7;
}

.article-content a,
.post-content a,
.post-body a {
  color: var(--accent-primary);
  font-weight: 500;
  border-bottom: 1px solid var(--accent-primary);
}

.article-content a:hover,
.post-content a:hover,
.post-body a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.article-content h2,
.post-content h2,
.post-body h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* Code Blocks */
pre, code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

pre {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-xl) 0;
  line-height: 1.6;
}

code {
  background: var(--card-bg);
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.9em;
  color: var(--primary-text);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Blockquotes - Editorial Feel */
blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-sm) var(--space-lg);
  border-left: 3px solid var(--accent-primary);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--secondary-text);
  line-height: 1.6;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-md);
  margin: var(--space-xl) auto;
  display: block;
}

.post-body img,
.article-content img,
.post-content img {
  margin: var(--space-2xl) auto;
  display: block;
  max-width: 100%;
  height: auto;
}

/* Logo images should not be centered */
.logo-icon,
.header-logo {
  margin: 0 !important;
  display: inline-block;
}

/* Theme Toggle - Removed (site uses dark theme by default) */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove default focus styles but keep for keyboard users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Improve focus for interactive elements */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* Search */
.search-container {
  max-width: 680px;
  margin: var(--space-xl) auto;
  padding: 0 var(--space-md);
}

.search-box input {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: var(--text-base);
  background: var(--card-bg);
  color: var(--primary-text);
  transition: var(--transition-smooth);
  font-family: var(--font-sans);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(215, 185, 168, 0.2);
}

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

/* Expertise Grid - 2x2 Layout */
.expertise-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-xl) 0;
  font-size: var(--text-sm);
}

thead {
  border-bottom: 2px solid var(--border-color);
}

th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  color: var(--primary-text);
}

td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background: var(--card-bg);
}

/* Horizontal Rules */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-2xl) 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--secondary-text); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Responsive */
@media (max-width: 768px) {
  :root {
    --text-4xl: 36px;
    --text-3xl: 30px;
    --text-2xl: 26px;
  }

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

  .expertise-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-lg) !important;
  }

  .section {
    padding: var(--space-72) var(--space-24);
  }

  .hero-editorial {
    padding: 48px var(--space-24);
  }

  .site-nav {
    padding: 0 var(--space-24);
    height: auto;
    min-height: 80px;
  }

  .nav-container {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
    padding: var(--space-16) 0;
  }

  .nav-menu {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .nav-links {
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .nav-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* RSS Icon */
.nav-links svg {
  transition: var(--transition-smooth);
}

.nav-links a:hover svg {
  stroke: var(--accent-primary);
}

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

/* Reduced Motion - Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #999;
  }

  a {
    text-decoration: underline;
  }

  .blog-card {
    border-width: 2px;
  }
}

/* Smooth Transitions for Theme Elements */
*, *::before, *::after {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

a, button, .blog-card, .tag, .btn {
  transition-property: all;
}
