/* ========================================
   MN HEADING STYLES
   ======================================== */

/* Wrapper */
.mn-heading-wrapper {
    width: 100%;
    display: block;
}

.mn-heading-wrapper a {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

/* Individual Part Link */
.mn-heading a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.mn-heading a:hover {
    opacity: 0.8;
}

/* Heading Base */
.mn-heading {
    margin: 0;
    padding: 0;
    display: inline;
    /* line-height: Set on .mn-heading-part for better individual control */
}

/* Line Break Spacing */
.mn-heading-part.mn-has-line-break {
    display: block;
}

/* Heading Part */
.mn-heading-part {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 0;
    line-height: 1.3; /* Default for desktop */
    transition: all 0.3s ease;
    vertical-align: baseline;
}

/* Tablet: 1.2 line height */
@media (max-width: 1024px) {
    .mn-heading-part {
        line-height: 1.2;
    }
}

/* Mobile: 1.2 line height */
@media (max-width: 767px) {
    .mn-heading-part {
        line-height: 1.2;
    }
}

.mn-heading-part:last-child {
    margin-right: 0;
}

/* ========================================
   GRADIENT EFFECT
   ======================================== */

.mn-effect-gradient {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
}

/* Gradient Animation on Hover */
.mn-heading-wrapper a:hover .mn-effect-gradient {
    background-size: 200% auto;
    animation: mn-gradient-shift 3s ease infinite;
}

@keyframes mn-gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ========================================
   UNDERLINE EFFECT
   ======================================== */

.mn-effect-underline {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.mn-effect-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--underline-height, 3px);
    background: var(--underline-color, #667eea);
    transform-origin: left;
    transition: transform 0.3s ease;
}

/* Underline Animation Variants */
.mn-effect-underline.mn-underline-animate::after {
    transform: scaleX(0);
}

.mn-heading-wrapper:hover .mn-effect-underline.mn-underline-animate::after,
.mn-heading-wrapper a:hover .mn-effect-underline.mn-underline-animate::after {
    transform: scaleX(1);
}

/* Stylish Underline with Offset */
.mn-effect-underline.mn-global-underline {
    padding-bottom: calc(var(--underline-offset, 5px) + var(--underline-height, 3px));
}

.mn-effect-underline.mn-global-underline::after {
    bottom: var(--underline-offset, 5px);
    border-radius: 2px;
}

/* Wavy Underline */
.mn-effect-underline.mn-underline-wavy::after {
    background: repeating-linear-gradient(
        90deg,
        var(--underline-color, #667eea) 0px,
        var(--underline-color, #667eea) 10px,
        transparent 10px,
        transparent 15px
    );
    height: 2px;
}

/* Dotted Underline */
.mn-effect-underline.mn-underline-dotted::after {
    background: repeating-linear-gradient(
        90deg,
        var(--underline-color, #667eea) 0px,
        var(--underline-color, #667eea) 5px,
        transparent 5px,
        transparent 10px
    );
}

/* ========================================
   HIGHLIGHT EFFECT
   ======================================== */

.mn-effect-highlight {
    background-color: rgba(255, 215, 0, 0.3);
    padding: 0 8px;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: background-color 0.3s ease;
}

.mn-heading-wrapper a:hover .mn-effect-highlight {
    background-color: rgba(255, 215, 0, 0.5);
}

/* Highlight Variants */
.mn-effect-highlight.mn-highlight-marker {
    background: linear-gradient(
        180deg,
        transparent 60%,
        rgba(255, 215, 0, 0.4) 60%
    );
    padding: 0;
}

.mn-effect-highlight.mn-highlight-box {
    box-shadow: inset 0 -0.5em 0 rgba(255, 215, 0, 0.4);
    background: transparent;
}

/* ========================================
   OUTLINE EFFECT
   ======================================== */

.mn-effect-outline {
    -webkit-text-stroke: 2px #000000;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
}

.mn-heading-wrapper a:hover .mn-effect-outline {
    -webkit-text-fill-color: currentColor;
    -webkit-text-stroke: 0px transparent;
}

/* ========================================
   SHADOW EFFECT
   ======================================== */

.mn-effect-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: text-shadow 0.3s ease;
}

.mn-heading-wrapper a:hover .mn-effect-shadow {
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4);
}

/* 3D Shadow Effect */
.mn-effect-shadow.mn-shadow-3d {
    text-shadow: 
        1px 1px 0 rgba(0, 0, 0, 0.2),
        2px 2px 0 rgba(0, 0, 0, 0.2),
        3px 3px 0 rgba(0, 0, 0, 0.2),
        4px 4px 0 rgba(0, 0, 0, 0.2);
}

/* Neon Shadow Effect */
.mn-effect-shadow.mn-shadow-neon {
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 30px currentColor;
}

/* ========================================
   ADDITIONAL EFFECTS
   ======================================== */

/* Glitch Effect */
.mn-effect-glitch {
    position: relative;
    display: inline-block;
}

.mn-effect-glitch::before,
.mn-effect-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mn-effect-glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00de;
    clip: rect(24px, 550px, 90px, 0);
    animation: mn-glitch-anim-2 3s infinite linear alternate-reverse;
}

.mn-effect-glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip: rect(85px, 550px, 140px, 0);
    animation: mn-glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes mn-glitch-anim {
    0% {
        clip: rect(17px, 9999px, 94px, 0);
    }
    20% {
        clip: rect(76px, 9999px, 62px, 0);
    }
    40% {
        clip: rect(2px, 9999px, 20px, 0);
    }
    60% {
        clip: rect(83px, 9999px, 40px, 0);
    }
    80% {
        clip: rect(44px, 9999px, 92px, 0);
    }
    100% {
        clip: rect(61px, 9999px, 11px, 0);
    }
}

@keyframes mn-glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 119px, 0);
    }
    20% {
        clip: rect(36px, 9999px, 85px, 0);
    }
    40% {
        clip: rect(115px, 9999px, 72px, 0);
    }
    60% {
        clip: rect(50px, 9999px, 15px, 0);
    }
    80% {
        clip: rect(99px, 9999px, 53px, 0);
    }
    100% {
        clip: rect(2px, 9999px, 67px, 0);
    }
}

/* Typing Effect */
.mn-effect-typing {
    overflow: hidden;
    border-right: 2px solid currentColor;
    white-space: nowrap;
    animation: mn-typing 3.5s steps(40, end), mn-blink-caret 0.75s step-end infinite;
}

@keyframes mn-typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes mn-blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: currentColor;
    }
}

/* Split Color Effect */
.mn-effect-split {
    background: linear-gradient(
        90deg,
        #667eea 0%,
        #667eea 50%,
        #764ba2 50%,
        #764ba2 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .mn-heading-part {
        margin-right: 5px;
    }

    .mn-effect-highlight {
        padding: 0 5px;
    }

    .mn-effect-underline {
        padding-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .mn-heading-part {
        margin-right: 3px;
    }

    .mn-effect-highlight {
        padding: 0 3px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus States */
.mn-heading-wrapper a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.mn-heading-wrapper a:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .mn-heading-part,
    .mn-effect-gradient,
    .mn-effect-underline::after,
    .mn-effect-highlight,
    .mn-effect-outline,
    .mn-effect-shadow {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .mn-effect-gradient {
        -webkit-text-fill-color: currentColor;
        background: none;
    }

    .mn-effect-outline {
        -webkit-text-fill-color: currentColor;
        -webkit-text-stroke: 0;
    }
}

/* Print Styles */
@media print {
    .mn-heading-wrapper {
        page-break-inside: avoid;
    }

    .mn-effect-gradient {
        -webkit-text-fill-color: #000;
        background: none;
    }

    .mn-effect-outline {
        -webkit-text-fill-color: #000;
        -webkit-text-stroke: 0;
    }

    .mn-effect-underline::after {
        display: none;
    }
}

/* ========================================
   ELEMENTOR EDITOR STYLES
   ======================================== */

.elementor-editor-active .mn-heading-wrapper {
    min-height: 40px;
}

.elementor-editor-active .mn-heading-part {
    pointer-events: none;
}
