/* ════════════════════════════════════════════════════════════════
   BENTO GRID LAYOUT - 2026 Modern Design Pattern
   Modular, self-contained stories with dynamic grid
   ════════════════════════════════════════════════════════════════ */

/* ─── BENTO GRID CONTAINER ─── */
.bento-grid {
    display: grid;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: auto;
    padding: clamp(2rem, 5vw, 4rem);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ─── BENTO ITEM BASE ─── */
.bento-item {
    background: linear-gradient(135deg, #4e9298 0%, #3d7a7f 100%);
    border: 1px solid rgba(123, 191, 196, 0.3);
    border-radius: 12px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    cursor: default;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: white;
}

.bento-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s;
    z-index: 0;
}

.bento-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(61, 122, 127, 0.15);
    border-color: #3d7a7f;
}

.bento-item:hover::before {
    left: 100%;
}

/* ─── FEATURED ITEM (HERO SIZE) ─── */
.bento-item.featured {
    grid-column: span 2;
    min-height: 400px;
    background: linear-gradient(135deg, #3d7a7f 0%, #2a5c60 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.bento-item.featured::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.bento-item.featured h2,
.bento-item.featured p {
    position: relative;
    z-index: 2;
}

/* ─── TALL ITEM (2x HEIGHT) ─── */
.bento-item.tall {
    grid-row: span 2;
    min-height: 500px;
}

/* ─── WIDE ITEM ─── */
.bento-item.wide {
    grid-column: span 2;
}

/* ─── SMALL ITEMS (STATS, FEATURES) ─── */
.bento-item.small {
    min-height: 200px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ─── ITEM CONTENT STRUCTURE ─── */
.bento-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bento-item:hover .bento-icon {
    transform: scale(1.1) rotate(5deg);
    opacity: 1;
}

.bento-title {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #2a3a3f;
    line-height: 1.2;
}

.bento-item.featured .bento-title {
    color: white;
}

.bento-description {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.bento-item.featured .bento-description {
    color: rgba(255, 255, 255, 0.9);
}

.bento-stat {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: #3d7a7f;
    margin-bottom: 0.5rem;
}

.bento-item.featured .bento-stat {
    color: #b8d8db;
}

.bento-label {
    font-size: 0.85rem;
    color: #7bbfc4;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── BENTO CTA BUTTON ─── */
.bento-cta {
    align-self: flex-start;
    padding: 0.8rem 1.5rem;
    border: 2px solid #3d7a7f;
    background: white;
    color: #3d7a7f;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    margin-top: 1rem;
}

.bento-item.featured .bento-cta {
    border-color: white;
    color: white;
    background: transparent;
}

.bento-cta:hover {
    background: #3d7a7f;
    color: white;
    transform: translateX(4px);
}

.bento-item.featured .bento-cta:hover {
    background: white;
    color: #3d7a7f;
}

/* ─── RESPONSIVE ADJUSTMENTS ─── */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .bento-item.featured,
    .bento-item.wide {
        grid-column: span 1;
    }

    .bento-item.tall {
        grid-row: span 1;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem;
        padding: 1.5rem;
    }

    .bento-item {
        padding: 1.5rem;
        min-height: auto !important;
    }

    /* Reset all span values on mobile */
    .bento-item.featured,
    .bento-item.wide,
    .bento-item.tall {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: auto !important;
    }

    .bento-title {
        font-size: 1.3rem;
    }

    .bento-stat {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 1rem;
    }

    .bento-item {
        padding: 1.2rem;
        min-height: auto !important;
    }

    /* Reset all span values on small mobile */
    .bento-item.featured,
    .bento-item.wide,
    .bento-item.tall {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: auto !important;
    }

    .bento-title {
        font-size: 1.1rem;
    }

    .bento-stat {
        font-size: 1.8rem;
    }

    .bento-description {
        font-size: 0.9rem;
    }
}

    .bento-item {
        padding: 1.2rem;
    }
}

    .bento-item {
        padding: 1.2rem;
    }

    .bento-title {
        font-size: 1.1rem;
    }

    .bento-description {
        font-size: 0.9rem;
    }

    .bento-stat {
        font-size: 1.8rem;
    }

    .bento-icon {
        font-size: 2rem;
    }
}

/* ─── GRID TEMPLATE PRESETS ─── */

/* Template 1: Featured + 6 items */
.bento-grid.template-1 {
    grid-template-columns: repeat(3, 1fr);
}

.bento-grid.template-1 .bento-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

/* Template 2: Balanced 2x3 */
.bento-grid.template-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Template 3: Magazine style */
.bento-grid.template-3 {
    grid-template-columns: repeat(4, 1fr);
}

.bento-grid.template-3 .bento-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-grid.template-3 .bento-item:nth-child(2) {
    grid-column: span 2;
}

/* ─── ANIMATION FOR BENTO ITEMS ─── */
.bento-item {
    opacity: 0;
    transform: translateY(20px);
}

.bento-item.animate {
    animation: bentoFadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bento-item:nth-child(1) { animation-delay: 0.1s; }
.bento-item:nth-child(2) { animation-delay: 0.2s; }
.bento-item:nth-child(3) { animation-delay: 0.3s; }
.bento-item:nth-child(4) { animation-delay: 0.4s; }
.bento-item:nth-child(5) { animation-delay: 0.5s; }
.bento-item:nth-child(6) { animation-delay: 0.6s; }
.bento-item:nth-child(7) { animation-delay: 0.7s; }
.bento-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes bentoFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── DARK MODE SUPPORT ─── */
@media (prefers-color-scheme: dark) {
    .bento-item {
        background: linear-gradient(135deg, #4e9298 0%, #3d7a7f 100%);
        border-color: rgba(123, 191, 196, 0.3);
        color: white;
    }

    .bento-title {
        color: #ffffff;
    }

    .bento-description {
        color: rgba(255, 255, 255, 0.9);
    }

    .bento-stat {
        color: #b8d8db;
    }

    .bento-cta {
        background: #3d7a7f;
        color: white;
        border-color: #3d7a7f;
    }

    .bento-cta:hover {
        background: #3d7a7f;
        border-color: #7bbfc4;
    }
}
