/* css/style.css */

/* CSS custom properties for navigation bar height only */
:root {
  --nav-height: 350px; /* Full header height initially */
  --nav-height-compressed: 175px; /* Compressed header height */
  --scroll-offset: 10vh; /* 1/4 of viewport height for section positioning */
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-offset); /* Position sections at 1/4 from top */
  /* overflow-x: hidden; */ /* Temporarily disabled - can prevent sticky */
  -webkit-text-size-adjust: 100%; /* Prevent zoom on orientation change */
  -ms-text-size-adjust: 100%; /* Prevent zoom on orientation change */
}

section[id] {
  scroll-margin-top: var(--scroll-offset); /* Position sections at 1/4 from top */
}

/* No body padding needed since header is not fixed */
body {
  font-family: Open Sans, Arial, sans-serif !important;
  color: #666;
  margin: 0;
  padding: 0;
  background-color: #EFE9D2;
  /* overflow-x: hidden; */ /* Temporarily disabled - can prevent sticky */
  -webkit-text-size-adjust: 100%; /* Prevent zoom on orientation change */
  -ms-text-size-adjust: 100%; /* Prevent zoom on orientation change */
  min-width: 320px; /* Minimum width to prevent layout issues */
  position: relative; /* Establish positioning context */
  min-height: 100vh; /* Ensure enough height for scrolling */
}

/* Main Header Styles - New Multi-Image Layout */
#main-header {
  position: -webkit-sticky; /* Safari */
  position: sticky;
  top: 0;
  z-index: 1001;
  width: 100%;
  transition: all 0.3s ease;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Add shadow to make sticky more obvious */
}

.header-container {
  width: 100%;
  height: 350px; /* Fixed height for header background */
  background-image: url('../assets/images/cnx_header_bg.png');
  background-size: 100% 100%; /* Force 100% width and height coverage */
  background-position: 0 0; /* Start position x=0, y=0 - you can adjust this */
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* This ensures nav stays at bottom */
  transition: all 0.3s ease; /* Ensure smooth transition for all properties */
  position: relative;
  will-change: height, transform;
}

.header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center the content */
  position: relative;
  height: 100%;
}

/* New main layout structure */
.header-main-layout {
  display: flex;
  height: 100%;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Left spacer for 25% gap */
.header-left-spacer {
  flex: 0 0 35%; /* Fixed 25% width */
}

/* Content area taking remaining space */
.header-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 2rem;
}

/* Top left logo positioning */
.header-top-left {
  position: absolute;
  top: 20px;
  /* left: 20px; */
  right: 70%;
  z-index: 10;
}

/* Center group with logo and date */
.header-center-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0rem;
}

.header-logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-date-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  padding-right: 2rem;
  width: 100%;
}

/* Logo Images */
.header-logo-left,
.header-logo-center,
.header-logo-date {
  max-width: 100%;
  height: auto;
  transition: all 0.3s ease;
}

.header-logo-left {
  max-width: 250px;
  height: auto;
}

.header-logo-center {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 300px;
}

.header-logo-date {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 100px;
  margin-top: -100px;
}

/* Navigation in Header */
.header-navigation {
  background-color: #900809;
  width: 100%;
  padding: 1rem 0; /* Remove horizontal padding */
  margin: 0; /* Remove all margins */
  position: relative;
  flex-shrink: 0; /* Prevent navigation from shrinking */
  margin-top: auto; /* Push navigation to bottom */
}

.header-navigation .nav-container {
  width: 100%;
  max-width: none; /* Remove max-width constraint */
  margin: 0;
  padding: 0 1rem; /* Add horizontal padding only to container */
}

.header-navigation .nav-link {
  color: white;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sticky Compressed State */
#main-header.compressed .header-container {
  height: 200px !important; /* 60% of 350px */
  transition: height 0.3s ease;
}

#main-header.compressed .header-content {
  flex: 1; /* Use full available space */
  overflow: hidden; /* Hide any overflow if images are too large */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Keep content vertically centered */
  min-height: 0; /* Allow shrinking */
  max-height: 200px; /* Specific height limit for compressed state */
  position: relative;
}

#main-header.compressed .header-content-area {
  padding: 1rem;
}

#main-header.compressed .header-main-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 0rem;
}

#main-header.compressed .header-left-spacer {
  /* display: none; */
  flex: 0 0 35%;
}

#main-header.compressed .header-top-left {
  /* display: none; */
  top: 50px;
}

#main-header.compressed .header-center-group {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex: 1;
  padding-right: 1rem;
}

#main-header.compressed .header-logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
}

#main-header.compressed .header-date-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: 0;
  padding-right: 0;
  width: 100%;
  transform: scale(0.4);
}

#main-header.compressed .header-logo-date {
    margin-top: -130px;
    margin-right: -100px;
}

#main-header.compressed .header-logo-center {
  max-height: 120px;
}

#main-header.compressed .header-logo-left {
  max-width: 200px;
  /* Remove transform scale to keep original size */
}

#main-header.compressed .header-logo-link img {
    margin-top: 0px;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
  /* Apply compressed styles automatically on mobile */
  /* #main-header height removed to allow sticky positioning */
  
  /* Ensure sticky works on mobile */
  #main-header {
    position: -webkit-sticky !important; /* Force sticky on iOS */
    position: sticky !important;
    top: 0 !important;
  }
  
  #main-header .header-container {
    height: 200px !important;
  }
  
  #main-header .header-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    max-height: 200px;
    position: relative;
  }
  
  #main-header .header-content-area {
    padding: 1rem;
  }
  
  #main-header .header-main-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 0rem;
  }
  
  #main-header .header-left-spacer {
    /* display: none; */
    flex: 0 0 35%;
  }
  
  #main-header .header-top-left {
    /* display: none; */
    top: 50px;
  }
  
  #main-header .header-center-group {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex: 1;
    padding-right: 1rem;
  }
  
  #main-header .header-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
  }
  
  #main-header .header-date-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: 0;
    padding-right: 0;
    width: 100%;
    transform: scale(0.4);
  }
  
  #main-header .header-logo-date {
    margin-top: -130px;
    margin-right: -100px;
  }
  
  #main-header .header-logo-center {
    max-height: 100px;
  }
  
  #main-header .header-logo-left {
    max-width: 200px;
  }
  
  #main-header .header-logo-link img {
    margin-top: 0px;
  }
}

/* Additional responsive styles for tablets and larger phones */
@media (max-width: 1024px) {
  .header-left-spacer {
    flex: 0 0 15%; /* Reduce left gap on tablets */
  }
  
  .header-content-area {
    padding: 1.5rem;
  }
}

/* Very small mobile screens - apply even more compressed styles */
@media (max-width: 480px) {
  #main-header .header-left-spacer {
    /* display: none; */
    flex: 0 0 25%;
  }
  
  #main-header .header-top-left {
    /* display: none; */
    top: 50px;
  }
  #main-header .header-logo-date {
    margin-top: -130px;
    margin-right: -100px;
  }
  #main-header .header-center-group {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex: 1;
    padding-right: 0rem;
  }
  #main-header .header-content-area {
      padding: 0rem;
  }
  #main-header .header-logo-left {
    max-width: 150px;
  }
  #main-header.compressed .header-logo-left {
    max-width: 150px;
  }
  #main-header.compressed .header-left-spacer {
    /* display: none; */
    flex: 0 0 25%;
  }
  #main-header.compressed .header-main-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 0rem;
  }
  #main-header.compressed .header-content-area {
    padding: 0rem;
  }
  #main-header.compressed .header-center-group {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex: 1;
    padding-right: 0rem;
  }
  /* #main-header {
    height: 150px !important;
  }
  
  #main-header .header-container {
    height: 150px !important;
  }
  
  #main-header .header-content {
    max-height: 150px;
  }
  
  #main-header .header-main-layout {
    padding: 0 0.5rem;
  }
  
  #main-header .header-center-group {
    padding-right: 0.5rem;
  }
  
  #main-header .header-date-wrapper {
    transform: scale(0.3);
  }
  
  #main-header .header-logo-date {
    margin-top: -60px;
    margin-right: -180px;
  }
  
  #main-header .header-logo-center {
    max-height: 80px;
  }
  
  #main-header .header-logo-left {
    max-width: 120px;
  } */
}

/* Event Highlight Section Styles */
.highlight-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  gap: 2rem;
}

/* General container styling */
.container {
  max-width: 1440px;
  margin: 0 auto;
  /* padding: 0 15px; */
}

/* Navigation specific container */
.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Course Overlay Buttons */
.course-overlay-buttons {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allow clicks to pass through the container */
}

.course-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 0px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto; /* Enable clicks on buttons */
  backdrop-filter: blur(0px);
  min-width: 270px;
  min-height: 470px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.course-btn-label {
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Adjustable positions for each button - modify these as needed */
.course-btn-1 {
  top: 9%;
  right: 9%;
}

.course-btn-2 {
  top: 9%;
  right: 30%;
}

.course-btn-3 {
  top: 9%;
  left: 30%;
}

.course-btn-4 {
  top: 9%;
  left: 9%;
}
@media (max-width: 1024px) {
  .course-btn {
    border: 0px solid rgba(255, 255, 255, 0.3);
    min-width: 151px;
    min-height: 273px;
    border-radius: 6px;
  }
}

/* Responsive adjustments for course buttons */
@media (max-width: 768px) {
  .course-btn {
    border: 0px solid rgba(255, 255, 255, 0.3);
    min-width: 90px;
    min-height: 163px;
    border-radius: 6px;
  }
  
  .course-btn-label {
    font-size: 13px;
    font-weight: bold;
  }
  
  /* Better mobile positioning - adjust these as needed */
  .course-btn-1 {
    top: 9%;
    right: 9%;
  }
  
  .course-btn-2 {
    top: 9%;
    right: 30%;
  }
  
  .course-btn-3 {
    top: 9%;
    left: 30%;
  }
  
  .course-btn-4 {
    top: 9%;
    left: 9%;
  }
}

@media (max-width: 480px) {
  .course-btn {
    padding: 8px 12px;
    min-width: 80px;
    min-height: 140px;
    border-radius: 5px;
    /* Make buttons more visible on small screens */
    background: rgba(255, 255, 255, 0.15);
    border: 0px solid rgba(255, 255, 255, 0.4);
  }
  
  .course-btn:hover, .course-btn:active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
  }
  
  .course-btn-label {
    font-size: 11px;
    font-weight: bold;
  }
  
  /* Adjusted positioning for small mobile screens */
  .course-btn-1 {
    top: 9%;
    right: 9%;
  }
  
  .course-btn-2 {
    top: 9%;
    right: 30%;
  }
  
  .course-btn-3 {
    top: 9%;
    left: 30%;
  }
  
  .course-btn-4 {
    top: 9%;
    left: 9%;
  }
}

/* Add touch-friendly styles for mobile */
@media (max-width: 768px) {
  .course-btn {
    /* Ensure buttons are easily tappable */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  }
  
  /* Add visual feedback for touch */
  .course-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* Improve lightbox for mobile */
  #lightbox .relative {
    max-width: 95vw;
    max-height: 90vh;
    margin: 0;
  }
  
  #lightbox-img {
    max-height: 80vh;
  }
  
  #lightbox-close {
    top: 5px;
    right: 5px;
    padding: 8px;
    font-size: 20px;
    /* Make close button more touch-friendly */
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #lightbox-title {
    top: 5px;
    left: 5px;
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Event Highlight Section Styles */
.event-highlight {
    /* padding: 80px 0; */
    background-color: #f7f7f7;
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
}

.highlight-container {
    display: flex;
    align-items: stretch; /* Ensures both columns are the same height */
    /* gap: 50px; */ /* Ensure this is removed or 0 if it was there */
    max-width: 100%; /* This is good, similar to reference's content constraint */
    /* margin: 0 auto; */
}

.highlight-text {
    flex: 40%;
    /* background-color: #efe9d2; */
    padding: 60px 50px; /* Added substantial padding. Adjust as needed. Reference uses ~80px top/bottom, ~60px sides */
    display: flex; /* To control alignment of content within */
    flex-direction: column; /* Stack text elements vertically */
    justify-content: center; /* Vertically center the text block */
}

.highlight-text h2 {
    font-size: 2rem;
    color: #900809;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}

.highlight-text .highlight-subtitle {
    font-size: 1.2rem;
    color: #c1201e;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.highlight-text p {
    font-size: 1.1rem;
    color: #900809;
    margin-bottom: 30px;
    line-height: 1.7;
}

.learn-more-button {
    display: inline-block;
    background-color: #900809;       /* Bold red background like in the image */
    color: #fff;                     /* White text */
    padding: 15px 40px;              /* Generous padding for bold appearance */
    text-decoration: none;
    font-weight: 900;                /* Extra bold font weight */
    font-size: 1.2rem;               /* Larger font size for impact */
    border-radius: 8px;              /* Slightly rounded corners */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;             /* Increased letter spacing for bold look */
    border: none;                    /* No border for clean look */
    align-self: flex-start;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.4); /* Red shadow for depth */
    font-family: 'Arial Black', Arial, sans-serif; /* Bold font family */
}

.learn-more-button:hover {
    background-color: #D32F2F;       /* Darker red on hover */
    transform: translateY(-2px);     /* Subtle lift effect */
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.6); /* Enhanced shadow on hover */
    color: #fff;                     /* Keep white text on hover */
}

.highlight-image {
    flex: 60%;
    /* height: auto; */ /* This is fine, will stretch due to align-items: stretch on parent */
    display: flex; /* Keeps image centered if it's not 100% width/height, though img style below handles it */
    /* align-items: center; */ /* Not strictly necessary if img is 100% height */
    /* justify-content: center; */ /* Not strictly necessary if img is 100% width */
}

.highlight-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* border-radius: 8px; */ /* Reference image does not have rounded corners */
    /* box-shadow: 0 4px 20px rgba(0,0,0,0.15); */ /* Reference image does not have a shadow */
}

/* Responsive adjustments for Event Highlight Section */
@media (max-width: 992px) { /* Adjust breakpoint as needed, e.g. for tablets */
    .highlight-text h2 {
        font-size: 2rem;
    }
    .highlight-text .highlight-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) { /* For smaller tablets and mobile */
    .event-highlight {
        padding: 50px 0;
    }
    
    .highlight-container {
        flex-direction: column;
        /* gap: 30px */
    }

    .highlight-text {
        /* padding-right: 0;
        text-align: center; */
        flex-basis: auto; /* Reset flex-basis for stacked layout */
        padding: 40px 20px; /* Adjust padding for mobile */
        text-align: center;
    }

    .highlight-image {
        /* max-width: 100%; */
        flex-basis: auto;
    }

    .highlight-text h2 {
        font-size: 1.8rem;
    }
    
    .learn-more-button {
        padding: 8px 18px;
        align-self: center; /* Center button on mobile if text is centered */
        font-size: 1.1rem;
        padding: 12px 30px;
        letter-spacing: 1.5px;
    }

    /* Responsive styles for fullscreen header */
    .header-image-fullscreen {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
  
  #main-header.scrolled .header-image-fullscreen {
    max-height: 50px; /* Smaller height on mobile when scrolled */
  }
  
  .logo-wrapper-fullscreen .container {
    padding: 10px 15px; /* Add some padding on mobile */
  }
}

@media (max-width: 480px) {
  #main-header.scrolled .header-image-fullscreen {
    max-height: 40px; /* Even smaller on very small screens */
  }
  
  .learn-more-button {
        font-size: 1rem;
        padding: 10px 25px;
        letter-spacing: 1px;
    }
}

/* Updated yellow background color */
.bg-yellow {
  background-color: #c1201e !important;
}

/* Center-align text in the Event Highlight section */
.text-event-highlight {
  text-align: center;
}

/* Main Header Styles */
#main-header {
  position: -webkit-sticky; /* Safari */
  position: sticky;
  top: 0;
  z-index: 1001;
  background-color: white;
  transition: all 0.3s ease;
  width: 100%;
}

/* Navigation bar - sticky behavior */
#main-header nav {
  background-color: #000000;
  color: #ffffff;
  border-bottom: 1px solid #333333;
  position: relative;             /* Changed from sticky since header is already sticky */
  z-index: 1001;                 /* High z-index for visibility */
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Add shadow when sticky */
}

/* Top header styling (now part of fixed header) */
.top_header {
  position: relative; /* Changed from sticky since main header is fixed */
  width: 100%;
  z-index: 1001;
}

/* Logo wrapper for smooth resizing */
.logo-wrapper {
  transition: padding 0.3s ease-in-out; /* More specific transition */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  background-color: white;
}

/* Fullscreen logo wrapper */
.logo-wrapper-fullscreen {
  transition: all 0.3s ease-in-out;
  background-color: white;
  width: 100%;
  padding: 0;
}

/* Header image fullscreen styles */
.header-image-fullscreen {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: all 0.3s ease-in-out;
}

/* Remove logo wrapper styling for scrolled state - no longer needed */

/* Logo resizing on scroll */
/* #main-header img {
  transition: max-height 0.3s ease-in-out;
  max-height: 300px;
  width: auto;
} */
 #main-header .header-logo-link img {
  transition: max-height 0.3s ease-in-out;
  max-height: 300px;
  width: auto;
  margin-top: 18px;
}

#main-header.scrolled img {
  max-height: 70px; /* Smaller fixed height */
}

/* Override for fullscreen header image */
#main-header .header-image-fullscreen {
  max-height: none; /* Remove height restriction for fullscreen */
  width: 100%;
  height: auto;
}

#main-header.scrolled .header-image-fullscreen {
  max-height: 70px; /* Apply height restriction when scrolled */
  width: auto;
}

/* Remove old navigation styling - already updated above */

/* Navigation links styling for sticky nav */
#sticky-nav a {
  color: #ffffff;
  font-weight: 500;
  transition: color 0.3s ease;
}

#sticky-nav a:hover {
  color: #fbbf24; /* yellow-400 */
  text-decoration: underline;
}

/* Mobile menu styling for sticky nav */
#sticky-nav #menu-links {
  background-color: #000000;
}

/* Navigation responsive text sizing and spacing */
.nav-links {
  font-size: 14px;
  white-space: nowrap;
}

.nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 0.5rem 0.75rem;
}

/* Mobile Navigation Improvements */
@media (max-width: 767px) {
  .nav-container {
    max-width: 100%;
    padding: 0 10px;
  }
  
  #menu-links {
    background-color: #000000;
    border-top: 1px solid #333333;
    max-width: 100%;
    left: 0;
    right: 0;
  }
  
  .nav-link {
    color: #ffffff;
    padding: 12px 20px;
    border-bottom: 1px solid #333333;
    font-size: 16px;
    white-space: normal;
    text-align: center;
    display: block;
    width: 100%;
  }
  
  .nav-link:hover {
    background-color: #333333;
    color: #fbbf24;
  }
  
}

/* Very small screens */
@media (max-width: 480px) {
  .nav-link {
    font-size: 14px;
    line-height: 1.3;
    padding: 10px 15px;
  }

}

/* Ensure navigation text doesn't wrap on desktop */
@media (min-width: 768px) {
  .nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  
  #menu-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  
  .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* For very wide screens, ensure optimal spacing */
@media (min-width: 1600px) {
  .nav-container {
    max-width: 1800px;
  }
  
  .nav-links {
    font-size: 17px;
  }
  
  .nav-link {
    padding: 0.5rem 1.5rem;
  }
  
  #menu-links {
    gap: 2rem;
  }
}

/* Responsive navigation adjustments */
@media (max-width: 768px) {
  :root {
    --nav-height: 70px; /* Slightly taller nav on mobile */
  }
}

@media (max-width: 480px) {
  :root {
    --nav-height: 65px;
  }
}

/* Sticky Navigation Logo Styles */
.sticky-nav-logo {
  width: 150px;
  height: auto;
  max-width: 90%;
  display: block;
  margin: 0 auto;
}

/* Responsive adjustments for sticky nav logo */
@media (max-width: 768px) {
  .sticky-nav-logo {
    width: 250px;
  }
  #main-header .header-logo-link img {
    transition: max-height 0.3s ease-in-out;
    max-height: 120px;
    width: auto;
    margin-top: 0px;
  }
}

@media (max-width: 480px) {
  /* .sticky-nav-logo {
    width: 200px;
  } */
}

/* Dropdown Menu Styles */
/* Default state for dropdown menu items is managed by Tailwind classes in HTML */
/* e.g., hidden, static, md:absolute etc. */

/* Desktop hover effect for dropdowns */
@media (min-width: 768px) { /* md breakpoint from Tailwind */
  .dropdown:hover .dropdown-menu {
    display: block; /* Show dropdown on hover */
  }
  .dropdown:hover > a .fas.fa-chevron-down {
    transform: rotate(180deg); /* Rotate chevron on hover */
  }
  /* Desktop specific positioning is primarily handled by Tailwind classes in the HTML 
     (e.g., md:absolute, md:bg-white, md:shadow-lg, md:rounded, md:mt-1, md:w-auto, md:min-w-max) */
}

/* Ensure text wrapping is handled for dropdown items if they become too long */
.dropdown-menu a {
  white-space: nowrap; /* Original style, keep if desired */
  /* Consider changing to 'normal' if nowrap causes issues on small dropdowns */
}

/* Chevron transition - applies to both hover and potential JS-driven rotation */
.dropdown > a .fas.fa-chevron-down {
  transition: transform 0.2s ease-in-out;
}

#lightbox {
  z-index: 1001;
}

/* Gallery Lightbox Styles */
#gallery-lightbox {
  z-index: 1003;
  backdrop-filter: blur(5px);
}

#gallery-lightbox .lightbox-container {
  position: relative;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  max-height: 90vh;
}

#gallery-lightbox-img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

#gallery-lightbox-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

#gallery-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

#gallery-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

#gallery-lightbox-prev,
#gallery-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

#gallery-lightbox-prev {
  left: 20px;
}

#gallery-lightbox-next {
  right: 20px;
}

#gallery-lightbox-prev:hover,
#gallery-lightbox-next:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

/* Gallery thumbnail styling */
.gallery-item {
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Mobile viewport fixes */
* {
  box-sizing: border-box;
}

/* Prevent mobile viewport zoom issues */
@media screen and (max-width: 768px) {
  html, body {
    max-width: 100vw;
    /* overflow-x: hidden; */ /* Remove this as it can break sticky */
  }
  
  /* Ensure all containers don't exceed viewport width */
  .container,
  .header-container,
  .nav-container,
  .highlight-container {
    max-width: 100vw;
    /* overflow-x: hidden; */ /* Remove this as it can break sticky */
  }
  
  /* Prevent images from causing horizontal scroll */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Prevent text from causing horizontal scroll */
  * {
    word-wrap: break-word;
    word-break: break-word;
  }
}

/* Prevent zoom on double tap for mobile Safari */
@media screen and (max-width: 768px) {
  button, input, select, textarea {
    touch-action: manipulation;
  }
  
  /* Prevent zoom on form elements */
  input, textarea, select {
    font-size: 16px !important; /* iOS won't zoom if font-size is 16px or larger */
  }
}

/* New Course Distance Grid Layout */
.course-distance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  height: auto;
  align-items: center;
  justify-items: center;
}

.course-distance-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  height: 400px;
  max-width: 280px;
}

.course-distance-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.course-distance-btn:active {
  transform: scale(0.98);
}

.course-distance-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: all 0.3s ease;
}

.course-distance-btn:hover .course-distance-img {
  transform: scale(1.02);
}

/* Grid positioning - all in one row for big screens */
.course-distance-btn-1 {
  grid-column: 1;
  grid-row: 1;
}

.course-distance-btn-2 {
  grid-column: 2;
  grid-row: 1;
}

.course-distance-btn-3 {
  grid-column: 3;
  grid-row: 1;
}

.course-distance-btn-4 {
  grid-column: 4;
  grid-row: 1;
}

/* Medium screens (under 900px) - 2 buttons per row */
@media (max-width: 900px) {
  .course-distance-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 800px;
  }
  
  .course-distance-btn {
    width: 100%;
    min-width: 200px;
    max-width: 400px;
    height: 300px;
    border-radius: 10px;
  }
  
  /* Medium screen positioning - 2x2 grid */
  .course-distance-btn-1 {
    grid-column: 1;
    grid-row: 1;
  }

  .course-distance-btn-2 {
    grid-column: 2;
    grid-row: 1;
  }

  .course-distance-btn-3 {
    grid-column: 1;
    grid-row: 2;
  }

  .course-distance-btn-4 {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Small screens (under 500px) - single button per row */
@media (max-width: 500px) {
  .course-distance-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1rem;
    max-width: 100%;
  }
  
  .course-distance-btn {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    height: 400px;
    border-radius: 8px;
  }
  
  /* Small screen positioning - single column */
  .course-distance-btn-1 {
    grid-column: 1;
    grid-row: 1;
  }

  .course-distance-btn-2 {
    grid-column: 1;
    grid-row: 2;
  }

  .course-distance-btn-3 {
    grid-column: 1;
    grid-row: 3;
  }

  .course-distance-btn-4 {
    grid-column: 1;
    grid-row: 4;
  }
}

/* Custom styles for registration fee section */
.section-title {
  color: #90080A;
  padding-left: 9%;
}

.section-sub-title {
  color: #030302;
  padding-left: 9%;
}

.section-text {
  color: #030302;
  padding-left: 1%;
  padding-right: 1%;
  background-color: rgba(237, 231, 209, 0.5);
  border-radius: 2px;
  padding-top: 15px;
  padding-bottom: 15px;
  margin: 20px 9%;
}

img.bg-opacity {
  background-color: rgba(237, 231, 209, 0.5);
}