/* =========================================================
   ACHIEVEMENTS PAGE - EXACT DESIGN MATCH
   ========================================================= */

/* Global */
.ach-hero, .ach-intro, .ach-principles, .ach-5c,
.ach-procedures, .ach-services, .ach-collection-cta {
    width: 100%;
}

/* 1. Hero - FORCE FULL WIDTH */
.ach-hero {
    width: 100vw; /* Forces full screen width */
    max-width: 100vw;
    margin-left: calc(50% - 50vw); /* Breaks out of the container padding */
    overflow: hidden;
    background: #ffffff;
    padding: 0;
}
.ach-hero-img {
    width: 100%;
    height: auto; /* Desktop keeps natural ratio */
    display: block;
}

/* 2. Intro */
.ach-intro {
    background: var(--color-light-gray);
    padding: 60px 20px;
    text-align: center;
}
.ach-intro p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.6rem;
    color: #333333;
}

/* 3. Core Principles - EXACT 3-2 LAYOUT (Desktop) */
.ach-principles {
    background: #ffffff;
    padding: 100px 20px;
}
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #171c3e;
}
.principles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.principle-card {
    background: transparent;
    width: 30%;
    min-width: 280px;
    padding: 0;
    text-align: center;
    border: none;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.principle-card:nth-child(4),
.principle-card:nth-child(5) {
    margin-left: auto;
    margin-right: auto;
}
.principle-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}
.principle-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.principle-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #9c7340;
    font-weight: 700;
}
.principle-card p {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    max-width: 280px;
}

/* 4. 5C Section (Dark) - ARCH SHAPES & SCROLLBAR */
.ach-5c {
    background: #171c3e;
    color: white;
    padding: 80px 20px;
}
.ach-5c .section-title {
    color: var(--color-primary);
}
.ach-5c .section-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.8);
    margin-bottom: 50px;
    font-size: 1rem;
}

.five-c-scroll-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.five-c-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* Desktop: 5 items in one row */
.five-c-item {
    width: calc(20% - 16px);
    text-align: center;
}
.five-c-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    margin-bottom: 15px;
    border-radius: 50% 50% 0 0 / 30% 30% 0 0;
    background: #0f2540;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.five-c-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 50% 50% 0 0 / 30% 30% 0 0;
}
.five-c-label {
    font-family: 'Great Vibes', cursive;
    font-size: 1.8rem;
    font-weight: 400;
    color: #cdae77;
    letter-spacing: 0.5px;
    display: block;
    line-height: 1.2;
    margin-bottom: 8px;
}
.five-c-label small {
    display: block;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-style: normal;
    color: rgba(255,255,255,0.9);
    margin-top: 4px;
    letter-spacing: 2px;
}

/* NEW: Scrollbar styles (Hidden on Desktop) */
.five-c-scrollbar {
    display: none; /* Only shows on mobile */
}

/* 5. Procedures - DESKTOP (Left image wider) */
.ach-procedures {
    background: #ffffff;
    padding: 80px 20px;
}
.ach-procedures .section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 50px;
    color: #1e293b;
}

.procedures-media {
    display: flex;
    justify-content: center;
    gap: 20px; /* Adjust gap if needed */
    max-width: 1100px;
    margin: 0 auto 40px;
}

/* LEFT IMAGE - Wider (60%) */
.procedures-media img:first-child {
    width: 60%;
    border-radius: 4px;
    object-fit: cover;
    height: 400px;
}

/* RIGHT IMAGE - Narrower (38%) */
.procedures-media img:last-child {
    width: 38%;
    border-radius: 4px;
    object-fit: cover;
    height: 400px;
}

.procedures-list {
    display: flex;
    justify-content: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    list-style: none;
    padding: 0;
}
.procedures-list li {
    font-size: 1.25rem;
    text-align: center;
    color: #1e293b;
    font-weight: 600;
}
.mobile-procedures { display: none; }

/* 6. Services - DESKTOP (Original, Unchanged) */
.ach-services {
    background: #f9f9f9;
    width: 100%;
    padding: 80px 0;
}
.services-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 0;
    max-width: 1280px;
    margin: 0 auto;
    align-items: stretch;
}
.service-image {
    position: relative;
    min-height: 400px;
}
.service-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.services-center {
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    text-align: center;
}
.services-center .section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}
.services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.services-list li {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #1e293b;
    font-weight: 500;
}

/* 7. Collection CTA */
.ach-collection-cta {
    background: url('/assets/images/achievements/down_bg_dark.jpg') center/cover no-repeat;
    padding: 100px 20px;
    text-align: center;
    color: #ffffff;
}
.ach-collection-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    color: #ffffff;
}
.ach-collection-cta p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.btn-gold {
    background: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 14px 36px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}
.btn-gold:hover {
    background: #ffffff;
    color: #171c3e;
}

/* Responsive */
@media (max-width: 1024px) {
    .five-c-grid,
    .procedures-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .services-layout {
        grid-template-columns: 1fr;
    }
    .principles-grid {
        flex-direction: column;
        align-items: center;
    }
    .principle-card {
        width: 100%;
        max-width: 400px;
    }
}
@media (max-width: 768px) {
    .ach-hero {
        width: 100vw;
        margin-left: calc(50% - 50vw);
    }
    .ach-hero-img {
        width: 100%;
        height: 70vh; /* 80% of screen height – much taller! */
        object-fit: cover; /* Crops the image to fill the height */
        object-position: center 35%; /* Zooms into the middle-center of the image */
        display: block;
    }
    .ach-intro {
        padding: 30px 15px; /* Tighten padding */
    }
    .ach-intro p {
        font-size: 0.85rem; /* Much smaller text */
        line-height: 1.6;
        max-width: 95%; /* Prevent it from stretching too wide */
    }
    .ach-principles {
        padding: 40px 15px;
    }
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    .principles-grid {
        flex-direction: column;
        gap: 30px;
        max-width: 100%;
    }
    .principle-card {
        width: 100%;
        min-width: 0;
        flex-direction: row; /* Icon Left, Text Right */
        align-items: flex-start;
        text-align: left;
        margin-bottom: 0;
        padding: 0;
    }
    .principle-icon {
        width: 56px;
        height: 56px;
        min-width: 56px; /* Prevent shrinking */
        margin: 0 20px 0 0; /* Space between icon and text */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .principle-icon img {
        max-width: 100%;
        max-height: 100%;
    }
    /* NEW: Forces text to stack vertically */
    .principle-card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .principle-card h3 {
        font-size: 1.1rem;
        margin-bottom: 6px;
        color: #9c7340; /* Gold/Brown Title */
        font-weight: 700;
        text-align: left;
    }
    .principle-card p {
        font-size: 0.85rem;
        color: #6b7280;
        line-height: 1.6;
        margin: 0;
        max-width: 100%;
        text-align: left;
    }
    .five-c-grid {
        flex-wrap: nowrap;           /* Prevent wrapping */
        overflow-x: auto;            /* Enable horizontal scrolling */
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 20px;
        width: 100%;
        padding: 0 0 20px 0;         /* Extra bottom padding for scrollbar */
        margin: 0 auto;
        
        /* CRITICAL FIXES: Force start from LEFT */
        justify-content: flex-start !important; /* Change from center to flex-start */
        scroll-padding-left: 0;                /* Snaps to the left edge */
        
        /* Hide scrollbar */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .five-c-grid::-webkit-scrollbar { display: none; }

    .five-c-item {
        flex: 0 0 75%;
        max-width: 75%;
        /* CRITICAL FIX: Snap to the start of the item, not center */
        scroll-snap-align: start !important; 
        text-align: center;
    }
    .five-c-image {
        height: 260px;
    }
    .five-c-label {
        font-size: 1.4rem;
    }

    /* Show and style the progress bar */
    .five-c-scrollbar {
        display: block;
        position: relative;
        width: 100%;
        height: 3px;
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 3px;
        margin-top: 30px;
        overflow: hidden;
    }
    .five-c-scrollbar-thumb {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 25%; /* Starts at 1/4 width */
        background-color: #cdae77; /* Gold color */
        border-radius: 3px;
        transition: width 0.1s ease, left 0.1s ease;
    }
    .ach-procedures {
        padding: 0 0 30px 0;
    }
    .ach-procedures .container {
        padding: 0px !important;
    }
    .ach-procedures .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    /* 1. Top Image Full Width */
    .procedures-media {
        display: block;
        margin-bottom: 20px;
    }
    .procedures-media img:first-child {
        width: 100%;
        height: auto;
        border-radius: 4px;
        margin-bottom: 20px;
        display: block;
    }
    
    /* 2. Hide the second image from media, show it in new layout */
    .procedures-media img:last-child {
        display: none;
    }

    /* 3. New Bottom Layout (Image Left + Vertical List Right) */
    .procedures-bottom-layout {
        display: flex;
        align-items: flex-start;
        gap: 15px;
        margin-top: 20px;
    }
    
    /* We need to inject a new div for the second image in HTML or use a helper class.
       To avoid changing HTML, we will use the CSS `.procedures-media` to create the bottom layout. */
    .procedures-media {
        display: flex;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 0;
    }
    
    /* Re-show the second image, now on the left */
    .procedures-media img:last-child {
        display: block;
        width: 50%;
        height: auto;
        flex-shrink: 0;
        border-radius: 4px;
    }

    /* 4. The List now goes to the right of the second image */
    .procedures-list {
        width: 50%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 0;
        padding: 0;
    }
    .procedures-list li {
        font-size: 0.95rem;
        text-align: left;
        padding-bottom: 10px;
        border-bottom: 1px solid #e5e7eb;
    }
    .procedures-media {
        flex-direction: column;
    }
    .procedures-media img:first-child,
    .procedures-media img:last-child {
        width: 100%;
        height: auto;
    }
    .procedures-list {
        flex-wrap: wrap;
        gap: 15px;
    }
    .desktop-procedures { display: none; }
    .mobile-procedures { display: block; }
    
    .mobile-top-img {
        width: 100%;
        height: auto;
        border-radius: 4px;
        margin-bottom: 30px;
        display: block;
    }
    .mobile-procedures .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
        text-align: center;
    }
    .mobile-bottom-layout {
        display: flex;
        align-items: flex-start;
        gap: 20px;
        padding: 0 var(--container-padding);
    }
    .mobile-bottom-img {
        width: 50%;
        height: auto;
        flex-shrink: 0;
        border-radius: 4px;
    }
    .mobile-procedures .procedures-list {
        width: 50%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 0;
    }
    .mobile-procedures .procedures-list li {
        font-size: 0.95rem;
        text-align: left;
        padding-bottom: 10px;
        border-bottom: 1px solid #e5e7eb;
    }
    .ach-services {
        padding: 40px 0 0 0;
    }
    
    /* Change the parent layout to a wrap-enabled flex container */
    .services-layout {
        display: flex;
        flex-wrap: wrap; /* Allows the images to wrap to the next line */
        justify-content: center;
        gap: 0; /* No gap so they touch perfectly */
        max-width: 100%;
        margin: 0;
    }
    
    /* Center block: Title + List on top (Takes full width) */
    .services-center {
        background: transparent;
        padding: 0 15px;
        text-align: center;
        width: 100%; /* Forces it to take the entire first row */
        flex: 0 0 100%; /* Prevents it from shrinking */
        order: 1; 
        margin-bottom: 30px;
    }
    .services-center .section-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    /* List: Allow wrapping into a centered 3-column layout */
    .services-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 30px;
        margin: 0;
    }
    .services-list li {
        font-size: 1rem;
        margin-bottom: 0;
        text-align: center;
    }
    
    /* Images below: Side-by-side */
    /* First Image takes 50% width */
    .service-image.left {
        width: 50%;
        min-height: 0;
        margin: 0;
        order: 2; 
        padding-right: 0; /* Slight gutter */
        position: relative;
    }
    /* Second Image takes 50% width */
    .service-image.right {
        width: 50%;
        min-height: 0;
        margin: 0;
        order: 3; 
        padding-left: 0; /* Slight gutter */
        position: relative;
    }
    
    /* Reset image positioning for mobile */
    .service-image img {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: 100%; /* Fills the container */
        object-fit: cover;
        display: block;
    }
    
    /* Ensure the images have a consistent height on mobile */
    .service-image.left, .service-image.right {
        height: auto;
        min-height: 200px; /* Adjust this to make them taller/shorter */
    }
    .ach-collection-cta {
        /* Fill the entire section without empty space */
        background: url('/assets/images/achievements/down_bg_dark.jpg') center / cover no-repeat;
        padding: 80px 20px;
        min-height: 50vh; /* Ensures the section is tall enough */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #ffffff;
    }

    .ach-collection-cta h2 {
        font-size: 1.8rem;
        white-space: nowrap; /* Title stays on one line */
        margin-bottom: 10px;
        text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    }

    .ach-collection-cta p {
        display: block;
        font-size: 0.85rem;
        margin-bottom: 30px;
        text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    }

    .ach-collection-cta .btn-gold {
        background: transparent;
        border: 1px solid #ffffff;
        border-radius: 0;
        padding: 14px 40px;
        font-size: 1.1rem;
        text-decoration: none;
    }

    .ach-collection-cta .btn-gold:hover {
        background: #ffffff;
        color: #171c3e;
    }
}