/*
 * Cyberpunk Ghost Theme - Main Stylesheet
 * A premium cyberpunk-themed Ghost template with 5 color modes
 * Version: 1.0.0
 */

/* Import statements for modular CSS architecture */
@import "color-schemes.css";
@import "components.css";
@import "cyberpunk-effects.css";

/* =====================================================
   BASE STYLES & RESET
   ===================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  font-size: var(--font-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Theme transition effect */
.theme-transition * {
  transition: background-color var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out) !important;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-accent);
  margin-bottom: var(--space-4);
}

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

p {
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

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

a:hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 5px var(--accent);
}

strong, b {
  font-weight: 600;
  color: var(--text-accent);
}

em, i {
  font-style: italic;
}

code {
  font-family: var(--font-main);
  font-size: 0.9em;
  background: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--neon-cyan);
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-4);
  overflow-x: auto;
  margin-bottom: var(--space-4);
  position: relative;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
}

blockquote {
  border-left: 4px solid var(--accent);
  padding-left: var(--space-4);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: 0 8px 8px 0;
}

/* =====================================================
   LAYOUT STRUCTURE
   ===================================================== */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  padding: var(--space-6) var(--space-4);
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

/* =====================================================
   CYBERPUNK GRID BACKGROUND
   ===================================================== */

.cyberpunk-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
  animation: grid-pulse 4s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

/* =====================================================
   HOMEPAGE STYLES
   ===================================================== */

.homepage-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Minimal Hero Section - Cleaner without image */
.hero-section-minimal {
  padding: var(--space-8) var(--space-6) var(--space-6);
  text-align: center;
  position: relative;
  margin-bottom: var(--space-8);
  border-radius: 16px;
  overflow: hidden;
}

.hero-content-minimal {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-description {
  font-size: var(--font-base);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.hero-decoration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.neon-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
  animation: pulse 2s ease-in-out infinite;
}

/* Grid overlay removed for cleaner look */

/* =====================================================
   POSTS SECTION
   ===================================================== */

.posts-section {
  margin-bottom: var(--space-12);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.section-title {
  font-size: var(--font-2xl);
  color: var(--text-accent);
  margin-bottom: 0;
}

.section-decoration {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.neon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.neon-dot.featured {
  background: var(--accent-secondary);
  box-shadow: 0 0 10px var(--accent-secondary);
}

.neon-line-small {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.neon-line-small.featured {
  background: linear-gradient(90deg, var(--accent-secondary), transparent);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.no-posts {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  border-radius: 16px;
}

.no-posts-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  color: var(--accent);
}

.no-posts-title {
  color: var(--text-accent);
  margin-bottom: var(--space-4);
}

.no-posts-text {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* =====================================================
   FEATURED SECTION
   ===================================================== */

.featured-section {
  margin-bottom: var(--space-12);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-6);
}

/* =====================================================
   NEWSLETTER SECTION
   ===================================================== */

.newsletter-section {
  margin-bottom: var(--space-12);
}

.newsletter-container {
  padding: var(--space-8) var(--space-6);
  text-align: center;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.newsletter-title {
  font-size: var(--font-2xl);
  margin-bottom: var(--space-4);
}

.newsletter-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-input-group {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.newsletter-input {
  flex: 1;
}

.newsletter-feedback {
  font-size: var(--font-sm);
}

.newsletter-success {
  color: var(--success);
  display: none;
}

.newsletter-error {
  color: var(--error);
  display: none;
}

.newsletter-decoration {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100px;
  opacity: 0.1;
  pointer-events: none;
}

.neon-circuit {
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 20%, var(--accent) 2px, transparent 2px),
    radial-gradient(circle at 80% 80%, var(--accent-secondary) 2px, transparent 2px);
  background-size: 30px 30px;
}

/* =====================================================
   PAGINATION
   ===================================================== */

.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: var(--space-8);
}

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-radius: 12px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.pagination-btn:hover {
  background: var(--bg-quaternary);
  border-color: var(--accent);
  color: var(--text-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-main);
  font-weight: 500;
}

.pagination-current {
  color: var(--accent);
  font-weight: 600;
}

.pagination-separator {
  color: var(--text-tertiary);
}

.pagination-total {
  color: var(--text-secondary);
}

/* =====================================================
   POST PAGE STYLES
   ===================================================== */

.post-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4);
}

.post-header {
  margin-bottom: var(--space-8);
}

.post-feature-image {
  position: relative;
  margin-bottom: var(--space-6);
  border-radius: 12px;
  overflow: hidden;
}

.post-feature-image img {
  width: 100%;
  height: auto;
  display: block;
}

.post-header-content {
  padding: var(--space-6);
  border-radius: 12px;
}

.post-title {
  font-size: var(--font-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.post-excerpt {
  font-size: var(--font-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.post-meta-separator {
  color: var(--text-tertiary);
  margin: 0 var(--space-1);
}

.post-author-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast);
}

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

.post-meta-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.post-content {
  margin-bottom: var(--space-8);
}

.post-content-wrapper {
  padding: var(--space-6);
  border-radius: 12px;
  line-height: 1.8;
  font-size: var(--font-base);
}

/* Post content typography */
.post-content-wrapper h1,
.post-content-wrapper h2,
.post-content-wrapper h3,
.post-content-wrapper h4,
.post-content-wrapper h5,
.post-content-wrapper h6 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
  font-weight: 700;
  line-height: 1.3;
}

.post-content-wrapper h1 { font-size: var(--font-2xl); }
.post-content-wrapper h2 { font-size: var(--font-xl); }
.post-content-wrapper h3 { font-size: var(--font-lg); }
.post-content-wrapper h4 { font-size: var(--font-base); }

.post-content-wrapper p {
  margin-bottom: var(--space-4);
}

.post-content-wrapper ul,
.post-content-wrapper ol {
  margin-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.post-content-wrapper li {
  margin-bottom: var(--space-2);
}

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

.post-content-wrapper pre {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow-x: auto;
}

.post-content-wrapper code {
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

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

.post-content-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: var(--space-6) 0;
}

.post-content-wrapper a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast);
}

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

/* Post footer */
.post-footer {
  margin-top: var(--space-8);
}

.post-tags-section,
.author-card,
.social-sharing {
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border-radius: 12px;
}

.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.post-nav-item {
  display: flex;
}

.post-nav-prev {
  justify-content: flex-start;
}

.post-nav-next {
  justify-content: flex-end;
}

.post-nav-link {
  display: block;
  padding: var(--space-4);
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--duration-fast);
  border: 1px solid var(--border);
  width: 100%;
}

.post-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
  border-color: var(--accent);
}

.post-nav-direction {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.post-nav-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.related-posts {
  margin: var(--space-8) 0;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.related-post-card {
  padding: var(--space-4);
  border-radius: 8px;
  transition: all var(--duration-fast);
}

.related-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

/* Tablet */
@media (max-width: 768px) {
  .main-content {
    padding: var(--space-4) var(--space-3);
  }
  
  .post-navigation {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .post-nav-next {
    justify-content: flex-start;
  }
  
  .hero-section-minimal {
    padding: var(--space-6) var(--space-4) var(--space-4);
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .featured-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .newsletter-input-group {
    flex-direction: column;
  }
  
  .newsletter-input {
    margin-bottom: var(--space-2);
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .main-content {
    padding: var(--space-3) var(--space-2);
  }
  
  .hero-section-minimal {
    padding: var(--space-4) var(--space-3);
    margin-bottom: var(--space-6);
  }
  
  .newsletter-container {
    padding: var(--space-6) var(--space-4);
  }
  
  .pagination {
    padding: var(--space-3) var(--space-4);
  }
  
  .pagination-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-sm);
  }
}

/* =====================================================
   KOENIG EDITOR SUPPORT
   ===================================================== */

/* Required Koenig classes for Ghost editor support */
.kg-width-wide {
  width: 100%;
  max-width: calc(100% + 8rem);
  margin-left: -4rem;
  margin-right: -4rem;
  position: relative;
}

.kg-width-full {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
}

@media (max-width: 768px) {
  .kg-width-wide {
    max-width: calc(100% + 2rem);
    margin-left: -1rem;
    margin-right: -1rem;
  }
  
  .kg-width-full {
    margin-left: 50%;
    transform: translateX(-50%);
  }
}