/* =============================================
   UNIMAC Custom Styles
   Overrides and enhancements beyond Webflow export
   ============================================= */

/* =============================================
   NAVBAR — Lock brand logo size during width animations
   ============================================= */

.brand-navbar {
  flex-shrink: 0;
  width: 110px !important;
}

/* =============================================
   GLOBAL BASE STYLES
   ============================================= */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.button-text {
  grid-column-gap: 4px !important;
}

/* =============================================
   ANCHOR SCROLL OFFSET
   Ensures anchor targets clear the fixed navbar
   ============================================= */

/* Base scroll offset for all anchor targets */
[data-anchor-target] {
  scroll-margin-top: 104px;
}

/* Apply to elements with IDs that are anchor destinations */
[id][data-anchor-target],
section[id],
.projects-right-col[id],
.industry-section [id] {
  scroll-margin-top: 104px;
}

/* Specific offsets for different screen sizes */
@media (max-width: 991px) {
  [data-anchor-target],
  .projects-right-col[id],
  .industry-section [id] {
    scroll-margin-top: 96px;
  }
}

@media (max-width: 767px) {
  [data-anchor-target],
  .projects-right-col[id],
  .industry-section [id] {
    scroll-margin-top: 88px;
  }
}

/* =============================================
   NAV DROPDOWN HOVER EFFECTS
   When hovering over one link, others are greyed out
   ============================================= */

/* Nav column inner container - desktop nav */
.nav-column-inner,
.nav-projects-collection-wrapper .nav-projects-collection {
  --transition-duration: 0.25s;
}

/* Default state for nav column items */
.nav-column-inner .nav-column-item,
.nav-projects-collection-wrapper .nav-column-item,
.nav-projects-collection .nav-column-item {
  transition: opacity var(--transition-duration) ease, 
              color var(--transition-duration) ease;
}

/* When hovering over the nav column container, reduce opacity of all items */
.nav-column-inner:hover .nav-column-item,
.nav-projects-collection-wrapper:hover .nav-column-item,
.nav-projects-collection:hover .nav-column-item {
  opacity: 0.4;
}

/* When hovering over a specific item, restore its opacity */
.nav-column-inner .nav-column-item:hover,
.nav-projects-collection-wrapper .nav-column-item:hover,
.nav-projects-collection .nav-column-item:hover {
  opacity: 1;
}

/* Mobile nav hover effects */
.mobile-nav-top-tile {
  --transition-duration: 0.25s;
}

.mobile-nav-top-tile .nav-column-item {
  transition: opacity var(--transition-duration) ease;
}

.mobile-nav-top-tile:hover .nav-column-item {
  opacity: 0.4;
}

.mobile-nav-top-tile .nav-column-item:hover {
  opacity: 1;
}

/* Mobile links wrap - for the link groups */
.mobile-links-wrap {
  --transition-duration: 0.25s;
}

.mobile-links-wrap a {
  transition: opacity var(--transition-duration) ease;
}

.mobile-links-wrap:hover a {
  opacity: 0.4;
}

.mobile-links-wrap a:hover {
  opacity: 1;
}

/* =============================================
   FOOTER HOVER EFFECTS
   When hovering over one link, others are greyed out
   ============================================= */

/* Footer links column container */
.footer-links-column {
  --transition-duration: 0.25s;
}

/* Default state for footer links */
.footer-links-column .footer-link,
.footer-links-column a {
  transition: opacity var(--transition-duration) ease,
              color var(--transition-duration) ease;
}

/* When hovering over the footer links container, reduce opacity of all links */
.footer-links-column:hover .footer-link,
.footer-links-column:hover a {
  opacity: 0.4;
}

/* When hovering over a specific link, restore its opacity */
.footer-links-column .footer-link:hover,
.footer-links-column a:hover {
  opacity: 1;
}

/* =============================================
   Certificate card image parallax
   ============================================= */
.certificates-image {
  overflow: hidden;
}

.certificate-image {
  transition: transform 0.5s ease;
}

.certificate-overlay {
  position: relative;
  z-index: 1;
}

.certificates-card:hover .certificate-image {
  transform: scale(1.05);
}

/* =============================================
   VIDEO LIGHTBOX MODAL
   Custom non-Webflow video popup
   ============================================= */

.video-lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}

.video-lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-lightbox-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 960px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.video-lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.video-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-lightbox-frame {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-lightbox-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .video-lightbox-container {
    width: 95%;
    border-radius: 8px;
  }
  
  .video-lightbox-close {
    top: -44px;
    width: 36px;
    height: 36px;
  }
}

/* =============================================
   FOOTER ACCORDION (Mobile)
   ============================================= */

@media (max-width: 767px) {
  /* Make footer column headers clickable on mobile */
  .footer-column .column-expand-top-tile {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Ensure wrap-column has proper initial state for animation */
  .footer-column .wrap-column {
    transition: height 0.3s ease, opacity 0.3s ease;
  }
  
  /* Rotate icon when expanded */
  .footer-column .footer-expand-icon {
    transform-origin: center;
  }
}

/* =============================================
   MOBILE NAVIGATION
   Single toggle class: .mobile-nav-open on .navbar
   ============================================= */

@media (max-width: 991px) {
  /* Kill Webflow's overlay — we show .nav-menu directly */
  .w-nav-overlay {
    display: none !important;
  }

  /* Hide desktop dropdown links on mobile */
  .wrap-nav-links {
    display: none !important;
  }

  /* Nav menu: hidden by default */
  .nav-menu {
    display: none !important;
  }

  /* ---- BASE STYLES WITH TRANSITIONS ---- */

  /* Nav wrap - maintain original padding for closed state */
  .navbar .nav-wrap {
    position: relative;
    overflow: hidden;
    /* Match border-radius immediately - no animation to avoid glitch */
    border-radius: var(--_🔘-radius---radius--small);
    /* Use max-height for smooth drawer animation */
    max-height: 60px; /* Approximate closed height */
    transition: max-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background-color 0.35s ease;
  }

  /* Nav menu starts hidden */
  .navbar .nav-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease 0.1s, 
                transform 0.4s ease 0.1s;
  }

  /* Mobile menu content starts hidden */
  .navbar .wrap-mobile-menu {
    opacity: 0;
    transition: opacity 0.35s ease 0.15s;
  }

  /* ---- OPEN STATE ---- */

  /* Navbar stays in place, nav-wrap expands */
  .navbar.mobile-nav-open {
    z-index: 999;
  }

  /* Nav wrap expands downward like a drawer - max-height for smooth animation */
  .navbar.mobile-nav-open .nav-wrap {
    flex-wrap: wrap;
    overflow: auto;
    background: var(--_🎨-color---background--eversand-for-navigation-bar) !important;
    -webkit-backdrop-filter: blur(32px);
    backdrop-filter: blur(32px);
    border: 1px solid var(--neutral--light-64);
    /* Match border-radius immediately - no transition to avoid corner glitch */
    border-radius: var(--_🔘-radius---radius--small);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    /* Max 90vh but hugs content, scroll if needed */
    max-height: 90vh;
  }

  /* Nav menu fades in smoothly */
  .navbar.mobile-nav-open .nav-menu {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    order: 3;
    padding: var(--spacing--16) var(--spacing--8) var(--spacing--24);
    background: transparent !important;
    opacity: 1;
    transform: translateY(0);
  }

  /* Mobile menu content */
  .navbar.mobile-nav-open .wrap-mobile-menu {
    display: flex !important;
    flex-direction: column;
    grid-column-gap: var(--spacing--32) !important;
    grid-row-gap: var(--spacing--32) !important;
    gap: var(--spacing--32) !important;
    background: transparent;
    opacity: 1;
  }

  /* ---- CLOSING STATE ---- */
  
  /* Smooth closing animation */
  .navbar.mobile-nav-closing .nav-wrap {
    max-height: 60px;
    transition: max-height 0.35s cubic-bezier(0.55, 0.085, 0.68, 0.53),
                box-shadow 0.35s ease,
                background-color 0.25s ease;
  }

  /* Fade out menu content when closing */
  .navbar.mobile-nav-closing .nav-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .navbar.mobile-nav-closing .wrap-mobile-menu {
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  /* Staggered animation for menu items */
  .navbar.mobile-nav-open .mobile-nav-top-tile .nav-column-item {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
  }

  .navbar.mobile-nav-open .mobile-nav-top-tile .nav-column-item:nth-child(1) { animation-delay: 0.15s; }
  .navbar.mobile-nav-open .mobile-nav-top-tile .nav-column-item:nth-child(2) { animation-delay: 0.2s; }
  .navbar.mobile-nav-open .mobile-nav-top-tile .nav-column-item:nth-child(3) { animation-delay: 0.25s; }
  .navbar.mobile-nav-open .mobile-nav-top-tile .nav-column-item:nth-child(4) { animation-delay: 0.3s; }
  .navbar.mobile-nav-open .mobile-nav-top-tile .nav-column-item:nth-child(5) { animation-delay: 0.35s; }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* Featured project card animation */
  .navbar.mobile-nav-open .mobile-nav-bottom-tile {
    opacity: 0;
    animation: fadeIn 0.4s ease 0.4s forwards;
  }

  /* Mobile nav top tile - links section */
  .navbar.mobile-nav-open .mobile-nav-top-tile {
    background: transparent;
    grid-column-gap: var(--spacing--8) !important;
    grid-row-gap: var(--spacing--8) !important;
    gap: var(--spacing--8) !important;
  }

  /* Mobile nav bottom tile - featured card section */
  .navbar.mobile-nav-open .mobile-nav-bottom-tile {
    background: transparent;
  }

  /* Featured project card in mobile nav */
  .navbar.mobile-nav-open .card-nav.mobile-nav-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    height: 160px;
    position: relative;
  }

  /* Ensure card text is white for dark background */
  .navbar.mobile-nav-open .card-nav.mobile-nav-card .card-cs-bottom-tile {
    color: white;
  }

  .navbar.mobile-nav-open .card-nav.mobile-nav-card .text-left-mobile-nav-cta {
    color: white;
    font-weight: 500;
  }

  /* Adjust eyebrow text color for dark card */
  .navbar.mobile-nav-open .card-nav.mobile-nav-card .eyebrow {
    color: white;
  }

  /* Ensure proper spacing for mobile nav items */
  .navbar.mobile-nav-open .nav-column-item {
    padding: var(--spacing--8) 0;
  }

  /* Featured project card Learn More link styling */
  .navbar.mobile-nav-open .card-nav.mobile-nav-card .link-cs-card {
    color: white;
    display: flex;
    align-items: center;
    gap: var(--spacing--4);
  }

  /* ---- MENU BUTTON ---- */

  .menu-button {
    display: flex !important;
    cursor: pointer;
    z-index: 1000;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .menu-button:active {
    transform: scale(0.95);
  }

  .menu-button-inner {
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .menu-button-inner.close {
    display: none;
    opacity: 0;
    transform: rotate(-90deg);
  }

  .menu-button.w--open .menu-button-inner.open {
    display: none;
    opacity: 0;
    transform: rotate(90deg);
  }

  .menu-button.w--open .menu-button-inner.close {
    display: flex;
    opacity: 1;
    transform: rotate(0);
    animation: iconRotateIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes iconRotateIn {
    from {
      opacity: 0;
      transform: rotate(-90deg) scale(0.8);
    }
    to {
      opacity: 1;
      transform: rotate(0) scale(1);
    }
  }

  /* Adjust text colors for the light panel */
  .navbar.mobile-nav-open .text-dark {
    color: #1a1a1a;
  }

  .navbar.mobile-nav-open .text-dark-48 {
    color: rgba(26, 26, 26, 0.48);
  }

  .navbar.mobile-nav-open .text-dark-32 {
    color: rgba(26, 26, 26, 0.32);
  }

  /* Divider color adjustment */
  .navbar.mobile-nav-open .divider-dark-16 {
    background-color: rgba(26, 26, 26, 0.16);
  }



  /* Adjust close button styling */
  .navbar.mobile-nav-open .menu-button {
    border-color: rgba(26, 26, 26, 0.32);
  }

  /* Adjust Contact Us button styling for light background */
  .navbar.mobile-nav-open .nav-right .cta-main {
    background: #1a1a1a;
    color: white;
  }
}

@media (min-width: 992px) {
  .wrap-mobile-menu {
    display: none !important;
  }

  .menu-button {
    display: none !important;
  }
}

/* =============================================
   Download pill buttons
   ============================================= */
.button-style-4,
.button-style-5 {
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.button-style-5.base:hover {
  background-color: var(--_🎨-color---unimac-grey-88);
}

/* Download button (ESG report) */
.download-button {
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.download-button:hover {
  background-color: var(--_🎨-color---neutral--dark-88);
  border-color: var(--_🎨-color---neutral--dark-88);
}

.download-button .esg-body-text {
  transition: color 0.25s ease;
}

.download-button:hover .esg-body-text {
  color: var(--_🎨-color---neutral--light-0);
}

.download-button img {
  transition: filter 0.25s ease;
}

.download-button:hover img {
  filter: brightness(0) invert(1);
}


/* =============================================
   ABOUT PAGE MARQUEE AUTO-SCROLL ANIMATION
   ============================================= */

/* Auto-scrolling marquee animation */
.marquee-images {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: var(--spacing--16);
}

.single-marquee-images {
  display: flex;
  flex-shrink: 0;
  gap: var(--spacing--16);
  animation: marquee-scroll 30s linear infinite;
}

/* Pause on hover */
.marquee-images:hover .single-marquee-images {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* =============================================
   CERTIFICATES GRID - RESPONSIVE FIX
   ============================================= */

/* Mobile: Certificates should be in a responsive grid, not horizontal flex */
@media (max-width: 767px) {
  .certificates-grid.about-us {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: var(--spacing--16);
  }
  
  .certificates-grid.about-us .certificates-card {
    flex-direction: column;
    max-height: none;
    overflow: visible;
  }
  
  .certificates-grid.about-us .certificates-bg {
    flex-direction: column;
    gap: var(--spacing--16);
  }
  
  .certificates-grid.about-us .certificates-image {
    width: 100%;
    height: 320px;
    flex-shrink: 0;
    border-radius: var(--_🔘-radius---radius--small);
    overflow: hidden;
  }
  
  .certificates-grid.about-us .certificates-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
  }
  
  .certificates-grid.about-us .certificates-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing--16);
  }
  
  .certificates-grid.about-us .certificate-title {
    font-size: 28px;
    line-height: 1.25;
    margin: 0;
    order: 0;
    font-weight: 500;
  }
  
  .certificates-grid.about-us .certificates-image {
    order: -1;
  }
  
  .certificates-grid.about-us .button-style-5.base {
    align-self: flex-start;
  }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
  .certificates-grid.about-us {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
    gap: var(--spacing--20);
  }
  
  .certificates-grid.about-us .certificates-card {
    flex-direction: column;
  }
}

/* Desktop: 3 columns */
@media (min-width: 992px) {
  .certificates-grid.about-us {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--spacing--24);
  }
}


/* =============================================
   CTA BUTTON HOVER ANIMATION - LETTER BY LETTER
   ============================================= */

/* Icon wrap - fixed dimensions and centering */
.cta-main .button-icon-wrap {
  position: relative;
  overflow: hidden;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-main .icon-button {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* Primary icon - slides up and out on hover */
.cta-main .icon-button:not(.prev) {
  transform: translate(0, 0);
}

.cta-main:hover .icon-button:not(.prev) {
  transform: translate(100%, -100%);
}

/* Prev icon (hover state) - starts offset and slides in */
.cta-main .icon-button.prev {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-100%, 100%);
}

.cta-main:hover .icon-button.prev {
  transform: translate(0, 0);
}

/* Optional: Background subtle scale effect */
.cta-main .button-bg {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cta-main:hover .button-bg {
  transform: scale(1.05);
}


/* =============================================
   CTA BUTTON HOVER ANIMATION - LETTER BY LETTER
   ============================================= */

/* Only apply to buttons that have been processed by JS (have .button-text-animated class) */

/* Text mask - clips text for animated buttons */
.cta-main .button-text.button-text-animated {
  position: relative;
  display: flex;
  align-items: center;
  height: 1.5em;
  overflow: hidden;
  text-shadow: none !important;
  color: inherit !important;
}

/* Original text - normal flow */
.cta-main .button-text-original {
  display: flex;
  align-items: center;
  height: 1.5em;
  line-height: 1.5em;
  color: inherit;
}

/* Hover text - positioned on top, initially hidden below, white for visibility */
.cta-main .button-text-hover {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 1.5em;
  line-height: 1.5em;
  pointer-events: none;
  color: var(--_🎨-color---neutral--light-100);
}

/* Individual character styling */
.cta-main .button-text-animated .char {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  vertical-align: middle;
  color: inherit;
}

/* Original: starts at normal position */
.cta-main .button-text-original .char {
  transform: translateY(0);
}

.cta-main:hover .button-text-original .char {
  transform: translateY(-100%);
}

/* Hover: starts 100% below (hidden), moves to normal position */
.cta-main .button-text-hover .char {
  transform: translateY(100%);
}

.cta-main:hover .button-text-hover .char {
  transform: translateY(0);
}




/* Button letter-by-letter hover animation - single text, color change */
/* Preserve flex layout from original */
.cta-main .button-text {
  display: flex !important;
  align-items: center;
  gap: 0 !important;
}
.cta-main .button-text .ch { 
  display: inline-block; 
  transition: color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font: inherit;
  text-shadow: none !important;
}
.cta-main:hover .button-text .ch { 
  color: var(--_🎨-color---neutral--light-100);
}


/* =============================================
   NAV DROPDOWN PROJECT CARDS - IMAGE FIX
   Anchor images to top to prevent black bar
   ============================================= */

/* Ensure nav dropdown project card images are anchored to top */
.image-wrap-cs .image-cover {
  object-position: top;
}

/* Fix image wrap positioning to fully cover card-nav */
.card-nav .image-wrap-cs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  flex: none;
}

/* Featured project cards in navbar dropdown —
   fill card, slight oversize for hover-scale buffer */
.project-card-large.navbar .large-image .image-cover.parallax {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
  flex: none;
  max-width: none;
}

/* =============================================
   SWIPER SLIDER OVERRIDES
   Fix Webflow slider artifacts for Swiper
   ============================================= */

/* Webflow mask max-width is for native slider — remove for Swiper wrapper */
.swiper-wrapper.mask-testimonial-slider-large {
  max-width: none;
}

/* Webflow slide margin — Swiper inline margin-right handles spaceBetween */
.swiper-slide.slide-project-large {
  margin-right: 0;
}

