/* Featured Programs Grid Block Styles */

.featured-programs-grid-block {
  width: 100%;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0;
}

/* 2x2 Grid Container */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Individual Program Item */
.program-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.program-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

/* Program Link - Overlay Area */
.program-link {
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-decoration: none;
  color: inherit;
  z-index: 10;
}

.program-link:focus {
  outline: 2px solid #d32f2f;
  outline-offset: -2px;
}

/* Image Wrapper */
.program-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
  background: #000;
}

.program-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.program-item:hover .program-image {
  transform: scale(1.05);
  opacity: 0.85;
}

/* Poster View Button */
.poster-view-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: scale(0.8);
}

.program-item:hover .poster-view-btn {
  opacity: 1;
  transform: scale(1);
}

.poster-view-btn:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
}

.poster-view-btn:focus {
  outline: 2px solid #d32f2f;
  outline-offset: 2px;
}

.poster-view-btn svg {
  color: #d32f2f;
  width: 24px;
  height: 24px;
}

/* Overlay with Title and CTA */
.program-overlay {
  position: relative;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
  transform: translateY(0);
  transition: transform 0.3s ease, background 0.3s ease;
}

.program-item:hover .program-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
}

/* Program Title */
.program-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.program-item:hover .program-title {
  transform: translateY(-2px);
}

/* CTA Text */
.program-cta {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: #d32f2f;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.program-item:hover .program-cta {
  background: #b71c1c;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Tablet Layout (768px - 1024px) */
@media (max-width: 1024px) {
  .featured-programs-grid-block {
    margin: 1.5rem auto;
  }

  .programs-grid {
    gap: 1.25rem;
  }

  .program-title {
    font-size: 1.15rem;
  }

  .program-cta {
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
  }
}

/* Mobile Layout (≤767px) - Single Column */
@media (max-width: 767px) {
  .featured-programs-grid-block {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .programs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Allow full image to show at natural aspect ratio */
  .program-image-wrapper {
    padding-bottom: 0;
    height: auto;
    position: relative;
  }

  .program-image {
    position: relative;
    height: auto;
    object-fit: contain;
  }

  /* Move overlay below image instead of on top */
  .program-link {
    position: relative;
    bottom: auto;
  }

  .program-overlay {
    background: #fff;
    border-top: 3px solid #d32f2f;
    padding: 1rem 1.25rem 1.25rem;
  }

  .program-item:hover .program-overlay {
    background: #fff;
  }

  .program-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #333;
    text-shadow: none;
  }

  .program-cta {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
}

/* Extra Small Mobile (≤480px) */
@media (max-width: 480px) {
  .program-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .program-overlay {
    padding: 0.875rem 1rem 1rem;
  }

  .program-cta {
    font-size: 0.8rem;
    padding: 0.4rem 0.875rem;
  }
}

/* Poster Modal */
.poster-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.poster-modal.active {
  display: block;
  opacity: 1;
}

.poster-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.poster-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  margin: 5vh auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.poster-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.poster-modal-close:hover {
  background: #fff;
  transform: rotate(90deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.poster-modal-close:focus {
  outline: 2px solid #d32f2f;
  outline-offset: 2px;
}

.poster-modal-close svg {
  color: #d32f2f;
}

.poster-modal-title {
  padding: 1.5rem 4rem 1rem 1.5rem;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
}

.poster-modal-image-wrapper {
  position: relative;
  width: 100%;
  max-height: calc(90vh - 100px);
  overflow: auto;
  background: #000;
}

.poster-modal-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .program-item,
  .program-image,
  .program-overlay,
  .program-title,
  .program-cta,
  .poster-view-btn {
    transition: none;
  }

  .program-item:hover {
    transform: none;
  }

  .program-item:hover .program-image {
    transform: none;
  }

  .program-item:hover .program-title {
    transform: none;
  }

  .program-item:hover .program-cta {
    transform: none;
  }

  .poster-modal-content {
    animation: none;
  }

  .poster-modal-close:hover {
    transform: none;
  }
}

/* Mobile Modal Adjustments */
@media (max-width: 767px) {
  .poster-modal-content {
    width: 95%;
    margin: 2.5vh auto;
    max-height: 95vh;
  }

  .poster-modal-title {
    font-size: 1.2rem;
    padding: 1rem 3.5rem 0.75rem 1rem;
  }

  .poster-modal-close {
    width: 40px;
    height: 40px;
    top: 0.75rem;
    right: 0.75rem;
  }

  .poster-modal-close svg {
    width: 24px;
    height: 24px;
  }

  .poster-view-btn {
    width: 40px;
    height: 40px;
    opacity: 1;
    transform: scale(1);
  }

  .poster-view-btn svg {
    width: 20px;
    height: 20px;
  }
}
