/* Global layout grid and alignment fixes */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

.container {
    width: min(1200px, 100% - 2rem);
    margin-left: auto;
    margin-right: auto;
}

section {
    scroll-margin-top: 100px;
}

.section-title {
    margin-bottom: 2rem;
}

.section-title p {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* Generic card alignment */
.services-grid,
.portfolio-grid,
.blog-grid,
.process-cards {
    display: grid;
    gap: 1.5rem;
}

.services-categories {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.service-category-item {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Services page: compact categories in rows of 4 */
.services-intro .services-categories {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.85rem !important;
    align-items: stretch;
}

.services-intro .service-category-item {
    width: auto !important;
    min-height: 120px;
    padding: 14px 10px !important;
    gap: 0.6rem !important;
    border-radius: 12px;
    flex-direction: column;
    justify-content: flex-start;
}

.services-intro .category-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.05rem !important;
    border-radius: 10px;
}

.services-intro .service-category-item span {
    font-size: 12px !important;
    line-height: 1.25;
}

.services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portfolio-grid,
.blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card,
.portfolio-card,
.blog-card,
.process-card {
    height: 100%;
}

.service-card-inner,
.portfolio-card-inner,
.blog-card-inner,
.process-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-content,
.blog-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-content p,
.blog-excerpt {
    flex-grow: 1;
}

/* Services detail page alignment */
.service-detail-card-inner .row {
    row-gap: 1.5rem;
}

.service-detail-image,
.service-detail-content {
    height: 100%;
}

/* Services detail blocks: compact and better aligned */
.service-detail-section {
    padding: 58px 0 !important;
}

.service-detail-card {
    max-width: 1120px;
    margin: 0 auto;
}

.service-detail-card-inner {
    padding: 22px !important;
}

.service-detail-content h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    margin-bottom: 0.6rem !important;
}

.service-detail-content > p {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 1rem !important;
}

.service-detail-image .image-wrapper {
    border-radius: 12px;
    overflow: hidden;
}

.service-detail-image .image-wrapper img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.tech-tags {
    margin-top: 0.7rem !important;
    gap: 0.45rem !important;
}

.tech-tag {
    font-size: 11px !important;
    padding: 4px 8px !important;
}

.service-features h3 {
    font-size: 1.02rem !important;
    margin-bottom: 0.7rem !important;
}

.service-features-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem 1rem;
}

.service-features-list li {
    margin-bottom: 0 !important;
}

.feature-text h4 {
    font-size: 0.92rem !important;
    margin-bottom: 0.2rem !important;
}

.feature-text p {
    font-size: 0.84rem !important;
    line-height: 1.45;
}

.service-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* About and CTA consistency */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.cta-wrapper {
    display: grid;
    gap: 1.5rem;
}

/* Homepage compaction and alignment */
.home-page .section-padding {
    padding: 64px 0 !important;
}

.home-page .section-title h2 {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    line-height: 1.25;
    margin-bottom: 0.6rem !important;
}

.home-page .section-title p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.home-page .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-page .services-section {
    background: linear-gradient(180deg, #f4f7fb 0%, #eef3f9 100%);
}

.home-page .service-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-page .service-card-inner {
    padding: 18px !important;
    background: #ffffff;
    border: 1px solid rgba(20, 30, 50, 0.08);
    border-radius: 14px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.home-page .service-thumb {
    margin-bottom: 0.75rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-page .service-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.home-page .service-icon {
    width: 54px !important;
    height: 54px !important;
    font-size: 1.15rem !important;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.home-page .service-content h3 {
    font-size: 1.03rem !important;
    margin-bottom: 0.45rem !important;
    transition: color 0.3s ease;
}

.home-page .service-content p {
    font-size: 0.9rem !important;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.home-page .service-link {
    transition: color 0.3s ease;
}

.home-page .service-card:hover {
    transform: translateY(-6px);
}

.home-page .service-card:hover .service-card-inner {
    background: linear-gradient(145deg, #0f2236 0%, #18324d 60%, #1e3d5c 100%);
    border-color: rgba(39, 168, 127, 0.45);
    box-shadow: 0 18px 35px rgba(10, 25, 45, 0.26);
}

.home-page .service-card:hover .service-icon {
    background: linear-gradient(135deg, #eb7b02 0%, #27a87f 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(39, 168, 127, 0.35);
}

.home-page .service-card:hover .service-content h3 {
    color: #ffffff !important;
}

.home-page .service-card:hover .service-content p {
    color: rgba(255, 255, 255, 0.86) !important;
}

.home-page .service-card:hover .service-link {
    color: #5ee3b3 !important;
}

.home-page .about-content {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
}

.home-page .about-img,
.home-page .about-text {
    height: 100%;
}

.home-page .about-img-wrapper {
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.home-page .about-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.home-page .about-img:hover .about-img-wrapper {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(10, 25, 45, 0.24);
}

.home-page .about-img:hover .about-img-wrapper img {
    transform: scale(1.03);
}

.home-page .about-text-inner {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(18, 34, 57, 0.08);
    border-radius: 14px;
    padding: 18px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.home-page .about-text-inner:hover {
    transform: translateY(-4px);
    border-color: rgba(39, 168, 127, 0.35);
    box-shadow: 0 16px 32px rgba(10, 25, 45, 0.14);
}

.home-page .about-text p {
    font-size: 0.92rem;
    line-height: 1.55;
}

.home-page .about-counter-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1rem 0;
}

.home-page .about-counter {
    margin: 0 !important;
    min-height: 110px;
    padding: 12px !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.home-page .about-counter:hover {
    transform: translateY(-3px);
    border-color: rgba(39, 168, 127, 0.35);
    box-shadow: 0 10px 20px rgba(10, 25, 45, 0.12);
}

.home-page .about-counter .counter-number {
    font-size: 1.15rem !important;
}

.home-page .about-counter .counter-text {
    font-size: 0.8rem !important;
    line-height: 1.3;
}

.home-page .about-pillars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 0.7rem 0 1rem;
}

.home-page .about-pillar {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f6f9fc;
    border: 1px solid rgba(20, 30, 50, 0.08);
    color: #13253f;
    font-size: 0.86rem;
    font-weight: 500;
    transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.home-page .about-pillar i {
    color: #27a87f;
    transition: color 0.22s ease;
}

.home-page .about-pillar:hover {
    transform: translateY(-2px);
    background: #13253f;
    color: #ffffff;
    border-color: #13253f;
}

.home-page .about-pillar:hover i {
    color: #5ee3b3;
}

.home-page .about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.home-page .about-text-inner .about-actions {
    margin-top: auto;
    padding-top: 0.6rem;
}

.home-page .about-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 10px 14px !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.home-page .about-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(10, 25, 45, 0.2);
}

.home-page .about-btn.about-btn-outline {
    background: transparent !important;
    color: #13253f !important;
    border: 1px solid rgba(20, 30, 50, 0.16);
}

.home-page .about-btn.about-btn-outline:hover {
    background: #13253f !important;
    color: #ffffff !important;
    border-color: #13253f;
}

.home-page .portfolio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-page .portfolio-img img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.home-page .testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-page .trusted-logos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-page .trusted-logo-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(20, 30, 50, 0.1);
    border-radius: 14px;
    min-height: 170px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.home-page .trusted-logo-card img {
    width: 100%;
    max-height: 130px;
    object-fit: contain;
    display: block;
    filter: grayscale(8%);
}

.home-page .trusted-logo-card:hover {
    transform: translateY(-4px);
    border-color: rgba(39, 168, 127, 0.35);
    box-shadow: 0 14px 28px rgba(10, 25, 45, 0.18);
}

/* About page modernization */
.about-page-section .about-content {
    align-items: stretch;
}

.about-page-section .about-img,
.about-page-section .about-text {
    height: 100%;
}

.about-page-section .about-img-wrapper {
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
}

.about-page-section .about-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-page-section .about-text-inner {
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(20, 30, 50, 0.1);
    border-radius: 14px;
    padding: 18px;
}

.about-page-section .about-counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-expertise-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.about-expertise-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(20, 30, 50, 0.1);
    border-radius: 14px;
    padding: 18px;
    min-height: 190px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.about-expertise-card i {
    font-size: 1.35rem;
    color: #27a87f;
    margin-bottom: 0.6rem;
}

.about-expertise-card h3 {
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

.about-expertise-card p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.about-expertise-card:hover {
    transform: translateY(-4px);
    border-color: rgba(39, 168, 127, 0.35);
    box-shadow: 0 12px 24px rgba(10, 25, 45, 0.16);
}

.about-trust-section .trusted-logos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.about-trust-section .trusted-logo-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(20, 30, 50, 0.1);
    border-radius: 14px;
    min-height: 170px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.about-trust-section .trusted-logo-card img {
    width: 100%;
    max-height: 130px;
    object-fit: contain;
    display: block;
}

.about-trust-section .trusted-logo-card:hover {
    transform: translateY(-4px);
    border-color: rgba(39, 168, 127, 0.35);
    box-shadow: 0 14px 28px rgba(10, 25, 45, 0.18);
}

.home-page .testimonial-card {
    height: 100%;
}

.home-page .cta-wrapper {
    padding: 24px !important;
}

/* Blog page cleanup and alignment */
.blog-page-intro .section-title {
    margin-bottom: 1.25rem;
}

.blog-search {
    max-width: 680px;
    margin: 0 auto 1.2rem;
}

.blog-categories ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.blog-categories ul li a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(20, 30, 50, 0.14);
    background: #ffffff;
}

.featured-article.section-padding {
    padding-top: 20px !important;
}

.featured-article .service-detail-card-inner {
    padding: 18px !important;
}

.featured-article .service-detail-image .image-wrapper img {
    aspect-ratio: 16 / 10;
}

.featured-article .article-meta .author img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-articles .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.blog-articles .blog-card-inner {
    border-radius: 14px;
    overflow: hidden;
}

.blog-articles .blog-img img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.blog-articles .blog-content {
    padding: 14px !important;
}

.blog-articles .blog-title {
    line-height: 1.35;
}

.blog-articles .pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}

/* Contact page alignment and spacing */
.contact-page-intro .section-title p {
    max-width: 820px;
}

.contact-info {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.contact-card,
.contact-card-inner {
    height: 100%;
}

.contact-card-inner {
    border-radius: 14px;
    padding: 18px !important;
}

.contact-text p {
    margin-bottom: 0;
    line-height: 1.55;
}

.contact-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1rem;
    align-items: stretch;
}

.contact-form-wrapper,
.contact-map-wrapper {
    width: 100%;
}

.form-card-inner,
.map-card-inner {
    height: 100%;
    border-radius: 14px;
    padding: 20px !important;
}

#contactForm .form-group {
    margin-bottom: 0.8rem;
}

#contactForm .form-control {
    min-height: 46px;
}

#contactForm textarea.form-control {
    min-height: 150px;
}

.contact-map {
    border-radius: 12px;
    overflow: hidden;
    min-height: 320px;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    min-height: 320px;
    border: 0;
}

.social-media-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

/* Responsive grid */
@media (max-width: 991px) {
    .services-grid,
    .portfolio-grid,
    .blog-grid,
    .process-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .services-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .services-intro .services-categories {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .service-detail-card-inner {
        padding: 16px !important;
    }

    .service-features-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .home-page .services-grid,
    .home-page .portfolio-grid,
    .home-page .testimonials-grid,
    .home-page .trusted-logos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-page .about-pillars {
        grid-template-columns: 1fr;
    }

    .about-expertise-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-trust-section .trusted-logos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .blog-articles .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .social-media-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .container {
        width: min(1200px, 100% - 1.25rem);
    }

    .services-grid,
    .portfolio-grid,
    .blog-grid,
    .process-cards {
        grid-template-columns: 1fr;
    }

    .services-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .services-intro .services-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .service-features-list {
        grid-template-columns: 1fr;
    }

    .section-title {
        margin-bottom: 1.5rem;
    }

    .home-page .section-padding {
        padding: 50px 0 !important;
    }

    .home-page .services-grid,
    .home-page .portfolio-grid,
    .home-page .testimonials-grid,
    .home-page .trusted-logos-grid {
        grid-template-columns: 1fr;
    }

    .home-page .about-counter-grid {
        grid-template-columns: 1fr;
    }

    .home-page .about-img-wrapper {
        min-height: 320px;
    }

    .about-page-section .about-counter-grid {
        grid-template-columns: 1fr;
    }

    .about-expertise-grid {
        grid-template-columns: 1fr;
    }

    .about-trust-section .trusted-logos-grid {
        grid-template-columns: 1fr;
    }

    .blog-search {
        max-width: 100%;
    }

    .blog-articles .blog-grid {
        grid-template-columns: 1fr;
    }

    .contact-info,
    .social-media-links {
        grid-template-columns: 1fr;
    }

    .form-card-inner,
    .map-card-inner {
        padding: 16px !important;
    }

    .home-page .cta-wrapper {
        padding: 18px !important;
    }
}
