/* insights.css */
.back-arrow {
    position: absolute;
    top: var(--back-arrow-top);
    left: var(--back-arrow-left);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--back-arrow-size);
    height: var(--back-arrow-size);
    border-radius: 50%;
    background-color: var(--color-bg-description-box);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 1.25rem;
    color: var(--color-heading-warm);
    text-decoration: none;
    padding: 0;
    transition: all 0.2s ease-in-out;
}

.back-arrow:hover {
    transform: scale(1.05);
}

/* --- Insights Page Specific Styles --- */

.container {
    max-width: var(--container-wide-max-width);
}

.section-title {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    border-bottom: 1px dotted black;
    color: var(--color-text-rishi-label);
}

.insights-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    background-color: var(--color-bg-navbar);
    color: var(--color-text-nav);
}

.insights-header h1 {
    color: var(--color-text-nav);
    margin-bottom: var(--spacing-sm);
}

.insights-header p {
    color: var(--color-text-footer);
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
}



/* ---------------------------------------------------- */
/* --- LAYOUT STRUCTURE (Stacking sections, boxes in rows) --- */
/* ---------------------------------------------------- */

.insights-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    padding: var(--spacing-lg);
}

.insight-section {
    padding: 0;
}

.insight-section h2 {
    color: var(--color-heading);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: var(--spacing-sm);
    font-size: 1.8rem;
    padding-left: 5px;
}

.insight-boxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    justify-items: stretch;
    align-items: stretch;
}


/* ---------------------------------------------------- */
/* --- INDIVIDUAL INSIGHT BOX STYLING (Card replacement) --- */
/* ---------------------------------------------------- */

.insight-box.card-item {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--box-shadow-subtle);
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
    text-align: left;
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none;
    height: 100%;
    width: 100%;
}

.insight-box.card-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-focus);
    background-color: var(--color-bg-card-hover);
    border-color: var(--color-card-border-strong);
}

.card-image-wrapper {
    width: 100%;
    height: var(--card-image-height-standard);
    overflow: hidden;
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
    background-color: var(--image-wrapper-fallback-color);
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--color-bg-card-hover);
    display: flex;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.insight-box.card-item:hover .card-image {
    transform: scale(1.05);
}

.box-content.card-content {
    background-color: var(--color-card-content-dark);
    padding: var(--spacing-md);
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    border-bottom-left-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
    min-height: 100px;
}

.card-item h3 {
    color: #ddd;
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    padding-bottom: var(--spacing-sm);
}

.card-description-box {
    background-color: var(--color-bg-card);
    flex-grow: 1;
    margin-left: calc(var(--spacing-md) * -1);
    margin-right: calc(var(--spacing-md) * -1);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom-left-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
    min-height: 50px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-description-box p {
    font-size: 1.1rem;
    color: var(--color-text-description);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Responsive adjustments for insights.ejs */
@media (max-width: 1400px) {
    .insight-boxes {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .insight-boxes {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    .card-item h3 { font-size: 1.1rem; }
    .card-image-wrapper { height: 200px; }
}

@media (max-width: 768px) {
    .insight-section { padding: 0; }
    .insight-boxes {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    .card-image-wrapper { height: 180px; }
}

@media (max-width: 480px) {
    .insights-header h1 { font-size: var(--font-size-h2); }
    .insights-grid { padding: var(--spacing-sm); }
    .insight-box.card-item { max-width: 95%; margin: 0 auto; }
    .card-image-wrapper { height: 200px; }
}