/*
Theme Name: RookyNex
Theme URI: https://rookynex.com
Author: RookyNex Team
Author URI: https://rookynex.com
Description: Custom theme for RookyNex — a community-driven platform for AI agents, tools, and automation workflows. Features a fixed navbar with Community, Blog, and Marketplace sections.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rookynex
Tags: community, blog, marketplace, custom-menu, featured-images, threaded-comments
*/

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Brand Colors */
  --rn-primary: #6C3CE1;
  --rn-primary-hover: #5A2DC5;
  --rn-primary-light: #EDE5FB;
  --rn-secondary: #1A1A2E;
  --rn-accent: #00D4AA;
  --rn-accent-hover: #00B892;

  /* Neutrals */
  --rn-white: #FFFFFF;
  --rn-gray-50: #F9FAFB;
  --rn-gray-100: #F3F4F6;
  --rn-gray-200: #E5E7EB;
  --rn-gray-300: #D1D5DB;
  --rn-gray-400: #9CA3AF;
  --rn-gray-500: #6B7280;
  --rn-gray-600: #4B5563;
  --rn-gray-700: #374151;
  --rn-gray-800: #1F2937;
  --rn-gray-900: #111827;

  /* Typography */
  --rn-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --rn-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --rn-navbar-height: 64px;
  --rn-container-max: 1280px;
  --rn-container-padding: 1.5rem;

  /* Shadows */
  --rn-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --rn-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --rn-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* Borders */
  --rn-radius-sm: 0.375rem;
  --rn-radius-md: 0.5rem;
  --rn-radius-lg: 0.75rem;
  --rn-radius-full: 9999px;

  /* Transitions */
  --rn-transition: 150ms ease-in-out;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--rn-font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--rn-gray-800);
  background-color: var(--rn-gray-50);
  padding-top: var(--rn-navbar-height);
}

/* Prevent WP admin bar inline styles from conflicting */
html { margin-top: 0 !important; }

a {
  color: var(--rn-primary);
  text-decoration: none;
  transition: color var(--rn-transition);
}

a:hover {
  color: var(--rn-primary-hover);
}

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

/* ============================================
   CONTAINER
   ============================================ */
.rn-container {
  max-width: var(--rn-container-max);
  margin: 0 auto;
  padding: 0 var(--rn-container-padding);
}

/* ============================================
   NAVBAR
   ============================================ */
.rn-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--rn-navbar-height);
  background: var(--rn-white);
  border-bottom: 1px solid var(--rn-gray-200);
  z-index: 100000;
  box-shadow: var(--rn-shadow-sm);
}

/* When WP admin bar is present, shift navbar below it */
.admin-bar .rn-navbar {
  top: 32px;
}

.admin-bar .rn-mobile-drawer {
  top: calc(var(--rn-navbar-height) + 32px);
}

@media screen and (max-width: 782px) {
  .admin-bar .rn-navbar {
    top: 46px;
  }
  .admin-bar .rn-mobile-drawer {
    top: calc(var(--rn-navbar-height) + 46px);
  }
}

.rn-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--rn-container-max);
  margin: 0 auto;
  padding: 0 var(--rn-container-padding);
}

/* Logo */
.rn-navbar__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--rn-secondary);
  text-decoration: none;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}

.rn-navbar__logo:hover {
  color: var(--rn-primary);
}

.rn-navbar__logo-icon {
  width: 32px;
  height: 32px;
  background: var(--rn-primary);
  border-radius: var(--rn-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rn-white);
  font-weight: 900;
  font-size: 0.875rem;
}

/* Primary nav */
.rn-navbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.rn-navbar__nav a {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rn-gray-600);
  border-radius: var(--rn-radius-md);
  transition: all var(--rn-transition);
  text-decoration: none;
  white-space: nowrap;
}

.rn-navbar__nav a:hover {
  color: var(--rn-primary);
  background: var(--rn-primary-light);
}

.rn-navbar__nav .current-menu-item a,
.rn-navbar__nav .current_page_item a {
  color: var(--rn-primary);
  background: var(--rn-primary-light);
  font-weight: 600;
}

/* Coming Soon badge */
.rn-navbar__nav .menu-item-coming-soon a {
  color: var(--rn-gray-400);
  cursor: default;
}

.rn-navbar__nav .menu-item-coming-soon a:hover {
  background: transparent;
  color: var(--rn-gray-400);
}

.rn-badge--coming-soon {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--rn-gray-200);
  color: var(--rn-gray-500);
  border-radius: var(--rn-radius-full);
  line-height: 1.4;
}

/* Tools dropdown (desktop) */
.rn-navbar__nav .menu-item-has-children,
.rn-tools-dropdown {
  position: relative;
}

.rn-navbar__nav .menu-item-has-children > a,
.rn-tools-dropdown__trigger {
  cursor: pointer;
}

.rn-tools-chevron {
  display: inline-block;
  vertical-align: middle;
  margin-left: 2px;
  transition: transform var(--rn-transition);
}

.rn-tools-dropdown.is-open .rn-tools-chevron,
.rn-navbar__nav .menu-item-has-children.is-open > a .rn-tools-chevron {
  transform: rotate(180deg);
}

.rn-navbar__nav .sub-menu,
.rn-tools-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: var(--rn-white);
  border: 1px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-lg);
  box-shadow: var(--rn-shadow-lg);
  padding: 0.5rem;
  list-style: none;
  z-index: 1002;
}

.rn-tools-dropdown.is-open > .rn-tools-dropdown__menu,
.rn-navbar__nav .menu-item-has-children.is-open > .sub-menu {
  display: block;
}

.rn-navbar__nav .sub-menu a,
.rn-tools-dropdown__menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rn-gray-600);
  border-radius: var(--rn-radius-sm);
  white-space: nowrap;
}

.rn-navbar__nav .sub-menu a:hover,
.rn-tools-dropdown__menu a:hover {
  background: var(--rn-primary-light);
  color: var(--rn-primary);
}

/* Mobile tools accordion */
.rn-mobile-tools__toggle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--rn-gray-700);
  background: none;
  border: none;
  border-radius: var(--rn-radius-md);
  cursor: pointer;
  font-family: var(--rn-font-sans);
  text-align: left;
}

.rn-mobile-tools__toggle:hover {
  background: var(--rn-primary-light);
  color: var(--rn-primary);
}

.rn-mobile-drawer__nav .sub-menu {
  display: none;
  list-style: none;
  padding: 0 0 0 1rem;
}

.rn-mobile-drawer__nav .menu-item-has-children.is-open > .sub-menu,
.rn-mobile-tools.is-open > .sub-menu {
  display: block;
}

.rn-mobile-drawer__nav .sub-menu a {
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
}

/* Auth section */
.rn-navbar__auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.rn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--rn-radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--rn-transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.rn-btn--ghost {
  background: transparent;
  color: var(--rn-gray-700);
}

.rn-btn--ghost:hover {
  background: var(--rn-gray-100);
  color: var(--rn-gray-900);
}

.rn-btn--primary {
  background: var(--rn-primary);
  color: var(--rn-white);
}

.rn-btn--primary:hover {
  background: var(--rn-primary-hover);
  color: var(--rn-white);
}

/* User menu (logged in) */
.rn-user-menu {
  position: relative;
}

.rn-user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem;
  background: transparent;
  border: 2px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-full);
  cursor: pointer;
  transition: border-color var(--rn-transition);
}

.rn-user-menu__trigger:hover {
  border-color: var(--rn-primary);
}

.rn-user-menu__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--rn-primary-light);
}

.rn-user-menu__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--rn-white);
  border: 1px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-lg);
  box-shadow: var(--rn-shadow-lg);
  padding: 0.5rem;
  z-index: 1001;
}

.rn-user-menu.is-open .rn-user-menu__dropdown {
  display: block;
}

.rn-user-menu__dropdown a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--rn-gray-700);
  border-radius: var(--rn-radius-sm);
  text-decoration: none;
}

.rn-user-menu__dropdown a:hover {
  background: var(--rn-gray-100);
  color: var(--rn-gray-900);
}

.rn-user-menu__divider {
  height: 1px;
  background: var(--rn-gray-200);
  margin: 0.375rem 0;
}

/* Mobile toggle */
.rn-navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--rn-radius-md);
  transition: background var(--rn-transition);
}

.rn-navbar__toggle:hover {
  background: var(--rn-gray-100);
}

.rn-navbar__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--rn-gray-700);
  border-radius: 1px;
  transition: all var(--rn-transition);
}

.rn-navbar__toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.rn-navbar__toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.rn-navbar__toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile drawer */
.rn-mobile-drawer {
  display: none;
  position: fixed;
  top: var(--rn-navbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--rn-white);
  z-index: 999;
  overflow-y: auto;
  padding: 1.5rem;
  border-top: 1px solid var(--rn-gray-200);
}

.rn-mobile-drawer.is-open {
  display: block;
}

.rn-mobile-drawer__nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rn-mobile-drawer__nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--rn-gray-700);
  border-radius: var(--rn-radius-md);
  text-decoration: none;
}

.rn-mobile-drawer__nav a:hover {
  background: var(--rn-primary-light);
  color: var(--rn-primary);
}

.rn-mobile-drawer__nav .current-menu-item a {
  background: var(--rn-primary-light);
  color: var(--rn-primary);
  font-weight: 600;
}

.rn-mobile-drawer__auth {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rn-gray-200);
}

.rn-mobile-drawer__auth .rn-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.rn-main {
  min-height: calc(100vh - var(--rn-navbar-height) - 200px);
  padding: 2rem 0;
}

/* ============================================
   SHARED SEARCH BAR (used by directory, workflows, etc.)
   ============================================ */
.rn-dir-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.rn-dir-search__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.rn-dir-search__input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  font-size: 1rem;
  font-family: var(--rn-font-sans);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--rn-radius-lg);
  color: var(--rn-white);
  transition: all var(--rn-transition);
}

.rn-dir-search__input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.rn-dir-search__input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--rn-accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

/* ============================================
   HOMEPAGE HERO
   ============================================ */
.rn-hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.rn-hero__title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--rn-secondary);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.rn-hero__title span {
  background: linear-gradient(135deg, var(--rn-primary), var(--rn-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rn-hero__subtitle {
  font-size: 1.25rem;
  color: var(--rn-gray-500);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.rn-hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.rn-hero__actions .rn-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

.rn-btn--outline {
  background: transparent;
  color: var(--rn-gray-700);
  border: 2px solid var(--rn-gray-300);
}

.rn-btn--outline:hover {
  border-color: var(--rn-primary);
  color: var(--rn-primary);
}

/* ============================================
   SECTION CARDS (Homepage)
   ============================================ */
.rn-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2rem 0 4rem;
}

.rn-sections--4 {
  grid-template-columns: repeat(4, 1fr);
}

.rn-sections--5 {
  grid-template-columns: repeat(5, 1fr);
}

.rn-section-card {
  background: var(--rn-white);
  border: 1px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-lg);
  padding: 2rem;
  transition: all var(--rn-transition);
  text-decoration: none;
  display: block;
}

.rn-section-card:hover {
  border-color: var(--rn-primary);
  box-shadow: var(--rn-shadow-md);
  transform: translateY(-2px);
}

.rn-section-card--disabled {
  opacity: 0.6;
  cursor: default;
}

.rn-section-card--disabled:hover {
  border-color: var(--rn-gray-200);
  box-shadow: none;
  transform: none;
}

.rn-section-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--rn-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.rn-section-card__icon--community {
  background: #EDE5FB;
  color: var(--rn-primary);
}

.rn-section-card__icon--blog {
  background: #D1FAE5;
  color: #059669;
}

.rn-section-card__icon--marketplace {
  background: #FEF3C7;
  color: #D97706;
}

.rn-section-card__icon--directory {
  background: #DBEAFE;
  color: #2563EB;
}

.rn-section-card__icon--tools {
  background: #FEE2E2;
  color: #DC2626;
}

.rn-section-card__icon--teal {
  background: #CCFBF1;
  color: #0D9488;
}

.rn-section-card__icon--pink {
  background: #FCE7F3;
  color: #DB2777;
}

.rn-section-card__icon--slate {
  background: #F1F5F9;
  color: #475569;
}

.rn-section-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rn-secondary);
  margin-bottom: 0.5rem;
}

.rn-section-card__desc {
  font-size: 0.9375rem;
  color: var(--rn-gray-500);
  line-height: 1.6;
}

/* ============================================
   FOOTER
   ============================================ */
.rn-footer {
  background: var(--rn-secondary);
  color: var(--rn-gray-400);
  padding: 3rem 0;
}

.rn-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.rn-footer__brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--rn-white);
}

.rn-footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.rn-footer__links a {
  color: var(--rn-gray-400);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--rn-transition);
}

.rn-footer__links a:hover {
  color: var(--rn-white);
}

.rn-footer__copy {
  font-size: 0.8125rem;
  color: var(--rn-gray-500);
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .rn-navbar__nav,
  .rn-navbar__auth {
    display: none;
  }

  .rn-navbar__toggle {
    display: flex;
  }

  .rn-hero__title {
    font-size: 2rem;
  }

  .rn-hero__subtitle {
    font-size: 1.0625rem;
  }

  .rn-sections {
    grid-template-columns: 1fr;
  }

  .rn-sections--4,
  .rn-sections--5 {
    grid-template-columns: 1fr;
  }

  .rn-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .rn-footer__links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .rn-sections--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .rn-sections--5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1025px) and (max-width: 1280px) {
  .rn-sections--5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 769px) {
  .rn-mobile-drawer {
    display: none !important;
  }
}

/* ============================================
   PAGE TITLE
   ============================================ */
.rn-page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--rn-secondary);
  margin-bottom: 2rem;
}

/* ============================================
   BLOG POST GRID
   ============================================ */
.rn-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.rn-post-card {
  background: var(--rn-white);
  border: 1px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-lg);
  overflow: hidden;
  transition: all var(--rn-transition);
}

.rn-post-card:hover {
  border-color: var(--rn-primary);
  box-shadow: var(--rn-shadow-md);
}

.rn-post-card__thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.rn-post-card__body {
  padding: 1.25rem;
}

.rn-post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--rn-gray-500);
  margin-bottom: 0.5rem;
}

.rn-post-card__cat {
  background: var(--rn-primary-light);
  color: var(--rn-primary);
  padding: 0.125rem 0.5rem;
  border-radius: var(--rn-radius-full);
  font-weight: 600;
  font-size: 0.75rem;
}

.rn-post-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.rn-post-card__title a {
  color: var(--rn-secondary);
  text-decoration: none;
}

.rn-post-card__title a:hover {
  color: var(--rn-primary);
}

.rn-post-card__excerpt {
  font-size: 0.9375rem;
  color: var(--rn-gray-500);
  line-height: 1.6;
}

/* ============================================
   SINGLE POST
   ============================================ */
.rn-single {
  max-width: 760px;
  margin: 0 auto;
}

.rn-single__header {
  margin-bottom: 2rem;
}

.rn-single__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--rn-gray-500);
  margin-bottom: 0.75rem;
}

.rn-single__cat {
  background: var(--rn-primary-light);
  color: var(--rn-primary);
  padding: 0.125rem 0.5rem;
  border-radius: var(--rn-radius-full);
  font-weight: 600;
  font-size: 0.75rem;
}

.rn-single__title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--rn-secondary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.rn-single__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rn-single__author img {
  border-radius: 50%;
}

.rn-single__author-name {
  font-weight: 600;
  color: var(--rn-gray-800);
  display: block;
  font-size: 0.9375rem;
}

.rn-single__read-time {
  font-size: 0.8125rem;
  color: var(--rn-gray-400);
}

.rn-single__featured {
  margin-bottom: 2rem;
  border-radius: var(--rn-radius-lg);
  overflow: hidden;
}

.rn-single__featured img {
  width: 100%;
  height: auto;
}

.rn-single__content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--rn-gray-700);
}

.rn-single__content h2,
.rn-single__content h3,
.rn-single__content h4 {
  color: var(--rn-secondary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.rn-single__content h2 { font-size: 1.5rem; }
.rn-single__content h3 { font-size: 1.25rem; }
.rn-single__content h4 { font-size: 1.125rem; }

.rn-single__content p {
  margin-bottom: 1.25rem;
}

.rn-single__content a {
  color: var(--rn-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rn-single__content img {
  border-radius: var(--rn-radius-md);
  margin: 1.5rem 0;
}

.rn-single__content pre {
  background: var(--rn-gray-900);
  color: var(--rn-gray-100);
  padding: 1.25rem;
  border-radius: var(--rn-radius-md);
  overflow-x: auto;
  font-family: var(--rn-font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.rn-single__content code {
  font-family: var(--rn-font-mono);
  background: var(--rn-gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: var(--rn-radius-sm);
  font-size: 0.875em;
}

.rn-single__content pre code {
  background: none;
  padding: 0;
}

.rn-single__content blockquote {
  border-left: 3px solid var(--rn-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--rn-primary-light);
  border-radius: 0 var(--rn-radius-md) var(--rn-radius-md) 0;
  color: var(--rn-gray-700);
}

.rn-single__content ul,
.rn-single__content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.rn-single__content li {
  margin-bottom: 0.375rem;
}

.rn-single__footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rn-gray-200);
}

.rn-single__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rn-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--rn-gray-100);
  color: var(--rn-gray-600);
  border-radius: var(--rn-radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--rn-transition);
}

.rn-tag:hover {
  background: var(--rn-primary-light);
  color: var(--rn-primary);
}

/* ============================================
   PAGE
   ============================================ */
.rn-page__title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--rn-secondary);
  margin-bottom: 1.5rem;
}

.rn-page__content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--rn-gray-700);
  max-width: 760px;
}

.rn-page__content p {
  margin-bottom: 1.25rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.rn-empty {
  text-align: center;
  padding: 4rem 0;
}

.rn-empty h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rn-secondary);
  margin-bottom: 0.5rem;
}

.rn-empty p {
  color: var(--rn-gray-500);
}

/* ============================================
   PAGINATION
   ============================================ */
.rn-pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}

.rn-pagination .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rn-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rn-gray-600);
  background: var(--rn-white);
  border: 1px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-md);
  text-decoration: none;
  transition: all var(--rn-transition);
}

.rn-pagination .page-numbers:hover {
  border-color: var(--rn-primary);
  color: var(--rn-primary);
}

.rn-pagination .page-numbers.current {
  background: var(--rn-primary);
  color: var(--rn-white);
  border-color: var(--rn-primary);
}

/* ============================================
   BLOG HEADER BAR
   ============================================ */
.rn-blog-header {
  background: var(--rn-secondary);
  color: var(--rn-white);
}

.rn-blog-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.75rem;
}

.rn-blog-header__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--rn-white);
}

.rn-blog-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.rn-blog-header__actions .rn-btn--sm {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
}

/* Search form inside header bar */
.rn-blog-header__search .search-form {
  display: flex;
  gap: 0.375rem;
}

.rn-blog-header__search .search-field {
  width: 220px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--rn-font-sans);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--rn-radius-md);
  color: var(--rn-white);
  transition: all var(--rn-transition);
}

.rn-blog-header__search .search-field::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.rn-blog-header__search .search-field:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--rn-accent);
}

.rn-blog-header__search .search-submit {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--rn-font-sans);
  background: var(--rn-accent);
  color: var(--rn-secondary);
  border: none;
  border-radius: var(--rn-radius-md);
  cursor: pointer;
  transition: background var(--rn-transition);
}

.rn-blog-header__search .search-submit:hover {
  background: var(--rn-accent-hover);
}

/* Category tabs */
.rn-blog-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rn-blog-tabs::-webkit-scrollbar {
  display: none;
}

.rn-blog-tabs__link {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all var(--rn-transition);
}

.rn-blog-tabs__link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.rn-blog-tabs__link--active {
  color: var(--rn-white);
  border-bottom-color: var(--rn-accent);
  font-weight: 600;
}

.rn-search-count {
  font-size: 0.9375rem;
  color: var(--rn-gray-500);
  margin-bottom: 1.5rem;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.rn-breadcrumbs {
  margin-bottom: 1.5rem;
}

.rn-breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--rn-gray-400);
}

.rn-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
}

.rn-breadcrumbs__item:not(:last-child)::after {
  content: "\203A";
  margin: 0 0.5rem;
  color: var(--rn-gray-300);
}

.rn-breadcrumbs__item a {
  color: var(--rn-gray-500);
  text-decoration: none;
  transition: color var(--rn-transition);
}

.rn-breadcrumbs__item a:hover {
  color: var(--rn-primary);
}

.rn-breadcrumbs__item span[aria-current] {
  color: var(--rn-gray-700);
  font-weight: 500;
}

/* Rank Math breadcrumb overrides */
.rn-breadcrumbs .rank-math-breadcrumb {
  font-size: 0.8125rem;
  color: var(--rn-gray-400);
}

.rn-breadcrumbs .rank-math-breadcrumb a {
  color: var(--rn-gray-500);
  text-decoration: none;
}

.rn-breadcrumbs .rank-math-breadcrumb a:hover {
  color: var(--rn-primary);
}

.rn-breadcrumbs .rank-math-breadcrumb .separator {
  margin: 0 0.5rem;
  color: var(--rn-gray-300);
}

/* ============================================
   SERIES NAVIGATION BOX
   ============================================ */
.rn-series-nav {
  background: var(--rn-gray-50);
  border: 1px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
}

.rn-series-nav__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rn-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rn-series-nav__title a {
  color: var(--rn-primary);
  text-decoration: none;
}

.rn-series-nav__title a:hover {
  text-decoration: underline;
}

.rn-series-nav__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rn-gray-400);
  background: var(--rn-gray-200);
  padding: 0.125rem 0.5rem;
  border-radius: var(--rn-radius-full);
}

.rn-series-nav__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  counter-reset: series;
}

.rn-series-nav__item {
  counter-increment: series;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--rn-gray-600);
  border-bottom: 1px solid var(--rn-gray-100);
}

.rn-series-nav__item:last-child {
  border-bottom: none;
}

.rn-series-nav__item::before {
  content: counter(series) ". ";
  font-weight: 600;
  color: var(--rn-gray-400);
}

.rn-series-nav__item a {
  color: var(--rn-gray-700);
  text-decoration: none;
}

.rn-series-nav__item a:hover {
  color: var(--rn-primary);
}

.rn-series-nav__item--current {
  font-weight: 600;
  color: var(--rn-primary);
}

.rn-series-nav__item--current::before {
  color: var(--rn-primary);
}

.rn-series-nav__arrows {
  display: flex;
  gap: 0.5rem;
}

.rn-btn--sm {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
}

/* Series badge on post cards */
.rn-post-card__series {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #B45309;
  background: #FEF3C7;
  border-radius: var(--rn-radius-full);
  text-decoration: none;
  transition: all var(--rn-transition);
}

.rn-post-card__series:hover {
  background: #FDE68A;
  color: #92400E;
}

/* Series archive header */
.rn-series-archive__header {
  margin-bottom: 2rem;
}

.rn-series-archive__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--rn-secondary);
  margin-bottom: 0.5rem;
}

.rn-series-archive__desc {
  font-size: 1rem;
  color: var(--rn-gray-500);
  margin-bottom: 0.5rem;
}

.rn-series-archive__count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rn-gray-400);
}

/* ============================================
   RELATED CONTENT (Cross-Linking)
   ============================================ */
.rn-related-content {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rn-gray-200);
}

.rn-related-content__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--rn-secondary);
  margin-bottom: 1rem;
}

.rn-related-content__list {
  list-style: none;
  padding: 0;
}

.rn-related-content__list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rn-gray-100);
  font-size: 0.9375rem;
}

.rn-related-content__list li:last-child {
  border-bottom: none;
}

.rn-related-content__list a {
  color: var(--rn-gray-700);
  text-decoration: none;
  flex: 1;
}

.rn-related-content__list a:hover {
  color: var(--rn-primary);
}

.rn-related-content__list time {
  font-size: 0.8125rem;
  color: var(--rn-gray-400);
  flex-shrink: 0;
}

.rn-related-content__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--rn-radius-full);
  background: var(--rn-primary-light);
  color: var(--rn-primary);
  flex-shrink: 0;
}

.rn-related-content__badge--blog {
  background: #D1FAE5;
  color: #047857;
}

/* ============================================
   TRENDING WIDGET
   ============================================ */
.rn-trending-list {
  list-style: none;
  padding: 0;
}

.rn-trending-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rn-gray-100);
}

.rn-trending-item:last-child {
  border-bottom: none;
}

.rn-trending-item__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--rn-gray-400);
  background: var(--rn-gray-100);
  border-radius: var(--rn-radius-sm);
  flex-shrink: 0;
}

.rn-trending-item__body {
  flex: 1;
  min-width: 0;
}

.rn-trending-item__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rn-gray-800);
  text-decoration: none;
  line-height: 1.4;
}

.rn-trending-item__title:hover {
  color: var(--rn-primary);
}

.rn-trending-item__views {
  font-size: 0.75rem;
  color: var(--rn-gray-400);
}

/* Sticky post highlight */
.rn-post-card.sticky {
  border-color: var(--rn-primary);
  box-shadow: 0 0 0 1px var(--rn-primary);
}

.rn-post-card.sticky::before {
  content: "Featured";
  display: inline-block;
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--rn-primary);
  color: var(--rn-white);
  border-radius: var(--rn-radius-full);
  z-index: 1;
}

.rn-post-card.sticky {
  position: relative;
}

/* ============================================
   SIDEBAR
   ============================================ */
.rn-sidebar {
  background: var(--rn-white);
  border: 1px solid var(--rn-gray-200);
  border-radius: var(--rn-radius-lg);
  padding: 1.5rem;
}

.rn-sidebar .widget {
  margin-bottom: 1.5rem;
}

.rn-sidebar .widget:last-child {
  margin-bottom: 0;
}

.rn-sidebar .widget-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--rn-secondary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rn-gray-100);
}

.rn-sidebar ul {
  list-style: none;
  padding: 0;
}

.rn-sidebar li {
  padding: 0.375rem 0;
}

.rn-sidebar li a {
  font-size: 0.875rem;
  color: var(--rn-gray-600);
  text-decoration: none;
}

.rn-sidebar li a:hover {
  color: var(--rn-primary);
}

/* ============================================
   RESPONSIVE (additional)
   ============================================ */
@media (max-width: 768px) {
  .rn-post-grid {
    grid-template-columns: 1fr;
  }

  .rn-single__title {
    font-size: 1.75rem;
  }

  .rn-page__title {
    font-size: 1.75rem;
  }

  .rn-blog-header__bar {
    flex-wrap: wrap;
  }

  .rn-blog-header__title {
    font-size: 1.125rem;
  }

  .rn-blog-header__search .search-form {
    flex-direction: column;
  }

  .rn-blog-tabs {
    padding: 0 var(--rn-container-padding);
    margin: 0 calc(var(--rn-container-padding) * -1);
  }
}
