/* Base layout */
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans CJK TC", sans-serif;
  color: #111;
}

/* Master page layout */
#masterPage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* iframe embed styling */
.embed-frame {
  width: 100%;
  border: 0;
  display: block;
  overflow: hidden;
  background: transparent;
}
#headerFrame { height: 72px; }
#footerFrame { height: 250px; }

/* Main content expands */
#PAGES_CONTAINER { flex: 1; }

/* Booking section background */
.program-section {
  background: #6fb5b5; /* teal background */
  padding: 60px 24px;
}

/* Stage wrapper so we can pin decorative images */
.program-stage {
  position: relative;
  max-width: 1400px; /* allows room for decorations on wide screens */
  margin: 0 auto;
}

/* The decor layer sits behind the panel */
.stage-decor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -60px;
  pointer-events: none;
  z-index: 3; /* pull decor to the front */
}
.stage-decor img {
  position: absolute;
  bottom: 0;
  width: 250px; /* default size (desktop) */
  height: auto;
  display: block;
}
.stage-decor .decor-left { left: 18px; }
.stage-decor .decor-right { right: 18px; width: 500px; } /* right group is wider in your reference */

/* Panel stays above decor */
.program-panel {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  background: #fff7d6;
  padding: 36px 40px;
  border-radius: 24px;
}

/* Card - using grid for perfect alignment */
.program-card {
  background: #fff3c6;
  border-radius: 18px;
  padding: 28px 36px;
  display: grid;
  grid-template-columns: 340px 1fr; /* Fixed image width, content fills rest */
  gap: 56px;
  align-items: center; /* Vertically center everything */
}
.program-card + .program-card { margin-top: 28px; }

/* Thumbnail - Regular cards (1, 2, 3) */
.program-thumb {
  width: 340px;
  height: 190px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  background: transparent;
  justify-self: center; /* Center the image in its grid cell */
}

.program-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Poster specific - Card 4 (square image) */
.program-thumb.poster {
  width: 268px;
  height: 268px;
  aspect-ratio: 1 / 1;
  justify-self: center; /* Center the square image */
}

.program-thumb.poster img {
  object-fit: contain; /* Show entire image without cropping */
}

/* Badge */
.badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: #7cb342;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 4px;
  z-index: 2;
}

/* Content - all text starts at the same left position */
.program-content { 
  padding: 0; /* Remove padding to align text properly */
}

.program-content h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}
.program-content .desc {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.75;
}
.program-content .meta {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.9;
}

/* Button */
.btn {
  display: inline-block;
  padding: 10px 18px;
  background: #333;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}
.btn:hover { background: #000; }

/* ======================================== */
/* RESPONSIVE BREAKPOINTS */
/* ======================================== */

/* Tablet - Medium screens */
@media (max-width: 1115px) {
  .program-card { 
    grid-template-columns: 320px 1fr;
    gap: 36px; 
    padding: 24px 26px; 
  }
  
  .program-thumb { 
    width: 320px; 
    height: 180px; 
  }
  
  .program-thumb.poster {
    width: 240px;
    height: 240px;
  }

  /* scale decor down a bit */
  .stage-decor { height: 220px; }
  .stage-decor img { width: 180px; }
  .stage-decor .decor-right { width: 270px; }
}

/* Mobile - Small screens */
@media (max-width: 932px) {
  .program-section { 
    padding: 28px 14px; 
  }
  
  .program-panel {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .stage-decor { display: none; }

  .program-card {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
    padding: 20px 18px;
  }

  /* All thumbs become full width on mobile */
  .program-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    justify-self: stretch;
  }
  
  .program-thumb img { 
    height: 100%;
    object-fit: cover;
  }
  
  /* Poster remains square on mobile */
  .program-thumb.poster {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 400px; /* Limit max size */
    justify-self: center; /* Center it */
    margin: 0 auto;
  }

  .program-thumb.poster img {
    object-fit: contain; /* Show full image */
  }

  .program-content { 
    padding: 0; 
  }
  
  .program-content h3 { 
    font-size: 16px; 
    margin: 0 0 8px; 
  }

  /* decor should be smaller and not overlap content */
  .stage-decor {
    height: 180px;
    bottom: -8px;
  }
  .stage-decor img { width: 140px; }
  .stage-decor .decor-right { width: 210px; }
  .stage-decor .decor-left { left: 8px; }
  .stage-decor .decor-right { right: 8px; }
}

/* Very small phones */
@media (max-width: 420px) {
  .stage-decor { display: none; }
  
  .program-thumb.poster {
    max-width: 100%; /* Full width on very small screens */
  }
}

/* ======================================== */
/* FIX: Ensure text alignment on desktop */
/* ======================================== */

/* On desktop, all text in card 4 aligns with cards 1-3 */
@media (min-width: 933px) {
  /* Remove any extra padding that might offset text */
  .program-card:last-child .program-content {
    padding: 0;
  }
  
  /* If you need fine-tuning, adjust the grid gap */
  .program-card {
    gap: 56px;
  }
}