/* E-GreenLife Premium — media components, archive title, gallery, sections */

/* --------------------------------------------------------------------------
   Layout offsets (sticky header + admin bar)
   -------------------------------------------------------------------------- */
:root {
  --eg-header-height: 72px;
  --eg-header-height-mobile: 64px;
  --eg-admin-bar-height: 0px;
}

body.admin-bar {
  --eg-admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    --eg-admin-bar-height: 46px;
  }
}

html {
  scroll-padding-top: calc(var(--eg-header-height) + var(--eg-admin-bar-height) + 12px);
}

body.eg-redesign .eg-header {
  top: var(--eg-admin-bar-height);
}

@media (max-width: 1023px) {
  :root {
    --eg-header-height: var(--eg-header-height-mobile);
  }
}

/* Archive / page title band — clear sticky header, keep Basel structure */
body.eg-redesign:not(.home):not(.front-page) .page-title,
body.eg-redesign:not(.home):not(.front-page) .basel-page-title {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--eg-header-height) + 28px) !important;
  padding-bottom: 28px !important;
  margin-top: 0 !important;
  overflow: visible !important;
  scroll-margin-top: calc(var(--eg-header-height) + var(--eg-admin-bar-height));
  min-height: calc(var(--eg-header-height) + 96px);
  box-sizing: border-box;
}

/* Light scheme titles need readable contrast if band bg is pale */
body.eg-redesign .page-title.color-scheme-light {
  background-color: #1b5e3b !important;
  background-image: linear-gradient(160deg, rgba(27, 94, 59, 0.92), rgba(21, 74, 47, 0.88)) !important;
}

body.eg-redesign .page-title .entry-title,
body.eg-redesign .page-title .entry-title span,
body.eg-redesign .page-title h1 {
  color: #fff !important;
  opacity: 1 !important;
  font-family: var(--eg-font-display) !important;
  font-weight: 500;
  line-height: 1.2;
  overflow: visible !important;
  clip: auto !important;
  text-overflow: unset !important;
  white-space: normal !important;
  position: relative;
  z-index: 2;
}

body.eg-redesign .page-title .breadcrumbs,
body.eg-redesign .page-title .breadcrumbs a,
body.eg-redesign .page-title .breadcrumbs span {
  color: rgba(255, 255, 255, 0.85) !important;
  position: relative;
  z-index: 2;
}

body.eg-redesign .eg-page-title,
body.eg-redesign .archive-title,
body.eg-redesign .eg-section,
body.eg-redesign .eg-main {
  scroll-margin-top: calc(var(--eg-header-height) + var(--eg-admin-bar-height) + 8px);
}

/* Main content flow under sticky header on archives */
body.eg-redesign:not(.home):not(.front-page) .main-page-wrapper,
body.eg-redesign:not(.home):not(.front-page) .website-wrapper > .container,
body.eg-redesign:not(.home):not(.front-page) #main-content {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Shared media components
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-media,
body.eg-redesign .eg-media-card,
body.eg-redesign .eg-media-featured,
body.eg-redesign .eg-project-card,
body.eg-redesign .eg-person-card .eg-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--eg-radius-md);
  background: var(--eg-color-surface-muted);
}

body.eg-redesign .eg-media__img,
body.eg-redesign .eg-media img,
body.eg-redesign .eg-gallery__img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

body.eg-redesign .eg-media-card:hover .eg-media__img,
body.eg-redesign .eg-media-featured:hover .eg-media__img,
body.eg-redesign .eg-project-card:hover .eg-media__img,
body.eg-redesign .eg-gallery__item:hover .eg-media__img,
body.eg-redesign .eg-styles__tile:hover .eg-media__img,
body.eg-redesign .eg-services__row:hover .eg-media__img,
body.eg-redesign .eg-person-card:hover .eg-media__img {
  transform: scale(1.04);
}

body.eg-redesign .eg-media-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 1.1rem;
  background: linear-gradient(transparent, rgba(26, 31, 28, 0.62));
  color: #fff;
  pointer-events: none;
}

body.eg-redesign .eg-media-overlay h3,
body.eg-redesign .eg-media-overlay span {
  color: #fff !important;
  margin: 0;
  font-family: var(--eg-font-display);
}

/* Logo badge on apparel (CSS compositing — exact brand file) */
body.eg-redesign .eg-person-card__logo {
  position: absolute;
  top: 38%;
  left: 50%;
  width: 12%;
  max-width: 56px;
  aspect-ratio: 200 / 48;
  transform: translateX(-50%);
  background-image: var(--eg-logo);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  z-index: 2;
}

body.eg-redesign .eg-person-card__logo--sm {
  top: 36%;
  width: 18%;
  max-width: 42px;
}

body.eg-redesign .eg-person-card__caption {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--eg-font-body) !important;
}

/* --------------------------------------------------------------------------
   Gallery + lightbox
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0 1.75rem;
}

body.eg-redesign .eg-gallery[data-cols="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.eg-redesign .eg-gallery[data-cols="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.eg-redesign .eg-gallery__item {
  aspect-ratio: 4 / 3;
  margin: 0;
}

body.eg-redesign .eg-gallery__link {
  display: block;
  width: 100%;
  height: 100%;
}

body.eg-redesign .eg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 12, 0.88);
  padding: 1.5rem;
}

body.eg-redesign .eg-lightbox.is-open {
  display: flex;
}

body.eg-redesign .eg-lightbox__img {
  max-width: min(1100px, 100%);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

body.eg-redesign .eg-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 767px) {
  body.eg-redesign .eg-gallery,
  body.eg-redesign .eg-gallery[data-cols="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Intro editorial
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-intro__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

body.eg-redesign .eg-intro__media {
  aspect-ratio: 4 / 5;
  max-height: 520px;
}

@media (max-width: 900px) {
  body.eg-redesign .eg-intro__layout {
    grid-template-columns: 1fr;
  }
  body.eg-redesign .eg-intro__media {
    max-height: 380px;
    aspect-ratio: 16 / 10;
  }
}

/* --------------------------------------------------------------------------
   Services editorial
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-services__editorial {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

body.eg-redesign .eg-services__feature .eg-media {
  aspect-ratio: 4 / 5;
  margin-bottom: 1rem;
}

body.eg-redesign .eg-services__feature-copy h3 {
  font-family: var(--eg-font-display);
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

body.eg-redesign .eg-services__stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

body.eg-redesign .eg-services__row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  text-decoration: none !important;
  color: inherit;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--eg-color-border);
}

body.eg-redesign .eg-services__row-media {
  aspect-ratio: 1;
  border-radius: var(--eg-radius-sm);
}

body.eg-redesign .eg-services__row-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

body.eg-redesign .eg-services__row-copy strong {
  font-family: var(--eg-font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--eg-color-text);
}

body.eg-redesign .eg-services__row-copy em {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--eg-color-muted);
}

body.eg-redesign .eg-text-link {
  color: var(--eg-color-primary) !important;
  font-size: 0.9375rem;
  text-decoration: none !important;
}

@media (max-width: 900px) {
  body.eg-redesign .eg-services__editorial {
    grid-template-columns: 1fr;
  }
}

/* Hide old equal service grid if present */
body.eg-redesign .eg-services__grid {
  display: none;
}

/* --------------------------------------------------------------------------
   Styles collage
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-styles__collage {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(140px, 18vw);
  gap: 0.75rem;
}

body.eg-redesign .eg-styles__tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--eg-radius-md);
  text-decoration: none !important;
  min-height: 0;
}

body.eg-redesign .eg-styles__tile--wide {
  grid-column: span 7;
}

body.eg-redesign .eg-styles__tile--tall {
  grid-column: span 5;
  grid-row: span 2;
}

body.eg-redesign .eg-styles__tile--sq {
  grid-column: span 3;
}

body.eg-redesign .eg-styles__tile img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

body.eg-redesign .eg-styles__row {
  display: none;
}

@media (max-width: 900px) {
  body.eg-redesign .eg-styles__collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 180px;
  }
  body.eg-redesign .eg-styles__tile--wide,
  body.eg-redesign .eg-styles__tile--tall,
  body.eg-redesign .eg-styles__tile--sq {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* --------------------------------------------------------------------------
   Process timeline
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-process__timeline {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

body.eg-redesign .eg-process__step {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
}

body.eg-redesign .eg-process__step--alt {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

body.eg-redesign .eg-process__step--alt .eg-media {
  order: 2;
}

body.eg-redesign .eg-process__step .eg-media {
  aspect-ratio: 16 / 11;
}

body.eg-redesign .eg-process__num {
  display: inline-block;
  font-family: var(--eg-font-display);
  font-size: 2rem;
  color: var(--eg-color-accent);
  line-height: 1;
  margin-bottom: 0.35rem;
}

body.eg-redesign .eg-process__copy h3 {
  font-family: var(--eg-font-display);
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
}

body.eg-redesign .eg-process__steps {
  display: none;
}

@media (max-width: 767px) {
  body.eg-redesign .eg-process__step,
  body.eg-redesign .eg-process__step--alt {
    grid-template-columns: 1fr;
  }
  body.eg-redesign .eg-process__step--alt .eg-media {
    order: 0;
  }
}

/* --------------------------------------------------------------------------
   Blog editorial
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-blog__editorial {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 1.5rem;
  align-items: start;
}

body.eg-redesign .eg-blog__lead .eg-blog__card-media {
  aspect-ratio: 16 / 11;
  margin-bottom: 1rem;
}

body.eg-redesign .eg-blog__rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.eg-redesign .eg-blog__card--rail {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
}

body.eg-redesign .eg-blog__card--rail .eg-blog__card-media {
  aspect-ratio: 1;
  margin: 0;
}

body.eg-redesign .eg-blog__grid {
  display: none;
}

@media (max-width: 900px) {
  body.eg-redesign .eg-blog__editorial {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Final CTA split
   -------------------------------------------------------------------------- */
body.eg-redesign .eg-final-cta__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: center;
  text-align: left;
}

body.eg-redesign .eg-final-cta__media {
  aspect-ratio: 4 / 3;
}

@media (max-width: 767px) {
  body.eg-redesign .eg-final-cta__layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Archive meta / category description spacing
   -------------------------------------------------------------------------- */
body.eg-redesign .archive-meta {
  margin-top: 1rem;
}

body.eg-redesign .archive-meta .eg-gallery {
  margin-top: 1rem;
}

/* Pagination stays usable */
body.eg-redesign .basel-pagination,
body.eg-redesign .woocommerce-pagination,
body.eg-redesign .pagination {
  position: relative;
  z-index: 2;
  margin: 2rem 0;
  clear: both;
}

@media (prefers-reduced-motion: reduce) {
  body.eg-redesign .eg-media__img,
  body.eg-redesign .eg-media img {
    transition: none !important;
  }
  body.eg-redesign .eg-media-card:hover .eg-media__img,
  body.eg-redesign .eg-media-featured:hover .eg-media__img {
    transform: none !important;
  }
}


/* Browser translate extension injects empty .from/.to imgs — hide if no src */
img.from:not([src]), img.to:not([src]),
img.from[src=""], img.to[src=""] {
  display: none !important;
}

/* User request: no logo overlays on media cards */
body.eg-redesign .eg-person-card__logo{display:none!important}

/* === CONTENT / ARCHIVE / RELATED FIXES === */

/* 1) Archive/category featured images: fill frame (absolute img needs sized parents) */
body.eg-redesign .blog-post-loop .entry-thumbnail,
body.eg-redesign article.blog-post-loop .entry-thumbnail {
  position: relative !important;
  aspect-ratio: 16 / 10;
  min-height: 220px;
  overflow: hidden;
  background: #e4e0d8;
}

body.eg-redesign .blog-post-loop .entry-thumbnail .post-img-wrapp,
body.eg-redesign .blog-post-loop .entry-thumbnail .owl-stage-outer,
body.eg-redesign .blog-post-loop .entry-thumbnail .owl-stage,
body.eg-redesign .blog-post-loop .entry-thumbnail .owl-item,
body.eg-redesign .blog-post-loop .entry-thumbnail .post-img-wrapp > a,
body.eg-redesign .blog-post-loop .entry-thumbnail > a {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  max-width: none !important;
}

body.eg-redesign .blog-post-loop .entry-thumbnail img,
body.eg-redesign .blog-post-loop .post-img img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Owl on single-thumb archives often collapses before init */
body.eg-redesign .blog-post-loop .entry-thumbnail.owl-carousel {
  display: block !important;
}

/* 2) Related posts block — flex, compact thumbs (not huge 1:1 float squares) */
body.eg-redesign .relate-cat {
  clear: both;
  margin: 2rem 0 1.5rem;
  padding: 1.25rem 0 0;
  background: transparent !important;
  overflow: hidden;
}

body.eg-redesign .relate-cat > h3 {
  margin: 0 0 1rem;
  font-family: var(--eg-font-display, Georgia, serif);
  font-size: 1.35rem;
}

body.eg-redesign .relate-cat .row {
  display: flex !important;
  flex-wrap: wrap;
  margin-left: -8px !important;
  margin-right: -8px !important;
}

body.eg-redesign .relate-cat .row > [class*="col-"] {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  float: none !important;
  width: 50% !important;
  max-width: 50% !important;
  padding: 8px !important;
  margin: 0 0 12px !important;
  box-sizing: border-box;
  clear: none !important;
}

@media (max-width: 767px) {
  body.eg-redesign .relate-cat .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}

body.eg-redesign .relate-cat .post-thum {
  float: none !important;
  position: relative !important;
  width: 96px !important;
  min-width: 96px;
  max-width: 96px;
  flex: 0 0 96px;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  border-radius: 4px;
  background: #e4e0d8;
}

body.eg-redesign .relate-cat .post-thum > a {
  position: absolute !important;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

body.eg-redesign .relate-cat .post-thum img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
}

body.eg-redesign .relate-cat .post-info {
  float: none !important;
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left !important;
  padding-top: 2px;
}

body.eg-redesign .relate-cat h4.post-title {
  font-size: 0.9375rem !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  font-family: var(--eg-font-body, system-ui, sans-serif) !important;
}

body.eg-redesign .relate-cat h4.post-title a {
  color: var(--eg-color-text, #1a1f1c) !important;
}

/* 3) Single post content overflow (VC/owl carousels, wide imgs) */
body.eg-redesign.single .site-content,
body.eg-redesign.single-post .site-content,
body.eg-redesign.single .entry-content,
body.eg-redesign.single-post .entry-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.eg-redesign.single .entry-content img,
body.eg-redesign.single-post .entry-content img,
body.eg-redesign.single .entry-content figure,
body.eg-redesign.single-post .entry-content figure {
  max-width: 100% !important;
}

body.eg-redesign.single .entry-content .vc_carousel_container,
body.eg-redesign.single-post .entry-content .vc_carousel_container,
body.eg-redesign.single .entry-content .owl-carousel,
body.eg-redesign.single-post .entry-content .owl-carousel,
body.eg-redesign.single .entry-content .wpb_wrapper,
body.eg-redesign.single-post .entry-content .wpb_wrapper {
  max-width: 100% !important;
  overflow: hidden !important;
}

body.eg-redesign.single .main-page-wrapper > .container,
body.eg-redesign.single-post .main-page-wrapper > .container {
  overflow-x: clip;
}

/* Broken external hotlink placeholders — hide empty/failed data gifs left by lazyload */
body.eg-redesign .entry-content img[data-src*="images.vov.vn"] {
  display: none !important;
}

/* Clamp VC/Owl product carousels that use negative margins */
body.eg-redesign.single .site-content,
body.eg-redesign.single-post .site-content,
body.eg-redesign.single .content-area,
body.eg-redesign.single-post .content-area {
  overflow-x: clip !important;
}
body.eg-redesign .entry-content .vc_carousel_container,
body.eg-redesign .entry-content .owl-carousel.product-items,
body.eg-redesign .entry-content .vc_carousel,
body.eg-redesign .wpb_gallery,
body.eg-redesign .wpb_images_carousel {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  left: 0 !important;
  overflow: hidden !important;
}
body.eg-redesign .entry-content .owl-stage-outer {
  overflow: hidden !important;
}


/* === HEADER / CTA POSITION TWEAKS === */

/* 1) Mobile/tablet: keep logo left, actions (cart + burger) flush right.
   When nav is display:none, 3-col grid packs actions into the middle — fix with flex. */
@media (max-width: 1023px) {
  body.eg-redesign .eg-header__inner {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: calc(100% - 24px);
    max-width: 1200px;
    margin-inline: auto;
    padding-right: 0;
  }
  body.eg-redesign .eg-header__logo {
    flex: 0 0 auto;
  }
  body.eg-redesign .eg-header__actions {
    margin-left: auto;
    margin-right: 0;
    gap: 6px;
  }
  body.eg-redesign .eg-burger {
    transform: none;
    margin-right: 0;
  }
}

@media (max-width: 767px) {
  body.eg-redesign .eg-header__inner {
    width: calc(100% - 20px);
    margin-right: max(6px, env(safe-area-inset-right, 0px));
    margin-left: auto;
  }
}

/* 2) Desktop only: nudge final-CTA contact button + hotline slightly right */
@media (min-width: 768px) {
  body.eg-redesign .eg-final-cta__copy > p {
    padding-left: 1.5rem;
  }
  body.eg-redesign .eg-final-cta__copy .eg-btn {
    margin-left: 0.25rem;
  }
}

@media (max-width: 767px) {
  body.eg-redesign .eg-final-cta__copy > p {
    padding-left: 0 !important;
  }
}
