/**
 * Main Theme Stylesheet for Radha Krishan Global Knowledge
 * Author: Nandkumar Diwakar
 * Version: 1.0.0
 */

/* ==========================================================================
   CSS Custom Properties (Variables) & Theme Tokens
   ========================================================================== */
:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Color Palette */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;
  --primary-950: #1e1b4b;

  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-emerald: #10b981;
  --accent-blue: #2563eb;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Layout & Spacing */
  --container-max-width: 1240px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-glow-indigo: 0 10px 25px -5px rgba(79, 70, 229, 0.3);
  --shadow-glow-amber: 0 10px 25px -5px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  color: var(--slate-800);
  background-color: var(--slate-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--slate-900);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

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

/* Container */
.site-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) {
  .site-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ==========================================================================
   Navigation Menu Styles
   ========================================================================== */
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu li {
  position: relative;
}

.nav-menu li a {
  display: block;
  padding: 0.5rem 0.875rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-700);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a {
  color: var(--primary-600);
  background-color: var(--primary-50);
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-list li a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-800);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.mobile-nav-list li a:hover,
.mobile-nav-list li.current-menu-item > a {
  color: var(--primary-600);
  background-color: var(--primary-50);
}

/* ==========================================================================
   CRITICAL OVERLAY & MODAL FIXES (Prevents breaking layout)
   ========================================================================== */

/* Search Modal - Hidden by default */
.search-modal {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background-color: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 5rem 1rem 1rem 1rem !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}

.search-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.search-modal-box {
  width: 100%;
  max-width: 42rem;
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.25s ease-in-out;
}

.search-modal.active .search-modal-box {
  transform: translateY(0);
}

/* Mobile Drawer Overlay - Hidden by default */
.mobile-drawer-overlay {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(15, 23, 42, 0.6) !important;
  z-index: 99990 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Mobile Drawer - Completely Hidden offscreen by default */
.mobile-drawer {
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 320px !important;
  max-width: 85vw !important;
  height: 100vh !important;
  background: #ffffff !important;
  z-index: 99995 !important;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25) !important;
  transform: translateX(100%) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  pointer-events: none;
}

.mobile-drawer.active {
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

/* ==========================================================================
   Category Pill & Card Badges
   ========================================================================== */
.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  color: #ffffff !important;
}

/* Card Hover Elevation */
.blog-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.12);
}

/* Single Post Content Typography (Prose) */
.prose {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--slate-700);
}

.prose p {
  margin-bottom: 1.5rem;
}

.prose h2 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--slate-100);
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose ul, .prose ol {
  margin-left: 1.75rem;
  margin-bottom: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose blockquote {
  border-left: 4px solid var(--primary-600);
  background: var(--primary-50);
  padding: 1.25rem 1.75rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--slate-800);
  margin: 2rem 0;
  font-size: 1.125rem;
}

.prose pre, .prose code {
  background: var(--slate-900);
  color: var(--accent-amber);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.prose pre {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
}

.prose img {
  border-radius: var(--radius-xl);
  margin: 2rem auto;
  box-shadow: var(--shadow-lg);
}

/* Pagination Custom Styles */
.rk-custom-pagination .nav-links,
.pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.rk-custom-pagination .page-numbers,
.pagination-wrapper a.page-numbers,
.pagination-wrapper span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--slate-700);
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.pagination-wrapper a.page-numbers:hover {
  background: var(--primary-50);
  color: var(--primary-600);
  border-color: var(--primary-300);
}

.pagination-wrapper .page-numbers.current {
  background: var(--primary-600);
  color: #ffffff;
  border-color: var(--primary-600);
  box-shadow: var(--shadow-glow-indigo);
}

/* Back to Top Button */
#back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#back-to-top.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

/* Toast Message Popup */
.rk-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--slate-900);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rk-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* WordPress Core Alignment */
.aligncenter { display: block; margin: 1.5rem auto; }
.alignleft { float: left; margin: 0 1.5rem 1.5rem 0; }
.alignright { float: right; margin: 0 0 1.5rem 1.5rem; }
.wp-caption { max-width: 100%; margin-bottom: 1.5rem; }
.wp-caption-text { font-size: 0.8125rem; color: var(--slate-500); text-align: center; margin-top: 0.5rem; }
