*, *::before, *::after { 
    box-sizing: border-box; 
}

/* 1. The Outer Wrapper */
.services-section {
    width: 98%; 
    max-width: 1800px; 
    margin: 0 auto;
}

.s-modern-boho-wrapper {
    position: relative;
    font-family: 'Inter', system-ui, sans-serif;
    color: #2c2a25;
		padding-bottom: 30px;
}

/* 2. The Layout Container - Switched back to Flexbox for smooth accordion widths */
.card-container {
    display: flex;
    flex-direction: row; 
    gap: 0.85rem; 
    width: 100%;
    align-items: start; 
}

/* 3. The Graceful Card */
.s-card {
    flex: 1 1 0px; /* Forces equal widths initially */
    min-width: 0; /* Prevents text from forcing the card wider than its flex value */
    
    background-color: transparent; 
    background-image: 
        linear-gradient(to right, rgba(201, 136, 96, 0) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(201, 136, 96, 0) 1px, transparent 1px);
    background-size: 30px 30px; 
    border: 1px solid transparent; 
    border-radius: 20px;
    padding: 32px 24px; 
    
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    
    /* Added flex-grow to the transition list so the width animates smoothly */
    transition: flex-grow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease,
                background-color 0.4s ease,
                background-image 0.4s ease;
    box-shadow: 0 10px 30px rgba(44, 42, 37, 0); 
    
    cursor: pointer; 
}

/* === NEW ACCORDION WIDTH LOGIC === */
/* If ANY card is hovered, expand the specifically hovered one */
.card-container:has(.s-card:hover) .s-card:hover {
    flex-grow: 1.8; 
}

/* If ANY card is hovered, shrink the ones NOT being hovered */
.card-container:has(.s-card:hover) .s-card:not(:hover) {
    flex-grow: 0.75; 
}

/* Fluid Hover State (Background, tilt, and shadow remain the same) */
.s-card:hover {
    background-color: #fdfbf7; 
    background-image: 
        linear-gradient(to right, rgba(201, 136, 96, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(201, 136, 96, 0.08) 1px, transparent 1px);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(201, 136, 96, 0.15); 
    border-color: rgba(201, 136, 96, 0.5);
}

/* Icon Wrapper */
.s-icon-wrapper {
    width: 48px;
    height: 48px;
    margin-bottom: 24px;
    color: #c98860; 
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2; 
    transform-origin: left center; /* Keeps the icon aligned left when it shrinks */
}

.s-card:hover .s-icon-wrapper {
    transform: scale(1.1) translateY(-4px);
}

/* Shrinks the icon on unhovered cards */
.card-container:has(.s-card:hover) .s-card:not(:hover) .s-icon-wrapper {
    transform: scale(0.85); 
}

/* Typography - Title */
.s-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0; 
    letter-spacing: -0.01em;
    color: #2c2a25; 
    position: relative;
    z-index: 2;
    
    /* CRITICAL: Forces text to stay on one line so height never changes */
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; /* Adds "..." if it gets too tight */
    
    transform-origin: left center;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shrinks the title text smoothly on unhovered cards */
.card-container:has(.s-card:hover) .s-card:not(:hover) .s-title {
    transform: scale(0.85); 
}

/* === DROPDOWN ANIMATION LOGIC === */
.s-dropdown-wrapper {
    display: grid;
    grid-template-rows: 0fr; 
    transition: grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.s-card:hover .s-dropdown-wrapper {
    grid-template-rows: 1fr;
}

.s-dropdown-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0; 
    transition: opacity 0.3s ease; 
}

.s-card:hover .s-dropdown-content {
    opacity: 1;
    transition-delay: 0.15s; 
}

.s-desc {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #5c584f;
    margin-top: 16px; 
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
    
    /* Restores standard wrapping for the description text */
    white-space: normal; 
}

.s-link {
    font-weight: 600;
    color: #2c2a25;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
    margin-top: auto; 
    padding-bottom: 8px; 
}

.s-link svg {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.s-link:hover {
    color: #c98860;
}

.s-link:hover svg {
    transform: translateX(6px);
}

/* Mobile Responsiveness - Falls back to Grid so elements stack nicely on small screens */
@media (max-width: 1200px) {
    .card-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 768px) {
    .card-container {
        display: grid;
        grid-template-columns: 1fr; 
    }
}