.small-card {
    width: 100%;
    padding: 38px 0px;
    border-top: 1px solid var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Custom column layout: show all cards */
.left-column .small-card,
.center-column .horizontal-card,
.right-column .extra-small-card {
    display: flex !important;
}

/* Adaptive density for long titles in left column */
.left-column .small-card .small-card-heading {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.15;
    margin-bottom: 12px;
}

.left-column .small-card.adaptive-long .small-card-heading {
    -webkit-line-clamp: 2;
    font-size: clamp(36px, 1.95vw, 44px) !important;
}

.left-column .small-card.adaptive-very-long .small-card-heading {
    -webkit-line-clamp: 2;
    font-size: clamp(31px, 1.7vw, 38px) !important;
}

.left-column .small-card.adaptive-long .small-card-image-wrapper {
    height: 14vw;
}

.left-column .small-card.adaptive-very-long .small-card-image-wrapper {
    height: 12.5vw;
}

.left-column .small-card:first-of-type,
.center-column .horizontal-card:first-of-type,
.right-column .extra-small-card:first-of-type {
    border-top: none;
    padding-top: 0;
}

.right-column .extra-small-card-image-wrapper {
    height: 10vw;
}

@media (max-width: 991px) {
    .right-column .extra-small-card-image-wrapper {
        height: 180px;
    }

    .left-column .small-card .small-card-heading {
        -webkit-line-clamp: 2;
    }

    .left-column .small-card.adaptive-long .small-card-image-wrapper {
        height: 220px;
    }

    .left-column .small-card.adaptive-very-long .small-card-image-wrapper {
        height: 200px;
    }
}

.small-card-small-text {
    display: flex;
    line-height: 100%;
    color: var(--text-color);
    align-items: flex-start;
}

.small-card-heading {
    margin-top: 13px;
    margin-bottom: 14px;
}

.small-card-heading,
.extra-small-card-heading,
.horizontal-card .small-card-heading {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2 !important;
    overflow: hidden;
    line-height: 1.18;
}

.small-card-image-link {
    display: block;
    margin-bottom: 14px;
    margin-top: auto;
    width: 100%;
}

.small-card-image-wrapper {
    width: 100%;
    height: 16vw;
}

.small-card-text {
    margin-bottom: 13px;
}

.small-card-bottom-text {
    font-style: italic;
    opacity: 0.7;
    line-height: 100%;
}

.big-card {
    width: 100%;
    padding-bottom: 38px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.big-card-image-link {
    width: 100%;
    display: block;
    margin-bottom: 28px;
}

.big-card-image-wrapper {
    width: 100%;
    height: 31vw;
}

.big-card-heading {
    margin-top: 14px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.18;
}

.big-card-text {
    margin-bottom: 15px;
}

.horizontal-card {
    border-top: 1px solid var(--text-color);
    width: 100%;
    padding: 38px 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 38px;
}

.horizontal-card-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.horizontal-card-image-link {
    margin-bottom: 0px;
    margin-top: 0px;
}

.extra-small-card {
    width: 100%;
    padding: 26px 0px;
    border-top: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.extra-small-card + .extra-small-card {
    border-top: 1px solid var(--text-color);
}

.extra-small-card-image-link {
    display: block;
    margin-bottom: 0px;
    width: 56%;
    margin-top: 12px;
}

.extra-small-card-image-wrapper {
    width: 100%;
    height: 9vw;
}

.extra-small-card-heading {
    margin-top: 9px;
    margin-bottom: auto;
}

.extra-small-card small {
    font-size: 12px;
}

.extra-small-card-mobile-excerpt {
    display: none;
}

.left-column .small-card,
.center-column .horizontal-card {
    display: none;
}

.left-column .small-card:nth-child(2),
.left-column .small-card:nth-child(3),
.left-column .small-card:nth-child(6),
.center-column .horizontal-card:nth-child(3),
.center-column .horizontal-card:nth-child(4),
.center-column .horizontal-card:nth-child(6) {
    display: flex;
}

.homepage-newsletter .center-column .horizontal-card:nth-child(3),
.homepage-newsletter .center-column .horizontal-card:nth-child(6),
.homepage-newsletter .left-column .small-card:nth-child(6),
.right-column .extra-small-card:nth-child(7),
.right-column .extra-small-card:nth-child(8) {
    display: none;
}

.homepage-newsletter .left-column .small-card:nth-child(4),
.homepage-newsletter .left-column .small-card:nth-child(7),
.homepage-newsletter .center-column .horizontal-card:nth-child(5),
.homepage-newsletter .center-column .horizontal-card:nth-child(7),
.homepage-newsletter .right-column .extra-small-card:nth-child(7),
.homepage-newsletter .right-column .extra-small-card:nth-child(8) {
    display: flex;
}

.big-card-mobile {
    display: none;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 42px;
    row-gap: 57px;
}

.pagination-grid {
    margin-top: 57px;
    margin-bottom: 57px;
}

.grid-small-card {
    border-top: none !important;
    padding: 0px !important;
}

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 16vw;
    border: 1px solid var(--text-color);
    margin-bottom: 14px;
    margin-top: auto;
}

.text-min-height {
    min-height: 115px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-heading-slider {
    width: 100%;
}

.big-slide-placeholder {
    display: none;
}

.extra-small-side-card {
    flex-direction: row;
    align-items: flex-end;
}

.extra-small-side-card-image-link,
.extra-small-side-card-placeholder {
    width: 45%;
    min-width: 45%;
    height: 7.4vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extra-small-side-card-heading {
    font-size: 18px;
    margin-bottom: 4px;
}

.extra-small-side-card-placeholder {
    border: 1px solid var(--text-color);
}

.extra-small-side-card-content {
    margin-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tags-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    column-gap: 26px;
    row-gap: 38px;
}

.authors-grid-section .small-card-text {
    margin-bottom: 0px !important;
}

.no-margin-left {
    margin-left: 0px !important;
}

/* Styles for large desktop */
@media (min-width: 1439px) {  
    .small-card {
        padding: calc(2.64vw * var(--scale)) 0px;
    }
    
    .small-card-heading {
        margin-top: calc(0.9vw * var(--scale));
        margin-bottom: calc(0.97vw * var(--scale));
    }
    
    .small-card-image-link {
        margin-bottom: calc(0.97vw * var(--scale));
    }
     
    .small-card-text {
        margin-bottom: calc(0.9vw * var(--scale));
    }

    .big-card {
        padding-bottom: calc(2.64vw * var(--scale));
    }
    
    .big-card-heading {
        margin-top: calc(1.11vw * var(--scale));
        margin-bottom: calc(0.7vw * var(--scale));
    }
    
    .big-card-image-link {
        margin-bottom: calc(1.94vw * var(--scale));
    }
     
    .big-card-text {
        margin-bottom: calc(1.04vw * var(--scale));
    }

    .horizontal-card {
        padding: calc(2.64vw * var(--scale)) 0px;
        gap: calc(2.64vw * var(--scale));
    }
    
    .horizontal-card-image-link {
        margin-bottom: 0px;
    }

    .extra-small-card {
        padding: calc(1.81vw * var(--scale)) 0px;
    }
    
    .extra-small-card-image-link {
        margin-top: calc(0.83vw * var(--scale));
    }
    
    .extra-small-card-heading {
        margin-top: calc(0.63vw * var(--scale));
    }

    .extra-small-card small {
        font-size: calc(0.83vw * var(--scale));
    }

    .grid {
        column-gap: calc(2.92vw * var(--scale));
        row-gap: calc(3.96vw * var(--scale));
    }

    .placeholder {
        margin-bottom: calc(0.97vw * var(--scale));
    }

    .text-min-height {
        min-height: calc(8vw * var(--scale));
    }

    .pagination-grid {
        margin-top: calc(3.96vw * var(--scale));
        margin-bottom: calc(3.96vw * var(--scale));
    }

    .extra-small-side-card-heading {
        font-size: calc(1.25vw * var(--scale));
    }
    
    .extra-small-side-card-content {
        margin-left: calc(0.97vw * var(--scale));
    }

    .tags-grid {
        column-gap: calc(1.81vw * var(--scale));
        row-gap: calc(2.64vw * var(--scale));
    }
}

/* Styles for tablet */
@media (max-width: 991px) { 
    .small-card-image-wrapper {
        height: 66vw;
    }

    .small-card-image-link {
        margin-bottom: 18px;
    }
    
    .big-card-image-wrapper {
        height: 66vw;
    }

    .big-card-desktop {
        display: none;
    }

    .big-card-mobile {
        display: block;
    }

    .horizontal-card-image-link {
        max-width: 50%;
    }

    .horizontal-card-image-link .small-card-image-wrapper {
        height: 31vw;
    }

    .horizontal-card .medium-text {
        margin-bottom: 11px;
    }

    .extra-small-card {
        padding: 38px 0px;
    }

    .extra-small-card + .extra-small-card {
        border-top: none;
    }

    .extra-small-card-image-link {
        width: 62vw;
        height: 44vw;
    }

    .extra-small-card-image-wrapper {
        height: 100%;
    }

    .extra-small-card-mobile-excerpt {
        display: block;
        margin-top: 12px;
        min-height: 51px;
    }

    .extra-small-card small {
        font-size: 14px;
    }

    .grid {
        grid-template-columns: 1fr;
        column-gap: 38px;
        row-gap: 0px;
    }
    
    .pagination-grid {
        margin-top: 0px;
        margin-bottom: 38px;
    }
    
    .grid-small-card {
        border-top: none !important;
        padding: 38px 0px !important;
        border-bottom: 1px solid var(--text-color);
    }
    
    .placeholder {
        display: none;
    }
    
    .text-min-height {
        min-height: auto;;
    }

    .right-column {
        overflow: hidden;
    }

    .big-slide-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 62vw;
        height: 42vw;
        border: 1px solid var(--text-color);
    }

    .tags-grid {
        grid-template-columns: 1fr 1fr;
        row-gap: 38px;
        padding-top: 38px;
    }

    .tags-grid .slide-card-image-link {
        width: 100%;
        height: 32vw;
    }

    .authors-grid-section .small-card:last-child{
        padding-bottom: 0px !important;
        border-bottom: none !important;
    }

    .homepage-newsletter .left-column .small-card,
    .homepage-newsletter .center-column .horizontal-card {
        display: none;
    }

    .big-card-mobile .small-card {
        display: flex !important;
    }

    .center-column .horizontal-card {
        display: none !important;
    }

    .left-column .small-card:nth-child(1) {
        display: flex;
    }   

    .center-column .horizontal-card:nth-child(3),
    .center-column .horizontal-card:nth-child(4),
    .center-column .horizontal-card:nth-child(5) {
        display: flex !important;
    }

    .left-column .small-card:nth-child(6) {
        display: none;
    }

    .homepage-newsletter .left-column .small-card:nth-child(4),
    .homepage-newsletter .left-column .small-card:nth-child(5),
    .homepage-newsletter .left-column .small-card:nth-child(7) {
        display: none !important;
    }

    .homepage-newsletter .left-column .small-card:nth-child(1),
    .homepage-newsletter .left-column .small-card:nth-child(2),
    .homepage-newsletter .left-column .small-card:nth-child(3) {
        display: flex !important;
    }
}

/* Styles for mobile */
@media (max-width: 479px) { 
    .small-card {
        padding: 32px 0px;
    }
    
    .small-card-heading {
        margin-top: 11px;
        margin-bottom: 14px;
    }
    
    .small-card-text {
        margin-bottom: 11px;
    }
    
    .horizontal-card {
        padding: 32px 0px;
        gap: 32px;
    }

    .horizontal-card-image-link {
        max-width: 40%;
        margin-bottom: 0px;
    }

    .horizontal-card-image-link .small-card-image-wrapper {
        height: 26vw;
    }

    .horizontal-card .medium-text {
        font-size: 20px;
        margin-bottom: 9px;
    }

    .horizontal-card small {
        font-size: 12px;
    }

    .extra-small-card {
        padding: 32px 0px;
    }

    .extra-small-card-mobile-excerpt {
        min-height: 45px;
    }

    .extra-small-card small {
        font-size: 12px;
    }
    
    .pagination-grid {
        margin-bottom: 32px;
    }
    
    .grid-small-card {
        padding: 32px 0px !important;
    }

    .section-heading-slider {
        padding-left: 18px;
        padding-right: 18px;
    }

    .tags-grid {
        row-gap: 22px;
        column-gap: 18px;
        padding-top: 32px;
    }
}

/* Compact desktop density to reduce blank areas in 3-column section */
@media (min-width: 992px) {
    .column-layout-grid {
        gap: 30px;
        margin-bottom: 8px;
    }

    .small-card {
        padding: 24px 0;
    }

    .small-card-image-wrapper {
        height: 12.8vw;
        max-height: 250px;
    }

    .big-card {
        padding-bottom: 20px;
    }

    .center-column .big-card-image-wrapper {
        height: 18vw;
        max-height: 300px;
    }

    .horizontal-card {
        padding: 20px 0;
        gap: 22px;
        align-items: flex-start;
    }

    .horizontal-card-image-link {
        width: 40%;
        min-width: 40%;
    }

    .horizontal-card .small-card-image-wrapper {
        height: 10.8vw;
        max-height: 190px;
    }

    .center-column .horizontal-card .small-card-heading {
        -webkit-line-clamp: 3 !important;
    }

    .extra-small-card {
        padding: 18px 0;
    }

    .right-column .extra-small-card-image-wrapper {
        height: 7.2vw;
        max-height: 150px;
    }
}

/* Reduce hero image size in center column */
.center-column .big-card-image-wrapper {
    height: 22vw;
    max-height: 360px;
}

@media (max-width: 991px) {
    .center-column .big-card-image-wrapper {
        height: 48vw;
        max-height: 320px;
    }
}

/* Final override: preserve full image and enforce section ratios */
.left-column .small-card-image-wrapper,
.right-column .extra-small-card-image-wrapper,
.center-column .big-card-image-wrapper,
.center-column .horizontal-card .small-card-image-wrapper,
.pagination-grid .small-card-image-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #f5f6f8;
}

.left-column .small-card-image-wrapper {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
}

.right-column .extra-small-card-image-wrapper {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    max-height: none !important;
}

.center-column .big-card-image-wrapper {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: none !important;
}

.center-column .horizontal-card .small-card-image-wrapper {
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    max-height: none !important;
}

.pagination-grid .small-card-image-wrapper {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: none !important;
}

.left-column .small-card-image-wrapper img,
.right-column .extra-small-card-image-wrapper img,
.center-column .big-card-image-wrapper img,
.center-column .horizontal-card .small-card-image-wrapper img,
.pagination-grid .small-card-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #f5f6f8;
}

@media (max-width: 991px) {
    .left-column .small-card-image-wrapper,
    .right-column .extra-small-card-image-wrapper,
    .center-column .horizontal-card .small-card-image-wrapper {
        aspect-ratio: 16 / 10 !important;
    }
}

/* V7 soft-surface cards: lower visual fatigue and match site background */
.homepage .small-card,
.homepage .big-card,
.homepage .horizontal-card,
.homepage .extra-small-card,
.homepage .pagination-grid .small-card,
.homepage .pagination-grid .grid-small-card {
    background: #f7faff !important;
    border: 1px solid #d8e3f1 !important;
    border-top: 1px solid #d8e3f1 !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgb(15 23 42 / 0.04);
}

.homepage .small-card,
.homepage .big-card,
.homepage .horizontal-card,
.homepage .extra-small-card {
    padding: 18px !important;
}

.homepage .left-column .small-card + .small-card,
.homepage .center-column .horizontal-card + .horizontal-card,
.homepage .right-column .extra-small-card + .extra-small-card {
    margin-top: 12px;
}

.homepage .left-column .small-card:first-of-type,
.homepage .center-column .horizontal-card:first-of-type,
.homepage .right-column .extra-small-card:first-of-type {
    margin-top: 0;
}

.homepage .small-card-image-wrapper,
.homepage .extra-small-card-image-wrapper,
.homepage .big-card-image-wrapper,
.homepage .horizontal-card .small-card-image-wrapper,
.homepage .pagination-grid .small-card-image-wrapper {
    background: #eaf1fb !important;
    border: 1px solid #d6e0ee !important;
    border-radius: 14px !important;
}

.homepage .small-card-image-wrapper img,
.homepage .extra-small-card-image-wrapper img,
.homepage .big-card-image-wrapper img,
.homepage .horizontal-card .small-card-image-wrapper img,
.homepage .pagination-grid .small-card-image-wrapper img {
    background: #eaf1fb !important;
}

.homepage .small-card-date,
.homepage .small-card-small-text {
    color: #61748f !important;
}

/* Homepage image policy: show full image without cropping */
.left-column .small-card-image-wrapper,
.right-column .extra-small-card-image-wrapper,
.center-column .big-card-image-wrapper,
.center-column .horizontal-card .small-card-image-wrapper,
.pagination-grid .small-card-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f6f8;
}

.left-column .small-card-image-wrapper {
    aspect-ratio: 4 / 3;
    height: auto !important;
}

.right-column .extra-small-card-image-wrapper {
    aspect-ratio: 4 / 3;
    height: auto !important;
    max-height: none !important;
}

.center-column .big-card-image-wrapper {
    aspect-ratio: 16 / 9;
    height: auto !important;
    max-height: none !important;
}

.center-column .horizontal-card .small-card-image-wrapper {
    aspect-ratio: 16 / 10;
    height: auto !important;
    max-height: none !important;
}

.pagination-grid .small-card-image-wrapper {
    aspect-ratio: 16 / 9;
    height: auto !important;
    max-height: none !important;
}

.left-column .small-card-image-wrapper img,
.right-column .extra-small-card-image-wrapper img,
.center-column .big-card-image-wrapper img,
.center-column .horizontal-card .small-card-image-wrapper img,
.pagination-grid .small-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center center;
    background: #f5f6f8;
}

@media (max-width: 991px) {
    .left-column .small-card-image-wrapper,
    .right-column .extra-small-card-image-wrapper,
    .center-column .horizontal-card .small-card-image-wrapper {
        aspect-ratio: 16 / 10;
    }
}

/* Reduce hero image further (about half) */
.center-column .big-card-image-wrapper {
    height: 11vw;
    max-height: 200px;
}

@media (max-width: 991px) {
    .center-column .big-card-image-wrapper {
        height: 24vw;
        max-height: 180px;
    }
}

/* Reduce hero image to half again */
.center-column .big-card-image-wrapper {
    height: 22vw;
    max-height: 360px;
}

@media (max-width: 991px) {
    .center-column .big-card-image-wrapper {
        height: 48vw;
        max-height: 360px;
    }
}

/* Center hero image size tweak (smaller) */
.center-column .big-card-image-wrapper {
    height: 22vw;
    max-height: 360px;
}

@media (max-width: 991px) {
    .center-column .big-card-image-wrapper {
        height: 48vw;
        max-height: 320px;
    }
}

/* Final override at EOF: no crop + stable ratios */
.left-column .small-card-image-wrapper,
.right-column .extra-small-card-image-wrapper,
.center-column .big-card-image-wrapper,
.center-column .horizontal-card .small-card-image-wrapper,
.pagination-grid .small-card-image-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #f5f6f8;
}

.left-column .small-card-image-wrapper {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
}

.right-column .extra-small-card-image-wrapper {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    max-height: none !important;
}

.center-column .big-card-image-wrapper {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: none !important;
}

.center-column .horizontal-card .small-card-image-wrapper {
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    max-height: none !important;
}

.pagination-grid .small-card-image-wrapper {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: none !important;
}

.left-column .small-card-image-wrapper img,
.right-column .extra-small-card-image-wrapper img,
.center-column .big-card-image-wrapper img,
.center-column .horizontal-card .small-card-image-wrapper img,
.pagination-grid .small-card-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #f5f6f8;
}

@media (max-width: 991px) {
    .left-column .small-card-image-wrapper,
    .right-column .extra-small-card-image-wrapper,
    .center-column .horizontal-card .small-card-image-wrapper {
        aspect-ratio: 16 / 10 !important;
    }
}
