/* =========================================================
   MSH – Kollegium-Filter
   Lokal gehostete SVG-Icons, keine externen Icon-CDNs.
   Shortcode: [msh_kollegium_filter]
   Version 1.3.11
   ========================================================= */

.msh-kf {
  --msh-orange: #f59b44;
  --msh-orange-dark: #ff7f00;
  --msh-orange-active: #70c8e4;
  --msh-terracotta: #70c8e4;
  --msh-black: #221f20;
  --msh-white: #ffffff;
  --msh-radius: 20px;
  --msh-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  --msh-shadow-strong: 0 14px 32px rgba(34, 31, 32, 0.16);
  width: 100%;
  color: var(--msh-black);
}

.msh-kf-inner {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 34px 0 0;
  box-sizing: border-box;
}

.msh-kf-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: stretch;
}

.msh-kf-filter-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--msh-orange);
  color: var(--msh-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 54px;
  min-height: 54px;
  padding: 4px 20px;
  box-sizing: border-box;
  font-family: texgyreadventor-bold, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.18;
  text-align: left;
  box-shadow: 0 10px 22px rgba(34, 31, 32, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.msh-kf-filter-btn:hover {
  background: var(--msh-orange-dark);
  transform: translateY(-2px);
  border: 0;
  outline: 0;
  box-shadow: 0 14px 32px rgba(34, 31, 32, 0.20);
}

.msh-kf-filter-btn:focus-visible {
  background: var(--msh-orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(34, 31, 32, 0.20);
}

.msh-kf-filter-btn[aria-pressed="true"] {
  background: var(--msh-terracotta);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(34, 31, 32, 0.20);
}

.msh-kf-filter-btn[aria-pressed="true"]:hover,
.msh-kf-filter-btn[aria-pressed="true"]:focus-visible {
  background: var(--msh-orange-dark);
}

.msh-kf-filter-btn:focus-visible {
  outline: 3px solid rgba(34, 31, 32, 0.28);
  outline-offset: 4px;
}

.msh-kf-icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  color: var(--msh-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msh-kf-icon svg {
  width: 42px;
  height: 42px;
  display: block;
  fill: currentColor;
}

.msh-kf-label {
  display: block;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

.msh-kf-status {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 1.4em;
  margin: 20px 0 35px 0 !important;
  padding-left: 10px !important;
  font-family: texgyreadventor-bold, Arial, sans-serif;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.4;
  color: var(--msh-black);
}

.msh-kf-results {
  margin-top: 0;
}

.msh-kf.is-loading .msh-kf-status::after {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5em;
  border-radius: 50%;
  border: 2px solid rgba(34, 31, 32, 0.18);
  border-top-color: var(--msh-orange);
  vertical-align: -0.12em;
  animation: msh-kf-spin 780ms linear infinite;
}

/* Kartenstruktur exakt an die ungefilterte Kollegium-Ansicht angelehnt */
.msh-kf-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.msh-kf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  width: 100%;
}

.msh-kf-half {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  min-width: 0;
}

.msh-kf-card {
  min-width: 0;
  opacity: 0;
  transform: translateX(70px);
  animation: msh-kf-card-in 1100ms cubic-bezier(0.16, 0.84, 0.32, 1) forwards;
  animation-delay: calc(var(--msh-card-index, 0) * 120ms);
}

.msh-kf-card-link {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--msh-radius);
  aspect-ratio: 3 / 4;
  background: #f4f4f4;
  color: var(--msh-white);
  text-decoration: none;
  box-shadow: var(--msh-shadow);
  isolation: isolate;
}

.msh-kf-card-link:hover,
.msh-kf-card-link:focus-visible {
  color: var(--msh-white);
  text-decoration: none;
  box-shadow: var(--msh-shadow-strong);
}

.msh-kf-card-link:focus-visible {
  outline: 3px solid var(--msh-orange);
  outline-offset: 4px;
}

.msh-kf-card-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.msh-kf-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s ease, filter 0.55s ease;
}

.msh-kf-card-link:hover .msh-kf-card-media img,
.msh-kf-card-link:focus-visible .msh-kf-card-media img {
  transform: scale(1.05);
  filter: brightness(0.88);
}

.msh-kf-card-placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.45), transparent 32%),
    linear-gradient(135deg, #f2f8fa, #fcf1e6);
}

.msh-kf-card-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 30%;
  min-height: 118px;
  padding: 13px 18px 21px;
  box-sizing: border-box;
  background: rgba(245, 155, 68, 0.94);
  color: var(--msh-white);
  transform: translateY(100%);
  transition: transform 0.45s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.msh-kf-card-link:hover .msh-kf-card-panel,
.msh-kf-card-link:focus-visible .msh-kf-card-panel {
  transform: translateY(0);
}

.msh-kf-card-panel h3 {
  margin: 0 0 8px !important;
  padding: 0 !important;
  color: var(--msh-white) !important;
  font-family: texgyreadventor-bold, Arial, sans-serif;
  font-size: 1.6em !important;
  line-height: 1.12 !important;
  font-weight: 700 !important;
  overflow-wrap: break-word;
}

.msh-kf-card-panel p {
  margin: 0;
  padding: 0;
  color: var(--msh-white);
  font-family: texgyreadventor-regular, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.msh-kf-card-link:hover .msh-kf-card-panel p,
.msh-kf-card-link:focus-visible .msh-kf-card-panel p {
  opacity: 1;
  transform: translateY(0);
}

.msh-kf-empty {
  border-radius: var(--msh-radius);
  padding: 22px 24px;
  background: rgba(245, 155, 68, 0.12);
  color: var(--msh-black);
  font-family: texgyreadventor-regular, Arial, sans-serif;
}

@keyframes msh-kf-card-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes msh-kf-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1024px) {
  .msh-kf-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .msh-kf-row {
    gap: 26px;
  }

  .msh-kf-half {
    gap: 20px;
  }
}

@media (max-width: 860px) {
  .msh-kf-inner {
    width: min(100%, calc(100% - 28px));
  }

  .msh-kf-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .msh-kf-half {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 620px) {
  .msh-kf-buttons,
  .msh-kf-half {
    grid-template-columns: 1fr;
  }

  .msh-kf-filter-btn {
    min-height: 54px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .msh-kf-card-panel {
    transform: translateY(0);
  }

  .msh-kf-card-panel p {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msh-kf-card,
  .msh-kf-filter-btn,
  .msh-kf-card-media img,
  .msh-kf-card-panel,
  .msh-kf-card-panel p,
  .msh-kf.is-loading .msh-kf-status::after {
    animation: none !important;
    transition: none !important;
  }

  .msh-kf-card {
    opacity: 1;
    transform: none;
  }
}

/* Alle steht unabhängig von der Spaltenzahl allein in der letzten Zeile. */
.msh-kf-all-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

.msh-kf-all-row .msh-kf-filter-btn {
  width: calc((100% - 54px) / 4);
  background: var(--msh-terracotta);
}

.msh-kf-all-row .msh-kf-filter-btn:hover,
.msh-kf-all-row .msh-kf-filter-btn:focus-visible {
  background: var(--msh-orange-dark);
}

@media (max-width: 1024px) {
  .msh-kf-all-row .msh-kf-filter-btn {
    width: calc((100% - 18px) / 2);
  }
}

@media (max-width: 620px) {
  .msh-kf-all-row .msh-kf-filter-btn {
    width: 100%;
  }
}
