/* =========================================
   LAGOM INSIGHTS - BEAUTIFUL GRID LAYOUT
   ========================================= */

:root {
    --insights-bg: #0c1930;
    --insights-text: #ffffff;
    --insights-text-muted: #9ba1a6;
    --insights-agency-acc: #f0f0f0;
    --insights-studio-acc: #00d4ff;
    --insights-transition-speed: 0.5s;
}

body.insights-page {
    background-color: var(--insights-bg);
    color: var(--insights-text);
    min-height: 100vh;
    font-family: 'Kufam', sans-serif;
    transition: background-color var(--insights-transition-speed) ease;
    overflow-x: hidden;
}

body.insights-page[data-view="studio"] {
    background-color: #0c1930;
    /* Studio background signature */
}

/* Header */
.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 5%;
    position: relative;
    z-index: 10;
}

.btn-back-insights {
    display: inline-flex;
    align-items: center;
    color: var(--insights-text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 10px 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-back-insights:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(-5px);
}

.header-right-placeholder {
    width: 100px;
    /* To balance flexbox space-between */
}

/* Toggle Switcher */
.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--insights-text-muted);
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.toggle-btn.active {
    background: var(--insights-text);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

body.insights-page[data-view="studio"] .toggle-btn.active {
    background: var(--insights-studio-acc);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

/* Container */
.insights-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 60px 5%;
    padding-bottom: 120px;
}

.insights-page-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 3.5rem;
    text-transform: uppercase;
    letter-spacing: -1.5px;
}

/* Grid Layout */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 40px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.insights-grid.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

/* Apple & Netflix Inspired Cards */
.modern-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    grid-column: span 1;
    text-decoration: none;
    color: inherit;
}

/* Feature the first card by making it span 2 columns if grid allows */
@media (min-width: 1024px) {
    .insights-grid>.modern-card:first-child {
        grid-column: span 2;
    }

    .insights-grid>.modern-card:first-child .card-image {
        padding-top: 45%;
        /* Slightly flatter for horizontal wide view */
    }

    .insights-grid>.modern-card:first-child .card-title {
        font-size: 2.8rem;
    }
}

.modern-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.card-image {
    width: 100%;
    padding-top: 65%;
    /* 3:2 Aspect Ratio */
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
    background-color: #1a1e24;
    /* Fallback */
}

.modern-card:hover .card-image {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
}

.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modern-card:hover .card-image::after {
    opacity: 1;
}

.card-content {
    padding: 30px 10px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--insights-text-muted);
}

.card-tag {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--insights-text);
    transition: color 0.3s ease;
}

body.insights-page[data-view="studio"] .card-tag {
    color: var(--insights-studio-acc);
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.modern-card:hover .card-title {
    color: rgba(255, 255, 255, 0.8);
}

body.insights-page[data-view="studio"] .modern-card:hover .card-title {
    color: var(--insights-studio-acc);
}

.card-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--insights-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .insights-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .insights-header {
        flex-direction: column;
        gap: 25px;
    }

    .btn-back-insights {
        align-self: flex-start;
    }

    .header-right-placeholder {
        display: none;
    }

    .insights-page-title {
        font-size: 3rem;
        margin-bottom: 2.5rem;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .card-title {
        font-size: 1.6rem !important;
    }
}