/* ═══════════════════════════════════════════════════════════════════════════
   THEOTOWN CENTER - Custom Theme
   Aesthetic: Retro-Futuristic City Builder / Isometric Grid
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   BASE RESET & BODY
   ───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body) !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Animated Isometric Grid Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-pulse 8s ease-in-out infinite;
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Gradient Overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 100% 100%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONTAINER OVERRIDES - Fix narrow layout on desktop
   ───────────────────────────────────────────────────────────────────────────── */
.main {
  max-width: 1400px !important;
  width: 100% !important;
  margin: 0 auto;
  padding: 2rem;
}

.post-content {
  max-width: 900px;
  margin: 0 auto;
}

/* For single post pages - wider layout */
.post-single-custom {
  max-width: 100% !important;
  width: 100% !important;
}

/* Override PaperMod's narrow container */
article.post-single {
  max-width: 100% !important;
}

.post-single .post-content {
  max-width: 800px;
  font-size: 1.05rem;
  line-height: 1.9;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.post-title,
.profile .profile_inner h1 {
  font-family: var(--font-pixel) !important;
  letter-spacing: 0.5px;
  line-height: 1.4;
  text-transform: uppercase;
}

h1, .post-title {
  font-size: clamp(1rem, 4vw, 1.5rem) !important;
  background: linear-gradient(135deg, var(--rci-residential) 0%, var(--rci-commercial) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

h2 {
  font-size: clamp(0.75rem, 3vw, 1rem) !important;
  color: var(--rci-commercial);
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

h2::before {
  content: '//';
  margin-right: 0.5rem;
  opacity: 0.5;
}

h3 {
  font-size: clamp(0.65rem, 2.5vw, 0.85rem) !important;
  color: var(--rci-industrial);
}

p, li {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

a {
  color: var(--rci-residential) !important;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

a:hover {
  color: var(--rci-commercial) !important;
  text-shadow: var(--glow-cyan);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER & NAVIGATION
   ───────────────────────────────────────────────────────────────────────────── */
.nav {
  background: rgba(10, 14, 20, 0.95) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

[data-theme="light"] .nav {
  background: rgba(248, 250, 252, 0.95) !important;
}

.logo a {
  font-family: var(--font-pixel) !important;
  font-size: 0.7rem !important;
  background: linear-gradient(135deg, var(--rci-residential), var(--rci-commercial));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

#menu {
  gap: 0.5rem;
}

#menu li a {
  font-family: var(--font-mono) !important;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

#menu li a:hover,
#menu li a.active {
  background: var(--bg-tertiary);
  border-color: var(--rci-residential);
  box-shadow: var(--glow-green);
}

/* Theme Toggle Button */
#theme-toggle {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#theme-toggle svg {
  width: 20px;
  height: 20px;
}

#theme-toggle:hover {
  border-color: var(--rci-industrial) !important;
  box-shadow: var(--glow-amber);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HOMEPAGE PROFILE
   ───────────────────────────────────────────────────────────────────────────── */
.profile {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
}

.profile .profile_inner {
  text-align: center;
  max-width: 800px;
}

.profile .profile_inner h1 {
  font-size: clamp(1rem, 5vw, 1.8rem) !important;
  margin-bottom: 1.5rem;
  animation: title-glow 3s ease-in-out infinite alternate;
}

@keyframes title-glow {
  0% { filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.3)); }
  100% { filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.5)); }
}

.profile .profile_inner h2 {
  font-family: var(--font-body) !important;
  font-size: 1.2rem !important;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: none;
  border: none;
  padding: 0;
  margin-bottom: 2rem;
}

.profile .profile_inner h2::before {
  display: none;
}

/* Profile Image */
.profile img {
  width: 150px !important;
  height: 150px !important;
  border-radius: 12px;
  border: 3px solid var(--rci-residential);
  box-shadow: var(--glow-green), 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: float 6s ease-in-out infinite;
}

.profile img:hover {
  transform: scale(1.05) rotate(2deg);
  border-color: var(--rci-commercial);
  box-shadow: var(--glow-cyan), 0 30px 60px rgba(0, 0, 0, 0.4);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Profile Buttons */
.profile .button-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.profile .button-container a {
  font-family: var(--font-mono) !important;
  font-size: 0.9rem;
  padding: 0.8rem 1.8rem;
  background: transparent;
  border: 2px solid var(--rci-residential);
  border-radius: 6px;
  color: var(--rci-residential) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.profile .button-container a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.2), transparent);
  transition: left 0.5s ease;
}

.profile .button-container a:hover {
  background: var(--rci-residential);
  color: var(--bg-primary) !important;
  box-shadow: var(--glow-green);
  transform: translateY(-3px);
}

.profile .button-container a:hover::before {
  left: 100%;
}

/* Different colors for each button */
.profile .button-container a:nth-child(2) {
  border-color: var(--rci-commercial);
  color: var(--rci-commercial) !important;
}

.profile .button-container a:nth-child(2):hover {
  background: var(--rci-commercial);
  color: var(--bg-primary) !important;
  box-shadow: var(--glow-cyan);
}

.profile .button-container a:nth-child(3) {
  border-color: var(--rci-industrial);
  color: var(--rci-industrial) !important;
}

.profile .button-container a:nth-child(3):hover {
  background: var(--rci-industrial);
  color: var(--bg-primary) !important;
  box-shadow: var(--glow-amber);
}

/* ─────────────────────────────────────────────────────────────────────────────
   POST LIST / ARCHIVE
   ───────────────────────────────────────────────────────────────────────────── */
.main {
  padding: 2rem 0;
  min-height: 80vh;
}

.post-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.post-entry::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--rci-residential), var(--rci-commercial));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-entry:hover {
  border-color: var(--rci-residential);
  transform: translateX(10px);
  box-shadow: -10px 0 40px rgba(16, 185, 129, 0.1);
}

.post-entry:hover::before {
  opacity: 1;
}

.post-entry .entry-header h2 {
  font-family: var(--font-pixel) !important;
  font-size: 0.7rem !important;
  color: var(--text-primary) !important;
  margin: 0;
  border: none;
  padding: 0;
}

.post-entry .entry-header h2::before {
  display: none;
}

.post-entry .entry-content {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.post-entry .post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Cover Images */
.post-entry .entry-cover img {
  border-radius: 8px;
  transition: all 0.5s ease;
}

.post-entry:hover .entry-cover img {
  transform: scale(1.02);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SINGLE POST
   ───────────────────────────────────────────────────────────────────────────── */
.post-single {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.post-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, var(--rci-residential), var(--rci-commercial));
}

.post-header .post-title {
  margin-bottom: 1rem;
}

.post-header .post-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.9;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content img {
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.post-content img:hover {
  transform: scale(1.01);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Lists in Content */
.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
  position: relative;
}

.post-content ul li::marker {
  color: var(--rci-residential);
}

/* Blockquotes */
.post-content blockquote {
  border-left: 4px solid var(--rci-commercial);
  background: var(--bg-secondary);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Code Blocks */
.post-content code {
  font-family: var(--font-mono) !important;
  background: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--rci-commercial);
}

.post-content pre {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.post-content pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   BREADCRUMBS
   ───────────────────────────────────────────────────────────────────────────── */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
}

.breadcrumbs a {
  color: var(--text-muted) !important;
}

.breadcrumbs a:hover {
  color: var(--rci-residential) !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOC - Table of Contents
   ───────────────────────────────────────────────────────────────────────────── */
.toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.toc .inner {
  max-height: 400px;
  overflow-y: auto;
}

.toc details summary {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--rci-commercial);
  cursor: pointer;
  padding: 0.5rem 0;
}

.toc ul {
  margin-top: 1rem;
  padding-left: 1rem;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary) !important;
}

.toc a:hover {
  color: var(--rci-residential) !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SHARE BUTTONS
   ───────────────────────────────────────────────────────────────────────────── */
.share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
}

.share-buttons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.share-buttons a:hover {
  background: var(--rci-residential);
  border-color: var(--rci-residential);
  transform: translateY(-3px);
  box-shadow: var(--glow-green);
}

.share-buttons svg {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
  transition: fill 0.3s ease;
}

.share-buttons a:hover svg {
  fill: var(--bg-primary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   POST NAVIGATION
   ───────────────────────────────────────────────────────────────────────────── */
.paginav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.paginav a {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.paginav a:hover {
  border-color: var(--rci-residential);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.1);
}

.paginav .title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SCROLL TO TOP
   ───────────────────────────────────────────────────────────────────────────── */
.top-link {
  background: var(--bg-secondary) !important;
  border: 2px solid var(--rci-residential) !important;
  border-radius: 8px;
  padding: 0.8rem;
  transition: all 0.3s ease;
}

.top-link:hover {
  background: var(--rci-residential) !important;
  box-shadow: var(--glow-green);
  transform: translateY(-5px);
}

.top-link svg {
  fill: var(--rci-residential);
  transition: fill 0.3s ease;
}

.top-link:hover svg {
  fill: var(--bg-primary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CATEGORY & TAG BADGES
   ───────────────────────────────────────────────────────────────────────────── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.post-tags a {
  font-family: var(--font-mono) !important;
  font-size: 0.75rem;
  padding: 0.3rem 0.8rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary) !important;
  transition: all 0.3s ease;
}

.post-tags a:hover {
  background: var(--rci-residential);
  border-color: var(--rci-residential);
  color: var(--bg-primary) !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SEARCH PAGE
   ───────────────────────────────────────────────────────────────────────────── */
#searchbox {
  font-family: var(--font-body);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  color: var(--text-primary);
  width: 100%;
  transition: all 0.3s ease;
}

#searchbox:focus {
  outline: none;
  border-color: var(--rci-residential);
  box-shadow: var(--glow-green);
}

#searchResults {
  margin-top: 2rem;
}

#searchResults li {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

#searchResults li:hover {
  border-color: var(--rci-residential);
  transform: translateX(5px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   COPY CODE BUTTON
   ───────────────────────────────────────────────────────────────────────────── */
.copy-code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-code:hover {
  background: var(--rci-residential);
  border-color: var(--rci-residential);
  color: var(--bg-primary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .profile {
    min-height: 60vh;
    padding: 2rem 1rem;
  }

  .profile .button-container {
    flex-direction: column;
    align-items: center;
  }

  .profile .button-container a {
    width: 100%;
    max-width: 250px;
    text-align: center;
  }

  .post-entry:hover {
    transform: translateX(5px);
  }

  h1, .post-title {
    font-size: 0.9rem !important;
  }

  h2 {
    font-size: 0.7rem !important;
  }

  #menu li a {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   SELECTION HIGHLIGHT
   ───────────────────────────────────────────────────────────────────────────── */
::selection {
  background: var(--rci-residential);
  color: var(--bg-primary);
}

::-moz-selection {
  background: var(--rci-residential);
  color: var(--bg-primary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SCROLLBAR STYLING
   ───────────────────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--rci-residential);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--rci-commercial);
}

/* ─────────────────────────────────────────────────────────────────────────────
   LOADING ANIMATION
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-entry {
  animation: fadeInUp 0.5s ease forwards;
}

.post-entry:nth-child(1) { animation-delay: 0.1s; }
.post-entry:nth-child(2) { animation-delay: 0.2s; }
.post-entry:nth-child(3) { animation-delay: 0.3s; }
.post-entry:nth-child(4) { animation-delay: 0.4s; }
.post-entry:nth-child(5) { animation-delay: 0.5s; }
.post-entry:nth-child(6) { animation-delay: 0.6s; }

/* ─────────────────────────────────────────────────────────────────────────────
   RCI INDICATOR DECORATION
   ───────────────────────────────────────────────────────────────────────────── */
.profile::before {
  content: '';
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

/* Decorative RCI bars */
.main::before {
  content: 'R C I';
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.3rem;
  color: var(--text-muted);
  opacity: 0.3;
  writing-mode: vertical-rl;
  z-index: 100;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HIGHLIGHT CLASSES FOR GUIDES
   ───────────────────────────────────────────────────────────────────────────── */
.post-content strong {
  color: var(--rci-residential);
  font-weight: 600;
}

.post-content em {
  color: var(--rci-commercial);
  font-style: italic;
}
