@import url('css/theme.css');

/* Global Variables & Theme Colors */
:root {
  --theme-red: #e73e3a;
  --theme-dark-grey: #333;
  --theme-accent-gold: #ffc107;

  /* Essential color palette */
  --mud-brown: #8b4513;
  --forest-green: #2e4f2e;
  --cream: #f5f0e6;
  --autumn-orange: #d35400;
  --moss-green: #4a6b4a;
  --sand: #e6d5ac;
  --deep-forest: #1b3d1b;

  --header-height-desktop: 90px;
  --header-height-mobile: 60px; /* Adjusted based on mobile header styles */
  --base-font-size: 16px; /* Base for rem calculations */
}

/* General Styles */
body {
  font-family: 'Arial', sans-serif;
  font-size: var(--base-font-size);
  margin: 0;
  padding: 0;
  line-height: 1.7; /* Slightly increased for overall readability */
  color: var(--theme-dark-grey);
  padding-top: var(--header-height-desktop);
  background-color: #6b4f36; /* earthy brown placeholder, replace with image later */
  overflow-x: hidden;
  background-image: url('images/background.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
}

header {
  background: var(--color-primary);
  background-image:
    url('images/mud-splatter.svg'), linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 0 100%);
  background-repeat: repeat, no-repeat;
  background-size:
    320px 180px,
    100% 100%;
  border-bottom: 6px solid var(--color-accent);
  box-shadow:
    0 8px 0 0 rgba(30, 58, 138, 0.13),
    0 0 0 8px rgba(30, 58, 138, 0.08);
  position: fixed;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4%;
  height: var(--header-height-desktop);
  top: 0;
  left: 0;
  box-sizing: border-box;
  transition: height 0.3s ease;
}

header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: url('images/mud-splatter.svg');
  background-size: 320px 24px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 2;
  filter: blur(1px);
  border-radius: 0 0 12px 12px;
}

.logo-container .surface-logo {
  height: 45px; /* Slightly increased for better presence */
  display: block;
  transition: height 0.3s ease;
}

/* Note: Navigation styles moved to component files */

main {
  display: grid;
  grid-template-rows: auto;
  /* No gap, no extra spacing */
  background: none;
}

section,
#schedule,
#course,
.hero {
  border-radius: 22px;
  box-shadow:
    0 16px 48px 0 rgba(44, 62, 80, 0.22),
    0 2px 16px 0 rgba(44, 62, 80, 0.18),
    0 -2px 8px 0 rgba(255, 255, 255, 0.18) inset;
  background: #fff;
  margin: 10px 12px;
  border: none;
  width: auto;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}

section::before,
#schedule::before,
#course::before,
.hero::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 2;
}

section {
  padding: 70px 4%;
  border-bottom: none;
  opacity: 0;
  transform: translateY(50px) rotate(-1deg); /* Start slightly more off-screen and rotated for a 'splatter' feel */
  transition:
    opacity 0.6s ease-out,
    transform 0.7s ease-out;
  margin-bottom: 10px;
  margin-top: 0;
}

/* Reduce padding for specific sections (excluding hero and sponsors) */
#about,
#schedule,
#course,
#register,
#contact {
  padding: 30px 4%;
}

section.visible {
  opacity: 1;
  transform: translateY(0) rotate(0); /* Ensure rotation is reset if applied before visible */
  transition:
    opacity 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* More dynamic easing and duration */
}

section:first-child {
  margin-top: 0;
}

section:last-child {
  margin-bottom: 0;
}

section + .section-divider.tight {
  margin-top: 0;
}

section + .section-divider.tight {
  margin-bottom: 0;
}

.section-divider.tight {
  margin-top: 0;
  margin-bottom: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Montserrat', 'Arial', sans-serif !important;
  font-weight: 700 !important;
}

section > h2 {
  margin-bottom: 1.2em; /* More space below main section titles */
  margin-top: 0.5em; /* More space above main section titles - R3 */
}

/* Hero Section: Two-Tier Layout */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 48px 0 32px 0;
}

/* Top Row: Card + Copy Side by Side */
.hero-top-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3vw;
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
}

.hero-card-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card-logo {
  max-width: 320px;
  width: 100%;
  height: auto;
  box-shadow: 0 8px 32px 0 rgba(30, 58, 138, 0.1);
  border-radius: 18px;
  background: #fff;
}

.hero-copy-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ace-theme-copy {
  display: flex;
  align-items: center;
  gap: 1.2em;
  font-family: 'Cinzel', 'Stardos Stencil', serif;
  font-size: 1rem;
  color: var(--color-dark);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  max-width: 500px;
}

.ace-theme-copy .ace-symbol {
  font-size: 2.2em;
  color: var(--color-secondary);
  font-family: 'Stardos Stencil', 'Cinzel', serif;
  margin: 0 0.5em;
  flex-shrink: 0;
}

.hero-lead {
  margin: 0;
  font-size: 1em;
  font-weight: 400;
  color: var(--color-dark);
  line-height: 1.5;
}

.hero-lead p {
  margin: 0 0 0.8em 0;
}

.hero-lead p:last-child {
  margin-bottom: 0;
}

.hero-lead .winning-hand {
  color: var(--color-primary);
  font-weight: 700;
  font-family: 'Cinzel', 'Stardos Stencil', serif;
  letter-spacing: 0.02em;
}

/* Bottom Section: Title + Countdown Centered */
.hero-bottom-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
}

.prologue-card-title {
  font-family: 'Cinzel', 'Stardos Stencil', serif;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--color-secondary);
  text-shadow: 0 2px 8px rgba(30, 58, 138, 0.08);
}

.cyclocross-subtitle {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.location {
  font-size: 1.25rem;
  color: var(--color-primary);
  font-weight: 600;
  margin: 0;
}

/* Responsive: Stack on mobile */
@media (max-width: 900px) {
  .hero {
    gap: 2rem;
    padding: 32px 0 24px 0;
  }

  .hero-top-row {
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
    padding: 0 1rem;
  }

  .hero-card-side {
    flex: 0 0 40%;
  }

  .hero-copy-side {
    flex: 1 1 60%;
  }

  .hero-card-logo {
    max-width: 180px;
  }

  .ace-theme-copy {
    font-size: 0.85rem;
    padding: 0;
    margin: 0;
  }

  .ace-theme-copy .ace-symbol {
    display: none;
  }

  .prologue-card-title {
    font-size: 2.2rem;
  }

  .cyclocross-subtitle {
    font-size: 1.3rem;
  }
}

/* Footer Card Logo */
.footer-card-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0 16px 0;
  background: none;
}
.footer-card-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  box-shadow: 0 4px 16px 0 rgba(30, 58, 138, 0.08);
  border-radius: 12px;
  background: #fff;
}

/* Footer: Red background to match header */
footer {
  background: var(--color-primary);
  color: var(--color-accent);
  text-align: center;
  padding: 24px 0 12px 0;
  font-size: 1.1em;
  border-top: 4px solid var(--color-secondary);
  margin-top: 0;
}

/* Schedule Section - Refined */
#schedule {
  background-color: var(--sand);
  padding-top: 30px;
  padding-bottom: 30px;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0 12px,
    transparent 12px 24px
  );
  margin: 10px 12px;
  border-radius: 22px;
  box-shadow:
    0 16px 48px 0 rgba(44, 62, 80, 0.22),
    0 2px 16px 0 rgba(44, 62, 80, 0.18),
    0 -2px 8px 0 rgba(255, 255, 255, 0.18) inset;
  box-sizing: border-box;
  overflow-x: hidden;
  width: auto;
  max-width: none;
  padding-left: max(2vw, 32px);
  padding-right: max(2vw, 32px);
}

#schedule h2 {
  text-align: center;
  font-size: clamp(1.7rem, 4.5vw, 2.2rem);
  color: var(--deep-forest);
  margin-bottom: 1em;
  text-transform: uppercase;
}

/* Pre-ride steps styling */
.pre-ride-steps {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 246, 240, 0.95) 100%);
  border: 3px solid var(--theme-red);
  border-radius: 15px;
  padding: 25px;
  margin: 20px auto 30px auto;
  max-width: 700px;
  box-shadow: 0 8px 25px rgba(214, 45, 32, 0.15);
  position: relative;
  overflow: hidden;
}

.pre-ride-steps::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--theme-red),
    var(--autumn-orange),
    var(--theme-accent-gold)
  );
}

.pre-ride-steps h4 {
  color: var(--theme-red);
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Cinzel', serif;
}

.steps-icon {
  font-size: 1.2em;
  margin-right: 8px;
  display: inline-block;
  transform: rotate(-5deg);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: rotate(-5deg) scale(1);
  }
  50% {
    transform: rotate(-5deg) scale(1.1);
  }
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  border-left: 4px solid var(--autumn-orange);
  transition: all 0.3s ease;
}

.step-item:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-number {
  background: linear-gradient(135deg, var(--theme-red), #d62d20);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  font-family: 'Cinzel', serif;
  box-shadow: 0 2px 8px rgba(214, 45, 32, 0.3);
  border: 2px solid white;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content p {
  color: var(--deep-forest);
  font-size: clamp(0.9rem, 2.3vw, 1rem);
  line-height: 1.5;
  margin: 0;
}

.step-content a {
  color: var(--theme-red);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.step-content a:hover {
  color: var(--autumn-orange);
  border-bottom-color: var(--autumn-orange);
}

/* Pre-ride grid styling */
.pre-ride-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px auto 0 auto;
  justify-items: center;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
}

/* Pre-ride grid inside the red box */
.pre-ride-steps .pre-ride-grid {
  margin: 20px auto 0 auto;
  max-width: 100%;
}

/* Medium screens - 2 columns */
@media (max-width: 768px) {
  .pre-ride-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Small screens - 1 column */
@media (max-width: 480px) {
  .pre-ride-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

#schedule h3 {
  font-size: clamp(1.4rem, 3.8vw, 1.7rem);
  font-weight: bold;
  color: var(--mud-brown);
  margin-top: 1.8em; /* More space above date */
  margin-bottom: 1em;
  text-align: center;
}

#schedule .schedule-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin: 30px 0 0 0;
  justify-items: stretch;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* Medium screens - 3 columns */
@media (max-width: 1100px) {
  #schedule .schedule-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* Small screens - 2 columns */
@media (max-width: 768px) {
  #schedule .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 700px) {
  #schedule .schedule-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 18px;
  }
}

#schedule .schedule-item {
  text-align: center;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  padding: 15px;
  background-color: var(--cream);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border: 1px solid var(--mud-brown);
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out;
  overflow-wrap: break-word;
  word-break: break-word;
}

#schedule .schedule-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

#schedule .event-time {
  font-size: clamp(1.4rem, 3.8vw, 1.7rem);
  font-weight: bold;
  color: var(--mud-brown);
  margin-bottom: 8px;
}

#schedule .event-description {
  font-size: clamp(0.85rem, 2.3vw, 0.95rem);
  color: var(--deep-forest);
  margin-bottom: 0;
  border-bottom: 2px solid var(--autumn-orange);
  padding-bottom: 8px;
  display: inline-block;
  min-width: 160px;
}

/* Course Section - Refined */
#course {
  background-color: var(--moss-green);
  color: #fff;
  padding-top: 30px;
  padding-bottom: 30px;
  background-image: url('images/mud-splatter.svg');
  background-repeat: repeat;
  background-size: 320px 180px;
  margin-bottom: 10px;
  margin-top: 0;
}

#course h2 {
  text-align: center;
  font-size: clamp(1.7rem, 4.5vw, 2.2rem);
  color: var(--cream);
  margin-bottom: 1em;
  text-transform: uppercase;
}

#course p {
  font-size: clamp(0.9rem, 2.4vw, 1rem);
  line-height: 1.8; /* Increased for red background */
  margin-bottom: 1.2em; /* More space between paragraphs */
  text-align: justify;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

.course-map {
  max-width: 75%; /* Slightly reduced for balance */
  height: auto;
  display: block;
  margin: 40px auto;
  border: 4px solid var(--cream);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Mobile Responsiveness - Adjustments based on new base values */
@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile);
    font-size: 15px;
  }

  header {
    flex-wrap: nowrap; /* Prevent wrapping */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height-mobile);
    min-height: var(--header-height-mobile);
    padding: 0 3%;
    gap: 0;
  }
  .logo-container {
    order: 1;
    flex: 0 0 auto;
    height: 30px;
    margin-right: 6px;
  }
  .audio-promo-container {
    order: 2;
    flex: 1 1 0;
    justify-content: center;
    margin: 0 4px;
    min-width: 0;
    max-width: 140px;
  }
  .audio-promo-container audio {
    width: 90px;
    min-width: 60px;
    max-width: 100%;
    height: 28px;
    padding: 0;
    background: var(--forest-green);
    border-radius: 16px;
    border: 2px solid var(--theme-accent-gold);
    color-scheme: dark;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.13);
  }
  .audio-text {
    display: none;
  }
  #menu-toggle {
    order: 3;
    flex: 0 0 auto;
    margin-left: 6px;
    align-self: center;
  }

  .logo-container .surface-logo {
    height: 100%;
    width: auto;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 25px 0;
    min-height: auto;
  }

  .hero-bg-side {
    min-height: 180px;
    width: 100%;
    flex-basis: auto;
  }

  .hero-content-side {
    padding: 25px 5vw;
    flex-basis: auto;
    gap: 12px;
  }

  #schedule .schedule-grid {
    grid-template-columns: 1fr;
    gap: 25px 0;
  }
  #schedule .schedule-item {
    padding: 12px;
  }

  #course p {
    text-align: left;
    padding: 0 4%;
  }
  .course-map {
    max-width: 90%;
    border-width: 3px;
  }

  section {
    padding: 45px 4%;
  }

  /* Reduce mobile padding for specific sections (excluding hero and sponsors) */
  #about,
  #schedule,
  #course,
  #register,
  #contact {
    padding: 20px 4%;
  }

  /* Mobile-specific overrides for sections with separate top/bottom padding */
  #schedule {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  #course {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  #register,
  #contact {
    padding: 20px 20px;
  }

  /* Note: Navigation styles moved to component files */
  .section-divider {
    display: none;
  }

  #schedule .event-description {
    min-width: 0;
    width: 100%;
    display: block;
    box-sizing: border-box;
    word-break: break-word;
  }

  #schedule,
  #schedule .schedule-grid,
  #schedule .schedule-item {
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  #schedule .event-description,
  #schedule .event-time {
    min-width: 0 !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow: visible !important;
  }
  #schedule .schedule-item * {
    word-break: break-word !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  /* Ensure main sections are fully visible with margin on both sides */
  .hero,
  #schedule,
  #course {
    margin-left: 3vw !important;
    margin-right: 3vw !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  /* Ensure children do not overflow */
  #schedule .schedule-grid,
  #course > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: visible !important;
  }

  /* Remove any 100vw/max-width: 100vw on these sections/children */
  .hero,
  #schedule,
  #course,
  #schedule .schedule-grid {
    max-width: none !important;
    width: auto !important;
  }

  .audio-play-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
    margin-right: 4px !important;
  }
}

/* Hamburger menu styles (base, open states) - mostly adjusted sizing above */
/* Mobile nav styles (positioning, animation) - mostly adjusted sizing above */

/* Desktop: hide hamburger, ensure nav is flex - styles moved to component files */
@media (min-width: 769px) {
  header {
    height: var(--header-height-desktop); /* Restore fixed height for desktop */
    flex-wrap: nowrap; /* Prevent wrapping on desktop */
  }
  .logo-container .surface-logo {
    height: 45px; /* Desktop logo size */
  }
  .audio-promo-container {
    order: 0; /* Reset order for desktop if needed, default flow should work */
    flex-basis: auto; /* Reset flex-basis */
    margin: 0 25px; /* Desktop margin */
  }
}

.event-logo-container {
  display: none;
}

/* Audio Promo Link Styles - Refined */
.audio-promo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-promo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--theme-medium-grey); /* Harmonized color */
  font-weight: bold;
  padding: 8px 12px; /* Adjusted padding */
  border-radius: 6px; /* Slightly more rounded */
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out;
  border: 1px solid transparent;
  background-color: transparent;
}

.audio-promo-link:hover,
.audio-promo-link:focus {
  background-color: var(--theme-red);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.audio-icon {
  font-size: 1.25rem; /* Harmonized size */
  margin-right: 7px;
  line-height: 1;
}

.audio-text {
  font-size: 1.1rem;
  color: var(--cream);
  font-weight: 600;
  text-shadow:
    0 2px 8px rgba(44, 62, 80, 0.18),
    0 1px 0 #0002;
  display: inline;
  margin-left: 8px;
  white-space: nowrap;
}

.audio-text .listen-emoji {
  font-size: 1.5em;
  color: var(--theme-accent-gold);
  vertical-align: middle;
  margin-right: 6px;
  text-shadow:
    0 2px 8px rgba(255, 193, 7, 0.18),
    0 1px 0 #0002;
}

/* Add a new rule for initial state of section before it becomes visible to have the rotation */
section:not(.visible) {
  transform: translateY(50px) rotate(-1deg);
  opacity: 0;
}

/* Mud Splatter Particle Styles - moved to animations.css */

/* Interactive Map Styles */
.interactive-map-container {
  position: relative;
  max-width: 100%;
  margin: 40px auto;
  overflow: hidden;
  border-radius: 8px;
  /* Ensure entire map fits into view */
  text-align: center;
}

.course-map {
  display: block;
  max-width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  border: 4px solid var(--cream);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  /* Ensure image is not scaled beyond its actual size */
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
}

.interactive-map-container:hover .course-map {
  /* Remove transform on hover so the map never lifts or moves */
  transform: none !important;
}

.map-hotspots {
  position: absolute;
  /* These values will be set by JavaScript to match the actual image dimensions */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
}

.hotspot-dot {
  display: block;
  width: 16px;
  height: 16px;
  background-color: #ffc107; /* Yellow accent */
  border-radius: 50%;
  margin: 0 auto;
  box-shadow: 0 0 0 6px rgba(255, 193, 7, 0.4);
  transition: all 0.3s ease;
  animation: pulse 1.2s infinite;
}

.hotspot:hover .hotspot-dot {
  transform: scale(1.5);
  box-shadow: 0 0 0 12px rgba(255, 193, 7, 0.5);
  animation: none;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    opacity: 1;
  }
  50% {
    transform: scale(1.7);
    box-shadow: 0 0 0 18px rgba(255, 193, 7, 0);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    opacity: 1;
  }
}

/* Info panel next to dot */
.map-info-panel {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s,
    transform 0.3s;
  z-index: 10;
  min-width: 220px;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  padding: 15px;
}

.map-info-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* Prevent info panel from going offscreen */
.map-info-panel.edge-right {
  transform-origin: left center;
  transform: translate(20px, -50%) scale(1);
}

.map-info-panel.edge-left {
  transform-origin: right center;
  transform: translate(-120%, -50%) scale(1);
}

.map-info-panel.edge-top {
  transform-origin: center bottom;
  transform: translate(-50%, 20px) scale(1);
}

.map-info-panel.edge-bottom {
  transform-origin: center top;
  transform: translate(-50%, -120%) scale(1);
}

.info-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  cursor: pointer;
  color: var(--theme-medium-grey);
}

.info-content {
  display: none;
}

.info-content h4 {
  color: var(--theme-red);
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 1.1rem;
}

.info-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--theme-dark-grey);
}

/* Mobile Adjustments for Interactive Map */
@media (max-width: 768px) {
  .hotspot {
    width: 36px;
    height: 36px;
  }

  .hotspot-dot {
    width: 18px;
    height: 18px;
  }

  .map-info-panel {
    min-width: 160px;
    max-width: 250px;
    font-size: 0.85em;
    padding: 12px;
  }

  .info-content h4 {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .info-content p {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .info-close {
    font-size: 18px;
    top: 8px;
    right: 8px;
  }
}

/* Section angled dividers */
.section-divider {
  width: 100%;
  height: 40px;
  background: linear-gradient(135deg, var(--cream) 60%, var(--sand) 100%);
  clip-path: polygon(0 0, 100% 100%, 100% 100%, 0 100%);
  margin: 0;
  border: none;
  display: block;
}

.section-divider.tight {
  margin-top: 0;
  margin-bottom: 0;
}

nav#main-nav a {
  color: var(--cream) !important;
  text-shadow:
    0 2px 8px rgba(44, 62, 80, 0.18),
    0 1px 0 #0002;
}

nav#main-nav a:hover,
nav#main-nav a:focus,
nav#main-nav a.active,
nav#main-nav a[aria-current='page'] {
  color: var(--theme-accent-gold) !important;
  text-shadow:
    0 2px 12px rgba(255, 193, 7, 0.18),
    0 1px 0 #0002;
}

nav#main-nav .menu-icon {
  color: var(--cream) !important;
  filter: drop-shadow(0 2px 4px #0004);
}

nav#main-nav a:hover .menu-icon,
nav#main-nav a:focus .menu-icon,
nav#main-nav a.active .menu-icon,
nav#main-nav a[aria-current='page'] .menu-icon {
  color: var(--theme-accent-gold) !important;
  filter: drop-shadow(0 2px 8px #ffc10788);
}

.audio-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue-medium);
  border: 3px solid #ffffff;
  color: #ffffff;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  font-size: 2.1rem;
  box-shadow: 0 2px 10px rgba(44, 62, 80, 0.18);
  cursor: pointer;
  margin-right: 10px;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.15s;
  outline: none;
  position: relative;
  z-index: 1;
  animation: play-btn-pulse 1.2s infinite;
}
.audio-play-btn:focus,
.audio-play-btn:hover {
  background: #ffffff;
  color: var(--color-blue-medium);
  border-color: var(--color-blue-medium);
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.22);
  transform: scale(1.08);
}
.audio-play-btn:active {
  background: #ffffff;
  color: var(--color-blue-medium);
  border-color: var(--color-blue-medium);
  transform: scale(0.96);
}
.audio-play-btn i.fas.fa-play,
.audio-play-btn i.fas.fa-pause {
  color: inherit;
  filter: none;
  opacity: 1;
  font-size: 0.9em;
  animation: icon-pulse-white 1.2s infinite;
  align-self: center;
  justify-self: center;
}
@keyframes play-btn-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* --- Section grid utility for two-column layouts --- */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 900px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Visually hidden skip link, visible on focus */
.skip-link {
  display: none !important;
}

/* Ensure all buttons and links have a visible focus style */
button:focus,
.audio-play-btn:focus,
.hotspot:focus,
.info-close:focus,
a:focus {
  outline: 2px solid #e73e3a;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px #e73e3a;
}

button,
.hotspot,
.info-close,
.audio-play-btn,
.cta-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hotspot,
.info-close,
.audio-play-btn {
  min-width: 48px;
  min-height: 48px;
}

@media (max-width: 768px) {
  .info-close {
    padding: 8px 12px;
  }
}

.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(245, 240, 230, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}
.spinner {
  border: 6px solid var(--color-background, #f5f0e6);
  border-top: 6px solid var(--color-primary, #e73e3a);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Panel/3D Card Enhancements --- */
.panel,
.card,
.map-info-panel,
#schedule .schedule-item {
  border-radius: 18px !important;
  box-shadow:
    0 8px 32px rgba(44, 62, 80, 0.18),
    0 1.5px 8px rgba(44, 62, 80, 0.1);
  border: 1.5px solid rgba(44, 62, 80, 0.1);
  background: #fff;
}

/* --- Menu Outline Enhancement --- */
header,
nav#main-nav {
  box-shadow:
    0 2px 0 0 var(--theme-accent-gold),
    0 0 0 3px rgba(44, 62, 80, 0.1);
  border-radius: 0 0 18px 18px;
  outline: 2px solid rgba(44, 62, 80, 0.1);
}

/* Register Section Styling */
#register {
  text-align: center;
  padding: 30px 20px;
}

#register h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 2rem;
  color: var(--color-secondary) !important;
}

.register-content {
  max-width: 600px;
  margin: 0 auto;
}

.register-hero {
  margin-bottom: 2rem;
}

.register-icon-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin: 0 auto 1.5rem auto;
  width: 120px;
  height: 120px;
}

.register-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 3px solid var(--color-secondary);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
  animation: dealCards 3s ease-in-out infinite;
  cursor: pointer;
  transition: all 0.3s ease;
}

.register-icon-link:hover .register-icon {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
  transform: scale(1.05);
}

.register-icon-link:focus .register-icon {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
  transform: scale(1.05);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.register-icon .fa-hand-paper {
  font-size: 3rem;
  color: var(--color-secondary);
  margin: 0;
  z-index: 2;
  position: relative;
}

.card-symbols {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  animation: showCards 3s ease-in-out infinite;
}

.card-symbol {
  font-size: 1.5rem;
  font-weight: bold;
  animation: floatCard 3s ease-in-out infinite;
}

.card-symbol.spade {
  color: #000;
  animation-delay: 0s;
}
.card-symbol.heart {
  color: #d62d20;
  animation-delay: 0.2s;
}
.card-symbol.diamond {
  color: #d62d20;
  animation-delay: 0.4s;
}
.card-symbol.club {
  color: #000;
  animation-delay: 0.6s;
}

.register-tagline {
  font-family: 'Stardos Stencil', 'Cinzel', serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-secondary);
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.register-description {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-dark);
  margin-top: 1.5rem;
  font-weight: 500;
}

.register-cta {
  margin-top: 2rem;
}

.register-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--color-secondary), #1e40af);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 1.5rem 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
  border: 2px solid transparent;
}

.register-button:hover {
  background: linear-gradient(135deg, #1e40af, var(--color-secondary));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.register-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(30, 58, 138, 0.3);
}

.register-button i {
  font-size: 1.2rem;
}

.register-note {
  font-size: 0.9rem;
  color: white;
  margin-top: 1rem;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Register Animations */
@keyframes dealCards {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  75% {
    transform: scale(1.1) rotate(-2deg);
  }
}

@keyframes showCards {
  0%,
  30% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  40%,
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  90%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(5deg);
  }
  50% {
    transform: translateY(-4px) rotate(-3deg);
  }
  75% {
    transform: translateY(-6px) rotate(2deg);
  }
}

/* Mobile responsiveness for register section */
@media (max-width: 768px) {
  .register-icon-link {
    width: 100px;
    height: 100px;
  }

  .register-icon {
    width: 100%;
    height: 100%;
  }

  .register-icon .fa-hand-paper {
    font-size: 2.5rem;
  }

  .card-symbols {
    gap: 0.3rem;
  }

  .card-symbol {
    font-size: 1rem;
  }

  .register-tagline {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }

  .register-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    margin: 1rem 0;
  }

  .register-button i {
    font-size: 1.1rem;
  }
}

/* Contact Section Styling */
#contact {
  text-align: center;
  padding: 30px 20px;
}

#contact h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 1rem;
}

.contact-content {
  max-width: 900px;
  margin: 0 auto;
}

.contact-intro {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  margin-bottom: 3rem;
  font-weight: 500;
  color: var(--color-dark);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.contact-item {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.1);
  border: 2px solid rgba(30, 58, 138, 0.1);
  transition: all 0.3s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.contact-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.contact-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.15);
  border-color: var(--color-secondary);
}

.contact-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(214, 45, 32, 0.2);
}

.contact-icon i {
  font-size: 1.5rem;
  color: white;
}

.contact-info h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
  font-family: 'Stardos Stencil', 'Cinzel', serif;
}

.contact-info a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.contact-info a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

.contact-info p {
  color: var(--color-dark);
  margin: 0.5rem 0;
  line-height: 1.6;
}

.social-description {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  margin-top: 0.3rem;
}

.contact-outro {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-top: 3rem;
  font-weight: 500;
  color: var(--color-dark);
  font-style: italic;
}

/* Mobile responsiveness for contact section */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-item {
    padding: 1.5rem;
    text-align: center;
  }

  .contact-icon {
    margin: 0 auto 1.5rem auto;
  }
}

/* Stylized Blue Quotes */
.blue-quotes {
  position: relative;
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* Keep the text color as the default brown color from the h3 */
}

.blue-quotes::before,
.blue-quotes::after {
  content: '"';
  font-family: 'Cinzel', serif;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--color-secondary);
  text-shadow:
    0 2px 4px rgba(30, 58, 138, 0.3),
    0 0 8px rgba(30, 58, 138, 0.2);
  position: relative;
  top: -0.1em;
}

.blue-quotes::before {
  margin-right: 0.1em;
  transform: rotate(-5deg);
  display: inline-block;
}

.blue-quotes::after {
  margin-left: 0.1em;
  transform: rotate(5deg);
  display: inline-block;
}

/* Add subtle animation on hover */
.blue-quotes:hover::before,
.blue-quotes:hover::after {
  color: var(--color-primary);
  text-shadow:
    0 3px 6px rgba(231, 62, 58, 0.4),
    0 0 12px rgba(231, 62, 58, 0.3);
  transition: all 0.3s ease;
}

/* Responsive sizing for mobile */
@media (max-width: 768px) {
  .blue-quotes::before,
  .blue-quotes::after {
    font-size: 1.2em;
  }
}
