
/* ==== PyLabRobot Card Grid Styling ==== */

/* ==== Filter Bar ==== */

.plr-card-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.plr-tag-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
}

.plr-filter-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--pst-color-border, #ccc);
  border-radius: 20px;
  background: var(--pst-color-surface, #f7f7f7);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  color: var(--pst-color-text, #222);
  min-width: 100px;
  text-decoration: none !important;
}

.plr-filter-btn:hover {
  background: var(--pst-color-hover, #e9eef7);
  border-color: var(--pst-color-primary, #1a4ed8);
  color: var(--pst-color-primary, #1a4ed8);
  transform: translateY(-1px);
}

.plr-filter-btn.active {
  background: var(--pst-color-primary, #1a4ed8);
  color: #fff;
  border-color: var(--pst-color-primary, #1a4ed8);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(26, 78, 216, 0.25);
}

/* ==== Grid Layout ==== */

.plr-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
  position: relative;
}

/* ==== Card Core ==== */

.plr-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pst-color-border, #e0e0e0);
  border-radius: 12px;
  background: var(--pst-color-background, #fff);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  height: 100%;
  animation: plrFadeIn 0.4s ease both;
}

.plr-card.hidden {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.plr-card:hover {
  transform: translateY(-4px);
  border-color: var(--pst-color-primary, #1a4ed8);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.plr-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: row;
  /* align-items: stretch; */
  height: 100%;
}

/* ==== Content Layout ==== */

.plr-card-content {
  flex: 1;
  display: flex;
  /* align-items: stretch; */
  justify-content: space-between;
  min-height: 220px;
  width: 100%;
}

.plr-card-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 1.7rem;
  width: 60%;
}

.plr-card-text h4 {
  margin: 0 0 0.6rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  /* color: var(--pst-color-primary, #1a4ed8); */
  line-height: 1.3;
}

.plr-card-text p, li {
  margin: 0;
  margin-top: 0.25rem;
  color: var(--pst-color-text);
  font-size: 0.95rem;
  line-height: 1.55;
  visibility: visible;
  opacity: 1;
}
.plr-card-text p {
  display: block;
}
.plr-card-text ul {
  margin-bottom: 0;
}
.plr-card-text li {
  margin-left: -1rem;
}

/* ==== Image & Video ==== */

.plr-card-image {
  max-width: 320px;
  overflow: hidden;
  position: relative;
  border-left: 1px solid var(--pst-color-border, #e0e0e0);
  background: var(--pst-color-surface, #fafafa);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.plr-card-image img,
.plr-card-image video {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;

  object-fit: cover;
  border-radius: 0;
  transition: transform 0.35s ease, filter 0.3s ease, opacity 0.25s ease-in-out;
  will-change: transform, filter, opacity;
  isolation: isolate;
  contain: paint;
  backface-visibility: hidden;
}

.plr-card-image video {
  display: none;
  position: absolute;
  inset: 0;
}

/* Image visual feedback */
.plr-card:hover .plr-card-image img {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* Add depth with subtle overlay */
.plr-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.plr-card:hover .plr-card-image::after {
  opacity: 1;
}

/* ==== Animations ==== */

@keyframes plrFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==== Responsive ==== */

@media (max-width: 1200px) {
}

@media (max-width: 900px) {
  .plr-card a {
    flex-direction: column;
  }

  .plr-card-content {
    flex-direction: column;
  }

  .plr-card-text {
    padding: 1rem 1.25rem;
    width: 100%;
  }

  .plr-card-image {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--pst-color-border, #e0e0e0);
    max-width: none;
    /* show before content */
    order: -1;
  }

  .plr-filter-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    min-width: auto;
  }
}
