/* =========================================================
   RuSpace — Main Theme Stylesheet (Final Build)
   Author: Pixarts Trade
   Built with Bootstrap 5
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* -------------------------
   ROOT VARIABLES
---------------------------- */
:root {
  --accent-color: #0078ff;
  --accent-color-alt: #098a61;
  --light-bg: #f9f9f9;
  --dark-bg: #121212;
  --text-color: #222;
  --text-light: #eaeaea;
  --radius: 1rem;
}


/* -------------------------
   BASE STYLES
---------------------------- */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  margin: 0;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  padding-top: 90px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Caveat', cursive;
  color: var(--text-color);
  letter-spacing: 0.5px;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: var(--accent-color-alt); }

/* -------------------------
   HEADER BASE
---------------------------- */
header#site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 1050;
  transition: all 0.35s ease;
}

/* -------------------------
   BRAND NAME STYLING + FADE ON SCROLL
---------------------------- */
.site-title {
  font-family: 'Caveat', cursive; /* elegant handwritten font */
  font-weight: 400;
  font-size: 1.4rem; /* thin and refined */
  letter-spacing: 0.4px;
  color: var(--text-color);
  margin-left: 0.4rem;
  transition: color 0.3s ease, opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
  text-decoration: none;
}

.site-title:hover {
  color: var(--accent-color);
  text-decoration: none;
}

body[data-theme="dark"] .site-title {
  color: rgba(255, 255, 255, 0.9);
}
body[data-theme="dark"] .site-title:hover {
  color: var(--accent-color-alt);
}

/* Fade-out effect when header scrolls */
header#site-header.scrolled .site-title {
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
}


.navbar { padding: 0.25rem 1rem; }

.navbar-brand {
  display: flex;
  align-items: center;
  margin: 0;
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  font-weight: 700;
}

/* -------------------------
   LOGO + INFO ICON
---------------------------- */
#info-btn { display:inline-flex; align-items:center; justify-content:center; }
#info-btn i { vertical-align:middle; }

.custom-logo-link { display:inline-block; max-width:140px; margin-left:6px; }
.custom-logo {
  display:block; width:100%; height:auto;
  max-height:55px;
  object-fit:contain;
  transition:max-height 0.35s ease;
}

/* -------------------------
   DESKTOP SEARCH BAR (Refined)
---------------------------- */
.search-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 480px;
  width: 100%;
}

.search-inner {
  background: rgba(0,0,0,0.05);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  height: 44px;
  transition: all 0.35s ease;
  border: none !important;
  box-shadow: none !important;
}

.search-inner:hover {
  background: rgba(0,0,0,0.07);
}

.search-inner:focus-within {
  background: rgba(0,0,0,0.08);
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.search-inner input[type="search"] {
  border: none !important;
  outline: none !important;
  background: transparent;
  flex-grow: 1;
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
  color: var(--text-color);
  transition: font-size 0.3s ease, padding 0.3s ease, background-color 0.3s ease;
  box-shadow: none !important;
}

.search-inner button {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#search-btn i.bi-arrow-up-circle {
  font-size: 1.25rem;
  color: rgba(80,100,130,0.9);
  transition: color 0.3s ease;
}
#search-btn:hover i.bi-arrow-up-circle { color: rgba(50,160,255,0.9); }

#search-clear i.bi-stop-circle {
  font-size: 1.25rem;
  color: rgba(160,70,70,0.8);
  transition: color 0.3s ease;
}
#search-clear:hover i.bi-stop-circle { color: rgba(220,90,90,0.9); }

.search-inner button:first-child::after,
.search-inner button:last-child::before {
  content:"";
  display:inline-block;
  width:1px; height:20px;
  background:rgba(0,0,0,0.15);
}
.search-inner button:first-child::after { margin-left:8px; }
.search-inner button:last-child::before { margin-right:8px; }

body[data-theme="dark"] .search-inner {
  background: rgba(255,255,255,0.08);
}
body[data-theme="dark"] .search-inner:hover {
  background: rgba(255,255,255,0.12);
}
body[data-theme="dark"] .search-inner:focus-within {
  background: rgba(255,255,255,0.15);
}
body[data-theme="dark"] .search-inner i { color: rgba(255,255,255,0.7); }

/* -------------------------
   HAMBURGER BUTTON
---------------------------- */
.navbar-toggler {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000;
  transition: color 0.25s ease, transform 0.3s ease, top 0.3s ease;
}
.navbar-toggler span {
  position: absolute;
  width: 16px;
  height: 1.6px;
  background-color: rgba(0,0,0,0.85);
  border-radius: 1px;
  transition: all 0.18s cubic-bezier(0.55,0.06,0.68,0.19);
}
.navbar-toggler span:nth-child(1){ top:8px; }
.navbar-toggler span:nth-child(2){ top:12px; }
.navbar-toggler span:nth-child(3){ top:16px; }
.navbar-toggler:hover span { background-color: var(--accent-color); }
.navbar-toggler.active span:nth-child(1){ transform:rotate(45deg); top:12px; }
.navbar-toggler.active span:nth-child(2){ opacity:0; transform:translateX(-5px); }
.navbar-toggler.active span:nth-child(3){ transform:rotate(-45deg); top:12px; }

body[data-theme="dark"] .navbar-toggler span { background-color: rgba(255,255,255,0.9); }

.navbar-toggler:focus,
.navbar-toggler:active,
.navbar-toggler:focus-visible {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Desktop: centered vertically */
@media (min-width: 992px) {
  .navbar-toggler {
    position: absolute;
    right: 1.4rem;
    top: 50%;
    transform: translateY(-50%);
  }
  header#site-header.scrolled .navbar-toggler {
    top: 50%;
    transform: translateY(-50%);
  }
}

/* Mobile: inline */
@media (max-width: 991.98px) {
  .navbar-toggler {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-left: auto;
  }
  header#site-header.scrolled .navbar-toggler {
    transform: none;
  }
}

/* -------------------------
   OFFCANVAS — RIGHT SLIDE PANEL
---------------------------- */
.offcanvas.offcanvas-end {
  top: 0; right: 0; bottom: 0;
  width: 300px;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1),
              opacity 0.45s ease;
  border-left: 1px solid rgba(0,0,0,0.05);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  box-shadow: -10px 0 30px rgba(0,0,0,0.08);
  z-index: 1050;
}
.offcanvas.offcanvas-end.show {
  transform: translateX(0);
  opacity: 1;
}
.offcanvas-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.offcanvas-body {
  padding: 1rem 1.25rem 2rem;
  overflow-y: auto;
  height: calc(100vh - 70px);
}

/* -------------------------
   OFFCANVAS MENU (Left-aligned)
---------------------------- */
.offcanvas-menu {
  text-align: left !important;
}
.offcanvas-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.offcanvas-menu ul li a {
  display: block;
  padding: 0.75rem 0;
  font-weight: 500;
  color: var(--text-color);
  text-decoration: none;
  text-align: left;
  transition: color 0.25s ease, transform 0.25s ease;
}
.offcanvas-menu ul li a:hover {
  color: var(--accent-color);
  transform: translateX(6px);
}

/* Dark mode offcanvas */
body[data-theme="dark"] .offcanvas.offcanvas-end {
  background: rgba(20,20,20,0.95);
  border-left: 1px solid rgba(255,255,255,0.05);
  box-shadow: -10px 0 25px rgba(0,0,0,0.4);
}
body[data-theme="dark"] .offcanvas-menu ul li a {
  color: rgba(240,240,240,0.9);
}
body[data-theme="dark"] .offcanvas-menu ul li a:hover {
  color: var(--accent-color-alt);
}

/* -------------------------
   OFFCANVAS FOOTER + SOCIAL ICONS
---------------------------- */
/* -------------------------
   OFFCANVAS FOOTER + SOCIAL ICONS (refined only)
---------------------------- */
.offcanvas-footer {
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(0,0,0,0.65);
  background: transparent; /* removed background shade */
  backdrop-filter: none;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.offcanvas-footer a {
  color: rgba(0,0,0,0.7);
  transition: color 0.3s ease;
}
.offcanvas-footer a:hover {
  color: var(--accent-color);
}

.offcanvas-logo img {
  max-height: 38px;
  width: auto;
  opacity: 0.9;
}

/* Social Icons */
.offcanvas-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 4px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.75);
  transition: all 0.35s ease;
}

/* Hover: lift + glow animation */
.offcanvas-social a:hover {
  transform: translateY(-3px);
  color: #fff;
  animation: pulseGlow 1.2s ease-in-out infinite alternate;
}

/* Brand hover colors */
.offcanvas-social a[aria-label="Facebook"]:hover { background: #1877f2; }
.offcanvas-social a[aria-label="Instagram"]:hover {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.offcanvas-social a[aria-label="Twitter"]:hover { background: #1da1f2; }
.offcanvas-social a[aria-label="YouTube"]:hover { background: #ff0000; }

.offcanvas-social i {
  font-size: 1rem;
  line-height: 1;
}

/* Pulse animation (light mode) */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 rgba(0,0,0,0); }
  100% { box-shadow: 0 0 10px rgba(0,0,0,0.25); }
}

/* -------------------------
   OFFCANVAS SEARCH + THEME TOGGLE
---------------------------- */

/* Search bar inside offcanvas */
.offcanvas-search .input-group {
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s ease;
}
.offcanvas-search .input-group:hover {
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
}
.offcanvas-search input {
  border: none;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
}
.offcanvas-search input:focus {
  outline: none;
  box-shadow: none;
}

/* Minimal & Compact Offcanvas Search Button */
.offcanvas-search .btn {
  border: none;
  background: transparent !important;
  color: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 26px;
  height: 26px;
  line-height: 1;
  transition: color 0.3s ease, transform 0.2s ease;
}

.offcanvas-search .btn i {
  font-size: 0.85rem; /* smaller icon size */
  line-height: 1;
  transition: transform 0.2s ease;
}

.offcanvas-search .btn:hover {
  color: var(--accent-color);
  transform: scale(1.05);
}

.offcanvas-search .btn:hover i {
  transform: rotate(8deg);
}

/* Dark Mode */
body[data-theme="dark"] .offcanvas-search .btn {
  color: rgba(255, 255, 255, 0.65);
}
body[data-theme="dark"] .offcanvas-search .btn:hover {
  color: var(--accent-color-alt);
}

/* Theme toggle button inside footer */
.offcanvas-theme-toggle .btn {
  border-radius: 30px;
  font-size: 0.85rem;
  border: 1px solid rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}
.offcanvas-theme-toggle .btn:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

/* Dark mode */
body[data-theme="dark"] .offcanvas-search .btn {
  background: var(--accent-color-alt);
  color: #fff;
}
body[data-theme="dark"] .offcanvas-theme-toggle .btn {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
}
body[data-theme="dark"] .offcanvas-theme-toggle .btn:hover {
  background: var(--accent-color-alt);
  color: #fff;
}


/* Dark Mode */
body[data-theme="dark"] .offcanvas-footer {
  color: rgba(255,255,255,0.65);
  background: rgba(20,20,20,0.4);
  border-top: 1px solid rgba(255,255,255,0.1);
}
body[data-theme="dark"] .offcanvas-footer a {
  color: rgba(255,255,255,0.75);
}
body[data-theme="dark"] .offcanvas-social a {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}
body[data-theme="dark"] .offcanvas-social a:hover {
  background: var(--accent-color-alt);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,191,166,0.35);
}

/* -------------------------
   SCROLL SHRINK EFFECT
---------------------------- */
header#site-header.scrolled {
  backdrop-filter: blur(15px);
  background: rgba(255,255,255,0.75);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
header#site-header.scrolled .custom-logo {
  max-height: 42px;
  transition: max-height 0.3s ease;
}
header#site-header.scrolled .search-inner {
  height: 36px;
  background: rgba(0,0,0,0.04);
  transition: height 0.3s ease, background 0.3s ease;
}
header#site-header.scrolled .search-inner input {
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
}
body[data-theme="dark"] header#site-header.scrolled {
  background: rgba(20,20,20,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* -------------------------
   RESPONSIVE FIXES
---------------------------- */
@media (max-width: 992px) {
  body { padding-top: 70px; }
  .search-box { display: none; }
  .custom-logo-link { max-width: 100px; }
  .custom-logo { max-height: 40px; }
  .navbar { padding: 0.25rem 0.75rem; }
  .offcanvas.offcanvas-end { width: 260px; }
}

/* -------------------------
   LIVE SEARCH SUGGESTIONS
---------------------------- */
.search-suggestions {
  z-index: 2000;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(0,0,0,0.05);
}
.search-suggestions a {
  display: block;
  color: var(--text-color);
  font-size: 0.9rem;
  transition: background 0.2s ease;
}
.search-suggestions a:hover {
  background: rgba(0,0,0,0.05);
  color: var(--accent-color);
  text-decoration: none;
}
body[data-theme="dark"] .search-suggestions {
  background: rgba(20,20,20,0.95);
  border-color: rgba(255,255,255,0.05);
}
body[data-theme="dark"] .search-suggestions a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--accent-color-alt);
}

/* -------------------------
   LIVE SEARCH RESULT STYLING (with Category)
---------------------------- */
.search-suggestions {
  z-index: 2000;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 8px;
}

.search-result-item {
  transition: background 0.25s ease;
}
.search-result-item:hover {
  background: rgba(0,0,0,0.05);
}
.search-result-item img {
  border-radius: 6px;
  flex-shrink: 0;
}
.search-result-item .fw-medium {
  font-size: 0.9rem;
  color: var(--text-color);
}
.search-result-item .xsmall {
  font-size: 0.75rem;
  color: rgba(100,100,100,0.8);
  margin-top: -1px;
}
body[data-theme="dark"] .search-result-item:hover {
  background: rgba(255,255,255,0.08);
}
body[data-theme="dark"] .search-result-item .fw-medium {
  color: rgba(255,255,255,0.9);
}
body[data-theme="dark"] .search-result-item .xsmall {
  color: rgba(255,255,255,0.65);
}

/* -------------------------
   GROUPED SEARCH RESULTS
---------------------------- */
.search-group-title {
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-weight: 600;
  letter-spacing: 0.5px;
}
body[data-theme="dark"] .search-group-title {
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
}


/* -------------------------
   SEARCH KEYBOARD NAVIGATION
---------------------------- */
.search-result-item.active {
  background: rgba(0, 120, 255, 0.08);
  border-left: 3px solid var(--accent-color);
}
body[data-theme="dark"] .search-result-item.active {
  background: rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent-color-alt);
}

/* -------------------------
   NO-THUMBNAIL RESULT ALIGNMENT
---------------------------- */
.search-result-item:not(:has(img)) {
  padding-left: 0.8rem;
}

.info-modal-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-color);
}
.info-modal-content p {
  margin-bottom: 0.8rem;
}
.info-modal-content .small {
  display: block;
  text-align: right;
  font-style: italic;
  opacity: 0.8;
}
body[data-theme="dark"] .info-modal-content {
  color: rgba(255,255,255,0.9);
}
body[data-theme="dark"] .info-modal-content .small {
  color: rgba(255,255,255,0.6);
}

.footer-copyright {
  font-size: 0.9rem;
  color: rgba(0,0,0,0.7);
  text-align: center;
}
body[data-theme="dark"] .footer-copyright {
  color: rgba(255,255,255,0.7);
}


/* Two-column responsive layout for footer main section */
.footer-columns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

/* ≥768px → two columns, opposite alignment */
@media (min-width: 768px) {
  .footer-columns {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  .footer-left {
    text-align: left;
  }
  .footer-right {
    text-align: right;
  }
}

/* <768px → stack & center */
@media (max-width: 767.98px) {
  .footer-columns {
    flex-direction: column;
    text-align: center;
  }
  .footer-left,
  .footer-right {
    text-align: center;
  }
}
/* =========================================================
   FOOTER 3-COLUMN STRUCTURE
   ========================================================= */
.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  gap: 0.5rem;
  text-align: center;
}

.footer-bottom .footer-search {
  flex-grow: 1;
  max-width: 320px;
}

@media (max-width: 576px) {
  .footer-bottom .footer-search {
    max-width: 220px;
  }
}

.footer-logo img {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.footer-brand-name {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: var(--text-color);
}
body[data-theme="dark"] .footer-brand-name {
  color: rgba(255, 255, 255, 0.9);
}

/* Search bar visibility */
.footer-search {
  flex-grow: 1;
}
@media (min-width: 768px) {
  .footer-search {
    display: none !important;
  }
}

/* Theme toggle styling */
.footer-theme-toggle button {
  color: rgba(0, 0, 0, 0.65);
  transition: transform 0.25s ease, color 0.3s ease;
}
.footer-theme-toggle button:hover {
  transform: rotate(20deg) scale(1.05);
  color: var(--accent-color);
}
body[data-theme="dark"] .footer-theme-toggle button {
  color: rgba(255, 255, 255, 0.7);
}
body[data-theme="dark"] .footer-theme-toggle button:hover {
  color: var(--accent-color-alt);
}
/* =========================================================
   FOOTER SEARCH — Focus + Live Results Above
   ========================================================= */

/* Remove default browser borders/outlines */
.footer-search-inner input:focus,
.footer-search-inner input:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Adjust background on focus for subtle highlight */
.footer-search-inner:focus-within {
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.08);
}

/* Live results ABOVE the footer search bar */
#footer-search-suggestions {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 0;
  width: 100%;
  z-index: 2000;
  border-radius: 0.75rem;
  overflow-y: auto;
  max-height: 300px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(6px);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: all 0.25s ease;
}

#footer-search-suggestions.active,
#footer-search-suggestions:not(.d-none) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}



/* Dark mode styling */
body[data-theme="dark"] .footer-search-inner:focus-within {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.08);
}
body[data-theme="dark"] #footer-search-suggestions {
  background: rgba(25, 25, 25, 0.96);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   HEADER LOGO — Gentle Wobble Rotation on Hover
   ========================================================= */

/* Base logo style */
.custom-logo {
  transition: transform 0.4s ease, filter 0.4s ease;
  transform-origin: center center;
}

/* Wobble keyframes */
@keyframes logoWobble {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(45deg); }
  70%  { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}

/* Hover triggers wobble */
.custom-logo:hover {
  animation: logoWobble 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  filter: brightness(1.1);
}
.custom-logo,
.footer-logo-img img {
  transition: transform 0.4s ease, filter 0.4s ease;
  transform-origin: center center;
}

.custom-logo:hover,
.footer-logo-img img:hover {
  animation: logoWobble 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  filter: brightness(1.1);
}

/* =========================================================
   FOOTER SOCIAL ICONS — Balanced Size & Official Colors
   ========================================================= */
.footer-social .social-link {
  font-size: 1.1rem; /* ✅ reduced from 1.35rem for balance */
  text-decoration: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-social .social-link:hover {
  transform: scale(1.1); /* smaller, refined hover effect */
  opacity: 0.9;
}

/* 🎨 Official brand colors */
.footer-social .facebook i { color: #1877f2; }
.footer-social .twitter i  { color: #000000; }
.footer-social .instagram i {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.footer-social .youtube i { color: #ff0000; }
.footer-social .linkedin i { color: #0077b5; }

/* 🌙 Dark mode brightness tweak */
body[data-theme="dark"] .footer-social .social-link i {
  filter: brightness(1.25);
}

/* Optional glow (subtle, only on hover) */
.footer-social .social-link:hover i {
  filter: drop-shadow(0 0 4px currentColor);
}

/* =========================================================
   INDEX PAGE REFINEMENTS — RuSpace Enhancements
   ========================================================= */

/* ✅ Justify post excerpts or content text */
.post-excerpt,
.entry-content p,
.post-card .card-text,
.blog .entry-summary {
  text-align: justify;
  text-justify: inter-word;
}

/* ✅ Subtle hover animation on post thumbnails */
.post-card .post-thumbnail img,
.blog .post-thumbnail img,
.archive .post-thumbnail img {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  transform-origin: center center;
}

.post-card:hover .post-thumbnail img,
.blog article:hover .post-thumbnail img,
.archive article:hover .post-thumbnail img {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ✅ Remove separation line between post items */
.blog article,
.archive article,
.post-card {
  border: none !important;
  box-shadow: none;
}

/* ✅ Slight hover lift for the full card (optional, if already present, can omit) */
.post-card:hover {
  transform: translateY(-3px);
}

/* =========================================================
   PAGINATION — RuSpace Style
   ========================================================= */

.pagination-wrapper {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  padding-left: 0;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  color: var(--text-color);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Active/current page */
.pagination .current {
  background: var(--accent-color);
  color: #fff !important;
  border-color: var(--accent-color);
}

/* Hover effect */
.pagination a:hover {
  background: var(--accent-color);
  color: #fff;
  transform: translateY(-1px);
  border-color: var(--accent-color);
}

/* Disabled buttons */
.pagination .disabled,
.pagination .dots {
  opacity: 0.6;
  cursor: not-allowed;
  background: transparent;
  border: none;
}

/* Dark mode adjustments */
body[data-theme="dark"] .pagination a,
body[data-theme="dark"] .pagination span {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
body[data-theme="dark"] .pagination a:hover {
  background: var(--accent-color-alt);
  border-color: var(--accent-color-alt);
  color: #fff;
}
body[data-theme="dark"] .pagination .current {
  background: var(--accent-color-alt);
  border-color: var(--accent-color-alt);
  color: #fff !important;
}

/* Responsive size adjustment */
@media (max-width: 576px) {
  .pagination a,
  .pagination span {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }
}
/* =========================================================
   RUSPACE PAGINATION — Elegant Bootstrap Inspired
   ========================================================= */

.ruspace-pagination {
  margin-top: 3rem;
}

.ruspace-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.ruspace-pagination li {
  display: inline-block;
}

/* Buttons */
.ruspace-pagination a,
.ruspace-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.25s ease;
  color: var(--text-color);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Active page */
.ruspace-pagination .current {
  background: var(--accent-color);
  color: #fff !important;
  border-color: var(--accent-color);
}

/* Hover animation */
.ruspace-pagination a:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

/* Icon animations */
.ruspace-pagination a i {
  transition: transform 0.25s ease, color 0.25s ease;
  color: var(--accent-color);
}

.ruspace-pagination a:hover i.bi-arrow-left-circle {
  transform: translateX(-3px);
  color: #fff;
}

.ruspace-pagination a:hover i.bi-arrow-right-circle {
  transform: translateX(3px);
  color: #fff;
}

/* Disabled/ellipsis states */
.ruspace-pagination .dots,
.ruspace-pagination .disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
  border: none;
}

/* 🌙 Dark Mode */
body[data-theme="dark"] .ruspace-pagination a,
body[data-theme="dark"] .ruspace-pagination span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

body[data-theme="dark"] .ruspace-pagination a:hover {
  background: var(--accent-color-alt);
  border-color: var(--accent-color-alt);
  color: #fff;
}

body[data-theme="dark"] .ruspace-pagination .current {
  background: var(--accent-color-alt);
  border-color: var(--accent-color-alt);
  color: #fff !important;
}

body[data-theme="dark"] .ruspace-pagination a i {
  color: var(--accent-color-alt);
}

/* 📱 Responsive adjustments */
@media (max-width: 576px) {
  .ruspace-pagination a,
  .ruspace-pagination span {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .ruspace-pagination a {
    gap: 0;
  }
  .ruspace-pagination a span {
    display: none;
  }
}

/* =========================================================
   POST THUMBNAIL HOVER ANIMATION — Works on Index, Archive, Single
   ========================================================= */

/* Base state */
.post-thumbnail img,
.card-img-top,
.wp-post-image,
.post-card img {
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), 
              box-shadow 0.35s ease, 
              filter 0.3s ease;
  transform-origin: center center;
}

/* Hover trigger for all layouts (index, single, archive, etc.) */
.post-thumbnail:hover img,
.card:hover .card-img-top,
.post-card:hover img,
.post-card:hover .wp-post-image,
a.post-thumbnail:hover .wp-post-image {
  transform: scale(1.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  filter: brightness(1.06);
}

/* Smooth transition for the entire post card */
.post-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Dark Mode */
body[data-theme="dark"] .post-thumbnail:hover img,
body[data-theme="dark"] .card:hover .card-img-top,
body[data-theme="dark"] .post-card:hover img,
body[data-theme="dark"] a.post-thumbnail:hover .wp-post-image {
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
  filter: brightness(1.15);
}

/* =========================================================
   INDEX PAGE — Thumbnail Hover Pop-Up (Image Only)
   ========================================================= */

/* Base state */
.post-card .card-img-top {
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1),
              box-shadow 0.35s ease,
              filter 0.3s ease;
  transform-origin: center center;
}

/* Hover effect — only on index post images */
.post-card:hover .card-img-top {
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  filter: brightness(1.05);
}

/* Optional: smoothness for rounded corners */
.post-card .card-img-top {
  border-radius: 0.75rem 0.75rem 0 0;
  overflow: hidden;
}

/* Dark mode adjustment */
body[data-theme="dark"] .post-card:hover .card-img-top {
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
  filter: brightness(1.15);
}


/* =========================================================
   INDEX PAGE — Thumbnail Pop-Up with Natural Motion
   ========================================================= */

/* Base state */
body.home .img-fluid.rounded-3.shadow-sm,
body.blog .img-fluid.rounded-3.shadow-sm {
  transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1), /* smooth ease-in */
              box-shadow 0.4s ease,
              filter 0.35s ease;
  transform-origin: center center;
  will-change: transform;
}

/* Subtle pop-up on hover (ease-out) */
body.home article:hover .img-fluid.rounded-3.shadow-sm,
body.blog article:hover .img-fluid.rounded-3.shadow-sm {
  transform: scale(1.05);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  filter: brightness(1.06);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), /* ease-out bounce */
              box-shadow 0.4s ease,
              filter 0.35s ease;
}

/* Dark mode refinement */
body[data-theme="dark"] body.home article:hover .img-fluid.rounded-3.shadow-sm,
body[data-theme="dark"] body.blog article:hover .img-fluid.rounded-3.shadow-sm {
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.08);
  filter: brightness(1.15);
}


/* =========================================================
   VIDEO FADE-IN ANIMATION (MP4 + YouTube)
   ========================================================= */
.ruspace-autoplay-video,
.ruspace-youtube-embed {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.ruspace-autoplay-video.is-visible,
.ruspace-youtube-embed.is-visible {
  opacity: 1;
}


/* =========================================================
   SINGLE POST NAVIGATION — Modern Green Buttons
   ========================================================= */
.post-navigation a.btn {
  background-color: #10b981; /* Modern emerald green */
  border-color: #10b981;
  color: #fff !important;
  transition: all 0.3s ease;
  font-weight: 500;
}

.post-navigation a.btn:hover {
  background-color: #059669; /* Slightly darker green on hover */
  border-color: #059669;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}


/* =========================================================
   TEXT JUSTIFICATION FIX — Excerpts & Post Content
   ========================================================= */

/* Force justification for excerpts */
.excerpt,
.excerpt p,
.post-excerpt,
.blog article .excerpt {
  text-align: justify !important;
  text-justify: inter-word !important;
}

/* Force justification for single post content */
.entry-content,
.entry-content p,
.single-post .entry-content p {
  text-align: justify !important;
  text-justify: inter-word !important;
}

/* Slightly better line spacing for readability */
.excerpt,
.entry-content p {
  line-height: 1.75;
  word-spacing: 0.05em;
}

.ratio iframe {
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
}


/* =========================================================
   RUSPACE ARTICLE WRAP — MEDIA LEFT + CONTENT RIGHT
   ========================================================= */
.ruspace-article-wrap {
  overflow: hidden; /* contain floats */
}

/* Thumbnail/video on the left */
.ruspace-article-media {
  float: left;
  width: 42%;
  max-width: 480px;
  margin: 0 1.5rem 1rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
}

/* Content naturally flows to the right and wraps below */
.ruspace-article-content {
  overflow: hidden;
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
  .ruspace-article-media {
    float: none;
    width: 100%;
    margin: 0 0 1rem 0;
  }
}
/* Optional vertical alignment for short posts */

@media (min-width: 992px) {
  .ruspace-article-wrap {
    /* Disable flex so float-based wrap works */
    overflow: hidden; /* contain float */
  }

  .ruspace-article-media {
    float: left;
    width: 42%;
    max-width: 480px;
    margin: 0 1.5rem 1rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
  }

  .ruspace-article-content {
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .ruspace-article-content {
    padding-top: 0.5rem;
  }
  .ruspace-article-media img,
  .ruspace-article-media video {
    border-radius: 0.5rem;
  }
}
.ruspace-article-media iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  border: 0;
}
.ruspace-article-media img {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.ruspace-article-media:hover img {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}


/* ✅ Force media container to shrink inside flex */
.ruspace-article-media {
  flex-shrink: 0;
  max-width: 480px;
  width: 42%;
}
.ruspace-article-media > .ratio,
.ruspace-article-media > img,
.ruspace-article-media > video {
  width: 100% !important;
  max-width: 100%;
  height: auto;
}

/* =========================================================
   WRAPPING POLISH — Natural flow enhancements
   ========================================================= */
.ruspace-article-content p:first-of-type {
  margin-top: 0;
}

.ruspace-article-content {
  text-align: justify;
  text-justify: inter-word;
}

.ruspace-article-media {
  margin-bottom: 1rem;
}


/* =========================================================
   FIX — Maintain video ratio inside floated container
   ========================================================= */
.ruspace-article-media .ratio {
  display: block;
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.ruspace-article-media .ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================================================
   MOBILE FIX — Make media full-width on smaller screens
   ========================================================= */
@media (max-width: 768px) {
  .ruspace-article-media {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 1rem 0 !important;
    display: block !important;
  }

  .ruspace-article-media img,
  .ruspace-article-media video,
  .ruspace-article-media iframe {
    width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem;
    object-fit: cover;
  }

  /* Remove extra padding or border constraints inside .ratio */
  .ruspace-article-media .ratio {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }

  .ruspace-article-media .ratio iframe {
    position: relative;
    width: 100% !important;
    height: auto !important;
  }
}

