/*
Theme Name: Inverce Theme
Description: Custom WordPress theme for Inverce.io. with ACF integration.
Author: Julian Remmers
Version: 1.0.0
Text Domain: inverce
*/

/* Core styles moved from HTML */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--dark-color, #000);
}

/* Hide Nav on Author Business Card Pages */
.author #main-nav {
    display: none !important;
}


.hero-bg {
    background: linear-gradient(-45deg, var(--dark-color, #000), #2d0e5e, var(--brand-color, #7a45ff), #1a0b2e, var(--dark-color, #000));
    background-size: 300% 300%;
    animation: gradientMove 12s ease-in-out infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.bg-brand-primary {
    background-color: var(--brand-color, #7a45ff);
}

.text-brand-primary {
    color: var(--brand-color, #7a45ff);
}

.tight-tracking {
    letter-spacing: -0.02em;
}

.grid-overlay {
    background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 80px 80px;
}

.bottom-shade {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.menu-icon-mobile {
    display: none;
}

/* Fixed Nav Styles */
#main-nav {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 1200px;
    border-radius: 9999px;
    z-index: 100;
    min-height: 80px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

@media (max-width: 767px) {
    #main-nav {
        top: auto;
        bottom: 1.5rem;
        left: 0;
        right: 0;
        width: min(calc(100% - 2.5rem), 480px);
        margin: 0 auto;
        transform: none;
        /* Ensure no transform is applied on mobile */
        min-height: 80px;
        padding: 0.5rem 0.5rem !important;
        background-color: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 2.5rem;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    }

    #main-nav::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        z-index: -1;
    }

    .desktop-logo {
        display: none !important;
    }

    .nav-links-container {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
    }

    .nav-menu-item {
        padding: 0.5rem;
        border-radius: 999px;
        /* Pill shape */
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 64px;
        align-self: center;
        margin: 0 4px;
        border: 1px solid transparent;
    }

    /* Active Item Highlight */
    .nav-menu-item.current-menu-item,
    .nav-menu-item.active {
        background-color: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .menu-icon-mobile {
        display: flex !important;
        width: 24px;
        height: 24px;
        margin-bottom: 2px;
        color: #fff;
        transition: all 0.3s ease;
    }

    .menu-icon-mobile svg {
        width: 100%;
        height: 100%;
        display: block;
        fill: currentColor;
    }

    .menu-icon-mobile svg * {
        fill: none !important;
        stroke: currentColor !important;
    }

    .menu-label {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: -0.01em;
        text-transform: none !important;
        color: rgba(255, 255, 255, 0.7);
    }

    /* Active Item Coloring */
    .current-menu-item .menu-icon-mobile,
    .current-menu-item .menu-label,
    .nav-menu-item.active .menu-icon-mobile,
    .nav-menu-item.active .menu-label {
        color: var(--brand-color, #ff007f) !important;
    }

    .current-menu-item .menu-label,
    .nav-menu-item.active .menu-label {
        color: #fff !important;
    }

    /* Submenu as floating card above menu */
    .sub-menu {
        position: absolute !important;
        bottom: calc(100% + 1rem) !important;
        /* Place it just above the nav bar */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        /* Inherit width from the nav bar */
        top: auto !important;
        height: auto !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 1.5rem !important;
        display: none !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        align-items: center !important;
        z-index: 100 !important;
        margin: 0 !important;
        padding: 1rem 0 !important;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    }

    /* Important: We need the parent #main-nav to be relative to position the absolute child relative to it. However, the child is inside .nav-menu-item. We must make sure .nav-menu-item is not positioned relative, so the absolute child relates to #main-nav */
    .nav-menu-item {
        position: static !important;
        /* Forces the absolute submenu to relate to the #main-nav relative wrapper */
    }

    #main-nav {
        position: fixed;
        /* Ensures the whole block is what absolute children align to */
    }

    .nav-menu-item.active .sub-menu {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }

    .sub-menu li {
        text-align: center;
        margin-bottom: 0 !important;
        width: 100%;
    }

    .sub-menu li a {
        display: block !important;
        font-size: 1.25rem !important;
        font-weight: 600 !important;
        color: rgba(255, 255, 255, 0.8) !important;
        padding: 0.85rem 1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .sub-menu li:last-child a {
        border-bottom: none;
    }

    .sub-menu li a:hover {
        color: var(--brand-color) !important;
    }

    /* Hide submenu arrows on mobile */
    .nav-menu-item.menu-item-has-children>a::after {
        display: none !important;
    }
}

@media (min-width: 768px) {
    #main-nav.scrolled {
        background-color: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    }

    #main-nav.scrolled a,
    #main-nav.scrolled span,
    #main-nav.scrolled .nav-menu-item {
        color: #000 !important;
    }
}

/* Force Logo Styles */
.nav-logo,
.custom-logo,
.nav-logo-container img {
    height: 1.25rem !important;
    width: auto !important;
    filter: brightness(0) invert(1) !important;
    transition: filter 0.5s ease;
}

.custom-logo:hover {
    opacity: 0.6 !important;
}

.custom-logo-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 0;
}

#main-nav.scrolled .nav-logo,
#main-nav.scrolled .custom-logo,
#main-nav.scrolled .nav-logo-container img {
    filter: brightness(0) !important;
}

#main-nav.scrolled .btn-pill {
    border-color: rgba(0, 0, 0, 0.2) !important;
    color: #000 !important;
}

#main-nav.scrolled .btn-pill:hover {
    background-color: #000 !important;
    color: #fff !important;
}

/* Standardized Button Class */
.btn-pill {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    border-radius: 9999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    text-align: center;
}

/* Glass Button Style */
.btn-glass {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #000 !important;
}

.btn-glass:hover {
    background-color: rgba(255, 255, 255, 0.45);
    border-color: rgba(0, 0, 0, 0.15);
    color: #000 !important;
}

/* Scrolled Nav overrides (already exist but for reference) */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    user-select: none;
    overflow-x: auto;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.hide-scrollbar:active {
    cursor: grabbing;
    scroll-snap-type: none;
}

.snap-card {
    scroll-snap-align: center;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .snap-card {
        scroll-snap-align: start;
    }
}

/* Standardized Card Style */
.premium-card {
    position: relative;
    border-radius: 2.5rem;
    height: 100%;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.premium-card .card-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.7s ease;
}

.premium-card:hover .card-bg-img {
    transform: scale(1.08);
}

.card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.0) 80%);
    z-index: 1;
}

.premium-card .card-content {
    position: relative;
    z-index: 2;
    padding: 2.5rem;
    width: 100%;
    margin-top: auto;
    /* Pushes content to bottom without taking full height */
    border-radius: 2.5rem;
}

.premium-card .card-icon-dynamic {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.capitalize {
    text-transform: capitalize !important;
}

.method-line {
    background: linear-gradient(to bottom, var(--brand-color, #7a45ff) 0%, transparent 100%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.is-visible {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Staggered delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* Container standardization */
.section-container {
    max-width: 72rem;
    /* Tailwind equivalent to 6xl */
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Pagination */
.navigation.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.navigation.pagination .page-numbers {
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.navigation.pagination .page-numbers.current,
.navigation.pagination .page-numbers:hover {
    background: var(--brand-color);
    color: #000;
    border-color: var(--brand-color);
}

/* Prose refinement */
.prose {
    color: #334155;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: #000;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.prose strong {
    color: #000;
}

.prose a {
    color: var(--brand-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.prose a:hover {
    border-bottom-color: var(--brand-color);
}

/* Submenu Styles - Desktop Specific */
@media (min-width: 768px) {
    .nav-menu-item {
        position: relative;
        display: flex;
        align-items: center;
    }

    .nav-menu-item a:hover {
        opacity: 0.5;
    }

    /* Ensure the parent link doesn't take up full width if it has children */
    .nav-menu-item.menu-item-has-children>a::after {
        content: '▾';
        margin-left: 0.5rem;
        font-size: 0.8rem;
        opacity: 0.6;
    }

    .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #111;
        min-width: 220px;
        padding: 1rem 0;
        border-radius: 1.5rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 0.5rem;
    }

    .nav-menu-item:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .sub-menu li {
        padding: 0;
        width: 100%;
        margin: 0;
    }

    .sub-menu li a {
        display: block;
        padding: 0.75rem 1.5rem;
        color: #ffffff;
        font-size: 0.85rem;
        font-weight: 500;
        text-transform: none;
        letter-spacing: normal;
        transition: all 0.2s ease;
        width: 100%;
    }

    .sub-menu li a:hover {
        color: var(--brand-color);
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Scrolled state for submenu - DESKTOP ONLY */
@media (min-width: 768px) {
    #main-nav.scrolled .sub-menu {
        background: #ffffff;
        border-color: rgba(0, 0, 0, 0.05);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    #main-nav.scrolled .sub-menu li a {
        color: #555 !important;
        /* Dark text for the white background on desktop */
    }

    #main-nav.scrolled .sub-menu li a:hover {
        color: #000 !important;
        background: rgba(0, 0, 0, 0.03) !important;
    }
}

/* MOBILE Submenu (Always stays dark/white text) */
@media (max-width: 767px) {
    .sub-menu {
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(25px) !important;
    }

    .sub-menu li a {
        color: #ffffff !important;
    }
}

/* Rounded corners for block editor images */
.prose img,
.wp-block-image img,
.wp-block-cover img,
.wp-block-video video {
    border-radius: 1.5rem;
}

.wp-block-image {
    margin-bottom: 2rem;
}