/* --- 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;
}

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: RESTORED TO EARLIER TWEAKS --- */
.md-blog-card-title {
    font-size: 1.25rem;
    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 */
}

/* 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;
}
}

/* --- 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;
}