/* ILBP Case Study System. Frontend styles are scoped to plugin output. */
.ilbp-case-index,
.ilbp-case-index *,
.ilbp-case-feed,
.ilbp-case-feed * {
  box-sizing: border-box;
}

.ilbp-case-index,
.ilbp-case-feed {
  width: 100%;
  min-width: 0;
  color: #4B5563;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(14px, 13px + .2vw, 16px);
  font-weight: 400;
}

.ilbp-case-index {
  display: grid;
  gap: 20px;
}

.ilbp-case-index__intro,
.ilbp-case-feed__intro {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ilbp-case-index h2,
.ilbp-case-feed h2 {
  margin: 0;
  color: #003366;
  font-size: clamp(22px, 18.4px + .6vw, 28px);
  font-weight: 700;
  line-height: 1.25;
}

.ilbp-case-index__intro p,
.ilbp-case-feed__intro p {
  margin: 0;
}

.ilbp-case-index__categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ilbp-case-index .ilbp-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  background: #F3F4F6;
  color: #4B5563;
  font: 600 13px/1.5 Arial, Helvetica, sans-serif;
  text-align: center;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.ilbp-case-index .ilbp-filter:hover,
.ilbp-case-index .ilbp-filter[aria-pressed="true"] {
  border-color: #003366;
  background: #003366;
  color: #FFFFFF;
}

.ilbp-case-index .ilbp-filter:focus-visible {
  outline: 3px solid #DAA520;
  outline-offset: 3px;
}

.ilbp-case-index .ilbp-filter--green { border-color: #BBF7D0; background: #ECFDF3; color: #166534; }
.ilbp-case-index .ilbp-filter--indigo { border-color: #C7D2FE; background: #EEF2FF; color: #3730A3; }
.ilbp-case-index .ilbp-filter--blue { border-color: #BAE6FD; background: #E0F2FE; color: #0369A1; }
.ilbp-case-index .ilbp-filter--gold { border-color: #FDE68A; background: #FEF3C7; color: #92400E; }
.ilbp-case-index .ilbp-filter--rose { border-color: #FECACA; background: #FEF2F2; color: #B91C1C; }

.ilbp-case-index__grid,
.ilbp-case-feed__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}

.ilbp-case-index__card,
.ilbp-case-feed__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  color: #4B5563;
  text-align: left;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ilbp-case-index__highlights,
.ilbp-case-feed__highlights {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}

.ilbp-case-index__highlights li + li,
.ilbp-case-feed__highlights li + li {
  margin-top: 6px;
}

.ilbp-case-index__card:hover,
.ilbp-case-feed__card:hover {
  border-color: #2E8B57;
  box-shadow: 0 6px 18px rgba(0, 51, 102, .1);
  color: #4B5563;
  transform: translateY(-2px);
}

.ilbp-case-index__card:focus-visible,
.ilbp-case-feed__card:focus-visible {
  outline: 3px solid #DAA520;
  outline-offset: 4px;
}

.ilbp-case-index__visual,
.ilbp-case-feed__image {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  aspect-ratio: 400 / 225;
  overflow: hidden;
  color: #003366;
  text-align: center;
}

.ilbp-case-index__visual--green { background: linear-gradient(135deg, #ECFDF3, #BBF7D0); }
.ilbp-case-index__visual--indigo { background: linear-gradient(135deg, #EEF2FF, #C7D2FE); }
.ilbp-case-index__visual--blue { background: linear-gradient(135deg, #DBEAFE, #93C5FD); }
.ilbp-case-index__visual--gold { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.ilbp-case-index__visual--rose { background: linear-gradient(135deg, #FEF2F2, #FECACA); }
.ilbp-case-index__visual--grey { background: linear-gradient(135deg, #F3F4F6, #E5E7EB); }

.ilbp-case-index__visual img,
.ilbp-case-feed__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ilbp-case-index__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px;
}

.ilbp-case-index__number,
.ilbp-case-feed__label {
  color: #6B7280;
  font-size: 12px;
  font-weight: 600;
}

.ilbp-case-index__body h2,
.ilbp-case-feed__card h3 {
  margin: 0;
  color: #003366;
  font-size: clamp(18px, 16px + .3vw, 22px);
  font-weight: 600;
  line-height: 1.35;
}

.ilbp-case-index__excerpt,
.ilbp-case-feed__card p {
  margin: 0;
  color: #4B5563;
  line-height: 1.6;
}

.ilbp-case-index__link,
.ilbp-case-feed__card > .ilbp-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 4px;
  color: #2E8B57;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.ilbp-case-index__link:hover,
.ilbp-case-feed__card:hover > .ilbp-link {
  color: #003366;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ilbp-case-index__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ilbp-case-index__tags .ilbp-filter {
  min-height: 0;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: default;
  font-size: 11px;
}

.ilbp-case-index__tags .ilbp-filter:hover {
  border-color: inherit;
  background: inherit;
  color: inherit;
}

.ilbp-case-index__card[hidden] {
  display: none !important;
}

.ilbp-case-feed {
  display: grid;
  gap: 16px;
}

.ilbp-case-feed__card {
  gap: 10px;
  padding: 12px;
  background: #F9FAFB;
}

.ilbp-case-feed__image {
  border-radius: 8px;
  background: #DBEAFE;
}

.ilbp-case-feed--appointeeships .ilbp-case-feed__image { background: linear-gradient(135deg, #ECFDF3, #BBF7D0); }
.ilbp-case-feed--deputyships .ilbp-case-feed__image { background: linear-gradient(135deg, #EEF2FF, #C7D2FE); }
.ilbp-case-feed--direct-payments .ilbp-case-feed__image { background: linear-gradient(135deg, #DBEAFE, #93C5FD); }
.ilbp-case-feed--care-providers .ilbp-case-feed__image { background: linear-gradient(135deg, #FEF2F2, #FECACA); }

.ilbp-case-feed__label,
.ilbp-case-feed__card h3,
.ilbp-case-feed__card p,
.ilbp-case-feed__card > .ilbp-link {
  margin-inline: 4px;
}

.ilbp-case-feed__empty {
  margin: 0;
  padding: 16px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  background: #F9FAFB;
  color: #6B7280;
}

@media (max-width: 980px) {
  .ilbp-case-index__intro,
  .ilbp-case-feed__intro {
    text-align: center;
  }

  .ilbp-case-index__categories {
    justify-content: center;
  }

  .ilbp-case-index__grid,
  .ilbp-case-feed__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .ilbp-case-index__grid,
  .ilbp-case-feed__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ilbp-case-index__card,
  .ilbp-case-feed__card,
  .ilbp-case-index .ilbp-filter {
    transition: none;
  }
}
