/* ============================================
   EV Chris Theme - Custom Ghost Theme
   Based on Stitch designs + Brand Guidelines
   ============================================ */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Colors */
  --color-dark: #1a1a1a;
  --color-dark-secondary: #2d2d2d;
  --color-light: #f8f8f8;
  --color-white: #ffffff;
  --color-accent: #05614b;
  --color-accent-hover: #044d3c;
  --color-highlight: #c8e600;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;

  /* Typography */
  --font-heading:
    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Spacing (8px base) */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */
  --space-24: 6rem; /* 96px */

  /* Layout */
  --max-width: 1200px;
  --content-width: 720px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

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

/* ============================================
   Base Styles
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--color-light);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-4);
  color: var(--color-dark);
}

h1 {
  font-size: var(--text-5xl);
}
h2 {
  font-size: var(--text-4xl);
}
h3 {
  font-size: var(--text-3xl);
}
h4 {
  font-size: var(--text-2xl);
}
h5 {
  font-size: var(--text-xl);
}
h6 {
  font-size: var(--text-lg);
}

p {
  margin: 0 0 var(--space-4);
}

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

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

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

/* ============================================
   Layout Utilities
   ============================================ */
.gh-outer {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

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

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

/* ============================================
   Header
   ============================================ */
.gh-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.gh-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--space-6);
}

.gh-head-brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.gh-head-logo {
  display: flex;
  align-items: center;
}

.gh-head-logo img {
  max-height: 40px;
  width: auto;
}

.gh-head-logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-dark);
}

.gh-head-menu {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.gh-head-menu .nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-6);
}

.gh-head-menu .nav li a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-dark);
  transition: color var(--transition-fast);
}

.gh-head-menu .nav li a:hover {
  color: var(--color-accent);
}

.gh-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.gh-head-members {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.gh-head-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-dark);
}

.gh-head-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-accent);
  border-radius: var(--radius);
  transition: background var(--transition-fast);
}

.gh-head-btn:hover {
  color: var(--color-white);
  background: var(--color-accent-hover);
}

.gh-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.gh-icon-btn:hover {
  background: var(--color-light);
}

.gh-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-dark);
}

.gh-burger {
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}

.gh-burger::before,
.gh-burger::after {
  content: none;
}

/* ============================================
   Hero Section
   ============================================ */
.gh-hero {
  padding: var(--space-20) 0;
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--color-white) 0%,
    var(--color-light) 100%
  );
}

.gh-hero-title {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: 800;
  margin-bottom: var(--space-6);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.gh-hero-title .accent {
  color: var(--color-accent);
}

.gh-hero-description {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.gh-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-accent);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.gh-hero-cta:hover {
  color: var(--color-white);
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}

/* ============================================
   Post Feed (Blog Grid)
   ============================================ */
.gh-feed-section {
  padding: var(--space-16) 0;
}

.gh-feed-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-8);
}

.gh-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-8);
}

/* ============================================
   Post Card
   ============================================ */
.gh-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

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

.gh-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

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

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

.gh-card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: var(--space-6);
}

.gh-card-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.gh-card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.gh-card-title a {
  color: var(--color-dark);
}

.gh-card-title a:hover {
  color: var(--color-accent);
}

.gh-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: var(--space-4);
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.gh-card-author-image {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* ============================================
   Article Page
   ============================================ */
.gh-article {
  padding: var(--space-12) 0;
}

.gh-article-header {
  margin-bottom: var(--space-10);
}

.gh-article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: var(--space-4);
}

.gh-article-tag {
  font-weight: 600;
  color: var(--color-accent);
}

.gh-article-title {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 800;
  margin-bottom: var(--space-6);
}

.gh-article-excerpt {
  font-size: var(--text-xl);
  color: var(--color-muted);
  line-height: 1.5;
}

.gh-article-image {
  margin: var(--space-10) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gh-article-image img {
  width: 100%;
}

/* ============================================
   Article Content (Ghost Editor Output)
   ============================================ */
.gh-content {
  font-size: var(--text-lg);
  line-height: 1.8;
}

.gh-content > * + * {
  margin-top: var(--space-6);
}

.gh-content h2 {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.gh-content h3 {
  margin-top: var(--space-10);
}

.gh-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gh-content blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  padding-left: var(--space-8);
  border-left: 4px solid var(--color-accent);
  background: var(--color-white);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.gh-content pre {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background: var(--color-dark);
  color: var(--color-light);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: var(--color-light);
  border-radius: 4px;
}

.gh-content pre code {
  padding: 0;
  background: transparent;
}

.gh-content figure {
  margin: var(--space-10) 0;
}

.gh-content figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-align: center;
}

.gh-content ul,
.gh-content ol {
  padding-left: var(--space-6);
}

.gh-content li + li {
  margin-top: var(--space-2);
}

/* Ghost Card Styles */
.kg-card {
  margin: var(--space-8) 0;
}

.kg-image-card img,
.kg-gallery-image img {
  border-radius: var(--radius);
}

.kg-gallery-row {
  align-items: flex-start;
}

.kg-gallery-image {
  min-width: 0;
  overflow: hidden;
}

.kg-gallery-image img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  margin: 0 !important;
}

.kg-bookmark-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kg-bookmark-container {
  display: flex;
  text-decoration: none;
}

.kg-bookmark-content {
  flex: 1;
  padding: var(--space-6);
}

.kg-bookmark-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: var(--space-2);
}

.kg-bookmark-description {
  font-size: var(--text-sm);
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-thumbnail {
  width: 200px;
  flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ghost Content Width Classes */
.kg-width-wide {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.kg-width-full img {
  width: 100%;
}

/* ============================================
   Related Posts
   ============================================ */
.gh-related {
  padding: var(--space-16) 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
}

.gh-related-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-8);
}

/* ============================================
   Footer
   ============================================ */
.gh-foot {
  padding: var(--space-16) 0 var(--space-8);
  background: var(--color-dark);
  color: var(--color-white);
}

.gh-foot-cta {
  text-align: center;
  padding-bottom: var(--space-12);
  margin-bottom: var(--space-12);
  border-bottom: 1px solid var(--color-dark-secondary);
}

.gh-foot-cta-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
  color: var(--color-white);
}

.gh-foot-cta-description {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-6);
}

.gh-foot-cta-form {
  display: flex;
  gap: var(--space-3);
  max-width: 480px;
  margin: 0 auto var(--space-4);
}

.gh-foot-cta-form input {
  flex: 1;
  padding: var(--space-4);
  font-size: var(--text-base);
  border: 1px solid var(--color-dark-secondary);
  border-radius: var(--radius);
  background: var(--color-dark-secondary);
  color: var(--color-white);
}

.gh-foot-cta-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.gh-foot-cta-note {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gh-btn-accent {
  color: var(--color-dark);
  background: var(--color-highlight);
}

.gh-btn-accent:hover {
  background: #d4f000;
  transform: translateY(-1px);
}

.gh-btn .loading {
  display: none;
}

.gh-foot-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.gh-foot-logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-white);
}

.gh-foot-menu .nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-6);
}

.gh-foot-menu .nav a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
}

.gh-foot-menu .nav a:hover {
  color: var(--color-white);
}

.gh-foot-social {
  display: flex;
  gap: var(--space-4);
}

.gh-foot-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--color-dark-secondary);
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition-fast);
}

.gh-foot-social a:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

.gh-foot-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.gh-foot-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-dark-secondary);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .gh-outer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .gh-head-menu {
    display: none;
  }

  .gh-burger {
    display: block;
  }

  .gh-hero {
    padding: var(--space-12) 0;
  }

  .gh-feed {
    grid-template-columns: 1fr;
  }

  .gh-foot-cta-form {
    flex-direction: column;
  }

  .gh-foot-nav {
    flex-direction: column;
    text-align: center;
  }

  .gh-foot-bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .kg-bookmark-container {
    flex-direction: column;
  }

  .kg-bookmark-thumbnail {
    width: 100%;
    height: 200px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: var(--text-3xl);
  }
  h2 {
    font-size: var(--text-2xl);
  }
  h3 {
    font-size: var(--text-xl);
  }

  .gh-content {
    font-size: var(--text-base);
  }
}
