/*
Theme Name: SpaceTech AI Deep Field Blue
Theme URI: https://spacetechchronicles.com
Author: Daniel Singleton / SpaceTech AI
Author URI: https://spacetechchronicles.com
Description: A JWST deep-field-inspired dark theme for SpaceTech AI — cobalt blue accents, animated starfield, glassmorphic navigation, and purpose-built templates for space technology journalism and student resources.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spacetech-ai
Tags: dark, one-column, two-columns, custom-logo, featured-images, blog, education, news
*/

/* ==========================================================
   DEEP FIELD BLUE — Design System
   ========================================================== */

/* ── Custom Properties ── */
:root {
  --stc-bg: #060b18;
  --stc-bg-mid: #0a1128;
  --stc-bg-card: #0d1530;
  --stc-bg-card-hov: #111d3d;
  --stc-accent: #2563eb;
  --stc-accent-hov: #1d4ed8;
  --stc-accent-soft: #3b82f6;
  --stc-accent-ice: #93c5fd;
  --stc-glow: rgba(37, 99, 235, 0.18);
  --stc-glow-strong: rgba(37, 99, 235, 0.35);
  --stc-warm: #f59e0b;
  --stc-warm-soft: rgba(245, 158, 11, 0.12);
  --stc-green: #22c55e;
  --stc-green-soft: rgba(34, 197, 94, 0.08);
  --stc-text: #e2e8f0;
  --stc-text-muted: #94a3b8;
  --stc-text-dim: #64748b;
  --stc-border: #152040;
  --stc-border-lit: #1e3060;
  --stc-radius: 16px;
  --stc-radius-sm: 10px;
  --stc-radius-xs: 6px;
  --stc-max-width: 1200px;
  --stc-content-width: 780px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--stc-bg);
  color: var(--stc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  min-height: 100vh;
}

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

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

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 0;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 1.75rem; font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1.125rem; font-weight: 600; }

p { margin-top: 0; margin-bottom: 1.25rem; }

/* ── Layout Containers ── */
.stc-container {
  max-width: var(--stc-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.stc-narrow {
  max-width: var(--stc-content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================
   HEADER — Glassmorphic Sticky Nav
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 11, 24, 0.92);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--stc-border);
}

.site-header .stc-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-branding .custom-logo-link img {
  height: 36px;
  width: auto;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.site-title a {
  color: #fff;
  text-decoration: none;
}
.site-title a:hover {
  color: var(--stc-accent-ice);
}

/* Primary Navigation */
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

.primary-nav a {
  display: block;
  padding: 8px 16px;
  color: var(--stc-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.primary-nav a:hover,
.primary-nav .current-menu-item a,
.primary-nav .current_page_item a {
  color: var(--stc-accent-ice);
  background: var(--stc-glow);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--stc-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* ==========================================================
   HERO BANNER
   ========================================================== */
.hero-banner {
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  border-bottom: 1px solid var(--stc-border);
}

.hero-banner h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--stc-accent-ice);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stc-text-dim);
  margin-bottom: 20px;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--stc-text-muted);
  max-width: 620px;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.hero-subtitle {
  font-style: italic;
  color: var(--stc-text-dim);
  font-size: 0.95rem;
}

/* ==========================================================
   POST CARDS
   ========================================================== */
.post-card {
  background: var(--stc-bg-card);
  border: 1px solid var(--stc-border);
  border-radius: var(--stc-radius);
  overflow: hidden;
  transition: all 0.3s ease;
}

.post-card:hover {
  background: var(--stc-bg-card-hov);
  border-color: var(--stc-border-lit);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px var(--stc-glow);
}

.post-card__image {
  overflow: hidden;
  position: relative;
}

.post-card__image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card__image img {
  transform: scale(1.05);
}

.post-card__image .image-credit {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 4px;
}

.post-card__body {
  padding: 20px 24px 24px;
}

.post-card__category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stc-accent-ice);
  margin-bottom: 8px;
}

.post-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}
.post-card__title a {
  color: inherit;
}
.post-card__title a:hover {
  color: var(--stc-accent-ice);
}

.post-card__meta {
  font-size: 0.8rem;
  color: var(--stc-text-dim);
  margin-bottom: 12px;
}

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--stc-text-muted);
  line-height: 1.6;
}

/* Featured / Hero Post */
.featured-post {
  margin-bottom: 48px;
}

.featured-post .post-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 360px;
}

.featured-post .post-card__image img {
  height: 100%;
  min-height: 360px;
}

.featured-post .post-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.featured-post .post-card__title {
  font-size: 1.5rem;
}

/* Post Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

/* Archive grid (text-only cards) */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.archive-card {
  background: var(--stc-bg-card);
  border: 1px solid var(--stc-border);
  border-radius: var(--stc-radius);
  padding: 24px;
  transition: all 0.3s ease;
}

.archive-card:hover {
  background: var(--stc-bg-card-hov);
  border-color: var(--stc-border-lit);
  transform: translateY(-2px);
}

/* ==========================================================
   SECTION HEADINGS
   ========================================================== */
.section-heading {
  text-align: center;
  margin-bottom: 32px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stc-accent-ice);
  margin-bottom: 8px;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.stc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--stc-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--stc-radius-sm);
  box-shadow: 0 4px 16px var(--stc-glow);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.stc-btn:hover {
  background: var(--stc-accent-hov);
  box-shadow: 0 6px 28px var(--stc-glow-strong);
  transform: translateY(-1px);
  color: #fff;
}

.stc-btn--ghost {
  background: transparent;
  border: 1px solid var(--stc-border);
  color: var(--stc-text-muted);
  box-shadow: none;
}

.stc-btn--ghost:hover {
  border-color: var(--stc-accent);
  color: var(--stc-accent-ice);
  background: var(--stc-glow);
  box-shadow: none;
}

/* WP Block buttons */
.wp-block-button__link,
.wp-element-button {
  background: var(--stc-accent);
  color: #fff;
  border: none;
  border-radius: var(--stc-radius-sm);
  box-shadow: 0 4px 16px var(--stc-glow);
  transition: all 0.2s;
  font-weight: 600;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
  background: var(--stc-accent-hov);
  box-shadow: 0 6px 28px var(--stc-glow-strong);
  transform: translateY(-1px);
  color: #fff;
}

.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 1px solid var(--stc-border);
  color: var(--stc-text-muted);
  box-shadow: none;
}

.is-style-outline .wp-block-button__link:hover {
  border-color: var(--stc-accent);
  color: var(--stc-accent-ice);
  background: var(--stc-glow);
}

/* ==========================================================
   SINGLE POST
   ========================================================== */
.single-post__hero {
  position: relative;
  margin-bottom: 40px;
}

.single-post__hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 0 0 var(--stc-radius) var(--stc-radius);
}

.single-post__hero .image-credit {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.55);
  padding: 4px 10px;
  border-radius: 6px;
}

.single-post__header {
  margin-bottom: 32px;
}

.single-post__category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stc-accent-ice);
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.2);
  padding: 4px 12px;
  border-radius: var(--stc-radius-xs);
  margin-bottom: 16px;
}

.single-post__title {
  font-size: 2.25rem;
  margin-bottom: 12px;
}

.single-post__meta {
  font-size: 0.875rem;
  color: var(--stc-text-dim);
}

.single-post__meta span + span::before {
  content: "·";
  margin: 0 8px;
}

/* Article content */
.entry-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.entry-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--stc-border);
}

.entry-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--stc-accent-ice);
}

.entry-content img {
  border-radius: 12px;
}

.entry-content figure {
  margin: 2rem 0;
}

.entry-content figcaption {
  font-size: 0.875rem;
  color: var(--stc-text-dim);
  margin-top: 8px;
  line-height: 1.5;
}

.entry-content figcaption .image-credit {
  color: var(--stc-accent-soft);
  font-style: italic;
}

.entry-content blockquote,
.entry-content .wp-block-quote {
  background: var(--stc-glow);
  border-left: 3px solid var(--stc-accent);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 2rem 0;
}

.entry-content ul, .entry-content ol {
  padding-left: 1.5rem;
}

.entry-content li {
  margin-bottom: 0.5rem;
}

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

.entry-content hr,
.entry-content .wp-block-separator {
  border: none;
  border-top: 1px solid var(--stc-border);
  margin: 3rem 0;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--stc-border);
}

.post-tags a {
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.2);
  color: var(--stc-accent-ice);
  padding: 4px 12px;
  border-radius: var(--stc-radius-xs);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}
.post-tags a:hover {
  background: rgba(37,99,235,0.2);
  border-color: var(--stc-accent);
}

/* Post navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--stc-border);
}

.post-navigation a {
  display: block;
  padding: 20px;
  background: var(--stc-bg-card);
  border: 1px solid var(--stc-border);
  border-radius: var(--stc-radius-sm);
  transition: all 0.2s;
  text-decoration: none;
}
.post-navigation a:hover {
  background: var(--stc-bg-card-hov);
  border-color: var(--stc-border-lit);
}

.post-navigation .nav-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stc-text-dim);
  margin-bottom: 6px;
}

.post-navigation .nav-title {
  color: #fff;
  font-weight: 600;
}

.nav-next {
  text-align: right;
}

/* ==========================================================
   PAGE TEMPLATES
   ========================================================== */
.page-content {
  padding: 48px 0 80px;
}

.page-header {
  margin-bottom: 32px;
}

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

/* Gutenberg block overrides for dark theme */
.wp-block-group.has-background {
  background-color: transparent;
}

.wp-block-columns .wp-block-column {
  background: var(--stc-bg-card);
  border: 1px solid var(--stc-border);
  border-radius: 14px;
  padding: 24px;
  transition: all 0.3s;
}

.wp-block-columns .wp-block-column:hover {
  background: var(--stc-bg-card-hov);
  border-color: var(--stc-border-lit);
  transform: translateY(-2px);
}

.wp-block-image img {
  border-radius: 12px;
}

figure.wp-block-image {
  overflow: hidden;
  border-radius: 12px;
}

/* ==========================================================
   STUDENT RESOURCES PAGE
   ========================================================== */
.page-template-template-student-resources .page-content {
  padding-top: 32px;
}

/* ==========================================================
   ARCHIVE PAGES
   ========================================================== */
.archive-header {
  text-align: center;
  padding: 48px 24px 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--stc-border);
}

.archive-header .section-label {
  margin-bottom: 12px;
}

.archive-description {
  color: var(--stc-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  background: var(--stc-bg);
  border-top: 1px solid var(--stc-border);
  padding: 48px 24px 32px;
  margin-top: 80px;
}

.site-footer .stc-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}

.footer-nav a {
  color: var(--stc-text-dim);
  font-size: 0.875rem;
  font-weight: 500;
}
.footer-nav a:hover {
  color: var(--stc-accent-ice);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--stc-text-dim);
  text-align: center;
}

/* ==========================================================
   FORMS & INPUTS
   ========================================================== */
input[type="search"],
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--stc-border-lit);
  color: var(--stc-text);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus {
  border-color: var(--stc-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--stc-glow);
}

button[type="submit"],
input[type="submit"] {
  background: var(--stc-accent);
  color: #fff;
  border: none;
  border-radius: var(--stc-radius-sm);
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--stc-glow);
  transition: all 0.2s;
}

button[type="submit"]:hover,
input[type="submit"]:hover {
  background: var(--stc-accent-hov);
  box-shadow: 0 6px 28px var(--stc-glow-strong);
}

/* ==========================================================
   COMMENTS
   ========================================================== */
.comments-area {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--stc-border);
}

.comment-list {
  list-style: none;
  padding: 0;
}

.comment-body {
  background: var(--stc-bg-card);
  border: 1px solid var(--stc-border);
  border-radius: var(--stc-radius-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.comment-author {
  font-weight: 600;
  color: #fff;
}

.comment-metadata {
  font-size: 0.8rem;
  color: var(--stc-text-dim);
}

/* ==========================================================
   WIDGETS & SIDEBAR
   ========================================================== */
.widget {
  background: var(--stc-bg-card);
  border: 1px solid var(--stc-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stc-border);
}

/* ==========================================================
   SEARCH RESULTS
   ========================================================== */
.search-results-header {
  text-align: center;
  padding: 48px 24px 32px;
  border-bottom: 1px solid var(--stc-border);
  margin-bottom: 32px;
}

.search-results-header h1 span {
  color: var(--stc-accent-ice);
}

/* ==========================================================
   404 PAGE
   ========================================================== */
.error-404 {
  text-align: center;
  padding: 100px 24px;
}

.error-404 h1 {
  font-size: 6rem;
  color: var(--stc-accent);
  margin-bottom: 16px;
}

.error-404 p {
  font-size: 1.125rem;
  color: var(--stc-text-muted);
  margin-bottom: 32px;
}

/* ==========================================================
   SCROLLBAR & SELECTION
   ========================================================== */
::selection {
  background: rgba(37, 99, 235, 0.3);
  color: white;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--stc-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--stc-border-lit);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--stc-accent);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .hero-banner h1 {
    font-size: 2rem;
  }

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

  .featured-post .post-card__image img {
    min-height: 220px;
  }

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

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

  .single-post__title {
    font-size: 1.75rem;
  }

  .primary-nav {
    display: none;
  }

  .primary-nav.is-open {
    display: block;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(6, 11, 24, 0.98);
    border-bottom: 1px solid var(--stc-border);
    padding: 16px 24px;
  }

  .primary-nav.is-open ul {
    flex-direction: column;
  }

  .nav-toggle {
    display: block;
  }

  .footer-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .hero-banner {
    padding: 48px 16px 40px;
  }

  .hero-banner h1 {
    font-size: 1.75rem;
  }

  .stc-container, .stc-narrow {
    padding: 0 16px;
  }
}

/* ==========================================================
   WORDPRESS CORE ALIGNMENT CLASSES
   ========================================================== */
.alignwide {
  max-width: var(--stc-max-width);
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100%;
  max-width: 100%;
}

.aligncenter {
  text-align: center;
}

/* Category/tag badges in entry content */
.cat-links a,
.tags-links a,
.wp-block-post-terms a,
.tag-cloud-link {
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.2);
  color: var(--stc-accent-ice);
  padding: 2px 10px;
  border-radius: var(--stc-radius-xs);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

/* Browse all posts CTA centered */
.browse-all {
  text-align: center;
  padding: 32px 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--stc-radius-xs);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--stc-border);
  color: var(--stc-text-muted);
  transition: all 0.2s;
}

.pagination a:hover {
  border-color: var(--stc-accent);
  color: var(--stc-accent-ice);
  background: var(--stc-glow);
}

.pagination .current {
  background: var(--stc-accent);
  border-color: var(--stc-accent);
  color: #fff;
}
