/*
Theme Name: Lunar AI Lab
Theme URI: https://lunarailab.com
Author: Lunar AI Lab
Author URI: https://lunarailab.com
Description: Custom dark theme matching the Lunar AI Lab landing page.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: lunar-ai-lab
*/

/* =============================================
   GOOGLE FONTS
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600&family=Geist+Mono:wght@400;500&display=swap');

/* =============================================
   RESET & ROOT
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  --black: #000000;
  --accent: #C15F3C;
  --accent-dim: rgba(193, 95, 60, 0.12);
  --white: #ffffff;
  --white-60: rgba(255,255,255,0.6);
  --white-40: rgba(255,255,255,0.4);
  --white-15: rgba(255,255,255,0.15);
  --white-10: rgba(255,255,255,0.10);
  --white-07: rgba(255,255,255,0.07);
  --card-bg: rgba(255,255,255,0.05);
  --card-border: rgba(255,255,255,0.12);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', 'Courier New', monospace;
  --max-w: 1100px;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* Grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Radial glow */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  right: -20%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(193,95,60,0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   LAYOUT
   ============================================= */
.site-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.section-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* =============================================
   HEADER / NAV
   ============================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--white-07);
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-logo {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
}

.site-logo span {
  color: var(--accent);
}

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

.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white-60);
  text-decoration: none;
  font-family: var(--mono);
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links .current-menu-item a {
  color: var(--white);
}

.nav-cta a {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--accent);
  border: 1px solid rgba(193,95,60,0.4);
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.nav-cta a:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.site-main {
  flex: 1;
  padding-top: 100px;
  padding-bottom: 6rem;
}

/* =============================================
   BLOG INDEX — POST GRID
   ============================================= */
.blog-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--white-10);
  margin-bottom: 3.5rem;
}

.blog-header .section-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.blog-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Post card */
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-2px);
}

.post-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--white-07);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(20%);
  transition: filter 0.3s, transform 0.3s;
}

.post-card:hover .post-card-thumb img {
  filter: grayscale(0);
  transform: scale(1.03);
}

.post-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-card-cat {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.post-card-date {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--white-40);
}

.post-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--white);
  margin-bottom: 0.6rem;
}

.post-card-excerpt {
  font-size: 0.8rem;
  color: var(--white-60);
  line-height: 1.6;
  flex: 1;
}

.post-card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

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

.pagination a,
.pagination span {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--white-15);
  border-radius: 6px;
  color: var(--white-60);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

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

.pagination .current {
  color: var(--accent);
  border-color: rgba(193,95,60,0.4);
}

/* =============================================
   SINGLE POST
   ============================================= */
.single-post-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 2rem;
}

.post-hero {
  margin-bottom: 3rem;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.post-cat-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(193,95,60,0.35);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

.post-hero-date {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--white-40);
}

.post-hero-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.post-hero-subtitle {
  font-size: 1.05rem;
  color: var(--white-60);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.post-hero-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--white-10);
}

.post-hero-author img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--white-15);
}

.post-hero-author-info {
  display: flex;
  flex-direction: column;
}

.post-hero-author-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--white);
}

.post-hero-author-role {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--white-40);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-featured-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 3rem;
  border: 1px solid var(--white-10);
}

.post-featured-image img {
  width: 100%;
  display: block;
}

/* Post content typography */
.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
}

.post-content h2 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--white);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.post-content h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--white);
  margin: 2rem 0 0.75rem;
}

.post-content h4 {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.75rem 0 0.5rem;
}

.post-content p {
  margin-bottom: 1.4rem;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(193,95,60,0.35);
  transition: border-color 0.15s;
}

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

.post-content ul,
.post-content ol {
  margin: 0 0 1.4rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--accent-dim);
  border-radius: 0 8px 8px 0;
}

.post-content blockquote p {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--white-60);
  margin: 0;
}

.post-content pre {
  background: var(--white-07);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--white-60);
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--white-07);
  border: 1px solid var(--white-10);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--white-60);
}

.post-content img {
  max-width: 100%;
  border-radius: 10px;
  margin: 1.5rem 0;
  border: 1px solid var(--white-10);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--white-10);
  margin: 2.5rem 0;
}

/* Post footer / back link */
.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-to-blog {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white-60);
  text-decoration: none;
  border: 1px solid var(--white-15);
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
}

.back-to-blog:hover {
  color: var(--white);
  border-color: var(--white-40);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  border-top: 1px solid var(--white-07);
  padding: 2.5rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
}

.footer-tagline {
  font-size: 0.75rem;
  color: var(--white-40);
  margin-top: 0.3rem;
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white-40);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer-credit {
  font-size: 0.72rem;
  color: var(--white-40);
  margin-top: 0.3rem;
}

.footer-credit a {
  color: var(--white-60);
  text-decoration: none;
  border-bottom: 1px solid var(--white-15);
  transition: color 0.15s;
}

.footer-credit a:hover {
  color: var(--white);
}

/* =============================================
   NO POSTS / EMPTY STATE
   ============================================= */
.no-posts {
  text-align: center;
  padding: 5rem 2rem;
}

.no-posts p {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--white-40);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 1rem 1.25rem;
  }

  .nav-links {
    display: none;
  }

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

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .post-hero-title {
    font-size: 1.7rem;
  }
}
