/*
Theme Name: Crownation
Theme URI: https://crownation.theme
Author: Nexus Team
Description: A modern, feature-rich WordPress theme built for Elementor with advanced admin controls, custom widgets, and powerful customization options.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crownation
Tags: elementor, page-builder, portfolio, blog, e-commerce, custom-widgets, modern
*/

/* === NEXUS PRO BASE STYLES === */
:root {
    --nexus-primary: #0a0a0a;
    --nexus-secondary: #111111;
    --nexus-accent: #6c63ff;
    --nexus-accent-2: #ff6584;
    --nexus-accent-glow: rgba(108, 99, 255, 0.4);
    --nexus-text: #e8e8e8;
    --nexus-text-muted: #888;
    --nexus-surface: #1a1a1a;
    --nexus-surface-2: #222;
    --nexus-border: rgba(255, 255, 255, 0.08);
    --nexus-font-heading: 'Space Grotesk', sans-serif;
    --nexus-font-body: 'Inter', sans-serif;
    --nexus-radius: 12px;
    --nexus-radius-lg: 20px;
    --nexus-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --nexus-glow: 0 0 30px var(--nexus-accent-glow);
    --nexus-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--nexus-font-body);
    background-color: var(--nexus-primary);
    color: var(--nexus-text);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Light Mode */
body.nexus-light-mode {
    --nexus-primary: #f8f8f8;
    --nexus-secondary: #ffffff;
    --nexus-text: #1a1a1a;
    --nexus-text-muted: #666;
    --nexus-surface: #ffffff;
    --nexus-surface-2: #f0f0f0;
    --nexus-border: rgba(0, 0, 0, 0.08);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--nexus-accent);
    text-decoration: none;
    transition: var(--nexus-transition);
}

a:hover {
    opacity: 0.85;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--nexus-font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--nexus-text);
}

/* Page Preloader */
#nexus-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nexus-primary);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#nexus-preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.nexus-preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.nexus-preloader-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: nexusPulse 1.5s ease-in-out infinite;
}

.nexus-preloader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--nexus-border);
    border-top-color: var(--nexus-accent);
    border-radius: 50%;
    animation: nexusSpin 0.8s linear infinite;
}

@keyframes nexusSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes nexusPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Maintenance Mode */
#nexus-maintenance {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nexus-maintenance-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.nexus-maintenance-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.nexus-maintenance-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 40px;
    max-width: 600px;
}

.nexus-maintenance-logo {
    margin-bottom: 30px;
}

.nexus-maintenance-logo img {
    max-width: 150px;
    margin: 0 auto;
}

.nexus-maintenance-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    color: #fff;
}

.nexus-maintenance-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* 404 Page */
.nexus-404-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background: var(--nexus-primary);
}

.nexus-404-image {
    max-width: 400px;
    margin: 0 auto 40px;
}

.nexus-404-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--nexus-accent), var(--nexus-accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 20px;
}

.nexus-404-subtitle {
    font-size: 1.5rem;
    color: var(--nexus-text-muted);
    margin-bottom: 40px;
}

.nexus-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--nexus-transition);
    cursor: pointer;
    border: none;
}

.nexus-btn-primary {
    background: linear-gradient(135deg, var(--nexus-accent), var(--nexus-accent-2));
    color: #fff;
    box-shadow: var(--nexus-glow);
}

.nexus-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px var(--nexus-accent-glow);
    color: #fff;
    opacity: 1;
}

/* Sticky Header */
#nexus-header {
    position: relative;
    z-index: 1000;
    transition: var(--nexus-transition);
}

#nexus-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--nexus-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Footer */
#nexus-footer {
    position: relative;
}

/* Content */
#nexus-content {
    min-height: 60vh;
}

/* Utility */
.nexus-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.nexus-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ============================================================
   HEADER / STICKY
   ============================================================ */
#nexus-header {
    background: var(--nexus-header-bg, rgba(10, 10, 10, 0.95));
    position: relative;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--nexus-border, rgba(255, 255, 255, 0.06));
}

#nexus-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.97) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.nexus-has-sticky-header {
    padding-top: var(--nexus-header-height, 80px);
}

/* ============================================================
   FOOTER BASE
   ============================================================ */
#nexus-footer {
    background: var(--nexus-footer-bg, #050505);
    color: var(--nexus-footer-text, #888);
    position: relative;
}

/* ============================================================
   CONTENT TYPOGRAPHY  
   ============================================================ */
.nexus-post-content h1,
.nexus-post-content h2,
.nexus-post-content h3,
.nexus-post-content h4,
.nexus-page-content h1,
.nexus-page-content h2,
.nexus-page-content h3,
.nexus-page-content h4 {
    margin: 1.5em 0 0.6em;
    color: var(--nexus-heading, #fff);
}

.nexus-post-content p,
.nexus-page-content p {
    margin-bottom: 1.2em;
}

.nexus-post-content a,
.nexus-page-content a {
    color: var(--nexus-accent, #6c63ff);
}

.nexus-post-content img,
.nexus-page-content img {
    border-radius: 12px;
    margin: 16px 0;
}

.nexus-post-content ul,
.nexus-post-content ol,
.nexus-page-content ul,
.nexus-page-content ol {
    padding-left: 24px;
    margin-bottom: 1.2em;
}

.nexus-post-content blockquote,
.nexus-page-content blockquote {
    border-left: 4px solid var(--nexus-accent, #6c63ff);
    padding: 16px 24px;
    margin: 24px 0;
    background: rgba(108, 99, 255, 0.06);
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

/* ============================================================
   ELEMENTOR INTEGRATION
   ============================================================ */
.elementor-page #nexus-content {
    min-height: unset;
}

.e-con,
.elementor-section {
    position: relative;
}

/* When Elementor renders full page (no header/footer override) */
body.elementor-page .nexus-main {
    padding: 0;
}

/* ============================================================
   UTILITY ANIMATIONS
   ============================================================ */
[data-nexus-anim] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-nexus-anim].nexus-animated {
    opacity: 1;
    transform: translateY(0);
}

[data-nexus-anim="fade-left"] {
    transform: translateX(-24px);
}

[data-nexus-anim="fade-right"] {
    transform: translateX(24px);
}

[data-nexus-anim="scale"] {
    transform: scale(0.92);
}

[data-nexus-anim="fade-left"].nexus-animated,
[data-nexus-anim="fade-right"].nexus-animated,
[data-nexus-anim="scale"].nexus-animated {
    transform: none;
}

/* ============================================================
   ELEMENTOR WIDGETS BASE (loaded via elementor/css/widgets.css too)
   ============================================================ */
.nexus-widget-wrap {
    position: relative;
}

/* ============================================================
   RTL (Right-to-Left) SUPPORT
   ============================================================ */
body.rtl {
    direction: rtl;
    unicode-bidi: embed;
}

body.rtl .nexus-post-content ul,
body.rtl .nexus-post-content ol,
body.rtl .nexus-page-content ul,
body.rtl .nexus-page-content ol {
    padding-left: 0;
    padding-right: 24px;
}

body.rtl .nexus-post-content blockquote,
body.rtl .nexus-page-content blockquote {
    border-left: none;
    border-right: 4px solid var(--nexus-accent, #6c63ff);
    border-radius: 12px 0 0 12px;
}

body.rtl .nexus-header-inner-wrap {
    flex-direction: row;
}

body.rtl .nexus-nav-menu {
    padding: 0;
}

body.rtl .nexus-tagline {
    margin-left: 0 !important;
    margin-right: 10px;
}

body.rtl .nexus-post-meta {
    flex-direction: row-reverse;
}

body.rtl .nexus-footer-nav li {
    margin-right: 0;
    margin-left: 20px;
}

/* ============================================================
   MOBILE RESPONSIVE — Header & Navigation
   ============================================================ */
@media (max-width: 1024px) {
    .nexus-header-inner-wrap {
        padding: 0 16px !important;
    }

    .nexus-nav-menu>li>a {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {

    /* Header mobile */
    #nexus-header {
        position: relative;
    }

    .nexus-header-nav {
        display: none !important;
    }

    .nexus-mobile-toggle {
        display: flex !important;
    }

    .nexus-header-inner-wrap {
        height: var(--nexus-header-height, 70px) !important;
        padding: 0 16px !important;
    }

    .nexus-logo-img {
        max-width: 120px;
    }

    .nexus-tagline {
        display: none !important;
    }

    .nexus-header-actions {
        gap: 6px;
    }

    /* Mobile Menu Active */
    .nexus-mobile-menu.active {
        display: block !important;
    }

    .nexus-mobile-nav {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .nexus-mobile-nav li {
        border-bottom: 1px solid var(--nexus-border, rgba(255, 255, 255, 0.06));
    }

    .nexus-mobile-nav a {
        display: block;
        padding: 14px 0;
        color: var(--nexus-text, #e8e8e8);
        font-size: 15px;
        font-weight: 500;
        text-decoration: none;
        transition: color 0.2s;
    }

    .nexus-mobile-nav a:hover {
        color: var(--nexus-accent, #6c63ff);
    }

    /* Footer mobile */
    .nexus-footer-widgets {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }

    .nexus-footer-bottom-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .nexus-footer-nav {
        justify-content: center;
    }

    /* Article mobile */
    .nexus-container[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .nexus-post-content {
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }

    .nexus-post-meta {
        font-size: 12px !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    .nexus-logo-text {
        font-size: 18px;
    }

    .nexus-post-content {
        font-size: 0.95rem !important;
    }

    .nexus-author-hero {
        padding: 40px 0 !important;
    }

    .nexus-author-hero img {
        width: 140px !important;
        height: 140px !important;
    }
}

/* ============================================================
   FOOTER WIDGETS LAYOUT
   ============================================================ */
.nexus-footer-widgets {
    display: grid;
    gap: 32px;
    padding: 60px 0;
}

.nexus-footer-cols-1 {
    grid-template-columns: 1fr;
}

.nexus-footer-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.nexus-footer-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.nexus-footer-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.nexus-footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    border-top: 1px solid var(--nexus-border, rgba(255, 255, 255, 0.06));
}

.nexus-footer-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nexus-footer-nav a {
    color: var(--nexus-footer-text, #888);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.nexus-footer-nav a:hover {
    color: var(--nexus-accent, #6c63ff);
}

/* Scroll Top Button */
.nexus-scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--nexus-accent, #6c63ff);
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.nexus-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nexus-scroll-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.5);
}

body.rtl .nexus-scroll-top {
    right: auto;
    left: 32px;
}

/* Author Header Social - RTL Fix */
body.rtl .nexus-author-hero .nexus-author-stats {
    flex-direction: row;
}

/* Sidebar Widget Styling */
.nexus-widget {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--nexus-surface);
    border-radius: 12px;
    border: 1px solid var(--nexus-border);
}

.nexus-widget-title {
    font-size: 1.15rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--nexus-accent);
}