/* ===== Popup Cards (Standalone) ===== */

/* Close button */
.pc-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  appearance: none;
  border: none;
  background: rgba(255,255,255,.9);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.pc-close:hover,
.pc-close:focus-visible {
  background: #fff;
  outline: 2px solid #0000; /* reset */
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}
.pc-close-icon {
  display: block;
  width: 18px;
  height: 18px;
  position: relative;
}
.pc-close-icon::before,
.pc-close-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 2px;
  background: #111;
  transform-origin: center;
}
.pc-close-icon::before { transform: rotate(45deg); }
.pc-close-icon::after  { transform: rotate(-45deg); }


/* 0) Trigger card (the thing you click) */
.pc-trigger {
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  background: #fff;
}
.pc-trigger:hover,
.pc-trigger:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
  outline: none;
  background: #d3430d;
  color: #fff;
}

.pc-card-img {
  width: 100%;
  height: auto;
  display: block;
}
.pc-card-body {
  padding: 1rem 1.25rem;
}
.pc-card-title, .pc-card-body h3 {
  margin: 0 0 .5rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
  border-bottom: none;
  margin: 0px !important;
}

.pc-trigger:hover .pc-card-body h3, .pc-card-title:hover, .pc-card-body:hover h3 {color: #fff;}

.pc-card-text {
  margin: 0;
  color: #444;
  line-height: 1.5;
}

/* 1) Overlay + modal shell */
.pc-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.5);
  z-index: 1000;

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.pc-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .2s ease;
}

/* 2) Modal panel (the popup card) */
.pc-modal {
  background: #fff;
  color: #111;
  width: min(92vw, 640px);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  transform: translateY(10px) scale(.98);
  transition: transform .22s ease, opacity .22s ease;
  opacity: 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.pc-overlay.is-open .pc-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Optional media region (only renders if you include it) */
.pc-modal-media {
  position: relative;
  background: #f6f7f8;
}
.pc-modal-media > img,
.pc-modal-media > video {
  display: block;
  width: 100%;
  height: auto;
}

/* Make modal and close button stack correctly */
.pc-modal { position: relative; }
.pc-close { z-index: 5; }          /* above iframe */
.pc-overlay { z-index: 9999; }     /* above the page */

/* Media inside the body */
.pc-modal-body { position: relative; }
.pc-modal-body .pc-modal-media {
  position: relative;
  margin: 1rem 0;
  width: 100%;
  aspect-ratio: 16/9;              /* responsive box */
  background: #f6f7f8;
  overflow: hidden;                 /* trim any bleed */
}

/* Force the iframe to fill the box and receive clicks */
.pc-modal-body .pc-modal-media iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;         /* override height="315" attribute */
  border: 0;
  display: block;
  pointer-events: auto;            /* ensure clicks reach the player */
  z-index: 2;
}


/* Content */
.pc-modal-body {
  padding: 1.25rem 1.25rem 1.5rem;
  overflow: auto;
}
.pc-modal-title {
  margin: 0 2.25rem .5rem 0; /* space for close button */
  font-size: 1.25rem;
  font-weight: 800;
}

.pc-modal-text, .pc-modal-body p {
  margin: 0 0 15px 0;
  color: #333;
  line-height: 1.6;
}

.pc-modal-body iframe { margin-bottom: 20px;}

.pc-modal-body .pc-modal-media {
  margin-bottom: 1rem;
  position: relative;
}

.pc-modal-body .pc-modal-media iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9; /* keeps it responsive */
  border: 0;
}


/* Only affect the popup card row */
.pc-cards .pc-trigger {
  display: flex;              /* lets image + body stack */
  flex-direction: column;
  width: 100%;
}

/* Optional: keep titles tidy but don’t force equal heights via CSS */
.pc-cards .pc-card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
}

.pc-cards .pc-card-title {
  text-align: center;
  /* uncomment to clamp to 2 lines if you want tighter rows:
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  */
}

/* Uniform image crop without changing your grid */
.pc-cards .pc-card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}



/* Utility: lock body scroll when modal is open */
.pc-lock {
  overflow: hidden !important;
  overscroll-behavior: contain;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pc-overlay,
  .pc-modal {
    transition: none !important;
  }
}
