/* Defense Organization Disaster Section - Bento Grid */
.organization-disaster-section {
    background: linear-gradient(180deg, #0a0e27 0%, #070b1f 100%);
    padding: 120px 20px;
    position: relative;
    overflow: hidden;
}

.organization-container {
    max-width: 1200px;
    margin: 0 auto;
}

.organization-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.organization-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-weight: 500;
    margin-bottom: 4rem;
}

/* Section Container */
.section-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #3543F0;
    margin-bottom: 2rem;
    text-align: center;
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    gap: 1rem;
    max-width: 100%;
}

/* Pattern Grid - 5 items */
.pattern-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 200px);
}

/* Lawyer Grid - 4 items */
.lawyer-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 200px);
}

/* Bento Card Base */
.bento-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bento-card[data-delay="0"] { animation-delay: 0.1s; }
.bento-card[data-delay="100"] { animation-delay: 0.2s; }
.bento-card[data-delay="200"] { animation-delay: 0.3s; }
.bento-card[data-delay="300"] { animation-delay: 0.4s; }
.bento-card[data-delay="400"] { animation-delay: 0.5s; }
.bento-card[data-delay="500"] { animation-delay: 0.6s; }
.bento-card[data-delay="600"] { animation-delay: 0.7s; }
.bento-card[data-delay="700"] { animation-delay: 0.8s; }
.bento-card[data-delay="800"] { animation-delay: 0.9s; }

/* Card Sizes for Pattern Grid */
.pattern-grid .bento-card.large {
    grid-column: span 2;
    grid-row: span 2;
}

.pattern-grid .bento-card.medium {
    grid-column: span 2;
    grid-row: span 1;
}

.pattern-grid .bento-card.small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Card Sizes for Lawyer Grid */
.lawyer-grid .bento-card.medium {
    grid-column: span 1;
    grid-row: span 1;
}

.lawyer-grid .bento-card.small {
    grid-column: span 1;
    grid-row: span 1;
}

.lawyer-grid .bento-card.wide {
    grid-column: span 2;
    grid-row: span 1;
}

/* Card Image */
.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity 0.5s ease;
    display: block;
}

/* Specific adjustments for lawyer grid images to show full image */
.lawyer-grid .bento-card:nth-child(2) .card-image img,
.lawyer-grid .bento-card:nth-child(3) .card-image img,
.lawyer-grid .bento-card:nth-child(4) .card-image img {
    object-fit: cover;
    transform: scale(0.85);
}

/* Position adjustments for specific cards */
.lawyer-grid .bento-card:nth-child(2) .card-image img {
    object-position: center center;
}

.lawyer-grid .bento-card:nth-child(3) .card-image img {
    object-position: center 20%; /* Show more of the top */
}

.lawyer-grid .bento-card:nth-child(4) .card-image img {
    object-position: center 20%; /* Show more of the top */
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem;
    background: linear-gradient(to top, 
        rgba(10, 14, 39, 0.98) 0%, 
        rgba(10, 14, 39, 0.95) 30%,
        rgba(10, 14, 39, 0.85) 60%,
        rgba(10, 14, 39, 0.7) 100%);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.card-overlay h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.card-overlay p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 1);
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
}

.card-overlay ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-overlay ul li {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.card-overlay ul li::before {
    content: '×';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-size: 1.5rem;
    line-height: 1;
}

/* Hover Effects */
.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.bento-card:hover .card-image {
    transform: scale(1.1);
}

.bento-card:hover .card-image img {
    opacity: 0.4;
}


/* Always show overlay for small cards in pattern grid */
.pattern-grid .bento-card.small .card-overlay {
    transform: translateY(0);
}

/* Wide card always shows overlay */
.bento-card.wide .card-overlay {
    transform: translateY(0);
}

/* Footer */
.organization-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.organization-footer p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.organization-footer strong {
    color: #ef4444;
    font-weight: 700;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .pattern-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 180px);
    }
    
    .lawyer-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 180px);
    }
    
    .section-container {
        padding: 1.5rem;
    }
    
    /* Adjust card sizes for medium screens */
    .pattern-grid .bento-card.large {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .pattern-grid .bento-card.medium {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .bento-card {
        min-height: 180px;
    }
    
    .card-overlay {
        padding: 1rem;
    }
    
    .card-overlay p {
        font-size: 0.85rem;
    }
}

/* Medium screens - 50-60% width fix */
@media (max-width: 768px) and (min-width: 600px) {
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 200px);
    }
    
    .lawyer-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 200px);
    }
    
    /* Reset all spans */
    .pattern-grid .bento-card.large,
    .pattern-grid .bento-card.medium,
    .pattern-grid .bento-card.small {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .bento-card {
        min-height: 200px;
    }
    
    /* Ensure images are visible */
    .card-image {
        opacity: 1;
        visibility: visible;
    }
    
    .card-image img {
        opacity: 0.6;
    }
}

/* Mobile Responsive */
@media (max-width: 599px) {
    .organization-disaster-section {
        padding: 80px 20px;
    }

    .pattern-grid,
    .lawyer-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 180px);
        gap: 0.75rem;
    }
    
    .bento-card {
        min-height: 180px;
    }
    
    /* Reset all spans on mobile */
    .pattern-grid .bento-card.large,
    .pattern-grid .bento-card.medium,
    .pattern-grid .bento-card.small,
    .lawyer-grid .bento-card.medium,
    .lawyer-grid .bento-card.small,
    .lawyer-grid .bento-card.wide {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    /* Always show overlay on mobile */
    .card-overlay {
        transform: translateY(0);
        padding: 1rem;
    }
    
    .card-overlay p {
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .organization-footer p {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .pattern-grid,
    .lawyer-grid {
        grid-template-columns: 1fr;
    }
    
    .section-container {
        padding: 1rem;
    }
}