/**
 * Elle Gourmet Blocks — More Stories
 * Horizontal card row (2–4 items) on desktop, stacked on mobile.
 * BEM hooks throughout for Chris's design sheet.
 */

/* ==========================================================================
   Block wrapper
   ========================================================================== */
.elg-more-stories {
    margin: 2rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   Section heading
   ========================================================================== */
.elg-more-stories__heading {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Card grid — flex row, equal-width columns
   ========================================================================== */
.elg-more-stories__grid {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

/* ==========================================================================
   Individual card
   ========================================================================== */
.elg-more-stories__card {
    flex: 1 1 0;
    min-width: 0; /* prevent flex children from overflowing */
    position: relative; /* for editor remove button */
}

/* ==========================================================================
   Link wrapper — whole card is the tap target
   ========================================================================== */
.elg-more-stories__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.elg-more-stories__link:hover .elg-more-stories__title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* ==========================================================================
   Thumbnail
   ========================================================================== */
.elg-more-stories__thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 0.6rem;
    background: #f0f0f0; /* visible while image loads or when absent */
}

.elg-more-stories__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Card body
   ========================================================================== */
.elg-more-stories__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.3rem;
}

.elg-more-stories__excerpt {
    font-size: 13px;
    line-height: 1.55;
    color: #666;
    margin: 0;
}

/* ==========================================================================
   Mobile: stack cards vertically
   ========================================================================== */
@media ( max-width: 600px ) {
    .elg-more-stories__grid {
        flex-direction: column;
    }

    .elg-more-stories__card {
        flex: none;
        width: 100%;
    }
}

/* ==========================================================================
   Editor-only: remove button per card
   ========================================================================== */
.elg-more-stories__remove {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    opacity: 0;
    transition: opacity 0.1s;
    background: rgba( 255, 255, 255, 0.92 ) !important;
    border-radius: 2px !important;
}

.elg-more-stories__card:hover .elg-more-stories__remove,
.elg-more-stories__card:focus-within .elg-more-stories__remove {
    opacity: 1;
}

/* ==========================================================================
   Editor-only: picker and notices
   ========================================================================== */
.elg-more-stories__picker {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin-top: 1rem;
}

/* Match the weight/size of a standard components control label, since
   LinkControl renders no label of its own. */
.elg-more-stories__picker-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
    color: #1e1e1e;
}

.elg-more-stories__picker > .components-base-control,
.elg-more-stories__picker .block-editor-link-control {
    flex: 1 1 auto;
}

.elg-more-stories__notice {
    margin: 0.5rem 0 0;
    font-size: 12px;
    font-style: italic;
    color: #757575;
}

.elg-more-stories__empty {
    color: #aaa;
    font-style: italic;
}
