/* meaningify-base.css - Core Visual Styles (v2.2.0 with 3D Effects) */

/* --- 1. 3D Background Effect --- */
.mn-3d-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.mn-3d-background::before,
.mn-3d-background::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 8s ease-in-out infinite;
}

.mn-3d-background::before {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.mn-3d-background::after {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    bottom: -150px;
    left: -150px;
    animation-delay: -4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(10deg);
    }
}

/* Light mode 3D background */
body:not(.dark-mode) .mn-3d-bg-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(59, 130, 246, 0.05) 0%, transparent 70%),
        linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

/* --- 2. Glassmorphism Cards --- */
.mn-glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--mn-radius-lg, 16px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: var(--mn-transition-3d, transform 0.5s cubic-bezier(0.23, 1, 0.32, 1));
}

.mn-glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 40px rgba(139, 92, 246, 0.2);
}

/* --- 3. 3D Title Hover Effects --- */
.mn-card,
.wp-block-query .wp-block-group {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.mn-card .wp-block-post-title,
.wp-block-post-title a,
.mn-title-3d {
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    position: relative;
}

.mn-card:hover .wp-block-post-title,
.wp-block-post-title a:hover,
.mn-title-3d:hover {
    transform: translateZ(20px) rotateX(-5deg);
    text-shadow:
        0 5px 15px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- 4. Card Styles with 3D lift --- */
.mn-card {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--mn-border-color);
    padding: 1.5rem;
    border-radius: var(--mn-radius-lg, 16px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.mn-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(139, 92, 246, 0.1) 0%,
            rgba(236, 72, 153, 0.05) 50%,
            rgba(59, 130, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.mn-card:hover {
    transform: translateY(-10px) rotateX(2deg);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(139, 92, 246, 0.2);
}

.mn-card:hover::before {
    opacity: 1;
}

/* Featured Number (Trending list) */
.mn-trending-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--mn-accent-purple, #8b5cf6), var(--mn-accent-pink, #ec4899));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 1rem;
    line-height: 1;
}

/* --- 5. Typography Utils --- */
.mn-meta {
    font-family: var(--mn-font-sans);
    font-size: 0.85rem;
    color: var(--mn-text-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mn-title-huge {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1px;
}

/* --- 6. Yellow Highlight --- */
.mn-text-yellow-highlight {
    background-color: var(--mn-accent-yellow);
    color: var(--mn-text-black);
    padding: 2px 6px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Annotation Effect */
.mn-annotation {
    background-color: rgba(255, 255, 100, 0.3);
    cursor: help;
    transition: background-color 0.2s;
    border-bottom: 2px solid var(--mn-accent-yellow);
}

.mn-annotation:hover {
    background-color: var(--mn-accent-yellow);
}

/* --- 7. Layout Overrides --- */
.mn-sidebar-sticky {
    position: sticky;
    top: 2rem;
}

/* --- 8. Button Overrides with 3D --- */
.wp-block-button__link {
    border: 2px solid black !important;
    background: transparent !important;
    color: black !important;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
    position: relative;
    overflow: hidden;
}

.wp-block-button__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.wp-block-button__link:hover {
    background: black !important;
    color: var(--mn-accent-yellow) !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.wp-block-button__link:hover::before {
    left: 100%;
}

/* --- 9. Form Styles with Glow --- */
input[type="text"],
input[type="email"],
input[type="search"] {
    border: 2px solid #e3e3e3;
    border-radius: var(--mn-radius-lg, 16px);
    padding: 14px 20px;
    font-family: var(--mn-font-sans);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus {
    outline: none;
    border-color: var(--mn-accent-purple, #8b5cf6);
    box-shadow:
        0 0 0 4px rgba(139, 92, 246, 0.2),
        0 10px 40px rgba(139, 92, 246, 0.1);
}

/* --- 10. Featured Image Fallback --- */
.mn-fallback-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* --- 11. TikTok Embed Fix --- */
.tiktok-embed,
blockquote.tiktok-embed {
    max-width: 605px;
    min-width: 325px;
    margin: 20px auto !important;
}

/* --- 12. Featured Image in Query Loop --- */
.wp-block-post-featured-image {
    overflow: hidden;
    border-radius: var(--mn-radius-lg, 16px);
}

.wp-block-post-featured-image img {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mn-card:hover .wp-block-post-featured-image img {
    transform: scale(1.05);
}

/* --- 13. Social Media & Video Embed Fixes --- */
/* Ensure embeds are always on top and clickable */
iframe,
.tiktok-embed,
.twitter-tweet,
.instagram-media,
.wp-block-embed__wrapper {
    position: relative;
    z-index: 20 !important;
    /* Above hover overlays */
    pointer-events: auto !important;
    transform: translateZ(1px);
    /* Force layer promotion */
    max-width: 100%;
}

/* Fix for TikTok specifically */
blockquote.tiktok-embed {
    margin: 0 auto !important;
    display: block !important;
}

/* Responsive video wrapper */
.wp-block-embed-youtube .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--mn-radius-lg, 16px);
}

.wp-block-embed-youtube .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Remove 3D effect from direct video containers if needed to prevent click-jacking */
.has-embeds .mn-card {
    transform-style: flat;
}