/*
Theme Name: Xavier Tan
Template: hello-elementor
Description: A child theme for Atlas Eye
Author: Xavier Tan
Author URI: https://www.xaviertan.co/
Version: 1.2
*/

/* ============================================
   ATLAS EYE STICKY CTA BUTTONS
   Maximum specificity overrides
   ============================================ */

.atlas-sticky-cta {
  position: fixed;
  z-index: 9999;
  display: flex;
  gap: 8px;
}

.atlas-sticky-cta .atlas-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
  letter-spacing: 0.3px !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* FORCE text styles on span with maximum specificity */
body .atlas-sticky-cta .atlas-cta-btn span,
html body .atlas-sticky-cta .atlas-cta-btn span,
.atlas-sticky-cta .atlas-cta-btn span {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
  letter-spacing: 0.3px !important;
  text-transform: none !important;
  text-decoration: none !important;
  text-shadow: none !important;
  background: none !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.atlas-sticky-cta .atlas-cta-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Hover states */
.atlas-sticky-cta .atlas-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  text-decoration: none !important;
}

body .atlas-sticky-cta .atlas-cta-btn:hover span,
html body .atlas-sticky-cta .atlas-cta-btn:hover span {
  color: #ffffff !important;
  text-decoration: none !important;
}

.atlas-sticky-cta .atlas-cta-btn:active {
  transform: translateY(-1px);
}

/* Button colors */
.atlas-sticky-cta .atlas-cta-whatsapp {
  background-color: #25D366 !important;
  color: #ffffff !important;
}

.atlas-sticky-cta .atlas-cta-whatsapp:hover {
  background-color: #1ebe5d !important;
  color: #ffffff !important;
}

.atlas-sticky-cta .atlas-cta-call {
  background-color: #4AAED9 !important;
  color: #ffffff !important;
}

.atlas-sticky-cta .atlas-cta-call:hover {
  background-color: #3a9fcb !important;
  color: #ffffff !important;
}

.atlas-sticky-cta .atlas-cta-email {
  background-color: #34495E !important;
  color: #ffffff !important;
}

.atlas-sticky-cta .atlas-cta-email:hover {
  background-color: #2c3e50 !important;
  color: #ffffff !important;
}

/* DESKTOP - Bottom Right */
@media (min-width: 769px) {
  .atlas-sticky-cta {
    bottom: 24px;
    right: 24px;
    flex-direction: column;
    align-items: flex-end;
  }
  
  .atlas-sticky-cta .atlas-cta-btn {
    min-width: 140px;
  }
  
  .atlas-sticky-cta .atlas-cta-whatsapp { animation: slideInRight 0.5s ease-out 0.1s both; }
  .atlas-sticky-cta .atlas-cta-call { animation: slideInRight 0.5s ease-out 0.2s both; }
  .atlas-sticky-cta .atlas-cta-email { animation: slideInRight 0.5s ease-out 0.3s both; }
  
  @keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
  }
}

/* MOBILE - Full Width Bottom Bar */
@media (max-width: 768px) {
  .atlas-sticky-cta {
    bottom: 0;
    left: 0;
    right: 0;
    gap: 0;
    background: #ffffff !important;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .atlas-sticky-cta .atlas-cta-btn {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 8px;
    font-size: 10px !important;
    font-weight: 500 !important;
    box-shadow: none;
    margin: 0 3px;
  }
  
  /* Mobile span text - FORCE styles */
  body .atlas-sticky-cta .atlas-cta-btn span,
  html body .atlas-sticky-cta .atlas-cta-btn span {
    font-size: 10px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
  }
  
  .atlas-sticky-cta .atlas-cta-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .atlas-sticky-cta .atlas-cta-btn:hover {
    transform: none;
    box-shadow: none;
  }
  
  .atlas-sticky-cta .atlas-cta-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
  }
  
  .atlas-sticky-cta { animation: slideUp 0.4s ease-out; }
  
  @keyframes slideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.atlas-sticky-cta .atlas-cta-btn:focus-visible {
  outline: 3px solid #4AAED9;
  outline-offset: 3px;
}

@media print {
  .atlas-sticky-cta { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-sticky-cta .atlas-cta-btn, .atlas-sticky-cta { animation: none; transition: none; }
}

/* ============================================
   ATLAS EYE HERO SLIDER (fallback styles)
   The footer-injected version uses !important
   for maximum specificity; this is the base.
   ============================================ */

.atlas-hero-slider {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  max-height: 800px;
  overflow: hidden;
  background: #003459;
}

.atlas-hero-slider .atlas-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.atlas-hero-slider .atlas-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.atlas-hero-slider .atlas-slide.active {
  opacity: 1;
  z-index: 2;
}

.atlas-hero-slider .atlas-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 23, 31, 0.65) 0%, rgba(0, 52, 89, 0.35) 60%, rgba(0, 52, 89, 0.1) 100%);
  z-index: 1;
}

.atlas-hero-slider .atlas-slide-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
  width: 100%;
  color: #fff;
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 0.9s ease 0.3s, transform 0.9s ease 0.3s;
}

.atlas-hero-slider .atlas-slide.active .atlas-slide-content {
  opacity: 1;
  transform: translateY(0);
}

.atlas-hero-slider .atlas-slide-content h1,
.atlas-hero-slider .atlas-slide-content h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 1.2rem;
  color: #fff;
  max-width: 640px;
}

.atlas-hero-slider .atlas-slide-content p {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  max-width: 540px;
  margin: 0 0 2rem;
}

.atlas-hero-slider .atlas-hero-btn {
  display: inline-block;
  background: #00A8E8;
  color: #fff !important;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem 2.2rem;
  border-radius: 60px;
  text-decoration: none !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 168, 232, 0.35);
}

.atlas-hero-slider .atlas-hero-btn:hover {
  transform: translateY(-3px);
  background: #007EA7;
  box-shadow: 0 12px 32px rgba(0, 126, 167, 0.45);
  color: #fff !important;
}

.atlas-hero-slider .atlas-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 4px 0;
}

.atlas-hero-slider .atlas-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.atlas-hero-slider .atlas-arrow-prev { left: 2rem; }
.atlas-hero-slider .atlas-arrow-next { right: 2rem; }

/* Dots — shared appearance only. Positioning is set per markup variant below. */
.atlas-hero-slider .atlas-dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  z-index: 10;
  padding: 0;
}

/* NEW markup: dots + stats wrapped in .atlas-hero-bottom.
   The wrapper carries the absolute positioning, the stats strip sits inside it
   in normal flow, and the dots anchor to the wrapper's top edge — so the gap
   above the strip stays constant however tall it grows. */
.atlas-hero-slider .atlas-hero-bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 360px);
  max-width: 1200px;
  z-index: 5;
}

.atlas-hero-slider .atlas-hero-bottom .atlas-dots {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  transform: none;
  margin: 0 0 1.5rem;
}

.atlas-hero-slider .atlas-hero-bottom .atlas-hero-stats {
  position: static;
  transform: none;
  width: 100%;
  max-width: 100%;
}

/* LEGACY markup: dots + stats as direct children of the slider.
   Kept so language versions not yet migrated to .atlas-hero-bottom
   (ZH, ID) keep rendering exactly as they do today. */
.atlas-hero-slider > .atlas-dots {
  position: absolute;
  bottom: 7rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.atlas-hero-slider > .atlas-hero-stats {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 360px);
  max-width: 1200px;
  z-index: 5;
}

.atlas-hero-slider .atlas-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, width 0.3s ease;
  padding: 0;
}

.atlas-hero-slider .atlas-dot.active {
  background: #fff;
  width: 32px;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .atlas-hero-slider {
    height: 70vh;
    min-height: 420px;
  }
  .atlas-hero-slider .atlas-slide-content {
    padding: 0 1.5rem;
  }
  .atlas-hero-slider .atlas-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .atlas-hero-slider .atlas-arrow-prev { left: 0.75rem; }
  .atlas-hero-slider .atlas-arrow-next { right: 0.75rem; }
  .atlas-hero-slider .atlas-slide-overlay {
    background: linear-gradient(180deg, rgba(0, 23, 31, 0.4) 0%, rgba(0, 23, 31, 0.7) 100%);
  }
  .atlas-hero-slider .atlas-hero-bottom {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
  }
  .atlas-hero-slider .atlas-hero-bottom .atlas-dots,
  .atlas-hero-slider > .atlas-dots {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    transform: none;
    margin: 0;
    padding: 0.25rem 0 1.25rem;
  }
}

/* ============================================
   POLYLANG LANGUAGE SWITCHER
   Hide language name in header, show in dropdown
   ============================================ */

li.pll-parent-menu-item > a > span[style*="margin-left"] {
  display: none !important;
}

li.pll-parent-menu-item > ul.sub-menu span[style*="margin-left"] {
  display: inline !important;
}

li.pll-parent-menu-item > ul.sub-menu {
  min-width: 200px !important;
}

/* ============================================
   TABLE OF CONTENTS - Fix SVG bullet dot sizing
   
   Problem: The SVG circle bullet inside
   .elementor-toc__list-item-text-wrapper shrinks
   when the adjacent <a> text is long/wraps.
   
   Fix: Force the wrapper into flex, lock the SVG
   to a fixed size with flex-shrink: 0.
   ============================================ */

/* Make the wrapper a flex row so SVG + link sit side by side */
.elementor-toc__body .elementor-toc__list-item-text-wrapper {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  flex-wrap: nowrap !important;
}

/* Lock the SVG bullet to a fixed size - never shrink */
.elementor-toc__body .elementor-toc__list-item-text-wrapper > svg.e-font-icon-svg {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  width: 0.5em !important;
  height: 0.5em !important;
  min-width: 0.5em !important;
  min-height: 0.5em !important;
  margin-top: 0.45em !important;
  margin-right: 0.5em !important;
}

/* Let the text link take remaining space and wrap freely */
.elementor-toc__body .elementor-toc__list-item-text-wrapper > a.elementor-toc__list-item-text {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* ============================================
   BLOG POST CONTENT - Long URL overflow fix
   
   Problem: Long URLs in blog posts (e.g. in
   References sections) overflow the left column
   and overlap the right sidebar.
   
   Fix: Allow the browser to break long URLs
   mid-string so they wrap within the container.
   Normal words will wrap whole to the next line.
   ============================================ */

.elementor-widget-theme-post-content {
  overflow-wrap: break-word;
}