/* ==========================================================================
   1. CORE TYPOGRAPHY & CONSTANTS
   ========================================================================== */
@font-face {
  font-family: "SaudiWeb";
  src: url("font/SaudiWeb-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --header-width: 57px;
  --active-bg: #f8f9fa;
  --primary-color: #1b8354;
}

/* ==========================================================================
   2. GLOBAL CONTAINER & DESKTOP ACCORDION LAYOUT
   ========================================================================== */
.slider-container {
  width: 100%;
  margin-inline: auto;
  position: relative;
  font-family: sans-serif;
  overflow: hidden;
}

.slider-header {
  position: absolute;
  top: 60px;
  inset-inline-start: 30px;
  z-index: 3;
}

.slider-container .show-desktop {
  display: block;
}

.slider-container .show-mobile {
  display: none;
}

.accordion-wrapper {
  display: flex;
  width: 100%;
  height: 491px;
  overflow: hidden;
  border: 1px solid #ddd;
  transition: opacity 0.2s ease-in-out;
  will-change: opacity;
}

.accordion-item {
  display: flex;
  flex-direction: row;
  width: var(--header-width);
  background-size: cover !important;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  transition:
    width 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    background 0.3s ease-in-out;
  will-change: width;
}

.accordion-item.active {
  flex-grow: 1;
  width: 0;
}

.accordion-header {
  width: var(--header-width);
  min-width: var(--header-width);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-header span {
  opacity: 0;
}

/* --- Accordion Custom Image Assets --- */
.accordion-item-01 {
  background: #7c5d21 url(../img/Hero_Section_V2.png) center right no-repeat;
}
.accordion-item-02 {
  background: #6565e0 url(../img/Hero_Section_V2-1.png) center right no-repeat;
}
.accordion-item-03 {
  background: #0050af url(../img/Hero_Section_V2-2.png) center right no-repeat;
}
.accordion-item-04 {
  background: #971a4d url(../img/Hero_Section_V2-3.png) center right no-repeat;
}
.accordion-item-05 {
  background: #971a4d url(../img/Hero_Section_V2-4.png) center right no-repeat;
}
.accordion-item-06 {
  background: #00a02d url(../img/Hero_Section_V2-5.png) center right no-repeat;
}

.accordion-item-01 .accordion-header {
  background: url(../img/snd_img_border_1.png) center left no-repeat;
}
.accordion-item-02 .accordion-header {
  background: url(../img/snd_img_border_2.png) center left no-repeat;
}
.accordion-item-03 .accordion-header {
  background: url(../img/snd_img_border_3.png) center left no-repeat;
}
.accordion-item-04 .accordion-header {
  background: url(../img/snd_img_border_4.png) center left no-repeat;
}
.accordion-item-05 .accordion-header {
  background: url(../img/snd_img_border_5.png) center left no-repeat;
}
.accordion-item-06 .accordion-header {
  background: url(../img/snd_img_border_6.png) center left no-repeat;
}

.accordion-item-01 .slide-text .typewriter {
  color: #d8b67a;
}
.accordion-item-02 .slide-text .typewriter {
  color: #ded8f7;
}
.accordion-item-03 .slide-text .typewriter {
  color: #07b9ff;
}
.accordion-item-04 .slide-text .typewriter {
  color: #ff85c7;
}
.accordion-item-05 .slide-text .typewriter {
  color: #c9e0bb;
}
.accordion-item-06 .slide-text .typewriter {
  color: #ebffe6;
}

.accordion-item.active .accordion-header {
  display: none;
}

.accordion-content {
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  opacity: 0;
  width: 0;
  transition:
    opacity 0.3s ease-in-out,
    width 0.3s ease-in-out;
}

.accordion-item.active .accordion-content,
.accordion-item.active .typewriter {
  opacity: 1;
  transform: translateY(0);
}

/* --- Slide Content Positioning Blocks --- */
.slide-inner {
  display: flex;
  width: 100%;
  height: 75%;
  align-items: center;
  transition: height 1.3s ease-in-out;
}

.accordion-item.active .slide-inner {
  height: 100%;
}

.accordion-item.before .slide-inner,
.accordion-item.after .slide-inner {
  padding-bottom: 50px;
  height: 100%;
}

.slide-text {
  flex: 1;
  padding: 110px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  order: 1;
  color: #fff;
  opacity: 0;
  min-width: 200px;
  transition: opacity 1.5s ease-in-out;
}

.slide-text h2 {
  font-family: "SaudiWeb", sans-serif;
  font-size: 2.5rem;
  font-weight: bold;
}
.slide-text p {
  color: #fff;
}

.slide-text img {
  max-width: 175px;
  margin-bottom: 20px;
}

.accordion-item.active .slide-text {
  opacity: 1;
}

.slide-image {
  flex: 1;
  order: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease-in-out;
  justify-content: flex-end;
}

.slide-image img {
  width: 369px;
  height: 369px;
  margin: 61px;
  object-fit: cover;
}

.accordion-item-01 .slide-image {
  background: url(../img/snd_img_border_1.png) center right no-repeat;
}
.accordion-item-02 .slide-image {
  background: url(../img/snd_img_border_2.png) center right no-repeat;
}
.accordion-item-03 .slide-image {
  background: url(../img/snd_img_border_3.png) center right no-repeat;
}
.accordion-item-04 .slide-image {
  background: url(../img/snd_img_border_4.png) center right no-repeat;
}
.accordion-item-05 .slide-image {
  background: url(../img/snd_img_border_5.png) center right no-repeat;
}
.accordion-item-06 .slide-image {
  background: url(../img/snd_img_border_6.png) center right no-repeat;
}

/* --- Slider Control UI Core --- */
.slider-navigation {
  position: absolute;
  bottom: 30px;
  inset-inline-start: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.nav-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease-in-out;
}

.nav-btn:hover {
  filter: brightness(0.9);
}

.slider-bullets {
  display: flex;
  gap: 8px;
}

.bullet {
  width: 12px;
  height: 12px;
  background: #e5e7eb;
  border-radius: 50%;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
}

.bullet.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* --- Typewriter FX Typography Caret --- */
.typewriter {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  position: relative;
  padding-inline-end: 6px;
}

.typewriter::after {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: 15%;
  height: 70%;
  width: 3px;
  background-color: currentColor;
  animation: blink 0.75s step-end infinite;
}

@keyframes blink {
  from,
  to {
    background-color: transparent;
  }
  50% {
    background-color: currentColor;
  }
}

.typewriter.typing-done::after {
  display: none;
}

/* ==========================================================================
   3. MOBILE RESPONSIVE ADAPTATION OVERRIDES (< 990px)
   ========================================================================== */
@media (max-width: 990px) {
  .slider-container .show-desktop {
    display: none;
  }
  .slider-container .show-mobile {
    display: block;
  }

  .slider-header,
  .slider-navigation {
    width: 100%;
    inset-inline-end: 0;
    text-align: center;
    inset-inline-start: 0;
  }

  .slider-header {
    top: 40px;
  }

  .slider-navigation {
    bottom: 40px;
  }

  /* Structural Horizontal Scrolling Matrix Track */
  .accordion-wrapper {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    height: auto;
    border: none;
    padding: 0;
    gap: 0;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .accordion-wrapper::-webkit-scrollbar {
    display: none;
  }

  /* Independent Stacked Card Components Structure */
  .accordion-item,
  .accordion-item.active {
    width: 100vw !important;
    flex-shrink: 0;
    flex-grow: 0;
    flex-direction: column;
    border: 1px solid #ddd;
    scroll-snap-align: center;
    height: 650px;
    background-size: cover;
  }

  /* Safe Logical Absolute Offsets for Transformed Items */
  .accordion-item.before .slide-image {
    position: absolute;
    inset-inline-start: -150px;
    transform: scale(0.7);
    z-index: 1;
  }

  .accordion-item.after .slide-image {
    position: absolute;
    inset-inline-end: -150px;
    transform: scale(0.7);
    z-index: 1;
  }

  .accordion-header {
    display: none;
  }

  .accordion-content {
    opacity: 1;
    height: auto;
    width: 100%;
  }

  .slide-inner {
    flex-direction: column;
    align-items: center;
  }

  .slide-text,
  .slide-text p {
    align-items: center;
    text-align: center;
  }

  .slide-image {
    order: 1;
    flex: none;
    width: 244px;
    height: 244px;
    background-size: cover !important;
    margin-top: 140px;
    position: relative;
    z-index: 2;
    transition:
      transform 0.7s ease-in-out,
      opacity 0.7s ease-in-out;
  }

  .slide-image img {
    width: 184px;
    height: 184px;
    margin: 30px;
  }

  .slide-text {
    order: 2;
    padding: 15px;
    flex: 1;
  }
}

/* ==========================================================================
   4. TOUCH ONLY OPTIMIZATIONS (COARSE INPUT SYSTEMS)
   ========================================================================== */
@media (max-width: 990px) and (pointer: coarse) and (hover: none) {
  .nav-btn {
    display: none !important;
  }
}

/* decorative styles */
.Eservice-Section {
  background: url(../img/Frame_145.png) bottom center repeat-x;
  padding-bottom: 40px;
}
.Eservice-Section .Home-sectionTitle {
  background: url(../img/Vector-3.png) left center no-repeat;
  padding-left: 60px;
  line-height: 38px;
}
.ImportantSection .Home-sectionTitle {
  background: url(../img/Vector-1.png) left center no-repeat;
  padding-left: 60px;
  line-height: 38px;
}
.AwardSection {
  background: url(../img/Frame_142.png) top center repeat-x;
  margin-top: 20px;
}
.AwardSection .Home-sectionTitle {
  background: url(../img/Vector.png) left center no-repeat;
  padding-left: 60px;
  line-height: 38px;
}
.footer {
  background: var(--colors-success-900) url(../img/Frame_105.png) top center
    repeat-x;
  padding-top: 120px;
}
.NewsEvent {
  background: #fff url(../img/Section.png) bottom left no-repeat;
  background-size: contain;
}
.NewsEvent .Home-sectionTitle {
  background: url(../img/Vector-2.png) left center no-repeat;
  padding-left: 60px;
  line-height: 38px;
}
@media (max-width: 990px) {
  .NewsEvent {
    background-size: cover;
  }
}
