/* ============================================
   NAI IT Theme - Layout
   Header, footer, container, grid, sections
   ============================================ */

/* ============================================
   Logo Dark/Light Toggle
   ============================================ */
.logo-light {
    display: none !important;
}

.light .logo-dark {
    display: none !important;
}

.light .logo-light {
    display: block !important;
}

/* ============================================
   Container
   ============================================ */
.container {
    width: 100%;
    max-width: 1224px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

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


.container--narrow {
    max-width: 960px;
}

.container--wide {
    max-width: 1440px;
}

/* ============================================
   Flex Layout
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.flex-1 { flex: 1; }

/* ============================================
   Grid System
   ============================================ */
.grid { display: grid; }

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   Header
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
    background: var(--bg-header-solid);
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-header__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.site-header__logo img {
    height: 36px;
    width: auto;
}

.site-header__nav {
    display: none;
}

@media (min-width: 1024px) {
    .site-header__nav {
        display: flex;
        align-items: center;
        gap: 4px;
    }
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Nav links */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.nav-link--cta {
    background: linear-gradient(135deg, var(--nai-primary), var(--nai-secondary));
    color: #ffffff !important;
    font-weight: 600;
}

.nav-link--cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 125, 183, 0.3);
    background: linear-gradient(135deg, var(--nai-primary), var(--nai-secondary));
}

/* Nav link as button (for dropdown triggers) */
button.nav-link,
button.nav-link--dropdown {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================
   Mega Menu
   ============================================ */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 999;
}

.mega-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu__inner {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 380px;
}

.mega-menu__tabs {
    border-right: 1px solid var(--border-subtle);
    padding: 16px 0;
}

.mega-menu__tab {
    display: block;
    width: 100%;
    padding: 14px 24px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-family: var(--font-sans);
}

.mega-menu__tab:hover,
.mega-menu__tab.active {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-left-color: var(--nai-primary);
}

.mega-menu__content {
    padding: 24px 32px;
}

.mega-menu__panel {
    display: none;
}

.mega-menu__panel.active {
    display: block;
}

.mega-menu__hero {
    margin-bottom: 24px;
}

.mega-menu__hero-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mega-menu__hero-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.mega-menu__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mega-menu__card {
    padding: 16px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
    text-decoration: none;
}

.mega-menu__card:hover {
    border-color: var(--border-color);
    background: var(--bg-card);
}

.mega-menu__card-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mega-menu__card-desc {
    font-size: 0.75rem;
    color: var(--text-subtle);
    line-height: 1.4;
}

.mega-menu__card-tag {
    display: inline-block;
    padding: 2px 8px;
    margin-top: 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--border-subtle);
    color: var(--text-muted);
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: var(--bg-surface);
}

@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.mobile-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-page);
    z-index: 998;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu__link {
    display: block;
    padding: 14px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle);
    transition: color 0.2s ease;
}

.mobile-menu__link:hover {
    color: var(--nai-primary);
}

.mobile-menu__sub {
    padding-left: 16px;
}

.mobile-menu__sub-link {
    display: block;
    padding: 10px 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
    text-decoration: none;
}

.mobile-menu__sub-link:hover {
    color: var(--text-primary);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding-top: 64px;
    padding-bottom: 0;
}

.site-footer__grid {
    display: grid;
    gap: 32px;
    margin-bottom: 48px;
}

@media (min-width: 640px) {
    .site-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .site-footer__grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }
}

.site-footer__brand {
    max-width: 320px;
}

.site-footer__brand img {
    height: 32px;
    margin-bottom: 16px;
}

.site-footer__brand p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 20px;
}

.site-footer__social {
    display: flex;
    gap: 12px;
}

.site-footer__social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-surface);
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
}

.site-footer__social-link:hover {
    background: var(--nai-primary);
    color: #ffffff;
}

.site-footer__col-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.site-footer__link {
    display: block;
    padding: 6px 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__link:hover {
    color: var(--text-primary);
}

.site-footer__bottom {
    border-top: 1px solid var(--border-subtle);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .site-footer__bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.site-footer__copyright {
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.site-footer__legal {
    display: flex;
    gap: 24px;
}

.site-footer__legal a {
    font-size: 0.8125rem;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__legal a:hover {
    color: var(--text-primary);
}

/* ============================================
   Sections
   ============================================ */
.section {
    padding: 80px 0;
}
.section-clients-carousel {
    padding: 16px 0;
}

.section--surface {
    background: var(--bg-surface);
}

.section--page {
    background: var(--bg-page);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header > * + * {
    margin-top: 16px;
}

@media (min-width: 768px) {
    .section {
        padding: 120px 0;
    }

    .section-clients-carousel {
    padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 64px;
    }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 72px;
    padding-bottom: 80px;
}

@media (min-width: 1024px) {
    .hero {
        padding-top: 120px;
    }
}

.hero.hero--inner {
    min-height: auto;
    padding-top: 160px;
    padding-bottom: 80px;
}

.hero.hero--blog {
    padding-top: 130px;
    padding-bottom: 50px;
}

/* Two-column grid: text left, visual right */
.hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
    width: 100%;
}

@media (min-width: 1024px) {
    .hero__grid {
        grid-template-columns: 1fr 1fr;
        gap: 64px;
    }
}

.hero__content {
    position: relative;
    z-index: 2;
}

.hero__visual {
    display: none;
    position: relative;
    z-index: 2;
}

@media (min-width: 1024px) {
    .hero__visual {
        display: block;
    }
}

/* Badge pulse */
.hero__badge {
    position: relative;
}

.hero__badge-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 6px;
    animation: hero-pulse 2s ease-in-out infinite;
}

@keyframes hero-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

.hero__title {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero__title .text-gradient {
    background: linear-gradient(135deg, var(--nai-primary), var(--nai-secondary), #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .hero__title {
        font-size: 3.5rem;
    }
}

@media (min-width: 1024px) {
    .hero__title {
        font-size: 3.75rem;
    }
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 580px;
    margin-bottom: 32px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Background effects */
.hero__bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.hero__bg-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
}

.hero__bg-glow--right {
    top: -80px;
    right: -80px;
    width: 384px;
    height: 384px;
    background: rgba(0, 125, 183, 0.2);
}

.hero__bg-glow--left {
    bottom: -80px;
    left: -80px;
    width: 320px;
    height: 320px;
    background: rgba(0, 98, 213, 0.2);
}

/* ============================================
   Dashboard Preview (Hero mock)
   ============================================ */
.dashboard-preview {
    position: relative;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.dashboard-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dashboard-preview__dots {
    display: flex;
    gap: 8px;
}

.dashboard-preview__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dashboard-preview__dot--red { background: rgba(239, 68, 68, 0.6); }
.dashboard-preview__dot--yellow { background: rgba(234, 179, 8, 0.6); }
.dashboard-preview__dot--green { background: rgba(34, 197, 94, 0.6); }

.dashboard-preview__title {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-subtle);
}

/* Stats row */
.dashboard-preview__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-preview__stat {
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 12px;
    text-align: center;
}

.dashboard-preview__stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-preview__stat-value--blue { color: #60A5FA; }
.dashboard-preview__stat-value--green { color: #34D399; }
.dashboard-preview__stat-value--amber { color: #FBBF24; }
.dashboard-preview__stat-value--violet { color: #A78BFA; }

.dashboard-preview__stat-label {
    display: block;
    font-size: 0.625rem;
    color: var(--text-subtle);
    margin-top: 2px;
}

/* Chart */
.dashboard-preview__chart {
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 16px;
}

.dashboard-preview__bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 96px;
}

.dashboard-preview__bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(to top, var(--nai-primary), var(--nai-secondary));
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.dashboard-preview__bar:hover {
    opacity: 1;
}

/* Modules */
.dashboard-preview__modules {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.dashboard-preview__module {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 8px 12px;
}

.dashboard-preview__module-icon { flex-shrink: 0; }
.dashboard-preview__module-icon--blue { color: #60A5FA; }
.dashboard-preview__module-icon--green { color: #34D399; }
.dashboard-preview__module-icon--amber { color: #FBBF24; }
.dashboard-preview__module-icon--violet { color: #A78BFA; }

.dashboard-preview__module-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dashboard-preview__module-status {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34D399;
}

/* Glow effects */
.dashboard-preview__glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
}

.dashboard-preview__glow--tr {
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(0, 98, 213, 0.2);
}

.dashboard-preview__glow--bl {
    bottom: -40px;
    left: -40px;
    width: 128px;
    height: 128px;
    background: rgba(0, 125, 183, 0.2);
}

/* ============================================
   Utility: Spacing
   ============================================ */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }

/* ============================================
   Utility: Text
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* ============================================
   Utility: Visibility
   ============================================ */
.hidden { display: none !important; }

@media (max-width: 1023px) {
    .lg\:hidden { display: none !important; }
}

@media (min-width: 1024px) {
    .lg\:flex { display: flex !important; }
    .lg\:block { display: block !important; }
}

@media (max-width: 767px) {
    .md\:hidden { display: none !important; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex !important; }
    .md\:block { display: block !important; }
}

/* ============================================
   Utility: Colors (theme-aware)
   ============================================ */
.bg-page { background-color: var(--bg-page); }
.bg-card { background-color: var(--bg-card); }
.bg-surface { background-color: var(--bg-surface); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.border-themed { border-color: var(--border-color); }
.border-subtle { border-color: var(--border-subtle); }

/* ============================================
   WordPress Specific
   ============================================ */
.wp-block-post-content { /* Gutenberg content */ }

/* Alignments for Gutenberg */
.alignwide {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    width: 100vw;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--nai-primary);
    color: #ffffff;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
