/* Prompted Maintenance Ghost Theme - Main Stylesheet */

/* CSS Variables from Brand Guide */
:root {
  --pm-blue: #2D9CDB;
  --pm-blue-dark: #185FA5;
  --pm-blue-deep: #0C447C;
  --pm-blue-glow: #5BB8E8;
  --pm-bg-primary: #0D0D0D;
  --pm-bg-surface: #1A1A1A;
  --pm-bg-card: #111111;
  --pm-bg-light: #F5F3EE;
  --pm-text-primary: #FFFFFF;
  --pm-text-secondary: #8A8A8A;
  --pm-text-muted: #555555;
  --pm-beam-width: 2.5px;
  --pm-beam-opacity: 0.75;
  --pm-beam-glow-opacity: 0.04;
  --pm-cursor-blink: 1.1s;
  --pm-section-padding: 96px;
  --pm-content-max-width: 1200px;
  --pm-border-radius: 8px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--pm-bg-primary);
  color: var(--pm-text-primary);
  line-height: 1.6;
  font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
  font-weight: 600;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.7;
}

a {
  color: var(--pm-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--pm-blue-glow);
}

/* Layout */
.container {
  max-width: var(--pm-content-max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: var(--pm-section-padding) 0;
}

/* Header & Navigation */
.site-header {
  background-color: var(--pm-bg-surface);
  padding: 1rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color 0.3s ease;
}

.site-header.scrolled {
  background-color: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--pm-content-max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

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

.site-logo svg {
  height: 40px;
  width: auto;
  transition: all 0.3s ease;
}

.site-header.scrolled .site-logo svg {
  height: 32px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: var(--pm-text-primary);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--pm-blue);
}

/* Hero Section */
.hero {
  padding: 8rem 0 6rem;
  text-align: center;
  position: relative;
  margin-top: 72px;
}

.hero-logo {
  margin-bottom: 2rem;
}

.hero-logo svg {
  height: 120px;
  width: auto;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--pm-text-secondary);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-beam {
  width: 100%;
  height: var(--pm-beam-width);
  background-color: var(--pm-blue);
  opacity: var(--pm-beam-opacity);
  margin: 4rem 0;
  position: relative;
}

.hero-beam::after {
  content: '_';
  position: absolute;
  right: 0;
  top: -16px;
  color: var(--pm-blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  animation: cursor-blink var(--pm-cursor-blink) infinite;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--pm-border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--pm-blue);
  color: white;
}

.btn-primary:hover {
  background-color: var(--pm-blue-glow);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--pm-blue);
  border: 2px solid var(--pm-blue);
}

.btn-outline:hover {
  background-color: var(--pm-blue);
  color: white;
}

/* Post Cards */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.post-card {
  background-color: var(--pm-bg-card);
  border-radius: var(--pm-border-radius);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card-content {
  padding: 1.5rem;
}

.post-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.post-card-title a {
  color: var(--pm-text-primary);
}

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

.post-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--pm-text-muted);
}

/* Individual Post */
.post-header {
  text-align: center;
  margin-bottom: 3rem;
}

.post-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.post-meta {
  color: var(--pm-text-secondary);
  font-size: 1rem;
}

.post-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
  word-spacing: normal;
}

.post-content h2, .post-content h3 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

.post-content img {
  width: 100%;
  height: auto;
  border-radius: var(--pm-border-radius);
  margin: 2rem 0;
}

.post-content pre {
  background-color: var(--pm-bg-card);
  padding: 1.5rem;
  border-radius: var(--pm-border-radius);
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.95rem;
}

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

/* Member Content */
.member-content {
  background-color: var(--pm-bg-surface);
  padding: 2rem;
  border-radius: var(--pm-border-radius);
  margin: 2rem 0;
  text-align: center;
}

.member-signup-form {
  max-width: 400px;
  margin: 2rem auto;
}

.member-signup-form input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--pm-bg-surface);
  border-radius: var(--pm-border-radius);
  background-color: var(--pm-bg-card);
  color: var(--pm-text-primary);
  margin-bottom: 1rem;
}

.member-signup-form input:focus {
  outline: none;
  border-color: var(--pm-blue);
}

/* Section Dividers */
.section-divider {
  width: 100%;
  height: 1px;
  background-color: var(--pm-blue);
  opacity: 0.2;
  margin: 4rem 0;
}

/* Footer */
.site-footer {
  background-color: var(--pm-bg-surface);
  padding: 3rem 0 2rem;
  margin-top: 6rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--pm-blue);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--pm-text-secondary);
}

.footer-bottom {
  border-top: 1px solid var(--pm-bg-card);
  padding-top: 2rem;
  text-align: center;
  color: var(--pm-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  color: var(--pm-blue);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 1px;
  opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --pm-section-padding: 60px;
  }

  .container {
    padding: 0 1rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .nav-menu {
    gap: 1rem;
  }

  .hero {
    padding: 6rem 0 4rem;
  }

  .hero-logo svg {
    height: 80px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-title {
    font-size: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  :root {
    --pm-section-padding: 40px;
  }

  .hero-logo svg {
    height: 60px;
  }

  .post-content {
    font-size: 1rem;
  }
}

/* Author Pages */
.author-image-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.author-bio {
  display: flex;
  align-items: center;
  gap: 2rem;
  background-color: var(--pm-bg-surface);
  padding: 2rem;
  border-radius: var(--pm-border-radius);
}

.author-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-info {
  flex: 1;
}

.author-info h3 {
  margin-bottom: 0.5rem;
  color: var(--pm-blue);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 3rem;
}

.pagination-info {
  color: var(--pm-text-secondary);
  font-size: 0.95rem;
}

/* Post Tags */
.post-tags {
  text-align: center;
  margin-top: 2rem;
}

.post-tags h4 {
  margin-bottom: 1rem;
  color: var(--pm-blue);
}

.tag-link {
  display: inline-block;
  background-color: var(--pm-bg-surface);
  color: var(--pm-text-secondary);
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  border-radius: var(--pm-border-radius);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.tag-link:hover {
  background-color: var(--pm-blue);
  color: white;
}

/* Mobile Menu (for future implementation) */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background-color: var(--pm-text-primary);
  margin: 3px 0;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
  
  .nav-menu {
    display: none;
  }
  
  .author-bio {
    flex-direction: column;
    text-align: center;
  }
  
  .pagination {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Ghost Content Card Widths */
.post-content .kg-width-wide {
  max-width: 1040px;
  margin-left: calc(50% - 520px);
  margin-right: calc(50% - 520px);
}

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

.post-content .kg-width-wide img,
.post-content .kg-width-full img {
  width: 100%;
}

@media (max-width: 1100px) {
  .post-content .kg-width-wide {
    max-width: none;
    margin-left: -2rem;
    margin-right: -2rem;
  }
}

/* Ghost Card Styles */
.kg-card {
  margin: 2rem 0;
}

.kg-image-card img,
.kg-gallery-card img {
  width: 100%;
  height: auto;
  border-radius: var(--pm-border-radius);
}

.kg-card figcaption {
  text-align: center;
  color: var(--pm-text-muted);
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.kg-bookmark-card {
  background-color: var(--pm-bg-surface);
  border-radius: var(--pm-border-radius);
  overflow: hidden;
}

.kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: var(--pm-text-primary);
}

.kg-bookmark-content {
  flex: 1;
  padding: 1.25rem;
}

.kg-bookmark-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.kg-bookmark-description {
  color: var(--pm-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 3rem;
  overflow: hidden;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--pm-text-muted);
}

.kg-bookmark-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

.kg-bookmark-author::after {
  content: " · ";
}

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

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

.kg-embed-card {
  display: flex;
  justify-content: center;
}

.kg-embed-card iframe {
  max-width: 100%;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--pm-text-muted);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }