.el2-widget {
  --el2w-purple: #100043;
  --el2w-header: #184787;
  --el2w-orange: #ff5f00;
  --el2w-gradient: linear-gradient(90deg, #02a3f6, #7a3fd7 40%, #e224ab 72%, #ff613c);
  --el2w-ink: #121018;
  --el2w-muted: #6b6775;
  --el2w-line: #ebeaef;
  --el2w-paper: #fff;
  --el2w-font: "Khula", "Helvetica Neue", system-ui, sans-serif;
  --el2w-display: "BenchNine", "Arial Narrow", sans-serif;
  --el2w-radius: 12px;

  font-family: var(--el2w-font);
  color: var(--el2w-ink);
  width: 100%;
  margin: 16px 0;
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 14px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.el2-widget[hidden] {
  display: none !important;
}

.el2-widget.is-ready {
  opacity: 1;
}

.el2-widget *,
.el2-widget *::before,
.el2-widget *::after {
  box-sizing: border-box;
}

.el2-widget__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.el2-widget__logo img {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
  margin: 0 auto;
}

.el2-widget__logo--white {
  display: none;
}

.el2-widget__nav {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.el2-widget__nav span {
  font-family: var(--el2w-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--el2w-muted);
  text-transform: uppercase;
}

.el2-widget__links {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.el2-widget__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--el2w-header);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 2px 10px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.el2-widget__links a + a {
  border-left: 1px solid var(--el2w-line);
}

.el2-widget__links a:hover {
  color: var(--el2w-orange);
  background: rgba(255, 95, 0, 0.08);
}

.el2-widget__links svg {
  width: 16px;
  height: 16px;
}

.el2-widget__body {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 28px;
  gap: 10px;
  padding: 14px 10px 10px;
  background: var(--el2w-paper);
  border: 1px solid var(--el2w-line);
  border-radius: var(--el2w-radius);
  min-height: 120px;
}

.el2-widget__ribbon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  font-family: var(--el2w-display);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--el2w-gradient);
  padding: 5px 12px;
  border-top-left-radius: calc(var(--el2w-radius) - 1px);
  border-bottom-right-radius: 12px;
  line-height: 1.1;
}

.el2-widget__list {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.el2-widget__card {
  display: grid;
  grid-template-rows: 110px auto;
  min-height: 188px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 2px solid var(--el2w-header);
  border-radius: var(--el2w-radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Wide layout shows 3 cards + chevron; 4th is for 2-col / sidebar */
.el2-widget__card:nth-child(n + 4) {
  display: none;
}

.el2-widget__card:hover {
  transform: translateY(-2px);
  border-color: var(--el2w-orange);
  box-shadow: 0 8px 18px rgba(16, 0, 67, 0.12);
}

.el2-widget__media {
  position: relative;
  background: linear-gradient(145deg, #eef3fb, #f7f4ff);
  overflow: hidden;
}

.el2-widget__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.el2-widget__media--empty img {
  opacity: 0.35;
  object-fit: contain;
  padding: 18px;
}

.el2-widget__pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: var(--el2w-orange);
  color: #fff;
  font-family: var(--el2w-display);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1;
}

.el2-widget__meta {
  display: grid;
  gap: 4px;
  padding: 10px 10px 12px;
  align-content: start;
}

.el2-widget__when {
  display: block;
  color: var(--el2w-header);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.el2-widget__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
}

.el2-widget__more {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--el2w-purple);
  text-decoration: none;
  border-radius: 10px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.el2-widget__more:hover {
  transform: translateX(2px);
  background: rgba(16, 0, 67, 0.05);
}

.el2-widget__more svg {
  width: 22px;
  height: 22px;
}

.el2-widget__empty {
  grid-column: 1 / -1;
  margin: 28px 0 12px;
  color: var(--el2w-muted);
  font-size: 0.95rem;
}

.el2-widget__footer {
  display: none;
}

/* Stacked / tablet */
@media screen and (max-width: 1200px) {
  .el2-widget {
    grid-template-columns: 1fr;
  }

  .el2-widget__brand {
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
  }

  .el2-widget__logo img {
    max-width: 150px;
  }

  .el2-widget__nav {
    justify-items: end;
  }

  .el2-widget__nav span {
    width: 100%;
    text-align: right;
  }
}

@media screen and (max-width: 1000px) {
  .el2-widget__body {
    grid-template-columns: 1fr;
  }

  .el2-widget__list {
    grid-column: auto;
    grid-template-columns: 1fr 1fr;
  }

  .el2-widget__more {
    display: none;
  }

  .el2-widget__card:nth-child(n + 4) {
    display: grid;
  }
}

/* Mobile band — matches v1 purple strip */
@media screen and (max-width: 600px) {
  .el2-widget {
    background: var(--el2w-purple);
    color: #fff;
    padding: 12px 10px 8px;
    border-radius: var(--el2w-radius);
    gap: 10px;
  }

  .el2-widget__logo--color {
    display: none;
  }

  .el2-widget__logo--white {
    display: block;
  }

  .el2-widget__nav span {
    color: rgba(255, 255, 255, 0.75);
  }

  .el2-widget__links a {
    color: rgba(255, 255, 255, 0.95);
  }

  .el2-widget__links a + a {
    border-left-color: rgba(255, 255, 255, 0.35);
  }

  .el2-widget__links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }

  .el2-widget__body {
    border: 0;
    background: transparent;
    padding: 18px 0 0;
  }

  .el2-widget__ribbon {
    left: 0;
    border-top-left-radius: 0;
  }

  .el2-widget__footer {
    display: flex;
    justify-content: center;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 8px;
  }

  .el2-widget__footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 10px;
  }

  .el2-widget__footer a + a {
    border-left: 1px solid rgba(255, 255, 255, 0.35);
  }

  .el2-widget__footer svg {
    width: 16px;
    height: 16px;
  }
}

@media screen and (max-width: 500px) {
  .el2-widget__brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .el2-widget__nav,
  .el2-widget__nav span {
    justify-items: center;
    text-align: center;
  }
}

@media screen and (max-width: 420px) {
  .el2-widget__list {
    grid-template-columns: 1fr;
  }
}

/* Sidebar / small */
.el2-widget--small {
  grid-template-columns: 1fr;
}

.el2-widget--small .el2-widget__brand {
  flex-direction: column;
  text-align: center;
}

.el2-widget--small .el2-widget__nav,
.el2-widget--small .el2-widget__nav span {
  justify-items: center;
  text-align: center;
}

.el2-widget--small .el2-widget__body {
  grid-template-columns: 1fr;
}

.el2-widget--small .el2-widget__list {
  grid-column: auto;
  grid-template-columns: 1fr 1fr;
}

.el2-widget--small .el2-widget__more {
  display: none;
}

.el2-widget--small .el2-widget__card:nth-child(n + 4) {
  display: grid;
}

.el2-widget--small .el2-widget__card {
  min-height: 170px;
  grid-template-rows: 96px auto;
}
