/* iPortale Universal News Widget — isolated, responsive styles.
 * Typography variables are populated from the active theme's computed text styles
 * by ipm-universal-news-widget-typography.js; inherit is the safe fallback.
 * The widget uses the theme's computed base size plus 1pt; component sizes are
 * relative units, so the entire widget scales consistently with that base.
 */
.ipm-universal-news {
  --ipmun-accent: var(--theme-color, var(--primary-color, #1769aa));
  --ipmun-text: #202a35;
  --ipmun-muted: #687586;
  --ipmun-border: #e0e6ed;
  --ipmun-soft: #f5f8fb;
  min-width: 0;
  font-family: var(--ipmun-theme-font-family, inherit);
  font-size: calc(var(--ipmun-theme-font-size, 1em) + 1pt);
  line-height: var(--ipmun-theme-line-height, inherit);
  margin: 0 0 26px;
  color: var(--ipmun-text);
  container-type: inline-size;
}
.ipm-universal-news--accent-blue { --ipmun-accent: #1769aa; }
.ipm-universal-news--accent-graphite { --ipmun-accent: #4a4a4a; }
.ipm-universal-news--accent-orange { --ipmun-accent: #ea4e00; }
.ipm-universal-news__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 0;
}
/* Theme-like category title: a full-width grey rule with a red segment sized to the title text. */
.ipm-universal-news__header:after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(to right,
    #e21e26 0,
    #e21e26 var(--ipmun-heading-underline-width, 33%),
    #dedede var(--ipmun-heading-underline-width, 33%),
    #dedede 100%);
  pointer-events: none;
}
.ipm-universal-news__heading {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  font-family: var(--ipmun-theme-heading-font-family, inherit);
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #444;
  font-size: 1.1em;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.ipm-universal-news__heading-text { display: inline; }
.ipm-universal-news__heading a { color: inherit; text-decoration: none; }
.ipm-universal-news__heading a:hover { color: var(--ipmun-accent); }
.ipm-universal-news__all {
  flex: 0 0 auto;
  color: var(--ipmun-accent);
  font-size: .78em;
  line-height: 1.3;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ipm-universal-news__all:hover { text-decoration: underline; }
.ipm-universal-news__featured { min-width: 0; margin: 0; }
.ipm-universal-news__featured-image {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: 3px;
  background: #dfe6ed;
  isolation: isolate;
  text-decoration: none;
}
.ipm-universal-news__featured-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  transition: none;
}
.ipm-universal-news__featured-image:hover img { transform: none; }
.ipm-universal-news__shade {
  position: absolute;
  inset: 20% 0 0;
  z-index: 1;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.76) 100%);
  pointer-events: none;
}
.ipm-universal-news__featured-caption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  padding: 28px 17px 15px;
  color: #fff;
  pointer-events: none;
}
.ipm-universal-news__date {
  display: block;
  margin: 0 0 5px;
  color: rgba(255,255,255,.9);
  font-size: .78em;
  line-height: 1.3;
}
.ipm-universal-news__featured-title {
  display: -webkit-box;
  font-family: var(--ipmun-theme-heading-font-family, inherit);
  max-width: 96%;
  color: #fff;
  font-size: clamp(1.16em, calc(1.55vw + .083em), 1.6em);
  line-height: 1.24;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.ipm-universal-news__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #dfe8f1, #9db9d3);
  font-size: 2.22em;
  font-weight: 800;
  opacity: .92;
}
.ipm-universal-news__grid {
  display: grid;
  grid-template-columns: repeat(var(--ipmun-columns, 3), minmax(0, 1fr));
  gap: 15px;
  min-width: 0;
  margin-top: 13px;
}
.ipm-universal-news--layout-grid .ipm-universal-news__grid,
.ipm-universal-news--layout-grid_2 .ipm-universal-news__grid,
.ipm-universal-news--layout-grid_3 .ipm-universal-news__grid { margin-top: 0; }
.ipm-universal-news__card { min-width: 0; margin: 0; padding: 0; }
.ipm-universal-news__image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  margin: 0 0 7px;
  border-radius: 3px;
  background: #edf1f5;
}
.ipm-universal-news__image img,
.ipm-universal-news__list-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  transition: none;
}
.ipm-universal-news__image:hover img,
.ipm-universal-news__list-image:hover img { transform: none; }
.ipm-universal-news__body { min-width: 0; }
.ipm-universal-news__card-date {
  display: block;
  margin: 0 0 4px;
  color: var(--ipmun-muted);
  font-size: .72em;
  line-height: 1.3;
}
.ipm-universal-news__post-title {
  display: -webkit-box;
  font-family: var(--ipmun-theme-heading-font-family, inherit);
  margin: 0;
  font-size: .91em;
  line-height: 1.35;
  font-weight: 750;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.ipm-universal-news__post-title a { color: inherit; text-decoration: none; }
.ipm-universal-news__post-title a:hover { color: var(--ipmun-accent); }
.ipm-universal-news__excerpt {
  display: -webkit-box;
  margin: 6px 0 0;
  color: #5b6572;
  font-size: .84em;
  line-height: 1.5;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  max-height: 4.5em;
}
.ipm-universal-news__list { display: grid; gap: 11px; min-width: 0; }
.ipm-universal-news__list-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  margin: 0;
  padding: 0 0 11px;
  border-bottom: 1px solid var(--ipmun-border);
}
.ipm-universal-news__list-item:last-child { padding-bottom: 0; border-bottom: 0; }
.ipm-universal-news__list-image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: 3px;
  background: #edf1f5;
}
.ipm-universal-news__subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin: 0 0 13px;
}
.ipm-universal-news__subcategories + .ipm-universal-news__featured { margin-top: 0; }
.ipm-universal-news__subcategories--bottom { margin: 13px 0 0; }
.ipm-universal-news__subcategory {
  display: inline-flex;
  flex: 1 1 auto;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ipmun-border);
  border-radius: 3px;
  background: var(--ipmun-soft);
  color: var(--ipmun-text);
  font-size: .78em;
  line-height: 1.3;
  font-weight: 650;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.ipm-universal-news__subcategory > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ipm-universal-news__subcategory:hover {
  border-color: var(--ipmun-accent);
  background: #fff;
  color: var(--ipmun-accent);
}
.ipm-universal-news__subcategory-count { margin-left: auto; color: var(--ipmun-muted); font-size: .72em; font-weight: 500; }
.ipm-universal-news__arrow { flex: 0 0 auto; color: var(--ipmun-accent); }
.ipm-universal-news--layout-links_only .ipm-universal-news__header { margin-bottom: 10px; }
.ipm-universal-news--layout-links_only .ipm-universal-news__subcategories { margin-bottom: 0; }
/*
 * Keep the selected 3-column layouts on laptop-sized content areas.
 * The previous 640px breakpoint forced every layout to two columns, even
 * when the editor had explicitly selected "3 articles per row". Two columns
 * are now reserved for genuinely narrow containers (small tablets/phones).
 */
@container (max-width: 480px) {
  .ipm-universal-news__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ipm-universal-news__featured-title { font-size: 1.22em; }
}
@container (max-width: 380px) {
  .ipm-universal-news__grid { grid-template-columns: minmax(0, 1fr); }
  .ipm-universal-news__list-item { grid-template-columns: 105px minmax(0,1fr); gap: 9px; }
  .ipm-universal-news__featured-caption { padding: 24px 12px 12px; }
  .ipm-universal-news__featured-title { font-size: 1.1em; }
}
@media (max-width: 600px) {
  .ipm-universal-news__heading { font-size: 1.1em; line-height: 1.25; }
  .ipm-universal-news__all { font-size: .72em; }
}
@media (prefers-reduced-motion: reduce) {
  .ipm-universal-news__featured-image img,
  .ipm-universal-news__image img,
  .ipm-universal-news__list-image img,
  .ipm-universal-news__subcategory { transition: none; }
}
