/* 1) Declare Cera Pro weights */
@font-face {
  font-family: "Cera Pro";
  src: url("assets/fonts/CeraPro-Medium.woff2") format("woff2"),
    url("assets/fonts/CeraPro-Medium.woff") format("woff");
  font-weight: 400; /* Mapped to medium */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cera Pro";
  src: url("assets/fonts/CeraPro-Medium.woff2") format("woff2"),
    url("assets/fonts/CeraPro-Medium.woff") format("woff");
  font-weight: 500; /* Mapped to medium */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cera Pro";
  src: url("assets/fonts/CeraPro-Bold.woff2") format("woff2"),
    url("assets/fonts/CeraPro-Bold.woff") format("woff");
  font-weight: 700; /* Mapped to bold */
  font-style: normal;
  font-display: swap;
}

/* CSS Variables for Modal Slider Layout */
:root {
  --slide-width-default: 773px; /* Base width of the main active slide */
  --slide-peek-amount: 10px; /* How much of the prev/next slide is visible */
  --arrow-margin-from-active-edge: 10px; /* Reduced to exactly 10px inside */
  --arrow-button-size: 40px; /* Visual size of the arrow button */
  --max-modal-content-width: 1080px; /* Max width of the modal content area */
  --slide-width: var(
    --slide-width-default
  ); /* Default slide width, will be updated by media queries */
}

/* Reset and Basic Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%; /* Ensure html and body take full height */
  overflow-x: hidden; /* Prevent horizontal scrollbar always */
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.4;
  background-color: #f8f8f8;
  color: #333;
  display: flex; /* Ensure body stretches to content */
  flex-direction: column;
}

/* === Homepage Layout (Viewport Height Distribution) === */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  margin: 0 0;
  position: relative;
  overflow: hidden; /* Changed to clip content exceeding container bounds */
  background-color: #f8f8f8;
  justify-content: space-between;
}

/* Background Images */
.container__background {
  position: absolute;
  bottom: 0;
  z-index: 1;
  left: 35%;
  transform: translateX(-50%);
  width: auto;
  height:  40vh;
}


.container__graphic {
  /* Second BG */
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 2;

  opacity: 0.9;
}

.site-header {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  padding: clamp(15px, 3vh, 30px) 0;
  position: relative;
  z-index: 10;
}

.logo {
  /* Applies to both homepage and modal logo */
  display: inline-block;
  width: 33%;
  max-width: 283px; /* Smaller logo size */
  height: auto;
  background-color: #fff;
  padding: clamp(8px, 1vw, 12px); /* Reduced padding */
  border-radius: 12px;
  margin-top: 30px;
  cursor: pointer; /* Keep pointer cursor */
}

.main-content {
  flex: 1 0 auto; /* Allow to grow, don't shrink, takes auto height */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 10;
  padding: 0 20px;
  margin: 0;
  min-height: 200px;

  @media (min-width: 1080px) {
    gap: 32px;
  }
}

.main-content-title {
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  font-size: 90px; /* Responsive font size */
  color: #2f0e0f;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.cta-button {
  font-family: "Cera Pro", sans-serif;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: start;
  background-color: #e51f4e;
  color: white;
  padding: 32px 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease,
    border-color 0.3s ease;
  box-shadow: 0px 14px 34px 0px #0000001A;
  gap: 28px;
}

.cta-button-text {
  font-family: "Cera Pro", sans-serif;
  font-weight: 500;
  font-size:  22px;
  display: flex;
  align-items: center;
  line-height: 1;
}

.cta-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 14px; /* Match SVG height */
  width: 10px; /* Match SVG width */
  margin-top: 0px;

  @media (min-width: 1080px) {
    margin-top: 4px;
  }
}

.cta-button .arrow {
  transition: filter 0.3s ease;
}

.cta-button:hover {
  background-color: #ffffff;
  color: #e51f4e;
  transform: translateY(-2px);
  border-color: #e51f4e;
}

.cta-button:hover .arrow {
  filter: brightness(0) saturate(100%) invert(35%) sepia(45%) saturate(5493%)
    hue-rotate(325deg) brightness(94%) contrast(97%);
}

/* Programme Infinite Scroller (Homepage Bottom Section) */
.programme-scroll-container {
  position: relative;
  height: auto;
  max-height: 557px; /* Base height, responsive queries adjust this */
  overflow: visible; /* Important: This container itself should NOT clip its content */
  z-index: 5;
  flex: 0 0 auto; /* Don't grow or shrink */
  transform: translateY(15px); /* Push down by 15px to clip bottom content */
  padding-bottom: 0;
}

.programme-scroll-wrapper {
  display: flex;
  position: relative;

  will-change: transform;
  animation: scrollProgrammes 80s linear infinite; /* Standardized speed */
  align-items: flex-end; /* Align items to the bottom */
  padding-bottom: 0;
  height: 100%; /* Take full height of container */
  gap: 30px;
  width: fit-content;
}

.programme-image {
  /* Specific styles for homepage scroll images */
  height: auto; /* Auto height based on aspect ratio */
  width: auto;
  max-width: 33vw; /* Maximum width */
  max-height: 33vh; /* Maximum height */
  flex-shrink: 0;
  margin-right: 30px;
  border-radius: 8px;
  object-fit: contain;
  background-color: rgba(255, 255, 255, 0.1);
  cursor: pointer; /* Show pointer cursor to indicate clickable */
  display: block; /* Ensure proper block display */
}

@keyframes scrollProgrammes {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.programme-scroll-container:hover .programme-scroll-wrapper {
  animation-play-state: paused;
}

/* --- Modal Styles --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto; /* Allow vertical scrolling */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  background-color: #93d3ea;
  flex-direction: column;
  justify-content: space-between; /* Pushes logo, content, button apart */
  align-items: center;
  padding: clamp(20px, 3vh, 30px) 0px; /* Vertical padding, no horizontal */
}

.modal::after {
  /* Modal Background */
  content: "";
  position: fixed; /* Fixed to stay in view when scrolling */
  bottom: 0;
  right: -20px;
  width: 78%;
  height: auto;
  padding-top: 60%; /* Aspect Ratio approximation for modal BG */
  background-image: url("assets/modal/modal-background.png");
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: contain;
  z-index: 0; /* Behind modal content */
  pointer-events: none;
  max-width: 1400px;
}

.modal-logo {
  flex-shrink: 0; /* Prevent shrinking */
  position: relative;
  z-index: 10; /* Above BG */
  margin-bottom: 0; /* Remove margin, spacing handled by justify-content */
  max-width: 280px; /* Smaller logo size */
}

.modal-content {
  flex: 1 1 auto; /* Takes available space */
  width: 100%;
  display: flex;
  justify-content: center; /* Center the swiper container */
  align-items: center;
  position: relative; /* Needed for positioning arrows */
  overflow: visible; /* Allow arrows to be potentially outside */
  z-index: 5; /* Above background */
  min-height: 0; /* Prevents flex item blowout */
  margin: 0 auto; /* Center horizontally with auto margins, but no vertical margin */
}

.swiper-overflow-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden; /* Prevent horizontal scrollbar */
  overflow-y: visible; /* Allow vertical visibility */
}

/* === Swiper Container for Peek Effect === */
.programme-swiper {
  max-width: 100%; /* Swiper itself should not exceed modal-content's width */
  height: 100%; /* Fill available height in modal-content */
  margin: 0 auto;
  position: relative; /* Crucial for positioning arrows inside it */
  overflow: visible !important; /* Swiper requirement for some effects/layouts */
}

.swiper-wrapper {
  display: flex;
  align-items: center;
  height: 100%; /* Allow slides to stretch vertically if needed */
  will-change: transform;
}

.swiper-slide {
  height: auto; /* Height based on image content */
  flex-shrink: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden; /* Clip content if slide resizes unexpectedly */
  cursor: default; /* No grabbing */
  border-radius: 16px; /* Add border radius to the slide container */
  padding: 1px; /* Tiny padding to ensure border radius is visible */
}

.swiper-slide-prev,
.swiper-slide-next {
  opacity: 0.3;
  transform: scale(0.9);
}


.swiper-slide img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 65vh;
  min-height: 400px;
  object-fit: contain;
  object-position: center;
  border-radius: 16px;
}

/* Navigation Buttons - Positioned OUTSIDE the active slide but inside swiper container */
.swiper-button-prev,
.swiper-button-next {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: var(--arrow-button-size) !important;
  height: var(--arrow-button-size) !important;
  z-index: 20; /* Above slides */
  cursor: pointer;
  background: none !important; /* Remove default Swiper background */
  color: transparent !important; /* Hide default Swiper arrow characters */
  display: flex; /* For centering the img child */
  align-items: center;
  justify-content: center;
}

/* Position buttons on each side of the active slide */
.swiper-button-prev {
  left: 10px !important; /* Position just outside the active slide */
}

.swiper-button-next {
  right: 10px !important; /* Position just outside the active slide */
}

/* Style for the custom arrow images */
.swiper-button-prev .arrow,
.swiper-button-next .arrow {
  width: 100%; /* SVG takes full width of its button container */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Remove any extra space below img */
  opacity: 0.8; /* Slight transparency */
  transition: opacity 0.2s ease;
}

.swiper-button-prev:hover .arrow,
.swiper-button-next:hover .arrow {
  opacity: 1;
}

/* Back Home Link */
.modal-back-home {
  font-family: "Cera Pro", sans-serif;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  position: relative; /* Needed for ::before */
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0; /* Prevent shrinking */
  margin-top: 0; /* Remove margin, spacing handled by justify-content */
  z-index: 10; /* Above modal BG */
  margin-bottom: 50px; /* Remove margin, spacing handled by justify-content */
}

.modal-image {
  border-radius: 16px;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Existing back-home styles */
.back-home span {
  padding: 16px 30px;
  position: relative;
  z-index: 2;
  font-weight: 500;
  color: #e51f4e;
  transition: color 0.3s ease;
  font-size: clamp(12px, calc(24 / 1080 * 100vw), 24px);
}
.back-home:hover span {
  color: #ffffff;
}
.back-home .arrow-container {
  width: 50px;
  background-color: #e51f4e;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px; /* Adjusted padding */
  height: 100%;

  position: relative;
  z-index: 2;
}
.back-home::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background-color: #e51f4e;
  border-radius: 6px;
  transition: width 0.3s ease;
  z-index: 1;
}
.back-home:hover::before {
  width: 100%;
}
.back-home .arrow {
  width: 8px;
  height: auto;
  filter: brightness(0) invert(1);
}

/* --- Responsive Design --- */

/* Large screens */
@media (min-width: 1200px) {
  :root {
    /* Cap slide width if modal content is narrower */
    --slide-width: min(
      773px,
      calc(var(--max-modal-content-width) - (2 * var(--slide-peek-amount)))
    );
  }
}

/* Specifically for 1080px wide screens that are also tall (like 1080x1920 mobile/tablet) */
@media (max-width: 1200px) and (min-width: 992px) {
  :root {
    --slide-width: 650px;
  }
}

@media (max-width: 992px) {
  :root {
    --slide-width: 550px;
  }

  .programme-scroll-container {
    min-height: 435px; /* Keep: This adjusts scroller height */
  }


  .programme-image {
    max-width: 220px; /* Keep: This adjusts image size */
  }

  .swiper-slide img {
    max-height: 50vh;
  }

  /* Ensure proper spacing in flex layout */
  .main-content {
    margin: 15px 0;
  }
}

@media (max-width: 768px) {
  :root {
    --slide-width: 450px;
    --arrow-margin-from-active-edge: 15px; /* Closer arrows on medium screens */
  }
  .swiper-slide {
    max-width: calc(95vw - 20px);
  }

  .swiper-button-prev,
  .swiper-button-next {
    width: 35px !important;
    height: 35px !important;
  }

  .programme-scroll-container {
    min-height: 362px; /* Keep: This adjusts scroller height */
  }
  .programme-scroll-wrapper {
    width: calc(34 * (180px + 20px)); /* Keep: This adjusts scroller width */
  }
  .programme-image {
    max-width: 180px; /* Keep: This adjusts image size */
  }

  .swiper-slide img {
    max-height: 50vh;
  }

  /* Ensure proper spacing */
  .main-content {
    margin: 10px 0;
  }
}

@media (max-width: 576px) {
  :root {
    --slide-width: calc(100vw - 80px); /* Account for peek on each side */
    --arrow-margin-from-active-edge: 10px; /* Even closer arrows on small screens */
  }
  .programme-swiper {
    width: calc(100vw - 60px); /* Allow for peek on each side */
  }
  .swiper-slide {
    max-width: calc(100vw - 80px);
  }

  .swiper-button-prev,
  .swiper-button-next {
    width: 30px !important;
    height: 30px !important;
  }

  .swiper-button-prev .arrow,
  .swiper-button-next .arrow {
    max-width: clamp(24px, 1vw, 40px);
    max-height: clamp(24px, 1vw, 40px);
  }

  .programme-scroll-container {
    min-height: 290px; /* Keep: This adjusts scroller height */
  }
  .programme-scroll-wrapper {
    width: calc(34 * (140px + 15px)); /* Keep: This adjusts scroller width */
  }
  .programme-image {
    max-width: 140px; /* Keep: This adjusts image size */
    margin-right: 15px; /* Keep: Spacing between images */
  }

  .swiper-slide img {
    max-height: 45vh;
  }

  /* Further adjustments for very small screens */
  .main-content {
    margin: 5px 0;
  }

  .logo {
    max-width: clamp(90px, 8vw, 120px);
  }
}

/* Adjustments for landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --arrow-margin-from-active-edge: 10px; /* Closest arrows on landscape */
  }

  .logo,
  .modal-logo {
    max-width: 90px;
  }
  .site-header {
    padding: 10px 0;
  }
  .main-content {
    margin: 5px 0;
  }

  .programme-scroll-container {
    min-height: 260px; /* Keep: This adjusts scroller height */
  }
  .programme-scroll-wrapper {
    width: calc(34 * (120px + 15px)); /* Keep: This adjusts scroller width */
  }
  .programme-image {
    max-width: 120px; /* Keep: This adjusts image size */
    margin-right: 15px; /* Keep: Spacing between images */
  }

  /* Adjust spacing in modal */
  .modal-logo {
    margin-bottom: 10px;
  }
  .modal-content {
    margin: 10px 0;
  }
  .modal-back-home {
    margin-top: 10px;
    margin-bottom: 10px;
  }
  .swiper-slide img {
    max-height: 240px;
  }
}

@media (min-height: 800px) {
  /* For taller screens, give more room to content area */
  .main-content {
    min-height: 250px;
  }
}

@media (min-height: 1000px) {
  /* For very tall screens, ensure proper spacing */
  .main-content {
    min-height: 300px;
  }
}

@media (min-height: 700px) {
  /* For medium-height screens, adjust modal spacing */
  .modal {
    padding: clamp(25px, 4vh, 35px) 0;
  }
}

@media (min-height: 900px) {
  /* For taller screens, adjust modal spacing */
  .modal {
    padding: clamp(30px, 5vh, 40px) 0;
  }
}

/* Mobile-specific adjustments for arrow spacing */
@media (min-width: 375px) and (max-width: 480px) {
  /* Position arrows outside the active slide for small mobile */
  .swiper-button-prev {
    left: -20px !important;
  }

  .swiper-button-next {
    right: -20px !important;
  }

  /* Make the buttons slightly larger */
  .swiper-button-prev,
  .swiper-button-next {
    width: 40px !important;
    height: 40px !important;
  }

  .swiper-button-prev .arrow,
  .swiper-button-next .arrow {
    max-width: clamp(24px, 1vw, 40px);
    max-height: clamp(24px, 1vw, 40px);
    filter: brightness(1.2); /* Make arrows slightly brighter */
  }

  /* Adjust modal image spacing */
  .modal-image {
    max-width: 85%;
    max-height: 75vh;
    object-fit: contain;
    object-position: center;
  }
}

/* For very small mobile devices */
@media (max-width: 374px) {
  /* Position arrows slightly outside the active slide */
  .swiper-button-prev {
    left: -15px !important;
  }

  .swiper-button-next {
    right: -15px !important;
  }

  /* Make the slide more visible by adjusting its max width */
  .swiper-slide {
    max-width: 85vw;
  }

  /* Adjust modal image spacing */
  .modal-image {
    max-width: 85%;
    max-height: 70vh;
    object-fit: contain;
    object-position: center;
  }

  /* Ensure the modal has enough padding for content */
  .modal {
    padding: 10px 0;
  }
}

/* Hide default Swiper ::after pseudo-elements used for arrows */
.swiper-button-prev::after,
.swiper-button-next::after {
  display: none !important;
}

/* For larger screens, position arrows further away */
@media (min-width: 992px) {
  .swiper-button-prev {
    left: 20px !important;
    width: 78px !important;
    height: 78px !important;
  }

  .swiper-button-next {
    right: 20px !important;
    width: 78px !important;
    height: 78px !important;
  }
}

/* Ensures the duplicate strip has exactly the same width as the original */
.programme-scroll-wrapper > img:last-child {
  margin-right: 0;
}
