:root {
    --color-primary-black: #27201f;
    --color-primary-red: #da291c;
    --color-white: #ffffff;
    --color-light-bg: #f7f7f7;
    --color-text-gray: #666666;
    --color-border-gray: #999999;
    --font-poppins: 'Poppins', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.insight-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

.insight-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1220px;
    padding: 80px 0;
    gap: 32px;
}

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 32px;
}

.search-bar {
    display: flex;
    width: 100%;
    gap: 20px;
    height: 52px;
}

.search-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    height: 52px;
    border: 1px solid var(--color-border-gray);
    border-radius: 8px;
    padding: 9px 16px;
    background-color: var(--color-white);
    -webkit-transition: border-color 0.3s ease, border-width 0.3s ease;
    -moz-transition: border-color 0.3s ease, border-width 0.3s ease;
    transition: border-color 0.3s ease, border-width 0.3s ease;
}

.search-input-container:hover {
    border-color: var(--color-primary-black);
    border-width: 1.5px;
}

.search-input-container:focus,
.search-input-container:focus-within {
    border-color: var(--color-primary-black);
    border-width: 1.5px;
    outline: none;
}

.search-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: var(--font-inter);
    font-size: 16px;
    color: var(--color-primary-black);
    height: 100%;
}

.category span {
    margin-right: 16px;
}
    .search-input::placeholder {
        color: var(--color-border-gray);
    }

.search-button {
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--color-primary-black);
    border-radius: 8px;
    padding: 8px 24px;
    cursor: pointer;
    font-family: var(--font-poppins);
    font-weight: 500; /* Medium */
    font-size: 16px;
    color: var(--color-white);
    transition: all 0.2s ease;
}

.selected-tags-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    align-items: center;
    flex: 1;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

    .selected-tags-container::-webkit-scrollbar {
        display: none;
    }

.selected-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    color: var(--color-primary-black);
}

.tag-close {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--color-text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tag-close:hover {
        color: var(--color-primary-black);
    }
    .search-button:hover {
        background-color: var(--color-primary-black);
        color: var(--color-white);
    }

/* Filter Section */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* removed flex-wrap and gap:16 to match news */
}

.filter-chips {
    display: flex;
    gap: 20px;
    /* Allow resizing to fit available space so year-filter isn't squeezed */
    flex: 1;
    min-width: 0;
    margin-right: 20px; /* Spacer between chips area and year filter */
}

/* Desktop Scrollable Chips & Arrows */
.filter-chips-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    min-width: 0;
    flex: 1; /* Allow taking available space */
    align-items: center; /* Vertically align chips */
}

    .filter-chips-scroll::-webkit-scrollbar {
        display: none;
    }

    /* Prevent chips from shrinking */
    .filter-chips-scroll .chip {
        flex-shrink: 0;
    }

/* Nav Arrow Styles */
.nav-arrow {
    display: none; /* Default hidden */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 4px;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    z-index: 10;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

    .nav-arrow:hover {
        background-color: var(--color-light-bg);
        color: var(--color-primary-black);
    }

    /* Base state for desktop arrows if visible */
    .nav-arrow:not([hidden]) {
        display: flex;
    }

/* Ensure chips list handles flex layout correctly on desktop */
.chips-list {
    width: 100%; /* Ensure it spans */
    justify-content: flex-start;
    align-items: center; /* Vertically center items including arrows */
    display: flex;
    gap: 20px;
}

.chip {
    padding: 14px 20px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background-color: var(--color-light-bg);
    color: var(--color-primary-black);
    font-family: var(--font-poppins);
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease, border 0.2s ease;
    height: 52px;
}

    .chip:hover {
        border: 1.5px solid #27201F;
    }

    .chip:active {
        border: 1.5px solid #27201F;
    }

    .chip.active-option {
        border: 1.5px solid #27201F;
        padding: 14px 20px;
    }

.year-filter {
    width: 200px;
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 16px;
    border: 1px solid var(--color-border-gray);
    border-radius: 8px;
    background-color: var(--color-white);
    cursor: pointer;
    position: relative; /* anchor for desktop dropdown */
    flex-shrink: 0; /* Prevent shrinking */
}

    .year-filter span {
        font-family: var(--font-poppins);
        font-size: 16px;
        color: var(--color-primary-black);
    }

.icon-down {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icon-down img {
        width: 20px;
        height: 20px;
    }

/* Featured Section */
.featured-section {
    display: flex;
    width: 100%;
    gap: 16px;
}

.featured-card {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.14);
    background-color: var(--color-light-bg);
    transition: box-shadow 0.3s ease;
}

.featured-card:hover {
    border-radius: 12px;
    box-shadow: 0 0 16px 0 rgb(0, 0, 0, 0.15);
}

    /* Specifics for Large Card */
    .featured-card.large {
        flex-direction: column;
        flex: 1 1 0%;
        min-width: 0; /* Add min-width to prevent content from stretching the flex item */
        min-height: 440px;
        height: auto;
        max-width: 602px;
    }

        .featured-card.large .card-image {
            width: 100%;
            height: 284px; /* Fixed height based on design */
            flex-shrink: 0;
            position: relative;
        }

        .featured-card.large .card-content {
            background-color: var(--color-light-bg);
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            height: 156px;
            flex-grow: 1; /* Fill remaining space */

        }

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Specifics for Side Cards */
.side-cards {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-width: 0;
    gap: 16px;
}

.featured-card.small {
    flex-direction: row;
    min-height: 212px;
    width: 100%;
    align-items: stretch; /* Ensure children stretch to fill height */
}

/* Fix for when anchor tag wraps the card content */
.featured-card.small > a {
    display: flex;
    flex-direction: inherit;
    width: 100%;
    text-decoration: none;
    color: inherit;
    align-items: inherit;
}

/* Fix for when anchor tag wraps the card content */
.featured-card.large > a {
    display: flex;
    flex-direction: inherit;
    width: 100%;
    text-decoration: none;
    color: inherit;
    align-items: inherit;
}
    .featured-card.small .card-image {
        width: 301px; /* Approximation, flex: 1 0 0 in design */
        flex: 1;
        height: auto; /* Let it stretch based on parent */
        min-height: 100%;
    }

    .featured-card.small .card-content {
        flex: 1;
        background-color: var(--color-light-bg);
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

/* Allow card-content (flex item) to shrink properly so text-overflow can work */
.featured-card .card-content {
    min-width: 0; /* important for flex items to allow overflow */
}

/* Ensure category inside featured-section truncates with ellipsis */
.featured-section .category {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* When category contains spans, keep them inline so they don't force wrapping */
.featured-section .category span {
    display: inline;
}

/* Text Styles in Cards */
.category {
    font-family: Poppins;
    font-weight: 500;
    font-style: Medium;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: 0%;
    color: #DA291C;
    text-align: left;
    width: 100%;
}

/* Make category a single-line container and truncate overflow with ellipsis */
.category {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Individual span items keep inline flow but won't force wrapping */
.category span {
    display: inline-block;
    vertical-align: middle;
    max-width: 100%;
}

.title {
    font-family: Poppins;
    font-weight: 600;
    font-style: SemiBold;
    font-size: 18px;
    letter-spacing: 0%;
    /* white-space: pre-wrap; Removed to allow ellipsis */
    padding: 0% !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.date {
    font-family: var(--font-poppins);
    font-weight: 400;
    font-size: 14px;
    color: var(--color-text-gray);
    margin-top: auto; /* Push to bottom of flex container */
}

.text-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Grid Section */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 32px 24px;
}

.grid-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    height: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.14);
    background-color: var(--color-light-bg);
    transition: box-shadow 0.3s ease;
}

.grid-card:hover {
    border-radius: 12px;
    box-shadow: 0 0 16px 0 rgb(0, 0, 0, 0.15);
}

    .grid-card .card-image {
        height: 180px;
        width: 100%;
    }

    .grid-card .card-content {
        background-color: var(--color-light-bg);
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        /* height: auto; Removed to allow flex grow */
        /* max-height: 156px; Removed to allow filling the card */
        flex: 1; /* Grow to fill the grid card height */
        min-height: 162px;
    }

        /* Grid card content styling is same as large card essentially */
        .grid-card .card-content .category {
        text-align: left;
            margin-bottom: auto; 
        }

    /* Make grid-card categories single-line and tighten ellipsis spacing */
    .grid-card .category {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .grid-card .category span {
        display: inline; /* inline prevents extra inline-block spacing */
        margin-right: 8px; /* keep small gap between tags */
    }
/* Mobile Dropdown Styles (New) */
.mobile-dropdown-header {
    display: none;
}

.chips-list {
    display: flex;
    gap: 20px;
}
/* Years list: hidden by default on all sizes; shown only when .show is added */
.years-list {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: var(--color-white);
    border: 1px solid var(--color-border-gray);
    border-radius: 8px;
    padding: 10px;
    z-index: 10;
    gap: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

    .years-list.show {
        display: flex;
    }



.page-ellipsis .icon {
    display: none;
    color: var(--color-primary-blue, #0056b3);
    font-size: 16px;
    letter-spacing: -1px;
}

.page-ellipsis:hover .dots {
    display: none;
}

.page-ellipsis:hover .icon {
    display: block;
}


/* Desktop Scrollable Chips & Arrows */
.filter-chips-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    min-width: 0;
    flex: 1; /* Allow taking available space */
    align-items: center; /* Vertically align chips */
}

    .filter-chips-scroll::-webkit-scrollbar {
        display: none;
    }

    /* Prevent chips from shrinking */
    .filter-chips-scroll .chip {
        flex-shrink: 0;
    }

/* Nav Arrow Styles - mimicking solutions__nav .nav-arrow */
.nav-arrow {
    display: none; /* Default hidden */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #fff;
    /* border: 1px solid var(--color-border-gray); or none? matches solutions which has specific bg/border */
    /* solutions uses white bg, no border mention initially? wait line 1974 says radius 4px */
    border-radius: 4px;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    z-index: 10;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

    .nav-arrow:hover {
        background-color: var(--color-light-bg);
        color: var(--color-primary-black);
    }

    /* Base state for desktop arrows if visible */
    .nav-arrow:not([hidden]) {
        display: flex;
    }

/* Ensure chips list handles flex layout correctly on desktop */
.chips-list {
    width: 100%; /* Ensure it spans */
    justify-content: flex-start;
    align-items: center; /* Vertically center items including arrows */
}

/* Responsive Design */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.year-option {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    text-align: left;
    border: none;
    background-color: transparent;
    padding: 10px 12px;
    margin: 0;
    font-family: var(--font-poppins);
    font-size: 16px;
    color: var(--color-primary-black);
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
}

    .year-option:hover,
    .year-option:focus {
        background-color: var(--color-light-bg);
        outline: none;
    }

    .year-option.active-option {
        background-color: var(--color-light-bg);
        font-weight: 500;
    }

/* Responsive Design */
@media (max-width: 1024px) {
    .insight-content {
        padding: 60px 20px;
    }

    .insight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .featured-section {
        flex-direction: column;
    }

    .featured-card.large {
        width: 100%;
        max-width: none;
        min-height: 400px;
    }

        .featured-card.large .card-image {
            height: auto;
            aspect-ratio: 16/9;
        }

    .side-cards {
        width: 100%;
        max-width: none;
        flex-direction: row;
    }

    .featured-card.small {
        flex: 1 1 0%;
        flex-direction: column;
        height: auto;
    }

        .featured-card.small .card-image {
            width: 100%;
            height: 180px;
            flex: none;
            min-height: 0;
        }

        .featured-card.small .card-content {
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex: 1;
            min-height: 162px;
            justify-content: flex-start;
        }

        .featured-card.small .card-content .category {
            margin-bottom: auto;
        }
}

@media (max-width: 768px) {
    .insight-content {
        padding: 40px 16px;
        gap: 32px;
    }

    .search-bar {
        flex-direction: column;
        height: auto;
    }

    .search-input-container {
        flex: none;
        height: 52px;
    }

    .search-button {
        width: 100%;
        padding: 12px;
    }

    .filter-section {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        justify-content: space-between;
    }

    .filter-chips {
        margin-right: 0;
        width: 0;
        flex: 1;
        min-width: 0;
        height: 52px;
        display: flex;
        align-items: center;
        padding: 9px 16px;
        border: 1px solid var(--color-border-gray);
        border-radius: 8px;
        background-color: var(--color-white);
        box-sizing: border-box;
        position: relative;
        gap: 8px;
    }

    .mobile-dropdown-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    .chips-list {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--color-white);
        border: 1px solid var(--color-border-gray);
        border-radius: 8px;
        padding: 10px;
        z-index: 1;
        gap: 5px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

        .years-list.show, .chips-list.show {
            display: flex;
        }

    /* Override for scroll containers on mobile to be flat list */
    .filter-chips-scroll {
        display: contents;
    }

    .nav-arrow {
        display: none !important;
    }

    .chip {
        width: 100%;
        text-align: left;
        border: none;
        background-color: transparent;
        padding: 10px 12px;
        margin: 0;
        font-family: var(--font-poppins);
        font-size: 16px;
        color: var(--color-primary-black);
        cursor: pointer;
        border-radius: 0;
        box-shadow: none;
        font-weight: 400;
        overflow-wrap: break-word;
    }

        .chip:hover,
        .chip:focus {
            border: 1.5px solid #27201F;
            outline: none;
        }

        .chip.active-option {
            border: none;
            font-weight: 500;
        }

    .year-filter {
        width: 0;
        flex: 1;
        min-width: 0;
        height: 52px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 9px 16px;
        border: 1px solid var(--color-border-gray);
        border-radius: 8px;
        background-color: var(--color-white);
        box-sizing: border-box;
        position: relative;
    }

    .years-list {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--color-white);
        border: 1px solid var(--color-border-gray);
        border-radius: 8px;
        padding: 10px;
        z-index: 10;
        gap: 5px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .insight-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-cards {
        flex-direction: column;
    }

    .featured-card.small {
        flex-direction: row;
        width: 100%;
    }

        .featured-card.small .card-image {
            width: 120px;
            flex: 0 0 120px;
            height: auto;
            min-height: 140px;
        }

    /* Small mobiles adjustments */
    @media (max-width: 480px) {
        .featured-card.small {
            flex-direction: column;
        }

            .featured-card.small .card-image {
                width: 100%;
                height: 180px;
                flex: initial;
            }
    }
}

@media (min-width: 480px) and (max-width: 1024px) {
    .featured-card.small {
        flex-direction: column !important;
        height: auto !important;
    }

        /* Fix image size to match grid-card */
        .featured-card.small .card-image {
            width: 100% !important;
            height: 180px !important;
            flex: none !important;
        }

        /* Fix content layout */
        .featured-card.small .card-content {
            flex-direction: column !important;
            padding: 20px !important;
            min-height: 162px !important;
            justify-content: flex-start !important;

        }

            .featured-card.small .card-content .category {
                margin-bottom: auto;
            }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .side-cards {
        flex-direction: row !important;
        gap: 24px;
    }

    .featured-card.small {
        flex: 1;
    }
}





/* Hover effect vars for search button */
.search-button {
    --btn-fill-bg: #27201F;
    --btn-fill-sweep: #fff;
    --btn-fill-text: #27201F;
    height: 52px;
}

/* Card image overflow hidden for scale hover */
.news-card .card-image {
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

/* News page class aliases (maps to insight-* equivalents) */
.news-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

.news-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1220px;
    padding: 80px 0;
    gap: 32px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 32px 24px;
}

.news-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    height: auto;
    background-color: var(--color-light-bg);
    transition: box-shadow 0.3s ease;
}

.news-card:hover {
    border-radius: 12px;
    box-shadow: 0 0 16px 0 rgb(0, 0, 0, 0.15);
}

    .news-card .card-image {
        height: 180px;
        width: 100%;
        overflow: hidden;
        border-radius: 12px 12px 0 0;
    }

    .news-card .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .news-card .card-content {
        background-color: var(--color-light-bg);
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex: 1;
        min-height: 162px;
    }

    .news-card .card-content .category {
        text-align: left;
        margin-bottom: auto;
    }

@media (max-width: 1024px) {
    .news-content {
        padding: 60px 20px;
    }

    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .news-content {
        padding: 40px 16px;
        gap: 32px;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
