/* Performance, LCP & CLS optimizations */

:root {
    --text-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --title-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --banner-min-height-mobile: 420px;
    --banner-min-height-desktop: 480px;
}

/* Cover images replacing CSS background-image */
.section-cover-img {
    display: block;
    max-width: 100%;
}

img.section-cover-img.bg-layer,
img.section-cover-img.pattern-layer,
.banner-carousel .slide-item img.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 0;
}

.events-section img.section-cover-img.bg-layer {
    opacity: 0.1;
}

.feature-block-one .inner-box img.section-cover-img.bg-layer {
    opacity: 0.1;
}

.banner-section img.section-cover-img.bg-layer {
    transform: scale(1.1);
    transition: transform 10s ease;
}

.banner-section:hover img.section-cover-img.bg-layer {
    transform: scale(1);
}

.banner-section img.section-cover-img.pattern-layer {
    opacity: 0.15;
    object-fit: cover;
}

.cta-block-one .inner-box:has(img.section-cover-img.bg-layer)::before {
    position: absolute;
    content: '';
    inset: 0;
    z-index: 1;
    background: linear-gradient(-90deg, rgba(55, 170, 103, 0) 0%, #197cba 90.95%);
    pointer-events: none;
}

.cta-block-one .inner-box .text,
.cta-block-one .inner-box h2,
.cta-block-one .inner-box .theme-btn {
    position: relative;
    z-index: 2;
}

/* Livewire contact form – reserved space prevents validation CLS */
.livewire-form-stable,
.livewire-contact-slot {
    min-height: 520px;
}

.contact-section .form-group {
    margin-bottom: 1.25rem;
}

.contact-section .field-error-slot {
    min-height: 1.35rem;
    margin-top: 0.35rem;
    font-size: 0.875rem;
    line-height: 1.35rem;
}

.contact-section .form-loading-slot {
    min-height: 1.5rem;
    margin-top: 0.75rem;
}

.contact-section .form-loading-text {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* FAQ accordion – reserve space for first open item */
.faq-section .accordion-box .acc-content.current {
    min-height: 3rem;
}

.faq-section .accordion-box .acc-content .content {
    min-height: 2.5rem;
}

/* Toast notification – fixed overlay, no CLS */
.notification {
    contain: layout style;
}
.header-top .top-inner p i[class^="icon-"] {
    display: inline-block;
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    vertical-align: middle;
    line-height: 1.125rem;
}

.menu-area .mobile-nav-toggler {
    min-width: 40px;
    min-height: 50px;
}

.menu-area .mobile-nav-toggler .icon-bar {
    min-height: 2px;
}

/* Main banner – stable height before/after Owl Carousel init */
.main-banner .banner-carousel,
.main-banner .banner-carousel .owl-stage-outer,
.main-banner .banner-carousel .owl-stage,
.main-banner .banner-carousel .owl-item {
    min-height: var(--banner-min-height-mobile);
}

.main-banner .slide-item {
    min-height: var(--banner-min-height-mobile) !important;
    padding: 60px 0 !important;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    :root {
        --banner-min-height-mobile: var(--banner-min-height-desktop);
    }

    .main-banner .slide-item {
        min-height: var(--banner-min-height-desktop) !important;
        padding: 80px 0 !important;
        aspect-ratio: 1280 / 400;
    }
}

/* LCP banner image */
body.reduce-motion .main-banner .slide-item {
    min-height: var(--banner-min-height-mobile) !important;
    padding: 60px 0 !important;
}

@media (min-width: 769px) {
    body.reduce-motion .main-banner .slide-item {
        min-height: var(--banner-min-height-desktop) !important;
        padding: 80px 0 !important;
    }
}

/* Inner page hero banners */
.banner-section:not(.main-banner),
.project-banner-section {
    min-height: 280px;
    position: relative;
}

@media (min-width: 769px) {
    .banner-section:not(.main-banner),
    .project-banner-section {
        min-height: 360px;
    }
}

body.reduce-motion .main-banner .bg-layer {
    transition: none !important;
    transform: none !important;
}

.banner-lcp-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.banner-lcp-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Banner text visible immediately (no carousel animation delay) */
.main-banner .slide-item .content-box .sub-title,
.main-banner .slide-item .content-box h2,
.main-banner .slide-item .content-box p {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.main-banner .slide-item:before {
    z-index: 1;
}

.main-banner .content-box {
    position: relative;
    z-index: 2;
}

/* Disable animation-driven layout shifts on homepage */
.reduce-motion .title-animation,
.reduce-motion .sec-title-animation .title-animation,
.reduce-motion .wow {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
}

.reduce-motion .sec-title-animation.animation-style2 .title-animation {
    opacity: 1 !important;
}

/* Icon font reserve space */
.icon-box .icon,
.icon-box .icon i,
.icon-box .icon [class^="icon-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    min-width: 3.75rem;
    min-height: 3.75rem;
    line-height: 3.75rem;
}

/* Media images */
.events-block-one .image-box img,
.project-section .image-box img {
    width: 100%;
    height: auto;
}

.about-section .image img {
    aspect-ratio: 6 / 7;
    object-fit: cover;
}

.events-block-one .image-box {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.events-block-one .image-box img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    height: 100%;
    width: 100%;
}

.project-section .image-box {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.project-section .image-box img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    height: 100%;
}

/* Feature section */
.feature-section {
    padding: 60px 0;
}

.feature-title {
    font-size: 1.2rem;
    line-height: 1.4;
    min-height: 3.4rem;
    margin-bottom: 0.8rem;
}

.feature-text {
    font-size: 0.95rem;
    line-height: 1.5;
    min-height: 3rem;
}

.feature-section .inner-container {
    margin: 0 -15px;
}

.feature-block-one {
    padding: 0;
}

@media (max-width: 991px) {
    .feature-section {
        padding: 40px 0;
    }

    .feature-title,
    .feature-text {
        min-height: auto;
    }
}

@media (max-width: 767px) {
    .feature-section {
        padding: 30px 0;
    }

    .feature-block-one {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 30px;
        padding: 0;
    }

    .feature-title {
        font-size: 1rem;
    }

    .feature-section .inner-box {
        text-align: center;
        padding: 20px;
    }

    .feature-section .icon-box {
        margin: 0 auto 15px;
    }
}

/* Service / project cards */
.service-block {
    margin-bottom: 30px;
}

.service-section .inner-box {
    padding: 30px;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-section .inner-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
    .service-block {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 30px;
        padding: 0 15px;
    }

    .service-block-one {
        width: 100%;
    }

    .service-section .inner-box {
        text-align: center;
        padding: 20px;
    }

    .service-section .icon-box {
        margin: 0 auto 15px;
    }
}

/* Owl Carousel – prevent height collapse on init */
.events-carousel .owl-stage-outer {
    min-height: 480px;
}

@media (max-width: 768px) {
    .events-carousel .owl-stage-outer {
        min-height: 420px;
    }
}

/* Article / archive card images */
.article-img {
    aspect-ratio: 854 / 480;
    height: auto;
    min-height: 180px;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sidebar & detail page images */
.project-image,
.related-projects .project-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
}

.project-image img,
.related-projects .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-article-content .image-box {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.single-article-content .image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-banner img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Card thumbnails – 400x300 display ratio */
.article-img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header / footer icon images */
.social-links img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Footer land acknowledgment bar – fixed overlay (no document-flow shift) */
.land-ack-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #222;
    color: #fff;
    width: 100%;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    opacity: 1;
    overflow: hidden;
    margin: 0;
    pointer-events: auto;
}

.land-ack-bar.land-ack-ready {
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.3s ease;
}

.land-ack-bar.hide {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

html.land-ack-dismissed .land-ack-bar {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.land-ack-bar .bar-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px 18px 48px;
    position: relative;
}

.land-ack-bar .bar-text {
    flex: 1;
    text-align: center;
    font-size: 1rem;
}

.close-bar {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-bar:hover {
    opacity: 1;
}

.land-ack-restore-btn {
    background: #222;
    color: #fff;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9997;
    padding: 12px 28px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1rem;
    cursor: pointer;
    opacity: 1;
    margin: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: fit-content;
    transition: none;
    user-select: none;
}

.land-ack-restore-btn.is-visible,
html.land-ack-dismissed .land-ack-restore-btn {
    display: flex;
}

.land-ack-restore-btn:hover {
    opacity: 1;
    background: #333;
}

.land-ack-restore-btn svg {
    pointer-events: none;
}

/* Archive / project list responsive layout */
@media (max-width: 767px) {
    .articles-section .article-card.flex-column .article-img {
        min-height: 200px !important;
        width: 100% !important;
    }

    .articles-section .article-card .article-content {
        width: 100%;
    }

    .project-banner-section,
    .about-article-section {
        margin-top: 0 !important;
        padding-top: 120px !important;
    }
}

@media (min-width: 768px) {
    .articles-section .article-card .article-img {
        min-height: 320px;
    }
}
.service-content > .w-100 {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.service-content > .w-100 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Team member images */
.team-block .image-box img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Featured image containers */
.featured-image-container {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.featured-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header stable dimensions */
.header-top .top-inner {
    min-height: 44px;
}

.header-lower .outer-box {
    min-height: 72px;
}

/* Font Awesome icon reserve in about section */
.list-style-one .feature-item i.fas,
.list-style-one .feature-item i.far {
    display: inline-block;
    width: 1.25rem;
    min-width: 1.25rem;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
