/* Keep the Elementor wrapper inside its flex/grid parent, including its padding. */
.elementor-element.elementor-widget-iuw-posts-grid {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.elementor-widget-iuw-posts-grid > .elementor-widget-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.iuw-posts-grid {
    display: grid;
    grid-template-columns: repeat(var(--iuw-pg-columns, 4), minmax(0, 1fr));
    gap: var(--iuw-pg-gap, 24px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    color: #1f3856;
    font-family: inherit;
}
.iuw-posts-grid *, .iuw-posts-grid *::before, .iuw-posts-grid *::after { box-sizing: border-box; }
.iuw-posts-grid .iuw-post-card {
    min-width: 0;
    margin: 0;
    border: 1px solid #dce3ea;
    border-radius: var(--iuw-pg-radius, 0);
    background: #fff;
    overflow: hidden;
    /* Cards adapt to their own width, so 2 columns on a phone get the compact variant. */
    container: iuw-post-card / inline-size;
}
.iuw-posts-grid .iuw-post-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    outline-offset: -3px;
}
.iuw-posts-grid .iuw-post-card__link:focus-visible { outline: 3px solid #1f3856; }
.iuw-posts-grid .iuw-post-card__media {
    aspect-ratio: var(--iuw-pg-ratio, 16/10);
    overflow: hidden;
    flex-shrink: 0;
    background: #eef4f8;
}
.iuw-posts-grid .iuw-post-card__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
}
.iuw-posts-grid .iuw-post-card__placeholder { width: 100%; height: 100%; background: #eef4f8; }
.iuw-posts-grid .iuw-post-card__body {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
    gap: 12px;
    padding: var(--iuw-pg-padding, 24px);
}
.iuw-posts-grid .iuw-post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: #4d6072;
    font-size: .8125rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.iuw-posts-grid .iuw-post-card__title {
    margin: 0;
    padding: 0;
    color: #1f3856;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--iuw-pg-title-lines, 3);
    line-clamp: var(--iuw-pg-title-lines, 3);
    overflow: hidden;
    overflow-wrap: break-word;
    hyphens: auto;
}
.iuw-posts-grid .iuw-post-card__excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--iuw-pg-lines, 3);
    line-clamp: var(--iuw-pg-lines, 3);
    overflow: hidden;
    overflow-wrap: anywhere;
    margin: 0;
    color: #455b72;
    font-size: 1rem;
    line-height: 1.6;
}
.iuw-posts-grid .iuw-post-card__more {
    margin-top: auto;
    padding-top: 12px;
    color: #1f3856;
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: .2em;
    text-decoration-thickness: 1px;
}
.iuw-posts-grid .iuw-post-card__link:hover .iuw-post-card__title { text-decoration: underline; text-underline-offset: .15em; }
.iuw-posts-grid ::selection { background: #1f3856; color: #fff; }
.iuw-posts-grid--overlay .iuw-post-card { background: #1f3856; }
.iuw-posts-grid--overlay .iuw-post-card__link { position: relative; min-height: var(--iuw-pg-min-height, 360px); justify-content: flex-end; }
.iuw-posts-grid--overlay .iuw-post-card__media { position: absolute; inset: 0; aspect-ratio: auto; }
.iuw-posts-grid--overlay .iuw-post-card__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,20,34,.76), rgba(9,20,34,.92)); }
.iuw-posts-grid--overlay .iuw-post-card__placeholder { background: #1f3856; }
.iuw-posts-grid--overlay .iuw-post-card__body { flex: 0; }
.iuw-posts-grid--overlay .iuw-post-card__title,
.iuw-posts-grid--overlay .iuw-post-card__excerpt,
.iuw-posts-grid--overlay .iuw-post-card__meta,
.iuw-posts-grid--overlay .iuw-post-card__more { color: #fff; }
.iuw-posts-grid--overlay .iuw-post-card__link:focus-visible { outline-color: #fff; }
.iuw-posts-grid--horizontal .iuw-post-card__link { flex-direction: row; }
.iuw-posts-grid--horizontal .iuw-post-card__media { width: 35%; aspect-ratio: auto; }
/* Narrow cards (2 columns on a phone, 5-6 on a small laptop): tighter type and spacing.
   Typography controls from Elementor use stronger selectors and still win. */
@container iuw-post-card (max-width: 260px) {
    .iuw-posts-grid .iuw-post-card__body { gap: 8px; }
    .iuw-posts-grid .iuw-post-card__meta { gap: 2px 8px; font-size: .75rem; line-height: 1.4; }
    .iuw-posts-grid .iuw-post-card__title { font-size: 1rem; line-height: 1.3; }
    .iuw-posts-grid .iuw-post-card__excerpt { font-size: .875rem; line-height: 1.5; }
    /* The whole card is the link; the extra label only crowds a narrow card. Elementor can show it again. */
    .iuw-posts-grid .iuw-post-card__more { display: none; }
}
/* Horizontal cards become a compact list once a card is narrow: square thumbnail and title only. */
@container iuw-post-card (max-width: 420px) {
    .iuw-posts-grid--horizontal .iuw-post-card__media { width: 104px; flex: 0 0 104px; aspect-ratio: 1 / 1; }
    .iuw-posts-grid--horizontal .iuw-post-card__body { gap: 6px; padding: 12px 14px; justify-content: center; }
    .iuw-posts-grid--horizontal .iuw-post-card__title { font-size: 1rem; line-height: 1.35; }
    .iuw-posts-grid--horizontal .iuw-post-card__meta { font-size: .75rem; }
    .iuw-posts-grid--horizontal .iuw-post-card__excerpt,
    .iuw-posts-grid--horizontal .iuw-post-card__more { display: none; }
}
/* Too narrow for a thumbnail beside text: stack like a classic card. */
@container iuw-post-card (max-width: 280px) {
    .iuw-posts-grid--horizontal .iuw-post-card__link { flex-direction: column; }
    .iuw-posts-grid--horizontal .iuw-post-card__media { width: 100%; flex: 0 0 auto; aspect-ratio: var(--iuw-pg-ratio, 16/10); }
    .iuw-posts-grid--horizontal .iuw-post-card__body { justify-content: flex-start; }
}
