/*
Theme Name: Novum Vinum
Theme URI: https://nu-wine.org
Author: Trent | Nu-Wine Ministries
Author URI: https://nu-wine.org
Description: The Matrix-inspired WordPress theme for Novum Vinum — black, neon green, grace theology meets the construct.
Version: 1.0.0
License: GNU General Public License v2 or later
Tags: dark, custom-background, custom-logo, full-width-template, blog
Text Domain: novumvinum
*/

/* ============================================================
   DESIGN SYSTEM — CSS VARIABLES
   ============================================================ */
:root {
  --primary:     #00ff00;
  --primary-dim: #00df00;
  --primary-dark:#009700;
  --accent:      #008000;
  --accent-light:#b4ff9a;
  --text:        #ffffff;
  --text-muted:  #a0a0a0;
  --bg:          #000000;
  --bg-2:        #0a0a0a;
  --bg-3:        #111111;
  --bg-4:        #1a1a1a;
  --border:      1px solid #009700;
  --glow-sm:     0 0 5px rgba(0,255,0,0.5);
  --glow-md:     0 0 10px rgba(0,255,0,0.7);
  --glow-lg:     0 0 20px rgba(0,255,0,0.9);
  --font-body:   'Barlow', sans-serif;
  --font-brand:  'VT323', monospace;
  --font-nav:    'Share Tech Mono', monospace;
  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --ease: 0.25s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  padding-top: 80px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--ease), text-shadow var(--ease); }
a:hover { color: var(--primary-dim); text-shadow: var(--glow-sm); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-brand);
  color: var(--primary);
  text-shadow: var(--glow-sm);
  line-height: 1.2;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 3vw, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; color: var(--text-muted); }
p a { color: var(--primary); }

ul, ol { margin-left: 1.5rem; margin-bottom: 1rem; }
li { color: var(--text-muted); margin-bottom: 0.25rem; }

blockquote {
  border-left: 3px solid var(--primary);
  padding: 1rem 1.5rem;
  background: var(--bg-3);
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--accent-light);
  box-shadow: -4px 0 0 var(--primary), inset 0 0 20px rgba(0,255,0,0.03);
}

code, pre {
  font-family: var(--font-nav);
  background: var(--bg-3);
  color: var(--primary);
  border: var(--border);
  border-radius: var(--r-sm);
}
code { padding: 0.1em 0.4em; font-size: 0.9em; }
pre { padding: 1rem; overflow-x: auto; margin-bottom: 1rem; }

hr {
  border: none;
  border-top: 1px solid var(--accent);
  margin: 2rem 0;
  box-shadow: 0 0 6px rgba(0,255,0,0.2);
}

/* ============================================================
   MATRIX RAIN CANVAS — BACKGROUND
   ============================================================ */
#matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -2;
  pointer-events: none;
  opacity: 0.18;
}

/* Scanlines overlay */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 0, 0.015) 2px,
    rgba(0, 255, 0, 0.015) 4px
  );
  pointer-events: none;
  z-index: -1;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.content-area {
  flex: 1;
  padding: 3rem 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: rgba(0, 0, 0, 0.96);
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 2px 20px rgba(0,255,0,0.08);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  justify-content: space-between;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.site-branding .custom-logo {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(0,255,0,0.6));
  transition: filter var(--ease);
}
.site-branding a:hover .custom-logo {
  filter: drop-shadow(0 0 12px rgba(0,255,0,0.9));
}

.site-title {
  font-family: var(--font-brand);
  font-size: 1.6rem;
  color: var(--primary);
  text-shadow: var(--glow-md);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
}
.site-title a { color: inherit; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 2rem;
}

.main-navigation a {
  font-family: var(--font-nav);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  padding: 0.4rem 0;
  position: relative;
  transition: color var(--ease), text-shadow var(--ease);
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--primary);
  box-shadow: var(--glow-sm);
  transition: width var(--ease);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  color: var(--accent-light);
  text-shadow: var(--glow-sm);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
  width: 100%;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--accent);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.menu-toggle .bar {
  display: block;
  width: 22px; height: 2px;
  background: var(--primary);
  margin: 4px 0;
  box-shadow: var(--glow-sm);
  transition: transform var(--ease), opacity var(--ease);
}

/* ============================================================
   HERO — HOMEPAGE
   ============================================================ */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,255,0,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { max-width: 800px; margin: 0 auto; }

.hero-tagline {
  font-family: var(--font-nav);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s ease both;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  text-shadow: var(--glow-lg);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.8s ease 0.3s both;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-nav);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  transition: all var(--ease);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: var(--glow-sm);
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: var(--glow-md);
  color: var(--bg);
  text-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: var(--glow-sm);
}
.btn-outline:hover {
  background: rgba(0,255,0,0.08);
  box-shadow: var(--glow-md);
  color: var(--primary);
}

/* ============================================================
   BLOG — POSTS LIST
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.post-card {
  background: var(--bg-2);
  border: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
  position: relative;
}
.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  box-shadow: var(--glow-sm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}
.post-card:hover::before { transform: scaleX(1); }
.post-card:hover {
  border-color: var(--primary);
  box-shadow: var(--glow-sm);
  transform: translateY(-3px);
}

.post-card-thumbnail {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.post-card-thumbnail img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: grayscale(30%) brightness(0.8);
}
.post-card:hover .post-card-thumbnail img {
  transform: scale(1.04);
  filter: grayscale(0%) brightness(0.9) drop-shadow(0 0 8px rgba(0,255,0,0.3));
}

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

.post-card-meta {
  font-family: var(--font-nav);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.post-card-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  text-shadow: none;
}
.post-card-title a { color: var(--primary); }
.post-card-title a:hover { text-shadow: var(--glow-sm); }

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.post-card-footer {
  border-top: 1px solid var(--bg-4);
  padding-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-header {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
}

.post-meta {
  font-family: var(--font-nav);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.post-content {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.85;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content p { color: var(--text-muted); }
.post-content strong { color: var(--text); }
.post-content em { color: var(--accent-light); }

/* Featured image */
.post-featured-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 3rem;
  filter: brightness(0.75) grayscale(20%);
  border: var(--border);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.site-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.sidebar-widget {
  background: var(--bg-2);
  border: var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.sidebar-widget h3 {
  font-size: 1rem;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.sidebar-widget ul { list-style: none; margin: 0; }
.sidebar-widget ul li {
  border-bottom: 1px solid var(--bg-4);
  padding: 0.4rem 0;
}
.sidebar-widget ul li:last-child { border: none; }
.sidebar-widget a { font-family: var(--font-nav); font-size: 0.85rem; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.pagination a,
.pagination .current,
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; height: 38px;
  padding: 0 0.75rem;
  font-family: var(--font-nav);
  font-size: 0.85rem;
  border: var(--border);
  border-radius: var(--r-sm);
  color: var(--primary);
  transition: all var(--ease);
}
.pagination a:hover,
.pagination .current,
.page-numbers.current {
  background: var(--primary);
  color: var(--bg);
  box-shadow: var(--glow-sm);
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section { max-width: 780px; margin: 3rem auto 0; }
.comments-section h2 { font-size: 1.3rem; }
.comment {
  background: var(--bg-2);
  border: var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.comment-author { color: var(--primary); font-family: var(--font-nav); font-size: 0.85rem; }
.comment-meta { color: var(--accent); font-size: 0.75rem; margin-bottom: 0.5rem; }
.comment-content p { font-size: 0.95rem; }

/* Comment form */
.comment-form input,
.comment-form textarea {
  width: 100%;
  background: var(--bg-3);
  border: var(--border);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-sm);
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input[type="submit"] {
  width: auto;
  cursor: pointer;
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-nav);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  box-shadow: var(--glow-sm);
  transition: box-shadow var(--ease), background var(--ease);
}
.comment-form input[type="submit"]:hover {
  background: var(--accent-light);
  box-shadow: var(--glow-md);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--accent);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand .site-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}
.footer-brand p { font-size: 0.9rem; max-width: 300px; }

.footer-col h4 {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; margin: 0; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col a { font-family: var(--font-nav); font-size: 0.8rem; letter-spacing: 0.05em; color: var(--text-muted); }
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--bg-4);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom p { font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.footer-bottom a { color: var(--primary); font-size: 0.78rem; }

/* ============================================================
   SECTION DIVIDERS & UTILITIES
   ============================================================ */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { max-width: 600px; margin: 0 auto; }

.terminal-label {
  font-family: var(--font-nav);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}
.terminal-label::before { content: '> '; }

.matrix-border {
  border: var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 0 0 1px rgba(0,255,0,0.05);
}

.glow-text { text-shadow: var(--glow-md); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Screen reader */
.screen-reader-text {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--glow-sm); }
  50%       { box-shadow: var(--glow-md); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .site-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { padding-top: 70px; }

  .site-header { height: 70px; }

  .main-navigation > div { display: none; }
  .main-navigation > div.toggled { display: block; }

  .main-navigation ul {
    flex-direction: column;
    position: fixed;
    top: 70px; right: -100%;
    width: 80%; max-width: 320px;
    height: calc(100vh - 70px);
    background: rgba(0,0,0,0.97);
    border-left: var(--border);
    padding: 2rem 1.5rem;
    gap: 0.25rem;
    transition: right var(--ease);
    overflow-y: auto;
    z-index: 999;
  }

  .main-navigation ul.toggled { right: 0; }

  .main-navigation a { font-size: 1rem; padding: 0.75rem 0; }

  .menu-toggle { display: block; }

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

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .hero-title { font-size: clamp(2rem, 8vw, 3rem); }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; text-align: center; }
}

/* ============================================================
   WORDPRESS CORE CLASSES
   ============================================================ */
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 0.4rem; }
.alignleft  { float: left;  margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1rem auto; }
.alignwide  { width: 100%; }
.alignfull  { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }
.sticky { border-left: 3px solid var(--primary); padding-left: 1rem; }
.bypostauthor {}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.gallery img { width: 100%; height: 180px; object-fit: cover; border: var(--border); border-radius: var(--r-sm); }

/* Search form */
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
  flex: 1;
  background: var(--bg-3);
  border: var(--border);
  border-radius: var(--r-sm);
  padding: 0.55rem 0.9rem;
  color: var(--text);
  font-family: var(--font-nav);
  font-size: 0.85rem;
}
.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-sm);
}
.search-form button {
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.55rem 1rem;
  font-family: var(--font-nav);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: box-shadow var(--ease);
}
.search-form button:hover { box-shadow: var(--glow-md); }

/* 404 */
.error-404 { text-align: center; padding: 5rem 1rem; }
.error-404 h1 { font-size: clamp(4rem, 15vw, 8rem); text-shadow: var(--glow-lg); }
