/* css/integrity.css */

.integrity-simple {
  padding: 2rem 0 6rem 0;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.integrity-simple__header {
  text-align: center;
  margin-bottom: 3rem;
}

/* ── The Accordion Blades ── */
.integrity-accordion {
  display: flex;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto 6rem auto;
  height: 500px;
  gap: 0.75rem;
  padding: 0 1rem;
}

.acc-blade {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.05);
  transition: flex 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Subtle Technical Grid Pattern */
.acc-blade::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: 1;
  opacity: 0.5;
}

/* Accent Top Bar */
.acc-blade::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
  opacity: 0;
  transition: opacity 0.4s ease;
}

@media (min-width: 969px) {
  .acc-blade:hover::after {
    opacity: 1;
  }
  .acc-blade:hover {
    flex: 4;
    background: #ffffff;
    box-shadow: 0 50px 120px rgba(15, 23, 42, 0.1);
    border-color: var(--accent-primary);
  }
}

.acc-blade.is-active::after {
  opacity: 1;
}

.acc-blade.is-active {
  flex: 4;
  background: #ffffff;
  box-shadow: 0 50px 120px rgba(15, 23, 42, 0.1);
  border-color: var(--accent-primary);
}

.acc-blade__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(2, 132, 199, 0.03) 0%, transparent 70%);
  z-index: 0;
}

@media (max-width: 768px) {
  .acc-blade__bg {
    display: none !important;
  }
}

.acc-blade__icon {
  position: absolute;
  bottom: 5%;
  right: 5%;
  transform: rotate(-10deg);
  color: var(--accent-primary); /* Vibrant Brand Blue as requested */
  opacity: 0.15;
  z-index: 1;
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

[dir="rtl"] .acc-blade__icon {
  right: auto;
  left: 5%;
}

@media (min-width: 969px) {
  .acc-blade:hover .acc-blade__icon {
    opacity: 0.25;
    transform: scale(1.6) rotate(5deg);
    bottom: 8%;
    right: 8%;
  }
  [dir="rtl"] .acc-blade:hover .acc-blade__icon {
    right: auto;
    left: 8%;
  }
}

.acc-blade.is-active .acc-blade__icon {
  opacity: 0.25;
  transform: scale(1.6) rotate(5deg);
  bottom: 8%;
  right: 8%;
}

[dir="rtl"] .acc-blade.is-active .acc-blade__icon {
  right: auto;
  left: 8%;
}

.acc-blade__content {
  position: relative;
  z-index: 3; /* Above icon and grid */
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 4rem 5rem;
}

.acc-blade__header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: all 0.4s ease;
}

.acc-blade__num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  opacity: 0.8;
  /* Add an architectural line */
  position: relative;
  width: fit-content;
}

.acc-blade__num::after {
  content: "";
  position: absolute;
  bottom: -5px;
  right: 0;
  width: 20px;
  height: 2px;
  background: var(--accent-primary);
}

.acc-blade__expand {
  display: none; /* Hide on desktop */
}

.integrity-hint {
  display: none; /* Hide on desktop */
}

/* hint text removed from desktop view */

.acc-blade h3 {
  font-size: 1.15rem; /* Reduced to fit in initial state */
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0;
  line-height: 1.2;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

@media (min-width: 969px) {
  .acc-blade:hover h3 {
    font-size: 1.8rem;
    white-space: normal;
  }
}

.acc-blade.is-active h3 {
  font-size: 1.8rem;
  white-space: normal;
}

/* Outlined Big Number for background */
.acc-blade__bg-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15rem;
  font-weight: 900;
  color: var(--accent-primary);
  opacity: 0.02;
  font-family: 'Outfit', sans-serif;
  z-index: 0;
  pointer-events: none;
  -webkit-text-stroke: 1px var(--accent-primary);
  color: transparent;
}

/* ── Handling Titles in Collapsed vs Expanded ── */

/* Initial State: All horizontal */
.acc-blade .acc-blade__header {
  transform: translateY(0);
}

/* When one blade is active or hovered, handle the ones NOT active (the shrunk ones) */
.integrity-accordion:hover .acc-blade:not(:hover) h3,
.integrity-accordion:has(.acc-blade.is-active) .acc-blade:not(.is-active) h3 {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.integrity-accordion:hover .acc-blade:not(:hover) .acc-blade__num,
.integrity-accordion:has(.acc-blade.is-active) .acc-blade:not(.is-active) .acc-blade__num {
  transform: scale(1.2);
  opacity: 1;
}

/* Expanded State: Reveal body */
@media (min-width: 969px) {
  .acc-blade:hover .acc-blade__body {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.2s;
  }
}

.acc-blade.is-active .acc-blade__body {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0.2s;
}

/* Body (The Reveal) */
.acc-blade__body {
  margin-top: 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 500px;
}

.acc-blade.is-active .acc-blade__body {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.acc-blade__body p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-muted);
}

/* ── HSE Statement (The Anchor) ── */
.hse-statement {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hse-statement__inner {
  background: #f8fafc;
  padding: 5rem;
  border-left: 6px solid var(--accent-primary);
  position: relative;
}

.hse-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent-primary);
  margin-bottom: 2rem;
}

.hse-text {
  font-size: 1.5rem;
  line-height: 1.8;
  font-weight: 600;
  color: var(--text-primary);
  font-style: normal;
}

/* RTL Support */
[dir="rtl"] .hse-statement__inner {
  border-left: 0;
  border-right: 6px solid var(--accent-primary);
}

[dir="rtl"] .hse-text {
  font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .acc-blade__header {
  text-align: right;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .integrity-accordion {
    height: 400px;
    padding: 0 1rem;
  }
  
  .acc-blade__content {
    padding: 2rem;
  }
  
  .acc-blade h3 {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .integrity-accordion {
    flex-direction: column;
    height: auto;
    gap: 1.5rem;
  }
  
  .acc-blade {
    flex: none;
    height: 120px;
    /* Performance: remove heavy transitions */
    transition: height 0.4s ease;
  }
  
  /* Performance: remove grid pattern pseudo-element */
  .acc-blade::before {
    display: none !important;
  }
  /* Performance: remove accent bar animation */
  .acc-blade::after {
    display: none !important;
  }
  /* Performance: hide large bg number */
  .acc-blade__bg-num {
    display: none !important;
  }
  /* Performance: simplify icon animation */
  .acc-blade__icon {
    transition: none !important;
  }
  .acc-blade.is-active .acc-blade__icon {
    transform: none;
  }
  
  .acc-blade.is-active {
    flex: none;
    height: auto;
    min-height: 380px;
    padding-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
    background: #ffffff !important;
  }
  
  .acc-blade__header {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  
  .acc-blade:not(.is-active) .acc-blade__header {
    transform: none;
  }
  
  .acc-blade__body {
    margin-top: 1.5rem;
  }
  
  .acc-blade:not(.is-active) .acc-blade__body {
    display: none; /* Hide completely when not active on mobile to avoid layout gaps */
  }

  .acc-blade.is-active .acc-blade__body {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .acc-blade.is-active .acc-blade__body {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .acc-blade__expand {
    position: static; /* Switch from absolute on desktop to flex on mobile */
    margin-left: auto; 
    right: auto;
    top: auto;
  }

  [dir="rtl"] .acc-blade__expand {
    margin-left: 0;
    margin-right: auto;
  }

  .integrity-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.8;
  }

  .hse-statement__inner {
    padding: 2rem 1.5rem;
  }

  .hse-text {
    font-size: 1.2rem;
    line-height: 1.6;
  }
}
