/* ============================================================
   SAF Elastic Project Atlas Widget — Scoped CSS
   ============================================================ */

.saf-elastic-atlas-widget {
  position: relative;
  background-color: #FAFAF7;
  padding: 100px 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.saf-elastic-atlas-widget .saf-atlas-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* Header / Intro */
.saf-elastic-atlas-widget .saf-atlas-intro {
  text-align: center;
  margin-bottom: 40px;
}

.saf-elastic-atlas-widget .saf-atlas-eyebrow {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #00695C;
  margin-bottom: 12px;
}

.saf-elastic-atlas-widget .saf-atlas-heading {
  font-family: 'Manrope', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: #263238;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.saf-elastic-atlas-widget .saf-atlas-desc {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: #455A64;
  max-width: 680px;
  margin: 0 auto;
}

/* Navigation Rail */
.saf-elastic-atlas-widget .saf-atlas-nav-rail {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.saf-elastic-atlas-widget .saf-atlas-rail-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #455A64;
  cursor: pointer;
  position: relative;
  transition: color 250ms ease;
  outline: none;
  border-radius: 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.saf-elastic-atlas-widget .saf-atlas-rail-btn:hover {
  color: #00695C;
}

.saf-elastic-atlas-widget .saf-atlas-rail-btn.is-active {
  color: #F4B400;
}

.saf-elastic-atlas-widget .saf-atlas-rail-indicator {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 2px;
  background-color: #F4B400;
  border-radius: 1px;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.saf-elastic-atlas-widget .saf-atlas-rail-btn.is-active .saf-atlas-rail-indicator {
  transform: translateX(-50%) scaleX(1);
}

.saf-elastic-atlas-widget .saf-atlas-rail-btn:focus-visible {
  outline: 2px solid #1565C0;
  outline-offset: 2px;
}

/* Gallery & Rows */
.saf-elastic-atlas-widget .saf-atlas-gallery {
  width: 100%;
}

.saf-elastic-atlas-widget .saf-atlas-row {
  display: flex;
  gap: 16px;
  width: 100%;
  height: 520px;
  box-sizing: border-box;
  margin-bottom: 16px;
}

.saf-elastic-atlas-widget .saf-atlas-row:last-child {
  margin-bottom: 0;
}

/* Panels */
.saf-elastic-atlas-widget .saf-atlas-panel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  background-color: #004D43;
  box-shadow: 0 4px 20px rgba(0, 77, 67, 0.08);
  flex: 1 1 0%;
  min-width: 0;
  transition: flex 700ms cubic-bezier(0.25, 1, 0.5, 1);
  will-change: flex;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active {
  flex: 4 1 0%;
}

.saf-elastic-atlas-widget .saf-atlas-panel:focus-visible {
  outline: 3px solid #1565C0;
  outline-offset: 3px;
  z-index: 10;
}

/* Gold Accent */
.saf-elastic-atlas-widget .saf-atlas-gold-accent {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background-color: #F4B400;
  z-index: 6;
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-gold-accent {
  transform: scaleY(1);
}

/* Image Wrap */
.saf-elastic-atlas-widget .saf-atlas-img-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.saf-elastic-atlas-widget .saf-atlas-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.6) saturate(0.9);
  transform: scale(1.06);
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1), filter 700ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, filter;
  display: block;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-img-wrap img {
  filter: brightness(1) saturate(1);
  transform: scale(1);
}

/* Overlays */
.saf-elastic-atlas-widget .saf-atlas-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 77, 67, 0.95) 0%, rgba(0, 77, 67, 0.75) 45%, rgba(0, 77, 67, 0.2) 75%, transparent 100%);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms ease;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-gradient-overlay {
  opacity: 1;
}

.saf-elastic-atlas-widget .saf-atlas-mobile-overlay {
  display: none;
}

/* Inactive Panel Content */
.saf-elastic-atlas-widget .saf-atlas-inactive-content {
  position: absolute;
  bottom: 32px;
  left: 24px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-inactive-content {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.saf-elastic-atlas-widget .saf-atlas-inactive-num {
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #F4B400;
  line-height: 1;
}

.saf-elastic-atlas-widget .saf-atlas-inactive-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.saf-elastic-atlas-widget .saf-atlas-inactive-arrow {
  display: none;
}

/* Active Panel Content */
.saf-elastic-atlas-widget .saf-atlas-active-content {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  box-sizing: border-box;
  pointer-events: none;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-active-content {
  pointer-events: auto;
}

.saf-elastic-atlas-widget .saf-atlas-active-cat {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #F4B400;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.saf-elastic-atlas-widget .saf-atlas-active-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 250ms ease, transform 250ms ease;
  flex-wrap: wrap;
}

.saf-elastic-atlas-widget .saf-atlas-active-num {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #F4B400;
  flex-shrink: 0;
}

.saf-elastic-atlas-widget .saf-atlas-active-title {
  font-family: 'Manrope', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
  margin: 0;
}

.saf-elastic-atlas-widget .saf-atlas-active-desc {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
  max-width: 520px;
  margin: 0 0 20px 0;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.saf-elastic-atlas-widget .saf-atlas-active-cta-wrap {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.saf-elastic-atlas-widget .saf-atlas-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  text-decoration: none;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  transition: background 250ms ease, border-color 250ms ease, color 250ms ease;
  outline: none;
}

.saf-elastic-atlas-widget .saf-atlas-cta-btn:hover {
  background-color: #F4B400;
  color: #263238;
  border-color: #F4B400;
}

.saf-elastic-atlas-widget .saf-atlas-cta-btn:focus-visible {
  outline: 3px solid #1565C0;
  outline-offset: 2px;
}

/* Stagger transitions when panel is active */
.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-active-cat {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1) 0ms, transform 400ms cubic-bezier(0.16, 1, 0.3, 1) 0ms;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-active-heading {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1) 70ms, transform 400ms cubic-bezier(0.16, 1, 0.3, 1) 70ms;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-active-desc {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1) 140ms, transform 400ms cubic-bezier(0.16, 1, 0.3, 1) 140ms;
}

.saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-active-cta-wrap {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1) 210ms, transform 400ms cubic-bezier(0.16, 1, 0.3, 1) 210ms;
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .saf-elastic-atlas-widget {
    padding: 80px 0;
  }
  .saf-elastic-atlas-widget .saf-atlas-row {
    height: 440px;
  }
  .saf-elastic-atlas-widget .saf-atlas-active-content {
    padding: 32px 24px;
  }
  .saf-elastic-atlas-widget .saf-atlas-heading {
    font-size: 38px;
  }
}

/* Mobile (<=768px): Vertical Accordion Stack */
@media (max-width: 768px) {
  .saf-elastic-atlas-widget {
    padding: 60px 0;
  }

  .saf-elastic-atlas-widget .saf-atlas-heading {
    font-size: 28px;
  }

  .saf-elastic-atlas-widget .saf-atlas-desc {
    font-size: 15px;
  }

  .saf-elastic-atlas-widget .saf-atlas-nav-rail {
    display: none !important;
  }

  .saf-elastic-atlas-widget .saf-atlas-row {
    flex-direction: column;
    height: auto;
    gap: 12px;
    margin-bottom: 12px;
  }

  .saf-elastic-atlas-widget .saf-atlas-panel {
    flex: none !important;
    width: 100% !important;
    height: 80px;
    transition: height 500ms cubic-bezier(0.25, 1, 0.5, 1);
  }

  .saf-elastic-atlas-widget .saf-atlas-panel.is-active {
    height: 400px;
  }

  .saf-elastic-atlas-widget .saf-atlas-mobile-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0, 77, 67, 0.7);
    z-index: 2;
    pointer-events: none;
    transition: opacity 300ms ease;
  }

  .saf-elastic-atlas-widget .saf-atlas-panel.is-active .saf-atlas-mobile-overlay {
    opacity: 0;
  }

  /* Inactive mobile content: horizontal bar */
  .saf-elastic-atlas-widget .saf-atlas-inactive-content {
    position: absolute;
    inset: 0;
    padding: 0 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    z-index: 4;
    bottom: auto;
    left: auto;
  }

  .saf-elastic-atlas-widget .saf-atlas-inactive-num {
    font-size: 20px;
    flex-shrink: 0;
  }

  .saf-elastic-atlas-widget .saf-atlas-inactive-title {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 16px;
    white-space: normal;
    flex: 1;
  }

  .saf-elastic-atlas-widget .saf-atlas-inactive-arrow {
    display: inline-block;
    color: #F4B400;
    font-size: 18px;
    font-weight: 700;
  }

  .saf-elastic-atlas-widget .saf-atlas-active-content {
    padding: 24px;
  }

  .saf-elastic-atlas-widget .saf-atlas-active-title {
    font-size: 22px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .saf-elastic-atlas-widget * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
