/*
Theme Name:   Citrapix Child
Template:     generatepress
Version:      1.0.1
Text Domain:  citrapix-child
*/

/* ==========================================================================
   FONTS (PEYDA FAMILY)
   ========================================================================== */

@font-face {
    font-family: 'Peyda';
    src: url('assets/fonts/PeydaRegular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Peyda';
    src: url('assets/fonts/PeydaMedium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Peyda';
    src: url('assets/fonts/PeydaBold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Peyda';
    src: url('assets/fonts/PeydaExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   DESIGN TOKENS (ROOT VARIABLES)
   ========================================================================== */

:root {
  --cx-bg: #070a12;
  --cx-panel: rgba(16, 20, 30, 0.68);
  --cx-panel-strong: rgba(16, 20, 30, 0.82);
  --cx-border: rgba(255, 255, 255, 0.08);
  --cx-border-strong: rgba(0, 212, 255, 0.18);
  --cx-halo-cyan: rgba(0, 212, 255, 0.14);
  --cx-halo-violet: rgba(146, 87, 255, 0.12);
  --cx-text-primary: rgba(248, 250, 252, 0.98);
  --cx-text-secondary: rgba(226, 232, 240, 0.74);
  --cx-text-tertiary: rgba(148, 163, 184, 0.54);
  --cx-accent: #00d4ff;
}

/* ==========================================================================
   GLOBAL TYPOGRAPHY & PAGE WRAPPER
   ========================================================================== */

body,
.cx-page-wrapper {
    font-family: 'Peyda', 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cx-page-wrapper {
    direction: rtl;
    text-align: start;
}

.cx-glass-page,
.cx-header-shell,
.cx-footer-shell {
    width: min(1200px, calc(100% - 32px));
    margin-inline: auto;
}

.cx-brand-mark,
.cx-footer-mark,
.cx-newsletter-title,
h1, h2, h3 {
    font-weight: 800;
    color: var(--cx-text-primary);
    letter-spacing: -0.01em;
}

.cx-header-link,
.cx-newsletter-button-label {
    font-weight: 500;
}

.cx-meta-row,
.cx-brand-subtitle,
.cx-newsletter-text,
.cx-header-search .search-field::placeholder {
    color: var(--cx-text-secondary);
}

.cx-meta-divider,
.cx-newsletter-kicker {
    color: var(--cx-text-tertiary);
}

/* ==========================================================================
   GALAXY BACKGROUND (GPU OPTIMIZED)
   ========================================================================== */

html, body, .site, #page, .site-content, .cx-page-wrapper {
  background: transparent !important;
}

body {
  position: relative;
  background-color: #010205;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Deep galaxy base (anti-banding) */
body::before {
  content: "";
  position: fixed;
  top: -25%;
  left: -25%;
  width: 150%;
  height: 150%;
  z-index: -2;
  background-color: #020305;
  background-image:
    radial-gradient(circle at 25% 25%, #02060e 0%, #020305 60%),
    radial-gradient(circle at 75% 75%, #050a14 0%, #020305 60%),
    radial-gradient(circle at 50% 80%, #050607 0%, #020305 65%);
  background-blend-mode: screen;
  animation: cx-galaxy-journey 30s ease-in-out infinite;
  will-change: transform, opacity;
}

/* Color splash volumetric lights (Static filter to prevent GPU overheat) */
body::after {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -1;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 90, 160, 0.45) 0%, transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(90, 20, 140, 0.40) 0%, transparent 55%);
  opacity: 0.6;
  filter: blur(40px);
  transform: translateZ(0); 
  pointer-events: none;
}

@keyframes cx-galaxy-journey {
  0%     { transform: translate(0%, 0%) scale(1); }
  30%    { transform: translate(-1.5%, 1.5%) scale(1.02); }
  60%    { transform: translate(1%, -2%) scale(0.98); }
  88.33% { transform: translate(2%, 1.5%) scale(1.03); }
  94%    { transform: translate(0%, 2%) scale(1.1); }
  100%   { transform: translate(0%, 0%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

/* ==========================================================================
   HOMEPAGE LAYOUT ENGINE (GRID STRUCTURE)
   ========================================================================== */

.cx-hero-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
    align-items: stretch;
}

.cx-hero-sidebar {
    display: grid;
    gap: 24px;
}

.cx-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.cx-post-card,
.cx-focus-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cx-focus-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin-top: 40px;
}

.cx-simple-list {
    display: grid;
    gap: 16px;
}

@media (max-width: 1024px) {
    .cx-hero-container {
        grid-template-columns: 1fr;
    }
    .cx-post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cx-post-grid,
    .cx-focus-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   META ROW
   ========================================================================== */

.cx-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: rgba(241, 245, 249, 0.72);
}

.cx-meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(241, 245, 249, 0.32);
    flex: 0 0 auto;
}

/* ==========================================================================
   ULTRA-PREMIUM HEADER + STICKY GLASS STRIP + MEGA PANEL
   ========================================================================== */

.cx-header-shell {
    width: min(1200px, calc(100% - 32px));
    margin-inline: auto;
}

.cx-nav-strip {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 22px;
  padding: 10px 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(241, 245, 249, 0.08);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.18),
    0 12px 32px rgba(0,0,0,0.55),
    0 0 40px rgba(0, 212, 255, 0.08);
  isolation: isolate;
  overflow: visible !important; /* Overflow fixed for Mega Menu */
  position: relative;
}

.cx-nav-strip--sticky {
  position: sticky;
  top: 12px;
  z-index: 50;
}

.cx-nav-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(0, 212, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 24%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.cx-nav-strip.is-pointer-inside::before {
  opacity: 1;
}

.cx-nav-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

/* Brand */
.cx-nav-strip-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.cx-brand-mark {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--cx-text-primary);
  text-shadow:
    0 0 12px rgba(0, 212, 255, 0.35),
    0 0 32px rgba(145, 80, 255, 0.25);
}

.cx-brand-subtitle {
  font-size: 0.82rem;
  color: var(--cx-text-secondary);
  white-space: nowrap;
}

/* Primary Navigation */
.cx-main-nav {
  position: relative;
}

.cx-nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.cx-nav-list > li {
  position: relative;
}

.cx-nav-list > li > a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-inline: 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--cx-text-secondary);
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition:
    transform 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease;
}

.cx-nav-list > li > a:hover,
.cx-nav-list > li > a:focus {
  transform: translateY(-1px);
  color: var(--cx-text-primary);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

/* Mega Menu Sub-Menu (Fixed visibility and positioning) */
.cx-nav-list > li.menu-item-has-children > ul.sub-menu {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 14px);
  width: min(850px, 90vw);
  max-height: 40vh;
  padding: 20px;
  border-radius: 20px;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  display: grid;
  direction: rtl;
  gap: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 100;
  overflow-y: auto;
}

.cx-nav-list > li.menu-item-has-children:hover > ul.sub-menu,
.cx-nav-list > li.menu-item-has-children:focus-within > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Mega Menu Columns & Inner Links */
.cx-nav-list > li.menu-item-has-children > ul.sub-menu > li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cx-nav-list > li.menu-item-has-children > ul.sub-menu > li > a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--cx-text-primary);
  text-decoration: none;
  margin-bottom: 4px;
}

.cx-nav-list > li.menu-item-has-children > ul.sub-menu > li > ul.sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cx-nav-list > li.menu-item-has-children > ul.sub-menu > li > ul.sub-menu > li > a {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--cx-text-secondary);
  border-radius: 10px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.cx-nav-list > li.menu-item-has-children > ul.sub-menu > li > ul.sub-menu > li > a:hover,
.cx-nav-list > li.menu-item-has-children > ul.sub-menu > li > ul.sub-menu > li > a:focus {
  color: var(--cx-text-primary);
  background: rgba(255,255,255,0.04);
}

/* Actions */
.cx-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cx-search-toggle,
.cx-header-cta {
  height: 36px;
  padding-inline: 14px;
  border-radius: 999px;
  border: 1px solid rgba(241,245,249,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--cx-text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.cx-header-cta {
  background: var(--cx-accent);
  border-color: transparent;
  color: #0b0f19;
  font-weight: 600;
}

.cx-search-toggle:hover,
.cx-search-toggle:focus {
  background: rgba(255,255,255,0.06);
  border-color: rgba(241,245,249,0.18);
}

.cx-header-cta:hover,
.cx-header-cta:focus {
  filter: brightness(1.08);
}

/* Mobile Toggle */
.cx-mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(241,245,249,0.12);
  background: rgba(11,15,25,0.9);
  cursor: pointer;
  position: relative;
}

.cx-mobile-icon {
  position: absolute;
  inset: 50%;
  width: 16px;
  height: 2px;
  background: #f1f5f9;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.cx-mobile-icon::before,
.cx-mobile-icon::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  background: #f1f5f9;
  border-radius: 999px;
  left: 0;
}

.cx-mobile-icon::before { top: -5px; }
.cx-mobile-icon::after  { top: 5px; }

/* Mobile Drawer (Optimized and Fixed) */
.cx-mobile-drawer {
  position: fixed;
  inset-inline-end: 0;
  inset-block-start: 0;
  width: 280px;
  height: 100vh;
  padding: 24px;
  background: rgba(11,15,25,0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-inline-start: 1px solid rgba(241,245,249,0.16);
  box-shadow: -10px 0 40px rgba(0,0,0,0.75);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  visibility: hidden;
}

.cx-mobile-drawer.is-open {
  transform: translateX(0) !important;
  visibility: visible;
}

.cx-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cx-mobile-nav-list a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--cx-text-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cx-mobile-nav-list a:hover,
.cx-mobile-nav-list a:focus {
  background: rgba(255,255,255,0.05);
  color: var(--cx-text-primary);
}

.cx-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Search Modal */
.cx-search-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cx-search-modal[hidden] {
  display: none;
}

.cx-search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}

.cx-search-modal-panel {
  position: relative;
  width: min(600px, calc(100% - 32px));
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02)),
    rgba(11,15,25,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(241,245,249,0.12);
  box-shadow: 0 24px 60px rgba(0,0,0,0.8);
  padding: 18px 20px;
  z-index: 1;
}

.cx-search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cx-search-modal-body .search-form {
  margin: 0;
}

.cx-search-close {
  background: transparent;
  border: none;
  color: var(--cx-text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .cx-main-nav {
    display: none;
  }
  .cx-mobile-toggle {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .cx-nav-strip {
    padding: 8px 10px;
    border-radius: 24px;
  }
  .cx-brand-subtitle {
    display: none;
  }
}

/* ==========================================================================
   RAYCAST HERO PANEL & CARDS (GLASS CAPSULE SYSTEM)
   ========================================================================== */

.cx-hero-panel,
.cx-hero-sidebar a {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 42%, rgba(255,255,255,0.02) 100%),
    radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.10), transparent 38%),
    radial-gradient(circle at 80% 80%, rgba(145, 80, 255, 0.08), transparent 34%),
    rgba(10, 14, 24, 0.72);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -18px 30px rgba(0, 0, 0, 0.34),
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 50px rgba(0, 212, 255, 0.08),
    0 0 90px rgba(145, 80, 255, 0.05);
}

.cx-hero-panel::before,
.cx-hero-sidebar a::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.11), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 22%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

.cx-hero-panel::after,
.cx-hero-sidebar a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.02) 35%, rgba(255,255,255,0.04) 70%, rgba(255,255,255,0.14));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

.cx-hero-panel:hover::before,
.cx-hero-sidebar a:hover::before {
  opacity: 1;
}

.cx-hero-panel {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background-position: calc(50% + var(--mx, 0px)) calc(50% + var(--my, 0px)) !important;
  transition: background-position 0.2s ease-out, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.cx-hero-panel h1 {
  color: var(--cx-text-primary);
  text-shadow:
    0 0 18px rgba(0, 212, 255, 0.10),
    0 0 32px rgba(145, 80, 255, 0.08);
  letter-spacing: -0.02em;
  animation: cx-title-glow 4s ease-in-out infinite;
}

@keyframes cx-title-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(0, 212, 255, 0.15), 0 0 20px rgba(0, 180, 220, 0.05); }
  50%      { text-shadow: 0 0 18px rgba(0, 212, 255, 0.35), 0 0 40px rgba(0, 200, 255, 0.15); }
}

.cx-hero-panel .cx-meta-row,
.cx-hero-sidebar .cx-meta-row {
  color: var(--cx-text-secondary);
}

.cx-hero-sidebar a {
  min-height: 186px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  border-radius: 22px;
  text-decoration: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.cx-hero-panel:hover,
.cx-hero-sidebar a:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(0, 212, 255, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -18px 30px rgba(0, 0, 0, 0.34),
    0 24px 60px rgba(0, 0, 0, 0.52),
    0 0 60px rgba(0, 212, 255, 0.12),
    0 0 110px rgba(145, 80, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.18);
}

/* Base Glass Cards */
.cx-post-card,
.cx-focus-card,
.cx-newsletter-panel {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  --spot-x: 50%;
  --spot-y: 50%;
  background-color: rgba(255, 255, 255, 0.025);
  background-image:
    radial-gradient(circle 220px at var(--spot-x) var(--spot-y), rgba(0, 212, 255, 0), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 40%, rgba(255, 255, 255, 0.005) 100%);
  background-blend-mode: normal, overlay, normal;
  background-repeat: no-repeat;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -12px 24px rgba(0, 0, 0, 0.30),
    inset 0 0 40px rgba(120, 200, 255, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.cx-post-card::after,
.cx-focus-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(155deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.12) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.cx-post-card:hover,
.cx-focus-card:hover,
.cx-newsletter-panel:hover {
  background-image:
    radial-gradient(circle 220px at var(--spot-x) var(--spot-y),
      rgba(0, 212, 255, 0.18),
      rgba(0, 212, 255, 0.05) 60%,
      transparent 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 40%, rgba(255, 255, 255, 0.005) 100%);
  background-blend-mode: screen, overlay, normal;
}

.cx-post-card:hover,
.cx-focus-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 212, 255, 0.30) !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -12px 24px rgba(0, 0, 0, 0.30),
    0 0 0 1px rgba(0, 212, 255, 0.14),
    0 20px 45px -12px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(0, 180, 255, 0.10);
}

/* ==========================================================================
   NEWSLETTER PANEL
   ========================================================================== */

.cx-newsletter-panel {
    padding: 40px 32px;
    margin-top: 64px;
    display: grid;
    gap: 20px;
    text-align: center;
}

.cx-newsletter-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 220px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.06),
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.cx-newsletter-panel.is-pointer-inside::before {
  opacity: 1;
}

.cx-newsletter-copy {
    display: grid;
    gap: 10px;
    max-width: 720px;
    margin-inline: auto;
}

.cx-newsletter-kicker {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(241, 245, 249, 0.68);
}

.cx-newsletter-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.15;
    color: #f1f5f9;
}

.cx-newsletter-text {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.8;
    color: rgba(241, 245, 249, 0.8);
}

.cx-newsletter-form {
    display: grid;
    gap: 14px;
    max-width: 680px;
    width: 100%;
    margin-inline: auto;
}

.cx-newsletter-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
}

.cx-newsletter-input {
    min-width: 0;
    height: 52px;
    padding-inline: 16px;
    border-radius: 10px;
    border: 1px solid rgba(241, 245, 249, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-align: start;
}

.cx-newsletter-input::placeholder {
    color: rgba(241, 245, 249, 0.42);
}

.cx-newsletter-input:focus {
    border-color: rgba(0, 212, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.cx-newsletter-input:invalid:not(:placeholder-shown) {
    border-color: rgba(255, 107, 107, 0.5);
}

.cx-newsletter-button {
    position: relative;
    min-width: 152px;
    height: 52px;
    padding-inline: 20px;
    border: 0;
    border-radius: 10px;
    background: #00d4ff;
    color: #0b0f19;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.cx-newsletter-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.cx-newsletter-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.cx-newsletter-button-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cx-newsletter-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(11, 15, 25, 0.25);
    border-top-color: #0b0f19;
    border-radius: 50%;
    animation: cx-spin 0.7s linear infinite;
    position: absolute;
    inset-inline-end: 14px;
    top: calc(50% - 8px);
}

.cx-newsletter-message {
    display: none;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
}

.cx-newsletter-success { color: #67e8a5; }
.cx-newsletter-error { color: #fda4af; }

.cx-newsletter-form.is-loading .cx-newsletter-button {
    pointer-events: none;
    opacity: 0.82;
}
.cx-newsletter-form.is-loading .cx-newsletter-button-label {
    opacity: 0.88;
}
.cx-newsletter-form.is-loading .cx-newsletter-spinner {
    display: block;
}
.cx-newsletter-form.is-success .cx-newsletter-success {
    display: block;
}
.cx-newsletter-form.is-error .cx-newsletter-error {
    display: block;
}

@keyframes cx-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .cx-newsletter-panel {
        padding: 28px 20px;
    }
    .cx-newsletter-fields {
        grid-template-columns: 1fr;
    }
    .cx-newsletter-button {
        width: 100%;
        min-width: 0;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.cx-footer-shell {
    width: min(1200px, calc(100% - 32px));
    margin-inline: auto;
}

.cx-site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-block: 36px 48px;
    margin-top: 64px;
    border-top: 1px solid rgba(241, 245, 249, 0.08);
    color: rgba(241, 245, 249, 0.68);
}

.cx-footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cx-footer-mark {
    margin: 0;
    font-size: 1rem;
    line-height: 1;
}

.cx-footer-title {
    margin: 0;
    color: #f1f5f9;
    font-size: 0.95rem;
    line-height: 1.2;
}

.cx-footer-copy {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.7;
    text-align: center;
}

.cx-footer-social {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cx-footer-link {
    color: rgba(241, 245, 249, 0.78);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.cx-footer-link:hover,
.cx-footer-link:focus {
    color: #00d4ff;
}

@media (max-width: 768px) {
    .cx-site-footer {
        flex-direction: column;
        align-items: flex-start;
        text-align: start;
    }
    .cx-footer-copy {
        text-align: start;
    }
}

/* ==========================================================================
   SCROLL REVEAL + ACCESSIBILITY
   ========================================================================== */

.cx-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cx-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cx-post-card:focus-visible,
.cx-focus-card:focus-visible,
.cx-header-link:focus-visible,
.cx-newsletter-button:focus-visible {
  outline: 2px solid var(--cx-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cx-hero-panel h1 { animation: none; }
  .cx-post-card,
  .cx-focus-card,
  .cx-newsletter-panel,
  .cx-hero-sidebar a {
    transition: none;
  }
}

/* ==========================================================================
   RTL FIXES
   ========================================================================== */

html[dir="rtl"] .cx-nav-strip-inner,
html[dir="rtl"] .cx-main-nav,
html[dir="rtl"] .cx-header-actions {
  direction: rtl;
}

html[dir="rtl"] .cx-nav-list {
  direction: rtl;
  justify-content: flex-end;
}

html[dir="rtl"] .cx-nav-list > li.menu-item-has-children > ul.sub-menu {
  inset-inline-end: 0;
  inset-inline-start: auto;
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .cx-nav-list > li.menu-item-has-children > ul.sub-menu > li > a,
html[dir="rtl"] .cx-nav-list > li.menu-item-has-children > ul.sub-menu > li > ul.sub-menu > li > a {
  text-align: right;
}

html[dir="rtl"] .cx-mobile-drawer {
  inset-inline-end: 0;
  inset-inline-start: auto;
  transform: translateX(100%);
}

html[dir="rtl"] .cx-mobile-drawer.is-open {
  transform: translateX(0) !important;
}

html[dir="rtl"] .cx-mobile-toggle {
  margin-left: 0;
  margin-right: 8px;
}

html[dir="rtl"] .cx-nav-strip-brand {
  margin-left: auto;
  margin-right: 0;
}

/* روش اول: محدود کردن هاله به حاشیه المان پدر */
.menu-item-hover-class {
    overflow: hidden;
    border-radius: 30px; /* این عدد باید دقیقاً هم‌اندازه انحنای دکمه شما باشد */
}

/* روش دوم: اعمال مستقیم انحنا به خود هاور */
.menu-item-hover-class:hover {
    background-color: rgba(255, 255, 255, 0.1); /* رنگ هاله شما */
    border-radius: 30px; 
}

.subscribe-btn-class {
    white-space: nowrap; /* جلوگیری از رفتن کلمات به خط بعد */
    min-width: max-content; /* عرض دکمه به اندازه محتوای داخلش تنظیم می‌شود */
    padding: 10px 25px; /* ایجاد فضای تنفس مناسب در چپ و راست کلمات */
}

.main-menu-ul {
    direction: rtl;
    text-align: right;
    display: flex;
    justify-content: flex-start; /* در حالت rtl، این گزینه آیتم‌ها را از راست می‌چیند */
}

.main-menu-ul li, 
.main-menu-ul li span {
    text-align: right;
    direction: rtl;
}

.search-modal-input {
    direction: rtl;
    text-align: right;
    font-family: inherit; /* هماهنگ کردن فونت با فونت قالب */
}
.search-modal-container {
    direction: rtl;
}