/* =========================================
   1. DESKTOP MARGINS & BASE STYLES
   ========================================= */

.s5bg {
  width: 100%;
  position: absolute;
  z-index: 26;
  margin-top: 290%; /* Desktop */
}

.s5carousel-container {
  --bg-color: #003400;
  --btn-color: #00b300;
  --card-white: #ffffff;
  
  --card-width: 200px;
  --card-height: 200px;
  --stack-width: 400px;
  --btn-size: 50px;
  --translate-offset: 85%; 

  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
  overflow: hidden; 
  font-family: sans-serif;
  margin-top: 290%; /* Desktop */
}

.s5text {
  left: 50%;
  transform: translateX(-50%);
  position: absolute;
  z-index: 27;
  width: 70%;
  margin-top: 325%; /* Desktop */
}

.s5aboutus {
  left: 50%;
  transform: translateX(-50%);
  position: absolute;
  z-index: 27;
  width: 25%;
  margin-top: 340%; /* Desktop */
}

.s5-footer-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background-color: #003400; 
  z-index: 60;
  width: 100%;
  color: white;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 350%; /* Desktop */
}

/* --- Card & Carousel Internal Styles --- */
.card-stack {
  position: relative;
  width: 100%; 
  max-width: var(--stack-width);
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  background: var(--card-white);
  border-radius: 24px;
  transition: all 0.4s ease-in-out;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  z-index: 0;
  transform: scale(0.8);
}

.card.active {
  opacity: 1;
  z-index: 10;
  transform: translateX(0) scale(1.2);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card.prev {
  opacity: 1;
  z-index: 5;
  transform: translateX(calc(var(--translate-offset) * -1)) scale(0.9);
}

.card.next {
  opacity: 1;
  z-index: 5;
  transform: translateX(var(--translate-offset)) scale(0.9);
}

.nav-btn {
  background: var(--btn-color);
  border: none;
  border-radius: 50%;
  width: var(--btn-size);
  height: var(--btn-size);
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px; 
  transition: transform 0.2s;
  flex-shrink: 0; 
}

.nav-btn:hover {
  transform: scale(1.1);
}

.nav-btn svg {
  width: 50%;
  height: 50%;
  stroke: #003300;
}

/* --- Footer Grid & Layout --- */
.s5-footer-grid {
  display: grid;
  gap: 15px;
  width: 100%;
  max-width: 900px;
  margin: 40px auto 50px;
}

.s5-grid-box {
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
}

.s5-grid-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.s5-full {
  aspect-ratio: 16/9;
}

.s5-thumbs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.s5-footer-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.s5-socials {
  display: flex;
  gap: 20px;
  margin-bottom: 5px;
}

.s5-socials svg {
  width: 24px;
  height: 24px;
  stroke: white;
}

.s5-legal-links, .s5-legal-links a {
  font-size: 11px;
  text-decoration: none;
  color: white;
  font-weight: bold;
  letter-spacing: 1px;
}

.s5-disclaimer, .s5-copyright {
  font-size: 10px;
  margin: 0;
  letter-spacing: 0.5px;
}

.s5-footer-logo {
  margin-bottom: 20px;
  margin-top: 15px;
  font-weight: 900;
  font-style: italic;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.s5-pill { 
  font-style: normal; 
}

.play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 48px;
  color: white;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.s5-grid-box:hover .play-icon {
  opacity: 1;
}

.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.video-modal.active {
  display: flex;
}

.video-modal-content {
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  position: relative;
}

.video-modal iframe {
  width: 100%;
  height: 100%;
}

.video-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 32px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}


/* =========================================
   2. SMARTPHONE MARGINS & OVERRIDES
   ========================================= */

@media (max-width: 768px) {
  
  /* --- Structural Margins for Mobile --- */
  .s5bg {
    margin-top: 250%; /* Adjusted to match your mobile carousel */
  }
  
  .s5carousel-container {
    margin-top: 260%; 
    height: 60vh;
    --card-width: 140px; 
    --card-height: 140px;
    --stack-width: 280px; 
    --btn-size: 40px;
    --translate-offset: 65%; 
  }
  
  .s5text {
    z-index: 80;
    margin-top: 349%;
  }

  .s5aboutus {
    margin-top: 362%;
  }
  
  .s5-footer-container {
    margin-top: 370%;
  }

  /* --- Other Mobile Adjustments --- */
  .card.active {
    transform: translateX(0) scale(1.15);
  }

  .s5-footer-grid {
    gap: 20px;
    justify-items: center;
  }

  .s5-thumbs-row {
    grid-template-columns: 1fr; 
    justify-items: center;
  }
}

/* Extra breakpoint for very small phones */
@media (max-width: 600px) {
  .s5-footer-grid {
    grid-template-columns: 1fr; 
  }
  
  .s5-grid-box.s5-full {
    grid-column: span 1;
    height: 200px;
  }

  .s5-grid-box {
    height: 150px;
  }
}