/* ----------------------------------------------------------------- */
/* Case Study Posts Block — Styles                                   */
/*                                                                   */
/* Layout:                                                           */
/*   - First post: full width                                        */
/*   - Posts 2 and 3: side by side beneath, equal width             */
/*                                                                   */
/* Hover state:                                                     */
/*   - Dark overlay fades in over the image                         */
/*   - Title and arrow appear at the bottom of the image            */
/* ----------------------------------------------------------------- */


/* ----------------------------------------------------------------- */
/* Post list wrapper — CSS grid                                      */
/* ----------------------------------------------------------------- */

.casestudy-posts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ----------------------------------------------------------------- */
/* First post — spans both columns                                   */
/* ----------------------------------------------------------------- */

.casestudy-posts__item:first-child {
    grid-column: 1 / -1;
}

/* ----------------------------------------------------------------- */
/* Post link                                                         */
/* ----------------------------------------------------------------- */

.casestudy-posts__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ----------------------------------------------------------------- */
/* Image wrapper                                                     */
/*                                                                   */
/* position: relative so the overlay can be absolutely positioned   */
/* inside it. overflow: hidden clips both the image and overlay.    */
/* ----------------------------------------------------------------- */

.casestudy-posts__image {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* First item — wider aspect ratio suits full-width display */
.casestudy-posts__item:first-child .casestudy-posts__image {
    aspect-ratio: 16 / 10;
}

.casestudy-posts__item:first-child .casestudy-posts__image .casestudy-posts__overlay .casestudy-posts__title {
    font-size: 2.25rem;
}


/* Items 2 and 3 — standard landscape ratio */
.casestudy-posts__item:not(:first-child) .casestudy-posts__image {
    aspect-ratio: 16 / 10;
}

.casestudy-posts__item:not(:first-child) .casestudy-posts__image .casestudy-posts__overlay .casestudy-posts__title {
    font-size: 1.5rem;
}

/* ----------------------------------------------------------------- */
/* Featured image                                                    */
/* ----------------------------------------------------------------- */

.casestudy-posts__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    /* Subtle scale on hover — transition defined here */
    transition: transform 0.4s ease;
}

/* Slight zoom on the image when the card is hovered */
.casestudy-posts__link:hover .casestudy-posts__img {
    transform: scale( 1.04 );
}

/* ----------------------------------------------------------------- */
/* Hover overlay                                                     */
/*                                                                   */
/* Absolutely positioned over the full image area.                  */
/* Uses a gradient so the bottom (where the title sits) is dark     */
/* and the top remains semi-transparent.                            */
/*                                                                   */
/* opacity: 0 by default, transitions to 1 on hover.               */
/* ----------------------------------------------------------------- */

.casestudy-posts__overlay {
    position: absolute;
    inset: 0;                          /* covers the full image */
    display: flex;
    flex-direction: column;
    justify-content: center;        /* title sits at the bottom */
    padding: 1.25rem 1rem;
    background: linear-gradient(
        to top,
        rgba( 0, 0, 0, 0.7 ) 0%,
        rgba( 0, 0, 0, 0.2 ) 50%,
        rgba( 0, 0, 0, 0 )   100%
    );

    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Reveal overlay on link hover */
.casestudy-posts__link:hover .casestudy-posts__overlay {
    opacity: 1;
}

/* ----------------------------------------------------------------- */
/* Title inside overlay                                              */
/* ----------------------------------------------------------------- */

.casestudy-posts__title {
    display: block;
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    text-align: center;
}

/* ----------------------------------------------------------------- */
/* Arrow icon inside overlay                                         */
/* ----------------------------------------------------------------- */

.casestudy-posts__overlay .bottom_arrow {
    width: 40px;
    height: 40px;
    position: absolute;
    bottom: 1rem;
    right: 1rem;
}

/* ----------------------------------------------------------------- */
/* Empty / no posts message                                         */
/* ----------------------------------------------------------------- */

.casestudy-posts__empty {
    font-style: italic;
    color: #666;
}


/* ----------------------------------------------------------------- */
/* Inspector picker: selected items list                             */
/* ----------------------------------------------------------------- */

.csb-picker__selected-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.csb-picker__selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e0e0e0;
    gap: 0.5rem;
}

.csb-picker__selected-title {
    font-size: 0.8125rem;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ----------------------------------------------------------------- */
/* Inspector picker: remove button                                   */
/* ----------------------------------------------------------------- */

.csb-picker__remove-btn {
    flex-shrink: 0;
}

/* ----------------------------------------------------------------- */
/* Inspector picker: limit notice                                    */
/* ----------------------------------------------------------------- */

.csb-picker__limit-notice {
    font-size: 0.8125rem;
    color: #757575;
    font-style: italic;
    margin: 0.5rem 0;
}

/* ----------------------------------------------------------------- */
/* Inspector picker: search results list                             */
/* ----------------------------------------------------------------- */

.csb-picker__results-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 2px;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
}

.csb-picker__result-item {
    border-bottom: 1px solid #f0f0f0;
}

.csb-picker__result-item:last-child {
    border-bottom: none;
}

.csb-picker__result-item .components-button {
    width: 100%;
    text-align: left;
    padding: 0.4rem 0.6rem;
    font-size: 0.8125rem;
    justify-content: flex-start;
}

/* ----------------------------------------------------------------- */
/* Inspector picker: no results notice                               */
/* ----------------------------------------------------------------- */

.csb-picker__no-results {
    font-size: 0.8125rem;
    color: #757575;
    font-style: italic;
    margin: 0.5rem 0 0;
}

@media (max-width: 1199px) {

    .casestudy-posts__overlay {
        opacity: 1;
    }

    .casestudy-posts__item:not(:first-child) .casestudy-posts__image {
        aspect-ratio: 16/15;
    }

    .casestudy-posts__item:first-child .casestudy-posts__image .casestudy-posts__overlay .casestudy-posts__title,
    .casestudy-posts__item:first-child .casestudy-posts__image .casestudy-posts__overlay .casestudy-posts__title {   
        font-size: 1.5rem;
    }

    .casestudy-posts__overlay .bottom_arrow {
        height: 30px;
        width: 30px;
    }

}

@media (max-width: 767px)  {

    .casestudy-posts {
        grid-template-columns: 1fr;
    }

    .casestudy-posts__item:first-child .casestudy-posts__image,
    .casestudy-posts__item:not(:first-child) .casestudy-posts__image {
        aspect-ratio: 16/9;
    }

    .casestudy-posts__overlay .bottom_arrow {
        height: 30px;
        width: 20px;
    }

}