/* ==========================================================================
   REBUILD STYLES
   This file contains all custom styles to recreate features from the chat history
   without touching style.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Global Fixes
   -------------------------------------------------------------------------- */
/* Fix landscape mode scale issues */
@media (max-height: 500px) and (orientation: landscape) {
    .page-body, .horizontal-wrapper, .subpage-wrapper {
        min-height: 100vh !important;
        position: relative !important;
    }
}

/* --------------------------------------------------------------------------
   2. Services Page (services2.html)
   -------------------------------------------------------------------------- */
/* Center Align AI Solutions */
.service-heading-center {
    text-align: center !important;
}

/* --------------------------------------------------------------------------
   3. About Page (about.html)
   -------------------------------------------------------------------------- */
/* Mobile Hero (White Bg, Black Text) */
@media (max-width: 768px) {
    .mobile-hero-white {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .mobile-hero-white h1, 
    .mobile-hero-white p, 
    .mobile-hero-white .page-hero-label {
        color: #000000 !important;
    }

    /* Asymmetric Curvature */
    .mobile-curve-overlay {
        position: absolute;
        top: -40px;
        left: 0;
        width: 100%;
        height: 60px;
        background: #000000;
        border-radius: 50% 50% 0 0 / 100% 100% 0 0;
        z-index: 10;
        transform: scaleX(1.1);
    }
    
    /* 2-in-a-row collective images */
    .collective-grid-mobile {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* About Page Specific Layout Overrides */
@media (max-width: 991px), (max-height: 500px) and (orientation: landscape) {
    /* Reset all title positions to top center */
    [class^="ch-title-"] {
        left: 0 !important;
        width: 100% !important;
        top: 15% !important;
        bottom: auto !important;
        justify-content: center !important;
    }
    
    [class^="ch-title-"] .giant-title {
        text-align: center !important;
        font-size: clamp(2.5rem, 8vw, 4rem) !important;
        margin-bottom: 10px !important;
    }

    /* Reset all content positions to be below the title */
    [class^="ch-content-"] {
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        top: 30% !important;
        bottom: auto !important;
        padding: 0 5% !important;
        justify-content: center !important;
    }
    
    .ch-content-1 {
        padding-top: 0 !important;
        top: 35% !important;
    }

    .intro-text {
        font-size: clamp(1rem, 4vw, 1.3rem) !important;
        margin-bottom: 2rem !important;
    }
    
    .value-grid {
        margin-top: 1rem !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .value-card {
        padding: 1.5rem !important;
    }
    .value-card h3 {
        font-size: 1.2rem !important;
    }
    .value-card p {
        font-size: 0.95rem !important;
    }
    .value-card .icon-wrap {
        width: 40px !important;
        height: 40px !important;
    }

    /* Team scatter for collective */
    .team-scatter {
        height: auto !important;
        display: flex !important;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        margin-top: 5vh;
    }
    .team-member {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: 45%; 
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
    }
    .team-img-wrap {
        width: 80px !important;
        height: 80px !important;
    }
    .team-info {
        background: transparent !important;
        box-shadow: none !important;
        padding: 10px 0 0 0 !important;
        border-radius: 0 !important;
        text-align: center !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        position: relative !important;
    }
    .team-info h3 {
        font-size: 1rem !important;
    }
    .team-info p {
        font-size: 0.85rem !important;
    }
    
    /* Compass SVG scale */
    .compass-vision-container {
        padding: 0 !important;
        transform: scale(0.8);
    }
}

/* Fix landscape height constraints aggressively */
@media (max-height: 500px) and (orientation: landscape) {
    [class^="ch-title-"] {
        top: 15% !important;
    }
    [class^="ch-title-"] .giant-title {
        font-size: 1.8rem !important;
        margin-bottom: 0 !important;
    }
    [class^="ch-content-"] {
        top: 35% !important;
    }
    .ch-content-1 {
        top: 35% !important;
    }
    .intro-text {
        font-size: 1rem !important;
    }
    .compass-vision-container {
        transform: scale(0.5);
        transform-origin: top center;
    }
    .value-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        margin-top: 0 !important;
    }
    .value-card {
        padding: 1rem !important;
    }
    .team-scatter {
        margin-top: 0 !important;
        gap: 10px;
        align-items: flex-start !important;
    }
    .team-member {
        width: 22%; /* 4 in a row */
    }
    .team-img-wrap {
        width: 50px !important;
        height: 50px !important;
    }
    .team-info h3 {
        font-size: 0.8rem !important;
    }
    .team-info p {
        font-size: 0.7rem !important;
    }
}

/* --------------------------------------------------------------------------
   4. Our Works Page (our-works.html)
   -------------------------------------------------------------------------- */
.works-hero-white {
    background: #ffffff !important;
    color: #000000 !important;
}
.works-hero-white * {
    color: #000000 !important;
}

/* Marquee Row Setup */
.works-marquee-container {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    padding: 10px 0;
    position: relative;
}
.works-marquee-row {
    display: inline-flex;
    gap: 15px;
    animation: marqueeScroll 25s linear infinite;
}
.works-marquee-row.reverse {
    animation-direction: reverse;
}
@keyframes marqueeScroll {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); } /* Assuming content is duplicated */
}

/* Card Styling */
.work-card {
    position: relative;
    width: 350px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
}
.work-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.work-card-title {
    position: absolute;
    bottom: 15px;
    left: 15px;
    color: #ffffff !important; /* Fix title visibility */
    background: rgba(0,0,0,0.6);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 1.1rem;
    backdrop-filter: blur(5px);
    margin: 0;
}

/* Mobile: 2 Cards horizontally */
@media (max-width: 768px) {
    .work-card {
        width: 60vw;
    }
}

/* --------------------------------------------------------------------------
   5. Blogs Page (blogs.html)
   -------------------------------------------------------------------------- */
/* Pinned Hero Wipe setup */
.blog-pinned-container {
    height: 100vh;
    overflow: hidden;
    position: relative;
}
.blog-hero-section {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff;
    color: #000000;
    z-index: 1;
}
.blog-hero-section * {
    color: #000000 !important;
}
.blog-featured-section {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000000;
    z-index: 2;
    clip-path: inset(100% 0 0 0); /* Wipes up */
}

/* 50/50 Split */
.featured-split {
    display: flex;
    height: 100%;
    align-items: center;
}
.featured-img-col {
    flex: 1;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.featured-text-col {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Read More Overlay */
.read-more-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.blog-card:hover .read-more-overlay {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.blog-card:hover .read-more-overlay span {
    transform: translateX(4px);
    transition: transform 0.3s ease;
}

/* Grid card padding fix */
.latest-article-img {
    height: 220px;
    object-fit: cover;
    width: 100%;
}
.blog-card-body {
    padding: 24px;
}
.footer-cta-fixed {
    color: #ffffff !important;
}
