
.event-section,
.map-section,
.countdown,
.calendar-section {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.page-loaded .event-section,
.page-loaded .map-section,
.page-loaded .countdown,
.page-loaded .calendar-section {
  opacity: 1;
}



/* ======= EVENTS SECTION ======= */

.event-section {

width: 100%;
height: auto;
margin: 0 auto;
display: flex;
justify-content: center;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;

position: relative;
z-index: 0;

}


.event-content {
  display: flex;
  flex-wrap: nowrap;
  
  max-width: 1400px;

  width: 100%;
  height: auto;
  justify-content: center;
  align-items: stretch; /* Ensures both image and text line up */
  gap: 2rem;

  margin: 1vh 2vh;
  padding: 1vh 2vh;
}


/* Image box */
.event-box {
  width: 50%;
  height: 100%;

  display: flex;
  justify-content: center;
  flex-direction: column;
  
  align-self: flex-start;

  box-sizing: border-box;
  overflow: hidden;

}

.event-box img {
  width: 80%; /* adjust this to scale event image */

  height: auto;
  object-fit: contain;
  display: block;
  align-self: center;
  border: 2px solid rgb(255, 255, 255);
  border-radius: 5px;

}



.event-info {
  container-type: inline-size;
  container-name: eventinfo;

  flex: 1 1 40%;
  width: 50%;
  height: 100%;

  
  font-size: 10px;
  line-height: 2;

  color: black;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  

  text-align: left;

  opacity: 0;
  transition: opacity 0.2s ease-in;

  position: relative;   /* create stacking context */
  z-index: 1;           /* below the nav */
}

.event-info.scaled {
  opacity: 1;
}

.section-title {
  align-items: flex-end;  /* aligns content to the bottom */
  font-size: 7cqw;
  text-decoration: underline;
  margin: 0;
  font-family: 'Minecraft-ten';
  text-align: left;
  padding: 0;
  color: white;
}

#event-description {
  margin-top: 0;    /* reduce top margin */
  text-shadow: 0 0 50px #ffffff;
}




.scroll-guard {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: auto;      /* captures touch, allowing scroll */
  background: transparent;
  touch-action: pan-y;       /* allow vertical scroll */
}

/* Hide scroll-guard when map is active */
.map-container.active .scroll-guard {
  display: none;
}



/* LIVE MAP SECTION */
.map-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-repeat: repeat;
  background-size: 100px; /* adjust as needed */
  image-rendering: pixelated;
  text-align: center;
  padding: 2rem 0;
}




/* MAP TITLE */
.map-header {
  display: flex;
  align-items: center;
  justify-content: center; /* center the title */
  position: relative;
  width: 100%;
  padding: 0 2rem;
}

.live-map-title {
  font-size: 6vh;
  color: red;

  text-shadow:
    -1px -1px 0 white,
     1px -1px 0 white,
    -1px  1px 0 white,
     1px  1px 0 white;

  margin: 0; /* remove default margins for better centering */
  font-family: 'Minecraft-ten';
  text-align: center;
  flex: 1; /* allow the title to take full available space */
}







/* MAP BUTTON */
.map-toggle-button {
  position: absolute;
  right: 0; /* align left with padding */
  font-size: 2rem;
  font-weight: bold;
  background-color: red;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.4s, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25em 0.5em;
}

.map-toggle-button:hover {
  transform: scale(1.2); /* Expand to 120% size on hover */
}

.map-toggle-button.open {
  background-color: green;
}

/* Animate rotation ONLY on the symbol */
.map-toggle-button .symbol {
  display: inline-block;
  transition: transform 0.4s;
}

.map-toggle-button.open .symbol {
  transform: rotate(180deg);
}






/* THE MAP */

/* Animate container collapsing */
.map-container {
  position: relative; /* needed for absolute positioning of overlay */
  width: 100%;
  height: 50vh;
  border: 4px solid red;
  margin-top: 1rem;
  margin-bottom: 4rem;
  border-radius: 10px;
  overflow: hidden;
  transition:
    height 1s ease,
    opacity 1s ease,
    border-color 0.3s ease,
    margin-bottom 2s ease; /* add margin-bottom transition */
  opacity: 1;
  display: block;
}

.map-container.closed {
  height: 0;
  opacity: 0;
  pointer-events: none;
  margin-bottom: 0; /* collapse margin bottom */
}


.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  pointer-events: auto; /* always on, since scroll is handled by guard */
}


.map-container.active {
  border-color: rgb(0, 255, 0);
}

.map-container.active iframe {
  pointer-events: auto;       /* Enable interaction once activated */
  touch-action: auto;         /* Allow gestures inside iframe */
}




.map-interact-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-family: 'Minecraftia-Regular', monospace, sans-serif;
  font-size: 1.8rem;
  padding: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  border-radius: 0.5rem;
  pointer-events: none; /* allow clicks to pass through */
  user-select: none;
  z-index: 10;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

/* Hide overlay when map is active */
.map-container.active .map-interact-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}



/* Countdown Timer */

.countdown {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-family: 'Minecraft-ten';
  margin-top: 3vh;
  margin-bottom: 3vh;

}

.time-box {
  background: #3f3f3f63;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); /* ✅ Safari-specific */
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  width: 15%;
  color: white;
}

.number {
  /* clamp(min, preferred, max) */
  font-size: clamp(2rem, 10vw, 5rem); /* scales up to 5rem */
  font-weight: bold;
  display: block;
}

.label {
  font-size: clamp(0.5rem, 3vw, 2rem); /* scales up to 3rem */
  font-weight: 200;
}


.label.days {
  color: #ff5555;
}

.label.hours {
  color: #ffaa00;
}

.label.minutes {
  color: #00cc66;
}

.label.seconds {
  color: #3399ff;
}


.event-started {
  font-family: 'Minecraft-ten';
  font-size: clamp(1.5rem, 6vw, 4rem);
  font-weight: bold;
  text-align: center;
  padding: 1.5rem 2rem;
  color: #00ff99;
  background: #111;
  border: 2px solid #00ff99;
  border-radius: 10px;
  box-shadow: 0 0 20px #00ff99;
  animation: glow 1.5s ease-in-out infinite alternate;
}


.event-ended {
  font-family: 'Minecraft-ten';
  font-size: clamp(1.5rem, 6vw, 4rem);
  font-weight: bold;
  text-align: center;
  padding: 1.5rem 2rem;
  color: #ff0000;
  background: #111;
  border: 2px solid #ff0000;
  border-radius: 10px;
  box-shadow: 0 0 20px #ff0000;
  animation: glow 1.5s ease-in-out infinite alternate;
}



#calendar-section {
  margin-top: 0;          /* space above it */
  text-align: center;          /* center the button horizontally */
}

#calendar-section a#download-ics {
  background-color: #3f3f3f63;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: white;
  padding: 0.6rem 1.2rem;
  padding-top: clamp(0.5rem, 2vw, 2rem);
  font-family: 'Minecraftia-Regular';
  font-size: clamp(0.5rem, 2vw, 2rem); /* scales up to 3rem */
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  vertical-align: bottom;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}


#calendar-section a#download-ics:hover {
  background-color: #5f5f5f80;         /* slightly brighter on hover */
  transform: scale(1.05);              /* subtle grow on hover */
  cursor: pointer;
}



@media (max-width: 1500px) {

  .map-toggle-button {
  right: 1.5rem;
}
}


/* Make events stack vertically on smaller screens */
@media (max-width: 996px) {
  .event-content {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2vh 8vw;
  }

  .event-box {
    width: 100%;
    align-items: center;
  }

  .event-box img{
    width: 80%;
  }

  .event-info {
    width: 100%;

    align-items: center;
    text-align: center;
    padding: 1rem;
    
    font-size: 3.5vw;

    opacity: 1;

  }

  .section-title {
    text-align: center;
    font-size: 7vw;
  }

  #event-description {
    line-height: 1.6;
  }
  

  /*Mobile Map*/

  .live-map-title {
    font-size: 6vw;
  }

  .map-container {
  margin-bottom: 6vw; /* or whatever looks best */
}

.time-box {
  width: 20vw;
}

.number {
  font-size: 8vw;
}

.label {
  font-size: 3vw;
}


#calendar-section a#download-ics {
  font-size: 3vw;
  padding-top:3vw ;
}


.map-toggle-button {
  right: 1.5rem;
}

}








/* Make events stack vertically on EVEN SMALLER screens */
@media (max-width: 712px) {

   .map-container {
  margin-bottom: 9.8vw; /* or whatever looks best */
}

.live-map-title {
    font-size: 10vw;
  }


.time-box {
  width: 35vw;
}

.number {
  font-size: 12vw;
}

.label {
  font-size: 5vw;
}


#calendar-section a#download-ics {
  font-size: 4vw;
  padding-top:4vw ;
}

}
