/**
 * Handpicked Posts widget.
 *
 * The thumbnail box is a fixed size with object-fit: cover, so the list stays
 * even no matter what dimensions the source images happen to have — including
 * posts whose intermediate sizes were never generated and which therefore
 * serve the full-size file.
 *
 * Sizing comes from custom properties set on the list:
 *   --hpw-thumb   box edge in px
 *   --hpw-ratio   aspect ratio of the box
 *   --hpw-radius  corner radius
 */

.hpw-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hpw-item {
    border-bottom: 1px solid #ebebeb;
}

.hpw-item:last-child {
    border-bottom: none;
}

.hpw-item::before,
.hpw-item::marker {
    content: none;
}

.hpw-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    color: inherit;
}

.hpw-link:hover .hpw-title,
.hpw-link:focus-visible .hpw-title {
    text-decoration: underline;
}

.hpw-thumb {
    flex: 0 0 auto;
    width: var(--hpw-thumb, 72px);
    aspect-ratio: var(--hpw-ratio, 1);
    overflow: hidden;
    border-radius: var(--hpw-radius, 3px);
    background: #f0f0f1;
}

/* width/height/max-width all forced, because the theme's own content rules or
   a stray max-width on images would otherwise let the box collapse. */
.hpw-thumb img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}

/* Keeps rows aligned when a post has no featured image. */
.hpw-thumb.hpw-thumb-empty {
    background: #f0f0f1;
}

.hpw-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Without this a long title refuses to wrap and pushes the row wider. */
    min-width: 0;
}

.hpw-title {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
    overflow-wrap: break-word;
}

.hpw-date {
    font-size: .8rem;
    color: #888;
}

@supports not (aspect-ratio: 1) {
    .hpw-thumb {
        height: var(--hpw-thumb, 72px);
    }
}
