/* Mexperience Sidebar Unicards — context chrome for the shared .mex-card when it
 * appears in the blog sidebar (single-column stack). The card look itself lives
 * in mex-cards.css; this file only handles sidebar spacing, headings and the
 * narrow-column ".mex-card--side" size tuning.
 *
 * Rendered by functions.php (mex_render_sidebar_unicards) via the sidebar.
 */

/* Some page templates add a broad "article { padding-top: 10px !important }"
   (e.g. body.page-template-spl-c-1030) intended for the main post article. Our
   cards are <article> elements, so that padding pushes the image off the card's
   rounded top, leaving a gap. Reset it for sidebar cards (needs !important +
   higher specificity to beat the template rule). */
#blog-sidebar .mex-sidebar-cards .mex-card {
    padding-top: 0 !important;
}

/* Each code line renders a group: an optional heading + one or more cards. */
.mex-sidebar-cards {
    margin: 0 0 28px;
}

.mex-sidebar-cards .mex-card {
    margin-bottom: 18px;
}

.mex-sidebar-cards .mex-card:last-child {
    margin-bottom: 0;
}

/* Heading above a card group — a small uppercase "eyebrow" label (grey/stone),
   matching the site's existing 'LATEST NEWSLETTER' / 'COPPER CANYON' sidebar
   labels. The high-specificity prefix beats the theme's big bold h3.widget-title
   and its padding-bottom. */
#blog-sidebar .mex-sidebar-cards .widget-title-wrap {
    display: block;
    margin: 0 0 5px;
    padding: 0;
    border: 0;
}

#blog-sidebar .mex-sidebar-cards h3.widget-title,
#blog-sidebar .mex-sidebar-cards h3.widget-title span {
    display: block;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    line-height: 1.3;
    color: var(--mex-grey);
    margin: 0;
    padding: 0;
}

/* Drop the legacy divider lines around the newsletter sidebar blocks — every
   item is now a self-contained card, so the borders just orphan above a card. */
#blog-sidebar .newsletter-sidebar-above {
    border-bottom: none;
}

#blog-sidebar .newsletter-sidebar-below {
    border-top: none;
}

/* Narrow-column size tuning: a touch tighter than the 3-up grid cards. */
.mex-card--side .card-body {
    padding: 14px 16px 16px;
}

.mex-card--side .card-title {
    font-size: 16px;
    line-height: 1.3;
}

.mex-card--side .card-excerpt {
    font-size: 13px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
}

/* On phones the sidebar drops below the content full-width; let the excerpt run
   free like the grid cards do (avoids a mid-word clamp cut). */
@media screen and (max-width: 600px) {
    .mex-card--side .card-title {
        font-size: 18px;
    }

    .mex-card--side .card-excerpt {
        font-size: 15px;
        display: block;
        -webkit-line-clamp: unset;
        overflow: visible;
    }
}
