/* StockApp Ghost Theme - Minimalist, Content-First Design */

/* ===================================================================
   1. CSS Variables & Theme - Dark Mode Only
   =================================================================== */

:root {
  /* Colors - Dark Theme (StockApp colors) */
  --background: hsl(0, 0%, 3.9%);
  --foreground: hsl(0, 0%, 98%);
  --card: hsl(0, 0%, 7%);
  --card-foreground: hsl(0, 0%, 98%);
  --primary: hsl(0, 0%, 98%);
  --primary-foreground: hsl(0, 0%, 10%);
  --secondary: hsl(0, 0%, 15.9%);
  --secondary-foreground: hsl(0, 0%, 98%);
  --muted: hsl(0, 0%, 15.9%);
  --muted-foreground: hsl(0, 0%, 64.9%);
  --accent: hsl(188.7, 94.5%, 42.7%);
  --accent-hover: hsl(188.7, 94.5%, 50%);
  --destructive: hsl(0, 84.2%, 60.2%);
  --border: hsl(0, 0%, 20%);
  --input: hsl(0, 0%, 15%);
  --ring: hsl(0, 0%, 83.9%);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-weight-light: 200;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 800;
  
  /* Font Sizes */
  --text-xs: 0.875rem;
  --text-sm: 0.9375rem;
  --text-base: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3rem;
  
  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.75;
  --leading-relaxed: 2;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  
  /* Layout */
  --content-width: 680px;
  --wide-width: 720px;
  --site-width: 960px;
  --radius: 0.375rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}


/* ===================================================================
   2. Font Face
   =================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('../fonts/inter-v12-latin-200.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-v12-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-v12-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-v12-latin-800.woff2') format('woff2');
}

/* ===================================================================
   3. Base Styles
   =================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================================================
   4. Layout
   =================================================================== */

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
  padding: var(--space-xl) var(--space-md);
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
}

.home-wrapper,
.tag-wrapper,
.author-wrapper {
  max-width: var(--wide-width);
  margin: 0 auto;
  width: 100%;
}

/* ===================================================================
   5. Header
   =================================================================== */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
  transition: all 0.2s ease;
}

.header-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--foreground);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

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

.stockapp-logo {
  width: 40px;
  height: 40px;
  color: var(--foreground);
}

.site-title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--foreground);
}

/* ===================================================================
   6. Typography
   =================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  color: var(--foreground);
}

h1 { font-size: var(--text-3xl); font-weight: var(--font-weight-bold); }
h2 { font-size: var(--text-2xl); margin-top: var(--space-xl); }
h3 { font-size: var(--text-xl); margin-top: var(--space-lg); }
h4 { font-size: var(--text-lg); margin-top: var(--space-lg); }

p {
  margin-bottom: var(--space-md);
}

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

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

/* ===================================================================
   7. Post Card
   =================================================================== */

.post-feed {
  margin: var(--space-xl) 0;
}

.post-card {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
  transition: color 0.2s ease;
}

.post-card-link:hover .post-card-title {
  color: var(--accent);
}

.post-card-excerpt {
  color: var(--muted-foreground);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-sm);
}

.post-card-excerpt p {
  margin: 0;
}

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

.meta-separator {
  opacity: 0.5;
}

.post-card-tag {
  color: var(--accent);
  font-weight: var(--font-weight-semibold);
}

/* ===================================================================
   8. Article
   =================================================================== */

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

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

.article-title {
  margin-bottom: var(--space-md);
}

.article-meta {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* Article Feature Image */
.article-image {
  margin: var(--space-2xl) auto;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  position: relative;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.article-image figcaption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* Table of Contents */
.article-toc-wrapper {
  margin: var(--space-lg) 0;
}

.article-toc {
  background: var(--secondary);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.article-toc summary {
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  color: var(--foreground);
}

.toc-nav {
  margin-top: var(--space-sm);
}

.toc-nav ol {
  list-style: decimal;
  padding-left: var(--space-md);
}

.toc-nav li {
  margin: var(--space-xs) 0;
}

.toc-nav a {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.toc-nav .h3-link {
  padding-left: var(--space-md);
}

/* Article Content */
.article-content {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.article-content h2 {
  margin-bottom: var(--space-md);
}

.article-content h3 {
  margin-bottom: var(--space-sm);
}

.article-content p {
  margin-bottom: var(--space-md);
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.article-content li {
  margin-bottom: var(--space-xs);
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--muted-foreground);
}

.article-content pre {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: var(--space-md);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  position: relative;
}

.article-content code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.article-content :not(pre) > code {
  background: var(--secondary);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: var(--foreground);
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.article-content figure {
  margin: var(--space-lg) 0;
}

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

/* Article Footer */
.article-footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.article-tags {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.tag-link {
  color: var(--accent);
  font-weight: var(--font-weight-semibold);
}

/* Article Newsletter */
.article-newsletter {
  margin: var(--space-2xl) 0;
}

.newsletter-box {
  background: var(--secondary);
  padding: var(--space-lg);
  border-radius: var(--radius);
  text-align: center;
}

.newsletter-box h3 {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.newsletter-box p {
  color: var(--muted-foreground);
  margin-bottom: var(--space-md);
}

/* Author Bio */
.article-author-bio {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding: var(--space-lg);
  background: var(--secondary);
  border-radius: var(--radius);
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
}

.author-name {
  margin: 0 0 var(--space-xs) 0;
}

.author-bio {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  margin: 0;
}

/* Related Posts */
.related-posts {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border);
}

.related-posts h3 {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.related-feed {
  display: grid;
  gap: var(--space-lg);
}

/* Reading Progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.2s ease;
}

/* ===================================================================
   9. Footer
   =================================================================== */

.site-footer {
  margin-top: var(--space-3xl);
  border-top: 1px solid var(--border);
  background: var(--background);
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.footer-newsletter {
  max-width: 400px;
  margin: 0 auto var(--space-2xl) auto;
  text-align: center;
}

.footer-newsletter h4 {
  margin-bottom: var(--space-xs);
}

.footer-newsletter p {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
}

.newsletter-form {
  display: flex;
  gap: var(--space-xs);
}

.newsletter-form input {
  flex: 1;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-sm);
}

.newsletter-form button {
  padding: var(--space-xs) var(--space-md);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background 0.2s ease;
}

.newsletter-form button:hover {
  background: var(--accent-hover);
}

.message-success,
.message-error {
  display: none;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
}

.message-success {
  color: var(--accent);
}

.message-error {
  color: var(--destructive);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

/* ===================================================================
   10. Forms & Buttons
   =================================================================== */

.button {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: white;
}

.button-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.button-secondary {
  background: var(--secondary);
  color: var(--foreground);
}

.button-secondary:hover {
  background: var(--muted);
  text-decoration: none;
}

/* ===================================================================
   11. Page Template
   =================================================================== */

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

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

.page-title {
  margin-bottom: var(--space-md);
}

.page-image {
  margin: var(--space-xl) 0;
}

.page-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.page-image figcaption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin-top: var(--space-xs);
}

.page-content {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.page-content h2 {
  margin: var(--space-xl) 0 var(--space-md) 0;
}

.page-content h3 {
  margin: var(--space-lg) 0 var(--space-sm) 0;
}

.page-content p {
  margin-bottom: var(--space-md);
}

.page-content ul,
.page-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.page-content li {
  margin-bottom: var(--space-xs);
}

.page-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--muted-foreground);
}

.page-content pre {
  background: var(--secondary);
  padding: var(--space-md);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

.page-content code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.page-content :not(pre) > code {
  background: var(--secondary);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: var(--foreground);
}

/* ===================================================================
   12. Pagination
   =================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
  font-size: var(--text-sm);
}

.pagination a {
  color: var(--muted-foreground);
  font-weight: var(--font-weight-semibold);
}

.page-number {
  color: var(--muted-foreground);
}

/* ===================================================================
   13. Error Pages
   =================================================================== */

.error-wrapper {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-code {
  font-size: var(--text-4xl);
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.error-message {
  margin-bottom: var(--space-md);
}

.error-description {
  color: var(--muted-foreground);
  margin-bottom: var(--space-lg);
}

.error-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* ===================================================================
   14. Homepage Hero & Featured Article
   =================================================================== */

/* Hero Section */
.home-hero {
  padding: var(--space-3xl) 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3xl);
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--foreground) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--muted-foreground);
  line-height: var(--leading-normal);
  margin: 0;
}

/* Featured Article */
.featured-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.featured-article {
  margin-bottom: var(--space-3xl);
}

.featured-grid {
  display: block;
  max-width: 800px;
  margin: 0 auto;
}

.featured-image {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  aspect-ratio: 21 / 9;
  margin-bottom: var(--space-xl);
  transition: transform 0.3s ease;
}

.featured-image:hover {
  transform: scale(1.01);
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-content {
  text-align: center;
  padding: 0;
}

.featured-label {
  margin-bottom: var(--space-md);
}

.featured-label span {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.featured-title {
  margin-bottom: var(--space-lg);
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
}

.featured-title a {
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.featured-excerpt {
  margin-bottom: var(--space-lg);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--muted-foreground);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
}

.featured-excerpt p {
  margin: 0;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.featured-author {
  font-weight: var(--font-weight-semibold);
  color: var(--foreground);
}

.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: var(--text-base);
}

.featured-cta:hover {
  background: var(--accent);
  color: white;
  transform: translateX(4px);
}

.cta-arrow {
  transition: transform 0.2s ease;
}

.featured-cta:hover .cta-arrow {
  transform: translateX(4px);
}

/* Archive Section */
.archive-section {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg);
  border-top: 1px solid var(--border);
}

.archive-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-lg);
  color: var(--muted-foreground);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.archive-card {
  padding: var(--space-md);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.archive-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.archive-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
  line-height: var(--leading-tight);
}

.archive-card-title a {
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.archive-card-date {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.archive-link {
  text-align: center;
}

.view-all {
  display: inline-block;
  color: var(--accent);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all 0.2s ease;
}

.view-all:hover {
  text-decoration: underline;
  transform: translateX(4px);
}

/* Responsive adjustments for homepage */
@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .featured-image {
    aspect-ratio: 16 / 9;
  }
  
  .archive-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: var(--text-3xl);
  }
  
  .featured-title {
    font-size: var(--text-2xl);
  }
}

/* ===================================================================
   15. Utilities
   =================================================================== */

.site-intro {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.site-intro h1 {
  margin-bottom: var(--space-sm);
}

.site-intro p {
  color: var(--muted-foreground);
  font-size: var(--text-lg);
  margin: 0;
}

.tag-header,
.author-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.tag-meta,
.author-meta {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
}

.author-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.author-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

/* ===================================================================
   16. Responsive Design
   =================================================================== */

@media (max-width: 768px) {
  :root {
    --text-base: 1rem;
    --text-3xl: 2rem;
    --text-2xl: 1.5rem;
  }
  
  .header-inner {
    padding: var(--space-sm) var(--space-md);
  }
  
  .site-content {
    padding: var(--space-lg) var(--space-md);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .back-to-app span {
    display: none;
  }
  
  .article-author-bio {
    flex-direction: column;
    text-align: center;
  }
  
  .author-avatar {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: var(--space-sm);
  }
  
  .site-logo .site-title {
    display: none;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .error-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .error-actions .button {
    width: 100%;
  }
}

/* ===================================================================
   17. Ghost Required Classes
   =================================================================== */

/* Ghost Editor Card Widths */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  max-width: 85vw;
  margin: calc(1.2 * var(--space-lg)) calc(-50vw + 50%);
}

.kg-width-full {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin: calc(1.2 * var(--space-lg)) calc(-50vw + 50%);
}

/* Ghost Gallery Cards */
.kg-gallery-container {
  position: relative;
  margin: var(--space-lg) 0;
}

.kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: var(--space-sm);
}

.kg-gallery-image {
  flex: 1 1 0%;
}

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

/* Ghost Bookmark Card */
.kg-bookmark-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-lg) 0;
}

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

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

.kg-bookmark-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.kg-bookmark-description {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  margin-bottom: var(--space-xs);
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.kg-bookmark-icon {
  width: 20px;
  height: 20px;
  margin-right: var(--space-xs);
}

.kg-bookmark-author {
  margin-left: var(--space-xs);
}

.kg-bookmark-thumbnail {
  position: relative;
  min-width: 33%;
  max-height: 100%;
}

.kg-bookmark-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ghost Button Card */
.kg-button-card {
  margin: var(--space-lg) 0;
  text-align: center;
}

.kg-button {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: background 0.2s ease;
}

.kg-button:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

/* Ghost Toggle Card */
.kg-toggle-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
}

.kg-toggle-heading {
  padding: var(--space-md);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kg-toggle-heading-text {
  font-weight: var(--font-weight-semibold);
}

.kg-toggle-content {
  padding: 0 var(--space-md) var(--space-md);
}

/* Ghost Product Card */
.kg-product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
  padding: var(--space-md);
}

.kg-product-card-container {
  display: grid;
  grid-template-columns: auto min-content;
  gap: var(--space-md);
  align-items: center;
}

.kg-product-card-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius);
}

.kg-product-card-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.kg-product-card-description {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

/* Ghost Audio Card */
.kg-audio-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
}

.kg-audio-player {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Ghost Video Card */
.kg-video-card {
  position: relative;
  margin: var(--space-lg) 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.kg-video-container {
  position: relative;
  padding-top: 56.25%;
}

.kg-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Ghost File Card */
.kg-file-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
}

.kg-file-card-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.kg-file-card-icon {
  width: 24px;
  height: 24px;
}

.kg-file-card-title {
  flex: 1;
  font-weight: var(--font-weight-semibold);
}

.kg-file-card-filesize {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

/* Ghost Header Cards */
.kg-header-card {
  padding: 12vw 4vw;
  margin: var(--space-lg) calc(-50vw + 50%);
  text-align: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.kg-header-card h2,
.kg-header-card h3 {
  color: white;
  margin: 0;
}

/* Ghost Callout Card */
.kg-callout-card {
  background: var(--secondary);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
  display: flex;
  gap: var(--space-sm);
}

.kg-callout-emoji {
  font-size: 1.5em;
  line-height: 1;
}

.kg-callout-text {
  flex: 1;
}

/* ===================================================================
   18. Print Styles
   =================================================================== */

@media print {
  .site-header,
  .site-footer,
  .article-newsletter,
  .related-posts,
  .reading-progress,
  .theme-toggle,
  .back-to-app {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
    background: white;
  }
  
  .article-content {
    max-width: 100%;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  pre {
    white-space: pre-wrap;
    page-break-inside: avoid;
  }
}