/*
Theme Name: Vertexium Blog
Theme URI: https://vertexiumenv.com
Author: Vertexium Environmental Solutions LLC
Author URI: https://vertexiumenv.com
Description: Custom dark theme matching vertexiumenv.com — Cormorant Garamond + Inter, navy/gold/teal/blue palette.
Version: 1.0.0
License: Proprietary
Text Domain: vertexium-blog
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ---------- Design Tokens (matching vertexiumenv.com) ---------- */
:root {
  /* Palette */
  --bg-deep:        #0d1117;
  --bg-primary:     #111820;
  --bg-secondary:   #151d27;
  --bg-elevated:    #1a2332;
  --bg-card:        #1c2736;
  --bg-card-hover:  #212f40;

  /* Borders */
  --border:         rgba(93, 173, 226, 0.08);
  --border-hover:   rgba(93, 173, 226, 0.18);
  --border-gold:    rgba(201, 168, 76, 0.2);

  /* Brand Colors */
  --blue:           #5dade2;
  --blue-dark:      #3498db;
  --blue-glow:      rgba(93, 173, 226, 0.12);
  --gold:           #c9a84c;
  --gold-light:     #d4b85e;
  --gold-dim:       rgba(201, 168, 76, 0.15);
  --gold-glow:      rgba(201, 168, 76, 0.08);
  --teal:           #1a6b5a;

  /* Text */
  --text-primary:   #e8eaed;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-dim:       #475569;

  /* Typography */
  --font-heading:   'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

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

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.4);

  /* Transitions */
  --t-fast:  150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:  300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --nav-h:       80px;
  --container:   800px;
  --container-wide: 1200px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--gold-light); }

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

::selection {
  background: rgba(93, 173, 226, 0.25);
  color: var(--text-primary);
}

/* ---------- Layout ---------- */
.site-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}

.container-wide {
  max-width: var(--container-wide);
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.site-header .container {
  max-width: var(--container-wide);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  text-decoration: none;
}

.site-logo-name {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.site-logo-blog {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 500;
  font-style: italic;
  color: var(--gold);
  margin-left: 6px;
}

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

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color var(--t-fast);
}

.site-nav a:hover {
  color: var(--gold);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-deep) !important;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all var(--t-fast);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
  color: var(--bg-deep) !important;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-xs);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all var(--t-fast);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--sp-xl);
    gap: var(--sp-lg);
  }
  .site-nav.active { display: flex; }
}

/* ---------- Blog Index ---------- */
.blog-hero {
  padding: var(--sp-3xl) 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.blog-hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 6px 18px;
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  background: var(--gold-glow);
  margin-bottom: var(--sp-lg);
}

.blog-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-md);
  line-height: 1.15;
}

.blog-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Post Cards */
.posts-grid {
  padding: var(--sp-3xl) 0;
  display: grid;
  gap: var(--sp-xl);
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-base);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.post-card-body {
  padding: var(--sp-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.post-card-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 3px 10px;
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  background: var(--gold-glow);
}

.post-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: var(--sp-sm);
}

.post-card-title a {
  color: inherit;
}

.post-card-title a:hover {
  color: var(--gold-light);
}

.post-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-lg);
  flex: 1;
}

.post-card-read-more {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-card-read-more:hover {
  color: var(--gold);
}

.post-card-read-more::after {
  content: '→';
  transition: transform var(--t-fast);
}

.post-card-read-more:hover::after {
  transform: translateX(4px);
}

/* Two-column grid on larger screens */
@media (min-width: 768px) {
  .posts-grid {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding-left: var(--sp-xl);
    padding-right: var(--sp-xl);
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Single Post ---------- */
.post-header {
  padding: var(--sp-3xl) 0 var(--sp-xl);
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-2xl);
}

.post-header-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 5px 16px;
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  background: var(--gold-glow);
  margin-bottom: var(--sp-lg);
}

.post-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: var(--sp-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.post-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-lg);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.post-header-author {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.post-header-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
}

.post-featured-image {
  max-width: 900px;
  margin: 0 auto var(--sp-2xl);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

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

/* ---------- Post Content ---------- */
.post-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-xl) var(--sp-3xl);
}

.post-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--sp-2xl) 0 var(--sp-lg);
  line-height: 1.2;
}

.post-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--sp-xl) 0 var(--sp-md);
  line-height: 1.25;
}

.post-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--sp-lg);
}

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

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

.post-content ul, .post-content ol {
  margin: var(--sp-md) 0 var(--sp-lg) var(--sp-xl);
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
  padding-left: var(--sp-xs);
}

.post-content li::marker {
  color: var(--gold);
}

.post-content blockquote {
  border-left: 3px solid var(--gold);
  padding: var(--sp-lg) var(--sp-xl);
  margin: var(--sp-xl) 0;
  background: var(--bg-card);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.post-content blockquote p {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 0;
}

.post-content img {
  border-radius: var(--r-md);
  margin: var(--sp-xl) 0;
  border: 1px solid var(--border);
}

.post-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(93, 173, 226, 0.3);
  text-underline-offset: 3px;
  transition: all var(--t-fast);
}

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

.post-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--blue);
}

.post-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  overflow-x: auto;
  margin: var(--sp-xl) 0;
}

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

/* Table of Contents */
.post-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-lg) var(--sp-xl);
  margin-bottom: var(--sp-2xl);
}

.post-toc-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-md);
}

.post-toc ol {
  list-style: decimal;
  margin: 0 0 0 var(--sp-lg);
}

.post-toc li {
  margin-bottom: var(--sp-xs);
}

.post-toc a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--t-fast);
}

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

/* CTA Box */
.post-cta {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-lg);
  padding: var(--sp-2xl);
  text-align: center;
  margin: var(--sp-3xl) 0;
}

.post-cta h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--sp-md);
}

.post-cta p {
  color: var(--text-secondary);
  margin-bottom: var(--sp-lg);
}

.post-cta .btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all var(--t-fast);
}

.post-cta .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
  color: var(--bg-deep);
}

/* Author Box */
.post-author-box {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin: var(--sp-2xl) 0;
}

.post-author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  flex-shrink: 0;
}

.post-author-box h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.post-author-box .author-title {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--sp-xs);
}

.post-author-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .post-author-box { flex-direction: column; align-items: center; text-align: center; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: var(--sp-2xl) 0;
}

.site-footer .container {
  max-width: var(--container-wide);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-lg);
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.footer-brand span {
  color: var(--gold);
}

.footer-links {
  display: flex;
  gap: var(--sp-xl);
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: var(--sp-lg);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--border);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-xl) 0 var(--sp-3xl);
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.pagination a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.pagination .current {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
}

/* ---------- Category Filter ---------- */
.category-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  padding: var(--sp-xl) var(--sp-xl) 0;
}

.category-filter a {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.category-filter a:hover, .category-filter a.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

/* ---------- 404 ---------- */
.page-404 {
  text-align: center;
  padding: var(--sp-3xl) 0;
}

.page-404 h1 {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--gold);
  margin-bottom: var(--sp-md);
}

.page-404 p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xl);
}
