/* ============================================================
   Emirates Pearl — Global Balance & Media Stability V9
   A small final layer instead of adding more overrides to main.css.
   ============================================================ */

:root{
  --ep-section-space:clamp(84px,8vw,136px);
  --ep-section-space-mobile:72px;
  --ep-card-radius:22px;
  --ep-content-max:1180px;
}

body{
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}

.page-hero{
  isolation:isolate;
}
.content-section,
.products-section,
.founders-section,
.partners-orbit-section,
.cta-section{
  padding-top:var(--ep-section-space);
  padding-bottom:var(--ep-section-space);
}

.section-title{
  text-wrap:balance;
}
.section-copy{
  text-wrap:pretty;
}

.products-grid{
  align-items:stretch;
}
.product-card{
  min-width:0;
  height:100%;
  display:grid;
  grid-template-rows:auto auto auto 1fr auto;
  align-content:start;
}
.product-card-image{
  width:100%;
  aspect-ratio:4/3;
  height:auto!important;
  min-height:0!important;
  background:linear-gradient(145deg,#102b4c,#071827);
  isolation:isolate;
}
.product-card-image .product-image-fallback{
  z-index:1;
}
.product-card-image img{
  z-index:2;
  opacity:0!important;
  visibility:visible!important;
  transition:opacity .22s ease,transform .42s var(--motion-fast,var(--ease))!important;
}
.product-card-image img.is-ready{
  opacity:1!important;
}
.product-card-image img.media-failed{
  opacity:0!important;
}
.product-card .product-name{
  min-height:2.4em;
}
.product-card .product-meta{
  min-height:1.5em;
}

.product-gallery-shell{
  display:grid;
  gap:12px;
}
.product-gallery-main{
  position:relative;
  overflow:hidden;
}
.product-gallery-thumbs{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
}
.product-gallery-thumb{
  padding:0;
  aspect-ratio:1/1;
  border:1px solid rgba(255,255,255,.11);
  border-radius:12px;
  overflow:hidden;
  background:#102b4c;
  opacity:.68;
  transition:.2s ease;
}
.product-gallery-thumb:hover,
.product-gallery-thumb.active{
  opacity:1;
  border-color:rgba(197,139,65,.7);
  transform:translateY(-2px);
}
.product-gallery-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

@media(max-width:720px){
  .content-section,
  .products-section,
  .founders-section,
  .partners-orbit-section,
  .cta-section{
    padding-top:var(--ep-section-space-mobile)!important;
    padding-bottom:var(--ep-section-space-mobile)!important;
  }

  .container{
    width:min(calc(100% - 32px),var(--max))!important;
  }

  .section-title{
    max-width:13ch!important;
    margin-inline:auto!important;
  }
  .section-copy{
    max-width:32ch!important;
    margin-inline:auto!important;
  }

  .products-grid,
  .founders-grid,
  .content-grid,
  .contact-grid{
    gap:22px!important;
  }

  .product-card{
    border-radius:20px!important;
    padding:20px!important;
  }
  .product-card-image{
    margin:-18px -18px 18px!important;
    width:calc(100% + 36px)!important;
  }
  .product-card .product-name{
    min-height:0;
  }
  .product-card .product-meta{
    min-height:0;
  }

  .product-gallery-thumbs{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

@media(prefers-reduced-motion:reduce){
  .product-card-image img,
  .product-gallery-thumb{
    transition:none!important;
  }
}

/* Product Description Styling */
.product-description-wrap{
  margin-top:24px;
  padding:20px 22px;
  border-radius:16px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(197,139,65,.25);
  box-shadow:0 8px 24px rgba(0,0,0,.14);
}
.product-description-title{
  font-size:1.1rem;
  font-weight:700;
  color:var(--gold-accent,#c58b41);
  margin:0 0 10px 0;
  letter-spacing:.3px;
}
.product-description-text{
  white-space:pre-line;
  line-height:1.85;
  color:#dce4ec;
  font-size:.95rem;
  word-break:break-word;
}
[data-theme="light"] .product-description-wrap,
.theme-light .product-description-wrap{
  background:rgba(11,31,56,.03);
  border-color:rgba(197,139,65,.35);
  box-shadow:0 6px 20px rgba(11,31,56,.06);
}
[data-theme="light"] .product-description-text,
.theme-light .product-description-text{
  color:#1c2d42;
}
