/*-- Use For Custom Styling --*/

/* ===================================
   Global: heading.text-center – modern, no border/line edge
====================================== */

.heading.text-center,
.heading-area .heading.text-center {
  border: none !important;
  padding: 0.25em 0 !important;
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.5em;
  font-family: 'Montserrat', sans-serif;
  text-shadow: none;
}

/* Optional: subtle accent line under heading (remove if you want zero lines) */
.heading.text-center::after,
.heading-area .heading.text-center::after {
  content: none;
}

/* ===================================
   Global: text.text-center – modern body copy
====================================== */

.text.text-center,
.heading-area .text.text-center {
  font-family: 'Roboto', sans-serif;
  font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: #4a4a4a;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.text.text-center strong,
.heading-area .text.text-center strong {
  font-weight: 600;
  color: #2a2a2a;
}

/* ===================================
   Portfolio section – 4K premium effects
====================================== */

.portfolio-modern {
  --portfolio-overlay: rgba(240, 49, 106, 0.88);
  --portfolio-overlay-hover: rgba(225, 35, 90, 0.95);
  --portfolio-radius: 20px;
  --portfolio-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --portfolio-shadow-hover: 0 24px 64px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06), 0 0 80px -12px rgba(240, 49, 106, 0.35);
  --portfolio-transition: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --portfolio-ease-out: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* Section + grid: keep everything inside the section */
.cubeportfolio.portfolio-modern#work {
  padding-bottom: 2rem;
  box-sizing: border-box;
}

.cubeportfolio.portfolio-modern .cbp,
.cubeportfolio.portfolio-modern .cbp-wrapper-outer {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Section background: subtle depth for 4K feel */
.portfolio-modern#work {
  background: linear-gradient(180deg, #fafbfc 0%, #f2f4f6 50%, #fafbfc 100%);
}

.portfolio-modern#work::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 49, 106, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* Section spacing and heading – crisp typography */
.portfolio-modern .heading-area .sub-heading {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.92;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.portfolio-modern .heading-area .heading {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.portfolio-modern#work .container {
  padding-left: 1rem;
  padding-right: 1rem;
  position: relative;
  z-index: 1;
}

/* Grid items: 4K-ready card, images fit inside */
.portfolio-modern .cbp-item {
  border-radius: var(--portfolio-radius);
  overflow: hidden;
  box-shadow: var(--portfolio-shadow);
  transition: transform var(--portfolio-ease-out), box-shadow var(--portfolio-transition), filter var(--portfolio-transition), opacity 0.5s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  opacity: 1;
  max-width: 100%;
  box-sizing: border-box;
}

.portfolio-modern .cbp-item .cbp-item-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--portfolio-radius);
}

.portfolio-modern .cbp-item .cbp-caption {
  display: block;
  max-width: 100%;
  overflow: hidden;
}

/* Staggered entrance when grid becomes ready (CubePortfolio adds .cbp-ready) */
.portfolio-modern .cbp-ready .cbp-item:nth-child(1) { animation: portfolioReveal 0.6s ease-out both; }
.portfolio-modern .cbp-ready .cbp-item:nth-child(2) { animation: portfolioReveal 0.6s ease-out 0.06s both; }
.portfolio-modern .cbp-ready .cbp-item:nth-child(3) { animation: portfolioReveal 0.6s ease-out 0.12s both; }
.portfolio-modern .cbp-ready .cbp-item:nth-child(4) { animation: portfolioReveal 0.6s ease-out 0.18s both; }
.portfolio-modern .cbp-ready .cbp-item:nth-child(5) { animation: portfolioReveal 0.6s ease-out 0.24s both; }
.portfolio-modern .cbp-ready .cbp-item:nth-child(6) { animation: portfolioReveal 0.6s ease-out 0.30s both; }
.portfolio-modern .cbp-ready .cbp-item:nth-child(7) { animation: portfolioReveal 0.6s ease-out 0.36s both; }
.portfolio-modern .cbp-ready .cbp-item:nth-child(8) { animation: portfolioReveal 0.6s ease-out 0.42s both; }
@keyframes portfolioReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.portfolio-modern .cbp-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--portfolio-shadow-hover);
  filter: brightness(1.02);
}

.portfolio-modern .cbp-item .cbp-caption-defaultWrap,
.portfolio-modern .cbp-item .cbp-caption-activeWrap {
  border-radius: var(--portfolio-radius);
}

.portfolio-modern .cbp-item .cbp-caption-defaultWrap {
  overflow: hidden;
  position: relative;
  display: block;
  max-width: 100%;
}

/* Subtle inner border for sharp 4K look (doesn’t affect layout) */
.portfolio-modern .cbp-item .cbp-caption-defaultWrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--portfolio-radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--portfolio-transition);
}

.portfolio-modern .cbp-item:hover .cbp-caption-defaultWrap::after {
  opacity: 1;
}

.portfolio-modern .cbp-item:hover .cbp-caption-defaultWrap {
  transform: none;
}

/* Images: fit into section tiles, no overflow (plugin needs height: auto for layout) */
.portfolio-modern .cbp-item .cbp-caption-defaultWrap img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  vertical-align: middle;
}

.portfolio-modern .cbp-item:hover .cbp-caption-defaultWrap img {
  transform: scale(1.12);
}

/* Overlay: glass-style gradient + backdrop blur */
.portfolio-modern .cbp-l-grid-mosaic-flat .cbp-caption-activeWrap {
  background: linear-gradient(165deg, var(--portfolio-overlay) 0%, rgba(180, 25, 70, 0.96) 100%) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity var(--portfolio-transition);
}

.portfolio-modern .cbp-item:hover .cbp-caption-activeWrap {
  opacity: 1;
}

.portfolio-modern .cbp-l-grid-mosaic-flat .cbp-caption-activeWrap:hover {
  background: linear-gradient(165deg, var(--portfolio-overlay-hover) 0%, rgba(180, 25, 70, 0.98) 100%) !important;
  opacity: 1;
}

/* Caption: crisp text with strong shadow */
.portfolio-modern .cbp-l-caption-body .title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 0, 0, 0.2);
  transition: transform var(--portfolio-transition);
}

.portfolio-modern .cbp-item:hover .cbp-l-caption-body .title {
  transform: translateY(-2px);
}

.portfolio-modern .cbp-l-caption-body .cbp-l-caption-desc {
  font-size: 0.9rem;
  opacity: 0.98;
  margin-top: 0.5rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  transition: transform var(--portfolio-transition);
}

.portfolio-modern .cbp-item:hover .cbp-l-caption-body .cbp-l-caption-desc {
  transform: translateY(-1px);
}

/* Plus icon: glow ring + smooth rotation */
.portfolio-modern .plus {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25), inset 0 0 20px rgba(255, 255, 255, 0.08);
  transition: transform var(--portfolio-ease-out), border-color var(--portfolio-transition), box-shadow var(--portfolio-transition);
}

.portfolio-modern .cbp-item:hover .plus {
  transform: rotate(90deg) scale(1.08);
  border-color: #fff;
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.4), inset 0 0 24px rgba(255, 255, 255, 0.12);
}

.portfolio-modern .plus::before {
  width: 2px;
  left: 50%;
  top: 12px;
  bottom: 12px;
  margin-left: -1px;
}

.portfolio-modern .plus::after {
  height: 2px;
  top: 50%;
  left: 12px;
  right: 12px;
  margin-top: -1px;
}

.portfolio-modern .plus::before,
.portfolio-modern .plus::after {
  content: " ";
  position: absolute;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

/* Featured CTA card (text-area): background image + text + YouTube Shorts + CTA */
.portfolio-modern .cbp-item-featured .cbp-caption.portfolio-cta-card {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.portfolio-modern .cbp-item-featured .cbp-caption-activeWrap.text-area {
  opacity: 1 !important;
  background: linear-gradient(165deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.82) 100%) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

/* Inner layout: text + CTA on one side, vertical video on the other */
.portfolio-modern .cbp-item-featured .featured-card-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  max-width: 100%;
  width: 100%;
  flex-wrap: wrap;
}

.portfolio-modern .cbp-item-featured .featured-card-content {
  flex: 1 1 200px;
  min-width: 0;
  text-align: center;
}

.portfolio-modern .cbp-item-featured .portfolio-text {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.2);
  display: block;
}

.portfolio-modern .cbp-item-featured .portfolio-para {
  font-size: 0.9375rem;
  line-height: 1.65;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 1.5rem;
  opacity: 0.96;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.portfolio-modern .cbp-item-featured .btn.link {
  border-color: rgba(255, 255, 255, 0.95);
  padding: 0.65rem 1.9rem;
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: background var(--portfolio-transition), color var(--portfolio-transition), border-color var(--portfolio-transition), transform var(--portfolio-transition), box-shadow var(--portfolio-transition);
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.portfolio-modern .cbp-item-featured .btn.link:hover {
  background: #fff !important;
  color: #1a1a1a !important;
  border-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

/* YouTube Shorts embed – vertical 9:16 (works when deployed; can show Error 153 on localhost) */
.portfolio-modern .cbp-item-featured .featured-card-video {
  flex: 0 0 auto;
  width: min(180px, 40vw);
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  aspect-ratio: 9 / 16;
  background: #000;
  position: relative;
}

.portfolio-modern .cbp-item-featured .featured-card-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  vertical-align: top;
}

/* Fallback link when embed fails (e.g. localhost) – open in new tab */
.portfolio-modern .cbp-item-featured .featured-card-video-fallback {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease;
}

.portfolio-modern .cbp-item-featured .featured-card-video-fallback:hover {
  background: rgba(255, 0, 0, 0.85);
  color: #fff;
}

/* Lightbox link styling */
.portfolio-modern .cbp a,
.portfolio-modern .cbp a:hover,
.portfolio-modern .cbp a:active {
  color: #fff;
  text-decoration: none;
}

.portfolio-modern .portfolio-cta-card {
  text-decoration: none;
  color: inherit;
}

/* Responsive: smaller radius and padding on mobile */
@media (max-width: 768px) {
  .portfolio-modern {
    --portfolio-radius: 12px;
    --portfolio-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  }

  .portfolio-modern .cbp-item-featured .featured-card-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .portfolio-modern .cbp-item-featured .featured-card-video {
    width: min(160px, 50vw);
    order: -1;
  }

  .portfolio-modern .cbp-item-featured .portfolio-text {
    margin-bottom: 0.75rem;
  }

  .portfolio-modern .cbp-item-featured .portfolio-para {
    width: 95%;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
  }
}

/* ===================================
   Facebook Messenger Chat Plugin – ensure widget is visible on top
====================================== */

#fb-root {
  position: relative;
  z-index: 1;
}

#fb-customer-chat,
.fb-customerchat {
  position: relative;
  z-index: 999999 !important;
}

/* Widget iframe injected by Facebook SDK */
#fb-customer-chat iframe,
.fb-customerchat iframe {
  z-index: 999999 !important;
}

/* ===================================
   YouTube Shorts popup – home page
====================================== */

.youtube-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s ease, opacity 0.3s ease;
}

.youtube-popup-overlay.youtube-popup-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.youtube-popup-overlay.youtube-popup-minimized {
  pointer-events: none;
  visibility: visible;
  opacity: 1;
}

.youtube-popup-overlay.youtube-popup-minimized .youtube-popup-box {
  pointer-events: auto;
}

.youtube-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  transition: opacity 0.3s ease;
}

.youtube-popup-overlay.youtube-popup-minimized .youtube-popup-backdrop {
  opacity: 0;
  pointer-events: none;
}

.youtube-popup-box {
  position: relative;
  width: 100%;
  max-width: min(360px, 95vw);
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.08),
              0 0 80px -10px rgba(240, 49, 106, 0.35);
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease-out,
              bottom 0.35s ease-out, left 0.35s ease-out,
              width 0.35s ease-out, max-width 0.35s ease-out,
              border-radius 0.3s ease;
}

.youtube-popup-overlay.youtube-popup-open .youtube-popup-box {
  transform: scale(1);
  opacity: 1;
}

/* Minimized: small at bottom-left */
.youtube-popup-overlay.youtube-popup-minimized .youtube-popup-box {
  position: fixed;
  bottom: 1rem;
  left: 8rem;
  width: 140px;
  max-width: 140px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.06),
              0 0 40px -8px rgba(240, 49, 106, 0.4);
  transform: scale(1);
  opacity: 1;
  cursor: pointer;
}

@media (max-width: 991px) {
  .youtube-popup-overlay.youtube-popup-minimized .youtube-popup-box {
    left: 1.5rem;
  }
}

.youtube-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.youtube-popup-close:hover {
  background: rgba(240, 49, 106, 0.9);
  transform: scale(1.05);
}

.youtube-popup-overlay.youtube-popup-minimized .youtube-popup-close {
  display: none;
}

.youtube-popup-dismiss {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.youtube-popup-dismiss:hover {
  background: rgba(200, 40, 80, 0.95);
}

.youtube-popup-overlay.youtube-popup-minimized .youtube-popup-dismiss {
  display: block;
}

.youtube-popup-video {
  position: absolute;
  inset: 0;
}

.youtube-popup-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}
