/* =================================================================
   Custom styles for pasted content responsiveness (V7 - Bulletproof)
   ================================================================= */

/* --- General Styles for All Screens --- */
.pasted-content {
  box-sizing: border-box; 
}

.pasted-content img {
  max-width: 100%;
  height: auto;
}

/* =================================================================
   TABLET & IPAD STYLES
   ================================================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .pasted-content .MuiContainer-root {
    padding: 40px 40px !important; 
  }
  .pasted-content .cms-card-preview-title {
    font-size: 32px !important; 
    line-height: 1.3 !important;
  }
  .pasted-content p, .pasted-content li {
    font-size: 18px !important;
    line-height: 1.5 !important;
  }
  .pasted-content .MuiGrid2-grid-xs-6 {
    width: 48% !important;
    margin-bottom: 20px;
  }
  .pasted-content .MuiGrid2-grid-xs-4 {
    width: 100% !important;
    margin-bottom: 30px;
  }
  .ios-tablet-page .cms-block-card.image.overlay .cms-card-preview-info,
  .cheng-mun-chee-kee-page .cms-block-card.image.overlay .cms-card-preview-info,
  .ming-kee-page .cms-block-card.image.overlay .cms-card-preview-info{
    padding: 30px !important;
  }
  .ios-tablet-page .cms-block-card.image.overlay .cms-card-preview-title,
  .cheng-mun-chee-kee-page .cms-block-card.image.overlay .cms-card-preview-title,
  .ming-kee-page .cms-block-card.image.overlay .cms-card-preview-title{
    font-size: 42px !important;
  }
  .ios-tablet-page .cms-block-card.image.overlay .cms-card-preview-description,
  .cheng-mun-chee-kee-page .cms-block-card.image.overlay .cms-card-preview-description,
  .ming-kee-page .cms-block-card.image.overlay .cms-card-preview-description{
    font-size: 20px !important;
  }
}

/* =================================================================
   MOBILE & SMALL TABLET STYLES
   ================================================================= */
@media (max-width: 768px) {

  /* --- FINAL Hero Banner Fix for Mobile (Padding-Top Method) --- */
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview{
      position: relative;
      height: 0;
      padding-top: 150%; /* This creates a 4:3 aspect ratio (3 / 4 * 100) */
      overflow: hidden;
      max-height: none !important;
  }
  
  /* Make the image, overlay, and text wrapper fill the container */
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-image-wrapper,
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-image-overlay,
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-info-wrapper,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-wrapper,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-overlay,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-info-wrapper,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-wrapper,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-overlay,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-info-wrapper{
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
  }

  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-image-overlay,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-overlay,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-overlay{
      background-color: rgba(0, 0, 0, 0.5) !important;
      z-index: 1;
  }

  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-image-wrapper,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-wrapper,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-image-wrapper{
      z-index: 0;
  }
    
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-image,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-image,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-image{
      width: 100%;
      height: 100%;
      object-fit: cover;
  }

  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-info-wrapper,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-info-wrapper,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-info-wrapper{
    z-index: 2; /* Ensure text is on top */
    display: flex; /* Use flexbox to center the content */
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-info,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-info,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-info{
    text-align: center !important;
    padding: 15px !important;
  }
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-title,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-title,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-title{
    font-size: 28px !important;
    line-height: 1.2 !important;
    font-weight: bold;
  }
  .ios-tablet-page div.cms-block-card.image.overlay .cms-card-preview-description,
  .cheng-mun-chee-kee-page div.cms-block-card.image.overlay .cms-card-preview-description,
  .ming-kee-page div.cms-block-card.image.overlay .cms-card-preview-description{
    font-size: 16px !important;
    line-height: 1.4 !important;
    margin-top: 10px;
  }
  .ios-tablet-page .cms-card-preview-image.paddingB-ratio41,
  .ios-tablet-page .cms-card-preview-image.paddingB-ratio21,
  .cheng-mun-chee-kee-page .cms-card-preview-image.paddingB-ratio169,
  .ming-kee-page .cms-card-preview-image.paddingB-ratio169
  {
    height: 100%;
  }
  /* --- End Hero Banner Fixes --- */


  /* --- General Mobile Styles for ALL Pasted Content --- */
  .pasted-content .MuiContainer-root {
    padding: 30px 15px !important;
  }
  .pasted-content .cms-card-preview-title {
    font-size: 24px !important;
    line-height: 1.3 !important;
  }
  .pasted-content p, .pasted-content li {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  .pasted-content button span {
    font-size: 18px !important;
    text-align: center;
  }
  .pasted-content .cms-card-preview.row-direction {
    flex-direction: column !important;
  }
  .pasted-content .cms-card-preview-info-wrapper,
  .pasted-content .cms-card-preview-image-wrapper {
    max-width: 100% !important;
  }
  .pasted-content .MuiGrid2-grid-xs-6 {
    width: 100% !important;
    margin-bottom: 25px; 
  }
  .pasted-content .MuiGrid2-grid-xs-4 {
    width: 100% !important;
    margin-bottom: 30px; 
  }
}