/* --- BANISHING THE HERO GHOSTS --- */
.page-modus-moment .carousel-page-top .carousel-item .carousel-caption {
    /* 1. Reset Verticality */
    top: auto !important;          /* Kills the calc(50% + 50px) */
    bottom: 4rem !important;       /* The exact gap from the bottom you want */
    transform: none !important;    /* Kills the translateY(-50%) shift */
    
    /* 2. Reset Positioning & Width */
    position: absolute !important; 
    left: 15.625% !important;      /* Keeps your standard left margin */
    right: auto !important;        /* Prevents the 'right' value from pulling it back */
    max-width: 70% !important;     /* Increased from 50% to give text more room */
    
    /* 3. Cleanup */
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure the parent doesn't try to flex-center it anymore */
.page-modus-moment #carouselPageHeader .carousel-item {
    display: block !important; /* Standard block display works best with absolute children */
    aspect-ratio: 16 / 8 !important;
    min-height: 550px !important;
    background-position: center 20% !important;
}

/* --- 1. THE HERO FRAME (Enforcing Ratio & Bottom Gravity) --- */
.page-modus-moment #carouselPageHeader .carousel-item {
    display: flex !important;
    flex-direction: column !important;
    
    /* Pushes everything to the bottom of the image */
    justify-content: flex-end !important; 
    
    /* The 4rem Gap you requested from the bottom */
    padding-bottom: 6rem !important; 
    
    /* Minimum Ratio to protect faces (16:8 is standard cinematic) */
    aspect-ratio: 16 / 8 !important; 
    min-height: 550px !important; 
    
    /* Focal Point: Crops from the bottom up to keep heads in frame */
    background-size: cover !important;
    background-position: center 20% !important; 
}

/* --- 2. THE CONTENT (Left-Aligned Grid) --- */
.page-modus-moment #carouselPageHeader .carousel-caption {
    /* Set to relative so it follows the parent's Flexbox gravity */
    position: relative !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    
    /* Left Margin: Aligns with your Logo and standard site grid */
    padding-left: 15.625% !important; 
    padding-right: 5% !important;
    
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-align: left !important;
}

/* --- 3. MOBILE HERO ADJUSTMENTS --- */
@media (max-width: 767px) {
    .page-modus-moment #carouselPageHeader .carousel-item {
        /* Taller ratio for mobile (4:5) to prevent text from covering faces */
        aspect-ratio: 4 / 5 !important; 
        min-height: 500px !important;
        padding-bottom: 3rem !important; /* Slightly tighter on mobile */
    }
    
    .page-modus-moment #carouselPageHeader .carousel-caption {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

/* --- MODUS MOMENT: LOGO MARQUEE --- */
.page-modus-moment .client-logos {
    background-color: transparent !important; /* Removes bg-secondary */
    padding: 4rem 0 !important;
    overflow: hidden; /* Hides the logos as they slide out */
    position: relative;
    
    /* Fade effect on the edges */
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.page-modus-moment .client-logos .container {
    max-width: none !important; /* Allow the track to expand beyond screen width */
    width: 100%;
    padding: 0;
}

.page-modus-moment .client-logos .row {
    display: flex !important;
    flex-wrap: nowrap !important; /* Force all logos onto one line */
    width: max-content !important; /* Essential: container grows to fit all logos */
    animation: marqueeEternal 40s linear infinite !important;
}

/* --- KILL AOS ENTRANCE ANIMATIONS --- */
.page-modus-moment .client-logos [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    visibility: visible !important;
}

/* --- LOGO ITEM STYLING --- */
.page-modus-moment .client-logos .col-6, 
.page-modus-moment .client-logos .col-lg-3 {
    flex: 0 0 auto !important; /* Prevents Bootstrap from shrinking the logos */
    width: 240px !important; /* Adjust this to control spacing between logos */
    padding: 0 3rem;
}

.page-modus-moment .client-logos .image-link {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.page-modus-moment .client-logos img {
    max-height: 45px;
    width: auto;
    filter: grayscale(100%); /* Pro-standard look */
    opacity: 0.5;
    transition: all 0.3s ease;
}

.page-modus-moment .client-logos img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* --- THE LOOP ANIMATION --- */
@keyframes marqueeEternal {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Resets seamlessly if content is duplicated */
}

/* Pause on hover so people can read the logos */
.page-modus-moment .client-logos:hover .row {
    animation-play-state: paused;
}

/* --- 2. GLOBAL BUTTONS: PINK TO BLACK (NO MOVEMENT) --- */
.page-modus-moment :not(.navbar) .btn-light,
.page-modus-moment :not(.navbar) .btn-danger {
    background-color: #FF2A6F !important;
    border-color: #FF2A6F !important;
    color: #ffffff !important;
    transition: background-color 0.25s ease-in-out !important;
    transform: none !important;
}

.page-modus-moment :not(.navbar) .btn-light:hover,
.page-modus-moment :not(.navbar) .btn-danger:hover {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    transform: none !important; /* Strictly stops movement */
}

/* --- 3. HERO: EYEBROW & DESCRIPTION --- */
.page-modus-moment #carouselPageHeader .md-title-alt {
    color: #FF2A6F !important;
    /* Eyebrow Large Clamp: 34px to 28px */
    font-size: clamp(1.75rem, 1.571rem + 0.75vw, 2.125rem) !important;
    line-height: 1.3 !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
    aspect-ratio: auto !important;
    min-width: auto !important;
}

.page-modus-moment #carouselPageHeader h2 {
    max-width: 42rem !important; /* 672px */
    width: 100% !important;
    display: block !important;
}

/* --- 4. STEP NUMBERS: PINK CIRCLES --- */
.page-modus-moment .md-text-and-image .md-title-alt {
    background-color: #FF2A6F !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem !important;
    aspect-ratio: 1 / 1 !important;
    min-width: 3.5rem !important;
    font-family: ClashDisplay-Bold !important;
    font-size: 2rem !important;
    line-height: 1 !important;
    margin-bottom: 0.75rem !important;
}

/* --- 5. BODY TEXT FIX (REMOVING INLINE BLACK) --- */
.page-modus-moment .md-text-and-image .mb-5 p span {
    color: #3d4550 !important;
}


/* --- MODUS MOMENT: GLOBAL PINK BUTTONS (EXCLUDING NAVBAR) --- */
.page-modus-moment :not(.navbar) .btn-light,
.page-modus-moment :not(.navbar) .btn-danger,
.page-modus-moment :not(.navbar) .md-contact-btn,
.page-modus-moment :not(.navbar) .btn-primary {
    /* 1. Base State: Hot Pink */
    background-color: #FF2A6F !important;
    border-color: #FF2A6F !important;
    color: #ffffff !important;
    
    /* 2. Transition & Stability */
    transition: all 0.25s ease-in-out !important;
}

/* --- HOVER STATE: SOLID BLACK --- */
.page-modus-moment :not(.navbar) .btn-light:hover,
.page-modus-moment :not(.navbar) .btn-danger:hover,
.page-modus-moment :not(.navbar) .md-contact-btn:hover,
.page-modus-moment :not(.navbar) .btn-primary:hover,
.page-modus-moment :not(.navbar) .btn-light:focus {
    /* 1. Colors: Black background & White text */
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    
}

/* --- HERO: EYEBROW LARGE --- */
.page-modus-moment .carousel-caption .md-title-alt {
    color: #FF2A6F !important;
    font-size: clamp(1.75rem, 1.571rem + 0.75vw, 2.125rem) !important;
    line-height: 1.3 !important; /* 130% */
    
    /* Reset circle styles from the step numbers */
    background: none !important;
    padding: 0 !important;
    display: block !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
    min-width: auto !important;
}

/* --- Modus Moment: Step Number Styling (Circles) --- */
.page-modus-moment .md-text-and-image .md-title-alt {
    background-color: #FF2A6F !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem !important; 
    aspect-ratio: 1 / 1 !important;
    min-width: 3.625rem !important;
    
    font-family: ClashDisplay-Bold !important;
    font-size: 2rem !important; 
    line-height: 1 !important;
    margin-bottom: 0.75rem !important;
}

/* --- HERO: DESCRIPTION WIDTH --- */
.page-modus-moment .carousel-caption h2 {
    max-width: 42rem !important; /* 672px */
    width: 100% !important;
    /* Reset any 'max-content' logic */
    display: block !important; 
}


/* --- Modus Moment: Body Text Clamps --- */
.page-modus-moment .md-text-and-image .mb-5 p span {
    font-size: clamp(1.25rem, 1.161rem + 0.238vw, 1.375rem) !important;
    color: #3d4550 !important; /* Ensures it overrides the inline rgb(0,0,0) */
}

/* --- MODUS MOMENT: SECTION SPACING --- */
.page-modus-moment .md-text-and-image {
    /* 80px Top Padding */
    padding-top: 5rem !important; 
}

/* --- 1. GLOBAL VARIABLES --- */
:root {
    --content-max-width: 56rem; /* 896px */
}

/* --- 2. HERO & SECTION HEADLINES --- */
#carouselBlogHeader.md-blog-hero .carousel-caption.md-blog-hero-caption h1.md-title { 
    font-size: clamp(2rem, 0.571rem + 3.81vw, 4rem); 
    text-wrap: balance;
}

/* Specific Badge for Hero only */
.md-blog-hero-caption .md-badge {
    font-size: 1rem !important;
    line-height: 1 !important;
}

/* Eyebrows / Pretitles (Related & CTA) - Restored to your preferred clamp */
.md-cta-blog__pretitle, 
.md-title-alt {
    font-size: clamp(1.375rem, 1.107rem + 0.714vw, 1.75rem) !important;
    line-height: 1.2;
}

/* Main Section Headings (Related & CTA) */
.md-cta-blog__title, 
.md-related-blogs-title {
    font-size: clamp(2rem, 1.554rem + 1.19vw, 2.625rem) !important;
    line-height: 1.2;
}

/* Body Headings */
.md-blog-body h2 {
    text-wrap: pretty;
    font-size: clamp(1.725rem, 1.529rem + 0.524vw, 2rem);
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
}

.md-blog-body h3 {
    margin-bottom: 1.25rem;
}

.md-blog-hero-meta {
    font-size: 0.875rem;
}

/* --- HERO CONTAINER & ALIGNMENT --- */
.md-blog-hero .carousel-item {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end !important;
    height: auto !important;
    min-height: 42rem !important; 
    padding-top: 3rem !important; 
    padding-bottom: 1.5rem !important;
    background-size: cover !important;
    background-position: center !important;
}

.md-blog-hero .carousel-caption.md-blog-hero-caption {
    position: relative !important;
    left: 15.625% !important;
    transform: none !important;
    width: 100% !important;
    max-width: var(--content-max-width) !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left;
}

@media (max-width: 61.99rem) {
    .md-blog-hero .carousel-caption.md-blog-hero-caption {
        left: 5% !important;
        max-width: 90% !important;
    }
    .md-blog-hero .carousel-item { min-height: 31.25rem !important; }
}

/* --- 3. TYPOGRAPHY: BODY CONTENT --- */
.md-blog-body p,
.md-blog-body.with-list-styles ul > li, 
.md-blog-body.with-list-styles ol > li {
    font-size: clamp(1.125rem, 1.036rem + 0.238vw, 1.25rem);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.md-inline-cta__content, .md-inline-cta__content p, .md-inline-cta__content span, .md-inline-cta__content strong {
	font-size: clamp(1.125rem, 1.071rem + 0.143vw, 1.2rem);
    line-height: 1.6;
}

p.md-blog-post-intro, .md-cta-blog__body {
    font-size: clamp(1.25rem, 1.161rem + 0.238vw, 1.375rem);
    line-height: 1.5;
}

.md-blog-body.with-list-styles ul,  
.md-blog-body.with-list-styles ol { margin-bottom: 1.5rem; }

.md-blog-body a {
    color: #218AAB;
    text-decoration: underline;
}

/* --- 4. CARDS & BADGES --- */
.md-blog-card-title {
    font-size: 1.375rem;
    line-height: 1.25;
    margin-bottom: 0.375rem;
}

.md-blog-card-desc {
    font-size: 1rem;
    line-height: 1.5;
}

/* Featured / Latest post body text size */
.md-blog-panel-overlay p {
    font-size: 1.25rem;
}

/* Big Card (Panel) Padding Fix */
.md-blog-panel-body {
    padding-left: 3rem;   /* Adjust this value for left spacing */
    padding-bottom: 3rem; /* Adjust this value for bottom spacing */
}

/* --- 4. CARDS & PANELS: DESKTOP --- */
.md-blog-panel-overlay {
    padding: 2.25rem 1.5rem; /* 36px 24px converted to rem */
}

.md-overlay-content {
    position: absolute;
    right: 2.25rem;   /* 36px */
    left: 2.25rem;    /* 36px */
    bottom: 0;
    padding-bottom: 1.5rem; /* 24px */
}

.md-blog-panel-date {
    font-size: 0.875rem;
}

.md-blog-panel-title{
	font-size: clamp(1.375rem, 0.75rem + 1.667vw, 2.25rem);
}

.md-blog-panel-overlay p{
	font-size: clamp(1rem, 0.821rem + 0.476vw, 1.25rem);
}

/* Small Card Padding */
.md-blog-card-body {
    padding: 1.25rem 1.5rem 1rem 1.5rem;
}

.md-blog-card-date {
    font-size: 0.875rem;
}

.md-blog-card .md-badge, 
.md-blog-panel .md-badge {
    font-size: 0.875rem;
    line-height: 100%;
}

/* --- 4. Unified Hover Logic (Fixed) --- */

/* 1. Prevent jumping/moving */
.md-blog-card:hover,
.md-blog-panel:hover {
    transform: none !important;
}

/* 2. Setup the Overlay Container */
/* We target the image wrapper for small cards and the panel itself for the big card */
.md-blog-card-image-wrap,
.md-blog-card-image-placeholder,
.md-blog-panel {
    position: relative;
    overflow: hidden;
}

/* 3. Create the Gradient Layer */
.md-blog-card-image-wrap::after,
.md-blog-card-image-placeholder::after,
.md-blog-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Your Brand Blue Gradient */
    background: linear-gradient(180deg, rgba(55, 107, 142, 0) 0%, rgba(55, 107, 142, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2; /* Sit above the <img> tag */
    pointer-events: none; /* Ensure it doesn't block clicks */
}

/* 4. Trigger Hover on the Parent Card */
/* When the CARD is hovered, show the overlay on the IMAGE WRAP */
.md-blog-card:hover .md-blog-card-image-wrap::after,
.md-blog-card:hover .md-blog-card-image-placeholder::after,
.md-blog-panel:hover::after {
    opacity: 1;
}

/* 5. Ensure Text is always on top */
.md-blog-panel-overlay {
    z-index: 3;
}



/* --- 5. TABLES --- */
.md-blog-body table th, 
.md-blog-body table td {
    padding: 1.25rem;
    min-width: 11.25rem;
    line-height: 1.4;
}

.md-blog-body table td:last-child { min-width: 15.625rem; }

.md-blog-body figure.table {
    margin: 1.5rem 0 !important;
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Tables */
.md-blog-body figure.table::-webkit-scrollbar { height: 6px; }
.md-blog-body figure.table::-webkit-scrollbar-thumb {
    background: #376B8E;
    border-radius: 10px;
}
.md-blog-body figure.table::-webkit-scrollbar-track { background: #f1f1f1; }

/* --- 6. MAIN LAYOUT & GRID --- */
.md-blog-body.col-lg-10,
.md-blog-content-layout.container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.md-blog-content-layout {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center;
    padding: 1rem 0;
}

@media (min-width: 90rem) { 
    .md-blog-content-layout {
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 75rem !important;
    }
}

@media (min-width: 62rem) {
    div.col-lg-10.offset-lg-1.md-blog-body { margin-left: 0; }
}

/* --- 7. SHARING RAIL --- */
.md-blog-share-rail {
    margin-left: 1rem !important;
    position: sticky !important;
    top: 7.5rem !important;
    height: fit-content;
    z-index: 10;
}

.sharebtn__twitter, .sharebtn__linkedin, .sharebtn__whatsapp, .sharebtn__email, .sharebtn__copy {
    background-color: #376B8E !important;
}

/* --- 8. RESPONSIVE: TABLET & MOBILE --- */
@media (min-width: 48rem) and (max-width: 61.99rem) {
    .md-blog-content-layout { gap: 1.875rem !important; }
    .md-blog-content-main { max-width: calc(100% - 6.25rem) !important; }
    .md-blog-share-rail .sharebtn__container {
        display: flex !important;
        flex-direction: column !important;
    }
}

@media (max-width: 47.93rem) {

    .md-blog-content-layout { flex-direction: column !important; }
    .md-blog-content-main { width: 100% !important; max-width: 100% !important; }

    /* Halved Heading Margins for Mobile */
    .md-blog-body h2, .md-blog-body h3 {
        margin-bottom: 0.625rem !important;
        margin-top: 2rem !important;
    }

    .md-blog-share-rail {
        position: static !important;
        order: 2;
        margin: 2.5rem 0 0 0 !important;
        width: 100% !important;
    }

    .md-blog-share-rail .sharebtn__container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 1rem !important;
    }

    .md-blog-body table td, .md-blog-body table th {
        padding: 0.5rem !important;
        font-size: 0.9rem;
    }
    
    .md-blog-hero .carousel-item { min-height: 25rem !important; }

	/* Unclip Table Scroll for Mobile (Negative Margin) */
.md-blog-body figure.table {
    margin-left: -1rem !important; 
    margin-right: -1rem !important;
    width: calc(100% + 2rem) !important;
    padding-left: 1rem;
    padding-right: 1rem;
    display: block;
    overflow-x: auto;
}
}

/* Resetting the 1024px Theme Overrides */
@media screen and (max-width: 64rem) {
    .md-blog-panel-overlay span.md-blog-panel-date {
        font-size: 0.875rem !important; /* Keep it small like the other dates */
        margin-left: 0 !important;      /* Remove that 20px gap */
        padding-top: 0 !important;     /* Remove the 20px top padding */
        line-height: 1;
    }

    .md-blog-panel-intro {
        margin-left: 0 !important;
        font-size: 1.125rem; /* Slightly smaller for tablet/mobile */
    }

    /* Ensure the content container doesn't have extra padding shifting the text */
    .md-overlay-content {
        left: 1.5rem; 
        right: 1.5rem;
    }
}

/* Mobile specific (below 767px) */
@media (max-width: 47.93rem) {
    .md-overlay-content {
        left: 1rem;
        right: 1rem;
        padding-bottom: 1.25rem;
    }
    
    .md-blog-panel-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
}

/* --- 9. NAVBAR & LOGO --- */
@media (max-width: 61.99rem) {
    .navbar { padding: 0.75rem 0 !important; }
    .navbar-brand img { max-height: 2.25rem !important; }
}

.carousel-caption.md-align-left .d-inline.align-start {
    display: inline-block !important; /* Ensure margin-top works on an inline element */
    margin-top: 1rem !important;
}