/* Fixes for static CMS content */

/* Team member page image size fix */
.team-details-image {
    width: 100%;
    height: auto;
    max-width: 500px;
    object-fit: cover;
}

/* Blog detail page image sizing - use natural dimensions */
.blog-details-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.blog-details-image-box {
    margin-bottom: 30px;
}

/* Portfolio grid image consistency - normalize heights for proper grid alignment */
.project-thumbnail {
    width: 100%;
    height: 250px; /* Increased height for better proportion */
    overflow: hidden;
    border-radius: 8px;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Maintain aspect ratio while filling container */
}

/* Portfolio item block - ensure full width usage */
.project-item-block {
    width: 100%;
}

/* Responsive portfolio image heights */
@media (max-width: 991px) {
    .project-thumbnail {
        height: 220px; /* Larger on tablets to match Webflow */
    }
}

@media (max-width: 767px) {
    .project-thumbnail {
        height: 180px; /* Appropriate size for phones */
    }
}

/* Service hover animations on homepage */
.service-2-link-block {
    position: relative;
    overflow: hidden;
}

.service-2-block-inner {
    position: relative;
}

/* Initially hide the hover content */
.service-hover-item-box {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.2s ease-out;  /* Faster animation - 200ms */
    z-index: 2;
}

/* Show description by default */
.service-2-desc-box {
    opacity: 1;
    transition: opacity 0.15s ease-out;  /* Faster fade - 150ms */
}

/* On hover, slide in the hover content */
.service-2-link-block:hover .service-hover-item-box {
    transform: translateX(0);
    opacity: 1;
}

/* On hover, fade out the description */
.service-2-link-block:hover .service-2-desc-box {
    opacity: 0;
}

/* Style the service list */
.service-hover-item-box .service-list-item {
    flex: 1;
    padding-right: 20px;
}

.service-hover-item-box .service-hover-image {
    flex: 0 0 auto;
    max-width: 280px; /* Increased from 200px to match Webflow size */
}

.service-hover-item-box .service-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Direct targeting for service image in hover overlay */
.service-thumbnail {
    max-width: 280px; /* Ensure container is large enough */
}

.service-thumbnail .service-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    max-width: 280px; /* Match Webflow service image size */
}

/* Team member hover effect - image zoom */
.team-thumbnail {
    overflow: hidden;
    border-radius: var(--border-radius-10);
    width: 100%;
}

.team-image {
    transition: transform 0.3s ease-out;
    width: 100%;
    height: auto;
    display: block;
}

.team-link-block:hover .team-image {
    transform: scale(1.05) !important;
}

/* Let Webflow animations handle team details page visibility naturally */

/* Fix blog page layout jump by maintaining minimum height during content loading */
.blog-section-wrapper {
    min-height: 350px; /* Ensure section maintains height before content loads */
}

/* Fix portfolio page layout jump by maintaining minimum height during content loading */
.portfolio-section-wrapper {
    min-height: 300px; /* Ensure section maintains height before content loads */
}

/* Fix blog detail pages visibility - let Webflow animations handle timing */
/* Removed opacity overrides to allow proper slide-up animations */

/* Let Webflow animations handle service section visibility naturally on all devices */

/* On tablets/mobile, make bullet points and images visible after animations complete */
@media (max-width: 991px) {
    /* Make bullet points and image container visible on tablets/mobile after animation */
    .service-hover-item-box {
        opacity: 1 !important;
        transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0) rotateY(0) rotateZ(0) skew(0, 0) !important;
        position: static !important; /* Override absolute positioning on mobile */
    }

    /* Hide description on mobile since we're showing bullet points */
    .service-2-desc-box {
        display: none;
    }

    /* Ensure blog multi-images are visible on mobile */
    .blog-details-multi-image-box {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .blog-multi-image-grid {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .blog-multi-image {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-bottom: 15px;
    }

    .multi-image {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        border-radius: 8px;
    }
}
/* About page blog section - equal height grid boxes */
.blog-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.blog-section-grid .blog-item-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-section-grid .blog-item-block {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 180px;
}

.blog-section-grid .blog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-section-grid .blog-title-box {
    flex: 1;
}

/* Limit title lines to prevent overflow */
.blog-section-grid .blog-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 767px) {
    .blog-section-grid {
        grid-template-columns: 1fr;
    }

    .blog-section-grid .blog-item-block {
        min-height: auto;
    }
}

/* Blog rich text formatting fixes */
.blog-rich-text {
    font-size: 17px;
    line-height: 1.75;
    color: #333;
}

.blog-rich-text p {
    margin-bottom: 1.25em !important;
    line-height: 1.75;
}

/* Handle empty paragraphs used for spacing (with &nbsp; or just br) */
.blog-rich-text p:empty,
.blog-rich-text p br:only-child {
    margin-bottom: 0.5em !important;
}

/* Proper spacing for headings */
.blog-rich-text h2 {
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    font-size: 1.75em;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

/* First h2 shouldn't have top margin */
.blog-rich-text > h2:first-child {
    margin-top: 0;
}

.blog-rich-text h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-size: 1.35em;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
}

/* Remove redundant bold inside headings */
.blog-rich-text h2 strong,
.blog-rich-text h3 strong {
    font-weight: inherit;
}

/* List spacing */
.blog-rich-text ul,
.blog-rich-text ol {
    margin-top: 0.75em;
    margin-bottom: 1.25em;
    padding-left: 1.75em;
}

.blog-rich-text li {
    margin-bottom: 0.4em;
    line-height: 1.6;
}

/* Fix lists that have p tags inside li */
.blog-rich-text li p {
    margin-bottom: 0.25em !important;
}

/* Horizontal rule as section divider */
.blog-rich-text hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 2em 0;
}

/* Blockquote styling */
.blog-rich-text blockquote {
    margin: 1.5em 0;
    padding: 1.25em 1.5em;
    border-left: 4px solid var(--main-color, #0066cc);
    background: #f8f9fa;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.blog-rich-text blockquote p {
    margin-bottom: 0 !important;
}

/* Links in blog content */
.blog-rich-text a {
    color: var(--main-color, #0066cc);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.blog-rich-text a:hover {
    border-bottom-color: var(--main-color, #0066cc);
}

/* Strong/bold text */
.blog-rich-text strong {
    font-weight: 600;
    color: #1a1a1a;
}

/* Emphasis text */
.blog-rich-text em {
    font-style: italic;
}
