:root {
  --background: #f7f1e5;
  --background: oklch(95.95% 0.0172 84.59);
  --grid: oklch(0.8 0.003 255 / 0.1);

  --backdrop-blur: blur(8px);

  --light-gold: #D3C8A3;
  --light-button: #C6B586;

  --dark-gold: hsl(47, 52%, 26%);
  --espresso: #4A4033;
  --success-green: #5B6E5D;
  --error-red: #7D5D4C;
  --hero-transition: 300px;
  --section-transition: 100px;

  --carousel-card-width: 450px;
  --carousel-gap: 1.5rem;

  --fancy-header-font: "Stix Two Text", serif;
}

html {
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Box-sizing reset: https://css-tricks.com/box-sizing/ */
*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  overflow-x: hidden; /* Prevent page-level horizontal scrollbars globally */
  width: 100%;
  position: relative;
  color: #fff;
  background-color: var(--background);
  /* Grid */
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size:
    13px 13px,
    13px 13px;
  background-repeat: repeat, repeat; 

  /* Typography */
  font-family: "Inter", sans-serif;
  font-weight: 350;
  font-size: 16px;
  line-height: 160%;
  letter-spacing: 0%;
  text-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 1px rgba(0, 0, 0, 0.1);
}


h1 {
  font-family: "Latin Modern Roman", serif;
  font-weight: 400;
  font-size: 60px;
  line-height: 100%;
  letter-spacing: 0%;
}

button {
  font-family: "Inter", sans-serif;
  font-weight: 350;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  text-decoration: underline dotted;
  color: var(--dark-gold);
}

.site-header {
  background-color: color-mix(in hsl, var(--dark-gold) 60%, transparent);
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1000;
}

.backdrop-blur {
  -webkit-backdrop-filter: var(--backdrop-blur);
  backdrop-filter: var(--backdrop-blur);

}

.dark-shadow {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
}

.light-shadow {
  text-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 1px rgba(0, 0, 0, 0.1);
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-shadow: none;
  z-index: 2000;
}

.logo {
  max-width: 100%;
}

.logo img {
  display: block;
  max-height: 45px;
  height: auto;
  width: auto;
  object-fit: contain;
}

.main-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: #fff;
  font-weight: 350;
}

.login-button {
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid #fff;
  border-radius: 4px;
  text-decoration: none;
  color: #fff;
}

/* Mobile Navigation Styles */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
  width: 2rem;
  height: 0.25rem;
  background: #fff;
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

.mobile-menu-toggle.open .hamburger-line:first-child {
  transform: rotate(45deg);
}

.mobile-menu-toggle.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg);
}

.mobile-menu-toggle.open {
  outline: none;
}

.mobile-menu-toggle.open:focus {
  outline: none;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: color-mix(in hsl, var(--dark-gold) 50%, transparent);
  z-index: 1500;
  padding-top: 88px;
  padding-bottom: 2rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-shadow: none;
}

.mobile-nav.open {
  transform: translateY(0);
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.mobile-nav a {
  text-decoration: none;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 350;
  padding: 0.75rem 4.5rem;
  line-height: 200%;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.mobile-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-login-button {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid #fff;
  border-radius: 4px;
}

.spacer {
  height: 100px;
}

#hero {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 0 0 8rem 4rem;
  text-align: left;
  text-shadow: none;
  position: relative; 
  overflow: hidden; 
  min-height: 100vh;
  margin-top: 0;
  background-color: var(--background);
  /* Grid */
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size:
    13px 13px,
    13px 13px;

  background: linear-gradient(
    to bottom,
     black 0%,
     black calc(100% - var(--hero-transition)),
     transparent 100%
  );
}

#hero-graph {
  position: absolute; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;

  -webkit-mask-image: -webkit-gradient(
    linear,
    left top,
    left bottom,
    from(black),
    to(transparent));
	-webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    transparent 100%);
	mask-image: -webkit-gradient(
    linear,
    left top,
    left bottom,
    from(black),
    to(transparent));
	mask-image: linear-gradient(
    to bottom,
    black 0%,
    black calc(100% - var(--hero-transition)),
    transparent 100%);
}

.hero-content {
  width: 50vw;
  text-align: left;
  margin-left: 0;
  margin-right: auto;
  margin-top: 6rem;
  position: relative;
  z-index: 2;
  padding-top: 6rem;

  background-color: hsla(0, 0%, 25%, 0.5);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

@media (max-width: 768px) {
  .hero-content {
    width: calc(100% - 2rem);
    max-width: calc(100vw - 2rem);
    margin-left: 1rem;
    margin-right: 1rem;
    margin-top: 4rem;
    padding-top: 4rem;
  }
}

@media (min-width: 1400px) {
  .hero-content {
    max-width: 840px;
  }
}

.hero-content h1 {
  margin-top: 0;
}

.pre-title {
  font-size: 24px;
  font-weight: 300;
  color: #ccc;
}

.hero-description {
  font-size: 16px;
  color: #ddd;
}

.concept-section {
  padding: 4rem 2rem;
  position: relative;
  min-height: 79vh;
  display: flex;
  gap: 2rem;
}

#concept.concept-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    url('../img/concept-auditorium-illustration-desaturated.png') no-repeat center/cover;
  z-index: 0; /* Behind the concept-container */

  /* Mask to fade top and bottom of this pseudo-element's background */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.8) var(--section-transition),
    rgba(0,0,0,0.8) calc(100% - var(--section-transition)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.8) var(--section-transition),
    rgba(0,0,0,0.8) calc(100% - var(--section-transition)),
    transparent 100%
  );
  mask-composite: intersect;
  -webkit-mask-composite: intersect;
}

.concept-container {
  max-width: 800px;
  position: relative;
  z-index: 2;

  margin: 0 0 auto 0;
}

@media (max-width: 768px) {
  .concept-container {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
}

.concept-container h1 {
  color: var(--dark-gold);
  margin-bottom: 3rem;
  width: 100%;
}

.concept-container p {
  margin-bottom: 1rem;
  color: black;
}

#math.concept-section {
  padding-bottom: 0rem;
  margin-bottom: -2rem;
}

#cs.concept-section {
  padding-top: 0rem;
  margin-top: -2rem;
}

.concept-image img {
  height: 100vh;
  width: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 2;
  filter: saturate(0.6);
  opacity: 0.8;
}

#math > .concept-image {
  display: flex;
  justify-content: center;
  align-items: center; /* Optional: if you want to vertically center the image within its container */
  overflow: hidden; /* Hide any overflow from the image */
  flex-basis: calc(55% - 1rem);
  max-width: 60vw; /* Limit to 50% viewport width */
}

#math > .concept-container {
  justify-content: center;
  align-items: center;
  overflow: auto;
  flex-basis: calc(45% - 1rem);
  padding-right: 2rem; /* Add padding to ensure text doesn't touch edge */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertically center the content */
  min-height: calc(100vh - 4rem); /* Match image height minus section padding */
}

#math > .concept-image,
#math > .concept-container {
  flex-grow: 0;
  flex-shrink: 0;
}

#cs > .concept-image {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  max-width: 60vw;
  flex-basis: calc(60% - 1rem);
}

#cs > .concept-container {
  padding-left: 2rem;
  flex-basis: calc(40% - 1rem);
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertically center the content */
  min-height: calc(100vh - 4rem); /* Match image height minus section padding */
}

#cs > .concept-image,
#cs > .concept-container {
  flex-grow: 0;
  flex-shrink: 0;
}


#courses { /* Parent section of the carousel */
  overflow-x: hidden; /* Important: Prevents section from being expanded by carousel track's visual width */
  overflow-y: visible;
  padding: 4rem 0rem;
  color: black;
}

#courses-intro-row {
  display: flex;
  padding: 0rem 2rem;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

#courses-header-container {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: calc(25% - 0.5rem); /* 25% of total width minus 25% of the 2rem gap */
  color: var(--dark-gold);
}

#courses-intro-container {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: calc(75% - 1.5rem); /* 75% of total width minus 75% of the 2rem gap */
}

/* Course Carousel Styles */
.course-carousel-container {
  overflow-x: auto;
  width: 100%; /* Takes full width of #courses's content box */
  cursor: grab;       /* Visual cue for draggability */
  padding-top: 1rem;    /* Vertical room for scaled cards */
  padding-bottom: 50px; /* Vertical room for scaled cards */
  margin-bottom: -50px;
  position: relative;   /* Good for potential future absolute positioning within carousel */

  /* Hide scrollbar styling */
  &::-webkit-scrollbar {
    display: none;
  }
  scrollbar-width: none;    /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.course-carousel-container.is-dragging {
  cursor: grabbing; /* Feedback when actively dragging */
}

.course-carousel-track {
  display: flex;
  flex-direction: row;
  /* This padding is CRUCIAL for allowing edge cards to center.
     It creates space on either side of the actual cards within the scrollable track.
     Calculation: (50% of container width) - (half of a card's width).
     This means when scrollLeft = 0, the first card can be centered.
  */
  padding-left: calc(50% - (var(--carousel-card-width) / 2));
  padding-right: calc(50% - (var(--carousel-card-width) / 2));
  gap: var(--carousel-gap);
  width: max-content;   /* Allows track to be as wide as its content (cards + gaps + padding) */
  align-items: center;  /* Vertically align items if heights differ due to scaling */
}

.course-card {
  user-select: none; /* Prevent text selection during drag */
  -webkit-user-select: none; /* Prevent default image drag behavior on some browsers */
  
  width: var(--carousel-card-width); /* Use CSS variable */
  background-color: #ffffff;
  border: 1px solid var(--dark-gold); /* Matching border to active state for consistency */
  border-radius: 8px;
  padding: 2rem;
  flex-shrink: 0; /* Prevent cards from shrinking if track width is constrained */
  box-shadow: 4px 10px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  color: #333;

  /* Default visual state for non-centered cards */
  opacity: 0.7;
  transform: scale(0.85);
  transform-origin: center center;
  
  /* Smooth transitions for properties changed by JS or :hover/:focus states */
  transition: transform 0.1s linear, 
              opacity 0.1s linear,
              box-shadow 0.1s linear,
              border-color 0.1s linear;
}

.course-card img { /* Prevent images inside cards from interfering with drag */
    pointer-events: none;
}

.course-card.is-center {
  box-shadow: 14px 20px 15px rgba(0, 0, 0, 0.4);
  border-color: var(--dark-gold); /* Keep distinct styles for the centered card */
}

.course-card .course-icon {
  margin-bottom: 1rem;
}

.course-card .course-icon img {
  width: 60px;
  height: 60px;
}

.course-card h3 {
  font-family: "Latin Modern Roman", serif;
  font-size: 1.75rem;
  color: #000000;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.course-card .course-audience {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1rem;
  min-height: 3em; /* Ensure consistent height for this paragraph */
}

.course-card .course-features {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.course-card .course-features li {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.course-card .course-features li img {
  width: 16px; /* Checkmark icon size */
  height: 16px;
  margin-right: 0.5rem;
  color: var(--dark-gold); /* If it's an SVG, this might color it if not done via filter */
}

.course-card .card-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 1rem 0;
}

.course-card .course-schedule {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 1.5rem;
  flex-grow: 1; /* Pushes the button to the bottom */
}

.course-card .course-schedule p {
  margin: 0.25rem 0;
}

.course-card .register-button {
  background-color: var(--dark-gold);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  font-weight: 350;
  font-size: 16px;
  text-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  width: 100%; /* Make button full width of card padding */
  margin-top: auto; /* Ensures button is at the bottom if schedule content is short */
  display: block; /* Ensure links display as block elements like buttons */
}

.course-card .register-button:hover {
  background-color: hsl(47, 52%, 36%); /* Slightly darker gold on hover */
}

.course-card .register-button.disabled-button {
  background-color: #f0f0f0; /* Light grey for disabled */
  color: #aaa;
  cursor: not-allowed;
}

.course-card .register-button.disabled-button:hover {
  background-color: #f0f0f0; /* No change on hover for disabled */
}

/* Style the third card from your example, the CS card, to have the darker background */
.course-carousel-track .course-card-disabled {
  filter:opacity(0.5);
}

#location.concept-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../img/location.png') no-repeat center/cover;
  z-index: 0; /* Behind the concept-container */

  /* Mask to fade top and bottom of this pseudo-element's background */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.5) var(--section-transition),
    rgba(0,0,0,0.5) 100%
  ),
  linear-gradient(
    to right,
    rgba(0,0,0,0.6) 0%,
    rgba(0,0,0,0.6) 50%,
    black 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.5) var(--section-transition),
    rgba(0,0,0,0.5) 100%
  ),
  linear-gradient(
    to right,
    rgba(0,0,0,0.6) 0%,
    rgba(0,0,0,0.6) 50%,
    black 100%
  );
  mask-composite: intersect;
  -webkit-mask-composite: intersect;
}

/* Map card styling */
#location .map-card {
  background-color: #ffffff;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.07),
    0 2px 4px rgba(0,0,0,0.07),
    0 4px 8px rgba(0,0,0,0.07),
    0 8px 16px rgba(0,0,0,0.07),
    0 16px 32px rgba(0,0,0,0.07);
  transition: transform 0.3s ease;
  width: 80%;
  max-width: 600px;
  min-width: 400px;
  height: 450px;
  position: relative;
  z-index: 10;
  margin-right: 2rem;
  flex: 1;
}

#location .map-card:hover {
  transform: scale(1.02);
}

#location .map-card iframe {
  border-radius: 2px;
}

/* Adjust location section layout to accommodate map */
#location.concept-section {
  justify-content: space-between;
  align-items: center;
}

#location .concept-container {
  max-width: 600px;
  flex: 1;
  margin-right: 2rem;
}

.cta-section {
  background-color: var(--dark-gold);
  text-shadow: none;
}

.cta-container-row {
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.cta-text {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: calc(50% - 1rem);
  margin-left: 10%;
  color: white;
}

.cta-button {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: calc(50% - 1rem);
}

.cta-button > .register-button {
  background-image: linear-gradient(to right, var(--light-gold) 0%, white 100%);
  color: var(--dark-gold);
  font-family: "Latin Modern Roman", serif;
  font-weight: 400;
  line-height: 130%;
  font-size: 30px;
  border: none;
  padding: 1rem 2rem;
  border-radius: 0px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Contact Section Styles */
.contact {
  padding: 4rem 2rem; /* Adjust padding as needed */
  color: #333; /* Default text color for this section */
}

.contact-content-wrapper {
  display: flex;
  gap: 2rem; /* Space between heading and info columns */
  max-width: 1200px; /* Optional: constrain width like other sections */
  margin: 0 auto;    /* Center if max-width is used */
}

.contact-heading-container {
  flex-basis: 25%; /* Adjust as per design, e.g., 30% or 1/4 width */
  flex-shrink: 0;
}

.contact-heading-container h1 {
  color: var(--dark-gold);
  margin-top: 0; /* Align with the top of the right column content */
}

.contact-info-container {
  flex-basis: 75%; /* Adjust as per design, e.g., 70% or 3/4 width */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.contact-info-container p {
  margin: 0 0 0.5rem 0; /* Adjust paragraph spacing */
  line-height: 1.6;
}

.email-info-row {
  margin-bottom: 2rem;
}

.contact-email-link {
  color: var(--dark-gold);
  text-decoration: none;
  font-weight: 500;
}

.contact-email-link:hover {
  text-decoration: underline;
}

.newsletter-prompt,
.follow-us-prompt {
  margin-top: 1rem; /* Add some space above these prompts */
  font-weight: 500; /* Slightly bolder if needed */
}

.newsletter-form {
  display: flex;
  align-items: center; 
  margin-bottom: 1rem;
  border: 1px solid var(--dark-gold);
  border-radius: 0px;
  overflow: hidden;
}

.newsletter-form input[type="email"] {
  flex-grow: 1; /* Allow input to take available space */
  padding: 0.75rem 1rem;

  border: none;
  border-radius: 0;
  font-size: 1rem;
  background-color: transparent;
  color: var(--dark-gold);
  outline: none;
}

.newsletter-form .submit-button {
  background-color: var(--dark-gold);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  text-align: center;
  text-decoration: none;
  font-weight: 350;
  cursor: pointer;
  transition: background-color 0.2s ease;
  align-self: stretch;
}

.newsletter-form .submit-button:hover {
  background-color: hsl(47, 52%, 36%); /* Slightly darker gold on hover */
}

.social-info-row {
  margin-top: 2rem;
}

.social-icons {
  display: flex;
  gap: 1rem; /* Space between social icons */
  align-items: center;
}

.social-icons a img {
  width: 32px; /* Adjust icon size as needed */
  height: 32px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.social-icons a:hover img {
  opacity: 1;
}

footer {
  text-align: center;
  color: gray;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.spacer.triangle-decoration {
  position: relative;
}

.spacer.triangle-decoration::before {
  position: absolute;
  top: -400%;
  right: 0;
  z-index: -1;
  content: url('../img/decoration/triangle.svg');
}

.spacer.circles-decoration {
  position: relative;
}

.spacer.circles-decoration::before {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  content: url('../img/decoration/circles.svg');
}

#cs {
  position: relative;
}

#cs::after {
  position: absolute;
  top: 0;
  left: 1em;
  content: url('../img/decoration/triangle-inscribed-circle.svg');
}

#math > .concept-container {
  position: relative;
  overflow: visible;
}

#math > .concept-container::after {
  position: absolute;
  bottom: -50%;
  right: 0;
  z-index: -1;
  content: url('../img/decoration/circle.svg');
}

#courses {
  position: relative;
}

#courses::after {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  content: url('../img/decoration/hexagon.svg');
}

footer {
  position: relative;
}

footer::after {
  position: absolute;
  right: 0;
  bottom: -2rem;
  z-index: -1;
  content: url('../img/decoration/hexagon-truncated.svg');
}

/* ===== SCROLL ANIMATIONS ===== */

/* Base animation states - elements start hidden/transformed */
.scroll-animate-fade-in {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animated states - when elements come into view */
.scroll-animate-fade-in.animate-in {
  opacity: 1;
}

.scroll-animate-slide-up.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.scroll-animate-slide-left.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-slide-right.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-scale-in.animate-in {
  opacity: 1;
  transform: scale(1);
}

/* Special animations for decorative elements */
.decorations-animate #cs::after {
  animation: decorationFadeIn 1.2s ease-out 0.5s both;
}

.decorations-animate #math > .concept-container::after {
  animation: decorationScale 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

.decorations-animate #courses::after {
  animation: decorationRotateIn 1.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.6s both;
}

.decorations-animate .spacer.triangle-decoration::before {
  animation: decorationSlideDown 1.2s ease-out 0.4s both;
}

.decorations-animate .spacer.circles-decoration::before {
  animation: decorationBounceIn 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.7s both;
}

.decorations-animate footer::after {
  animation: decorationFadeUp 1.2s ease-out 0.3s both;
}

/* Keyframe animations for decorations */
@keyframes decorationFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes decorationScale {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes decorationRotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes decorationSlideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes decorationBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes decorationFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Improve the hero section animation */
.hero-content {
  /* Remove the initial animation state since we'll control it with scroll */
  animation: none;
}

/* Enhanced animations for mobile */
@media (max-width: 768px) {
  .scroll-animate-slide-left,
  .scroll-animate-slide-right {
    transform: translateY(20px);
  }
  
  .scroll-animate-slide-left.animate-in,
  .scroll-animate-slide-right.animate-in {
    transform: translateY(0);
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .scroll-animate-fade-in,
  .scroll-animate-slide-up,
  .scroll-animate-slide-left,
  .scroll-animate-slide-right,
  .scroll-animate-scale-in {
    transition: opacity 0.3s ease;
    transform: none;
  }
  
  .decorations-animate *::before,
  .decorations-animate *::after {
    animation: none;
  }
}


/* Mobile Media Queries */
@media (max-width: 768px) {
  /* Prevent horizontal overflow on mobile */
  * {
    max-width: 100%;
  }
  
  .main-nav,
  .login-button {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .mobile-nav {
    display: block;
  }
  
  .site-header {
    padding: 1rem;
  }
  
  /* Hero Section Mobile */
  body #hero {
    padding: 30svh 0 4rem 0;
    justify-content: center;
  }
  
  h1 {
    font-size: 46px;
    line-height: 120%;
  }
  
  .pre-title {
    font-size: 20px;
  }
  
  .hero-description {
    font-size: 16px;
    line-height: 160%;
  }
  
  /* Math and CS sections - single column on mobile */
  #math.concept-section,
  #cs.concept-section {
    flex-direction: column;
    padding: 2rem 1rem;
    min-height: auto;
    padding-top: 2rem !important; /* Override desktop adjustments */
    padding-bottom: 2rem !important; /* Override desktop adjustments */
    margin-top: 0 !important; /* Override desktop adjustments */
    margin-bottom: 0 !important; /* Override desktop adjustments */
  }
  
  /* Ensure image comes first in both sections */
  #math .concept-image,
  #cs .concept-image {
    order: 1;
    margin-bottom: 2rem;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    display: block;  /* Remove flexbox to let image fill width */
    flex-basis: auto !important; /* Override desktop flex-basis */
    max-width: none !important; /* Override desktop max-width */
  }
  
  #math .concept-container,
  #cs .concept-container {
    order: 2;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    max-width: none;
    min-height: auto !important; /* Override desktop min-height */
    padding-left: 0 !important; /* Remove desktop padding */
    padding-right: 0 !important; /* Remove desktop padding */
  }
  
  /* Adjust image sizing for mobile */
  #math .concept-image img,
  #cs .concept-image img {
    height: auto;
    max-height: 50vh;
    width: 100%;
    object-fit: cover;  /* Changed from contain to cover for full width */
    margin-top: 0;
    display: block;
  }
  
  /* Remove the flex-basis rules on mobile */
  #math > .concept-image,
  #math > .concept-container {
    flex-basis: auto;
  }
  
  /* Courses section - stack vertically on mobile */
  #courses-intro-row {
    flex-direction: column;
    padding: 0 1rem;
    gap: 1rem;
  }
  
  #courses-header-container {
    flex-basis: auto;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }
  
  #courses-intro-container {
    flex-basis: auto;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Course carousel - convert to vertical stack on mobile */
  .course-carousel-container {
    overflow-x: visible !important;
    overflow-y: visible !important;
    cursor: default;
    padding: 0;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    touch-action: pan-y !important; /* Allow vertical scrolling */
  }
  
  /* Disable dragging behavior on mobile */
  .course-carousel-container.is-dragging {
    cursor: default !important;
  }
  
  .course-carousel-track {
    flex-direction: column;
    padding: 0 1rem;
    gap: 0; /* Remove gap - Safari handles this inconsistently */
    width: 100%;
    align-items: center; /* Center align instead of stretch */
    touch-action: auto !important; /* Allow all touch actions */
  }
  
  .course-card {
    width: calc(100% - 2rem) !important; /* Full width minus consistent margins */
    max-width: 500px; /* Prevent cards from getting too wide on tablets */
    margin: 1rem; /* Consistent margin on all sides */
    opacity: 1 !important; /* Override any JS-set opacity */
    transform: none !important; /* Override any JS-set transform */
    user-select: text;
    -webkit-user-select: text;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: auto !important; /* Ensure touch events work */
    -webkit-touch-callout: default; /* Allow iOS touch behaviors */
    touch-action: auto !important; /* Allow all touch actions */
  }
  
  /* Ensure all child elements also allow touch */
  .course-card * {
    pointer-events: auto !important;
    touch-action: auto !important;
  }
  
  /* iOS-specific fix for proper margins */
  @supports (-webkit-touch-callout: none) {
    .course-card {
      width: calc(100vw - 4rem) !important; /* Use viewport width for iOS */
      max-width: calc(100% - 2rem);
    }
    
    /* Ensure the track doesn't add extra padding on iOS */
    .course-carousel-track {
      padding: 0;
    }
    
    /* Add padding to container instead for iOS */
    .course-carousel-container {
      padding: 0 1rem;
    }
  }
  
  /* First and last card specific margins to maintain consistent spacing */
  .course-card:first-child {
    margin-top: 1rem;
  }
  
  .course-card:last-child {
    margin-bottom: 1rem;
  }
  
  .course-card.is-center {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Same as regular cards */
  }
  
  .course-card img {
    pointer-events: auto; /* Re-enable pointer events */
  }
  
  /* Location section - push text down on mobile */
  #location.concept-section {
    flex-direction: column; /* Stack vertically on mobile */
    justify-content: flex-start;
    padding-top: 8vh;
    gap: 2rem;
  }

  #location .concept-container {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    flex: none;
  }
  
  /* Map card responsive styling */
  #location .map-card {
    width: 90%;
    height: 350px;
    margin: 0 auto 2rem auto;
  }
  
  #location .map-card:hover {
    transform: scale(1.02); /* Keep scale but remove rotation */
  }

  /* Adjust background image on mobile to show only middle 50% */
  #location.concept-section::before {
    /* Override the desktop mask to crop top/bottom 25% and show middle 50% */
    background-size: cover;
    max-height: 40vh;
    
    /* Fade in after spacer, show middle 50%, fade out before text */
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      black 50%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      black 50%,
      transparent 100%
    );
  }
  
  /* CTA section - stack vertically on mobile */
  .cta-container-row {
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 1.5rem;
    margin-bottom: 0;
  }
  
  .cta-text {
    flex-basis: auto;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  
  .cta-button {
    flex-basis: auto;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .cta-button > .register-button {
    width: 100%;
    text-align: center;
    display: block;
  }
  
  /* Contact section - single column on mobile */
  .contact {
    padding: 2rem 1rem;
  }
  
  .contact-content-wrapper {
    flex-direction: column;
    gap: 1.5rem;
    max-width: none;
  }
  
  .contact-heading-container {
    flex-basis: auto;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .contact-heading-container h1 {
    margin-bottom: 0;
  }
  
  .contact-info-container {
    flex-basis: auto;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Ensure newsletter form looks good on mobile */
  .newsletter-form {
    flex-wrap: nowrap;
  }
  
  .newsletter-form input[type="email"] {
    min-width: 0;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .newsletter-form .submit-button {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
  }
  
  /* Center social media section on mobile */
  .social-info-row {
    text-align: center;
  }
  
  .follow-us-prompt {
    text-align: center;
  }
  
  .social-icons {
    justify-content: center;
  }
}

/* ===== NOTIFICATION STYLES ===== */

/* Notification colors */
.notification-success {
  background-color: var(--success-green);
}

.notification-error {
  background-color: var(--error-red);
}

.notification-warning,
.notification-info {
  background-color: var(--dark-gold);
}

/* ===== DJANGO MESSAGES ===== */

.messages-container {
  position: fixed;
  top: 80px; /* Below the header */
  left: 0;
  right: 0;
  z-index: 1500;
  padding: 0 2rem;
  pointer-events: none;
}

.message {
  /* Base notification styling */
  color: white;
  padding: 1rem 2rem;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 300;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
  text-shadow: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* Message-specific styles */
  position: static;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  pointer-events: auto;
  animation: messageSlideIn 0.3s ease-out;
}

.message-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.message-text {
  flex: 1;
  text-align: center;
}

.message-dismiss {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.message-dismiss:hover {
  opacity: 1;
}

/* Message animations */
@keyframes messageSlideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.message.hiding {
  animation: messageSlideOut 0.3s ease-out forwards;
}

@keyframes messageSlideOut {
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* Mobile adjustments for all notifications */
@media (max-width: 768px) {
  .message {
    font-size: 14px;
    padding: 0.75rem 1.5rem;
  }
  
  .messages-container {
    padding: 0 1rem;
  }
  
  .message-content {
    gap: 0.5rem;
  }
}

/* ===== NEWSLETTER FORM BUTTON STATES ===== */

/* Subscribed Button State */
.newsletter-form .submit-button.subscribed {
  background-color: var(--success-green);
  cursor: default;
  opacity: 0.9;
}

.newsletter-form .submit-button.subscribed:hover {
  background-color: var(--success-green); /* No hover effect when subscribed */
}

.newsletter-form .submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* ===== REGISTRATION PAGE STYLES ===== */

/* Registration Header */
/* Registration header removed - back button now in hero */

.back-to-site-button {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background-color: transparent;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 0px;
  border-radius: 4px;
  font-weight: 350;
  transition: all 0.2s ease;
  text-shadow: none;
  z-index: 10;
}

.back-to-site-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Logo styles removed - now part of hero section */

/* Registration Main Layout */
.registration-main {
  min-height: 100vh;
  color: #333;
}

/* Registration page full-bleed layout */
.registration-page {
  margin: 0;
  padding: 0;
}

.registration-page body {
  margin: 0;
  padding: 0;
}

/* Fix sticky positioning for registration page */
body.registration-page {
  overflow-x: visible !important;
}

/* Registration container removed - using new course-main-content layout */

.course-hero .register-button {
  background-color: var(--light-button);
  color: var(--espresso);
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.course-hero .register-button:hover {
  background-color: var(--dark-gold);
  color: white;
}

.course-hero .register-button {
  min-width: 300px;
}

.course-hero .register-button h3 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
}

.course-hero .register-button p {
  font-size: 16px;
  font-weight: 300;
  margin: 0;
}

/* Course Information Card */
.course-info-card {
  background-color: #ffffff;
  border: 1px solid var(--dark-gold);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.course-info-icon {
  margin-bottom: 1rem;
}

.course-info-icon img {
  width: 60px;
  height: 60px;
}

.course-info-card h3 {
  font-family: var(--fancy-header-font), "Latin Modern Roman", serif;
  font-size: 1.75rem;
  font-weight: normal;
  color: #000000;
  margin: 0 0 1rem 0;
}

.course-info-description {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.course-info-features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.course-info-features li {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.course-info-features li img {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}

.course-info-schedule {
  font-size: 0.9rem;
  color: #333;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.course-info-schedule p {
  margin: 0.25rem 0;
}

/* Registration Form */
.registration-form-container {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex: 1;
}

.registration-form-container h1 {
  font-family: "Latin Modern Roman", serif;
  color: var(--dark-gold);
  margin-top: 0;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.form-section {
  margin-bottom: 3rem;
}

.form-section h2 {
  font-family: "Latin Modern Roman", serif;
  color: var(--dark-gold);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--dark-gold);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field.full-width {
  grid-column: 1 / -1;
  margin-bottom: 1.5rem;
}

.form-field label {
  font-weight: 500;
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: "Inter", sans-serif;
  transition: border-color 0.2s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--dark-gold);
}

/* Custom select dropdown styling */
.form-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364551F' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-field select:hover {
  border-color: var(--dark-gold);
}

.form-field select:focus {
  border-color: var(--dark-gold);
  box-shadow: 0 0 0 3px rgba(74, 56, 25, 0.1);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  margin-top: 0.1rem;
  width: 18px;
  height: 18px;
  accent-color: var(--dark-gold);
}

.checkbox-text {
  flex: 1;
}

.required-checkbox {
  font-weight: 500;
}

.agreements-intro {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.continue-payment-button  {
  background-color: var(--dark-gold);
  color: white;
  padding: 1rem 2rem;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 500;
}

.continue-payment-button:hover {
  background-color: var(--light-button);
}

/* Mobile Responsiveness - moved to main responsive section */

/* Course Detail Hero Section */
.course-hero {
  color: white;
  padding: 0;
  position: relative;
  text-shadow: none;
  width: 100%;
  min-height: 70vh;
  margin: 0;
}

.course-hero.gr-9-10-math {
  background: linear-gradient(119.61deg, #8C7253 22.38%, #4A4033 85.45%);
}

.course-hero.gr-11-12-math {
  background: linear-gradient(117.96deg, #58799C 12.34%, #705B84 85.1%);
}

.course-hero.computer-science {
  background: linear-gradient(127.89deg, #4B8B8B 21.11%, #5B6E5D 87.17%);
}


.course-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-image: url("/static/website/img/course-backgrounds/gr-9-10.svg");
  background-repeat: no-repeat;
  opacity: 0.5;
  background-position: right;
  z-index: 0;
}

.course-hero-container {
  position: inherit;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  min-height: 500px;
  height: 70vh;
  display: flex;
  align-items: center;
  z-index: 1;
}

.course-hero-content {
  max-width: 800px;
  width: 100%;
}

.course-hero-logo {
  margin-bottom: 4rem;
}

.course-hero-logo img {
  height: 50px;
  width: auto;
}

.course-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.course-icon-inline {
  width: 48px;
  height: 48px;
  filter: brightness(0) invert(1); /* Make icon white */
  flex-shrink: 0;
}

.course-hero-title {
  font-family: var(--fancy-header-font);
  font-size: 3rem;
  margin: 0;
  font-weight: normal;
}

.course-hero-description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* Hero button uses same styling as form submit button */
.course-hero .continue-payment-button {
  display: inline-block;
}

/* Info Bar - White box overlapping hero bottom */
.course-info-bar {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
  z-index: 10;
}

.info-bar-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-bar-item {
  text-align: center;
  flex: 1;
  position: relative;
}

.info-bar-label {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-bar-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
}

/* Main Content Section with Sidebar */
.course-main-content {
  padding: 12rem 2rem 3rem; /* Extra top padding to account for info bar */
  margin: 0 auto;
  max-width: 1200px;
}

.course-content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 3rem;
}

/* Left Column: Sticky Course Card */
.course-sidebar {
  flex: 0 0 350px;
  position: -webkit-sticky; /* For Safari */
  position: sticky;
  top: 2rem; /* Space from top when stuck */
  align-self: flex-start; /* This is crucial for sticky in flex containers */
  z-index: 10; /* Ensure it stays above other content */
}

/* Right Column: Course Details and Registration Form */
.course-content {
  flex: 1;
  min-width: 0;
}

/* Course Details Section */
.course-details {
  margin-bottom: 3rem;
}

.course-details h2 {
  margin-top: 0;
  font-family: var(--fancy-header-font);
  font-size: 40px;
  font-weight: 400;
  line-height: 100%;
  color: var(--dark-gold);
}

.course-about h2,
.topics-covered h2 {
  font-family: "Latin Modern Roman", serif;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--dark-gold);
}

.course-about-description {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 2rem;
}

.course-additional-info {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.course-additional-info p {
  margin: 0;
  line-height: 1.6;
}

/* Math Contests Section */
.math-contests {
  background-color: white;
  padding: 0rem 2rem 2rem 2rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.math-contests h3 {
  font-family: "Latin Modern Roman", serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--green);
}

.contest-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 1.5rem;
}

.contest-table {
  width: 100%;
  border-collapse: collapse;
}

.contest-table th {
  font-size: 1rem;
  color: #333;
  font-weight: 600;
  text-align: left;
  padding: 0 0 1rem 0;
}

.contest-table th:last-child {
  text-align: right;
}

.contest-row td {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.contest-table tbody tr:last-child td {
  border-bottom: none;
}

.contest-name {
  font-weight: 600;
  color: var(--green);
}

.contest-info {
  color: #666;
  text-align: right;
}

.contest-dates {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.contest-dates p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #666;
}

/* Topics Section */
.topics-section {
  margin: 3rem 0;
}

/* Expanded Topics List */
.topics-expanded-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.topic-expanded-item {
  border-bottom: 1px solid #eee;
}

.topic-expanded-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.topic-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topic-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.topic-header h3 {
  font-size: 1.25rem;
  color: #333;
  font-weight: 600;
  margin: 0;
}

.topic-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #666;
  margin: 0;
  padding-left: calc(32px + 1rem); /* Align with topic name */
}

/* Terms of Service Page */
.terms-header {
  padding: 1rem 2rem;
}

.terms-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.terms-back-button {
  position: absolute;
  left: 0;
  background-color: var(--dark-gold);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 350;
  transition: background-color 0.2s ease;
  text-shadow: none;
}

.terms-back-button:hover {
  background-color: hsl(47, 52%, 36%);
}

.terms-logo {
  height: 40px;
  width: auto;
}

.terms-main {
  min-height: calc(100vh - 80px);
  padding: 2rem;
  color: #333;
}

.terms-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: white;
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.terms-container h1 {
  font-family: var(--fancy-header-font);
  font-size: 2.5rem;
  color: var(--dark-gold);
  margin-bottom: 2rem;
  text-align: center;
}

.terms-section {
  margin-bottom: 2rem;
}

.terms-section h2 {
  font-family: var(--fancy-header-font);
}

.terms-section p {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: #333;
}

.terms-footer {
  border-top: 1px solid #eee;
  padding-top: 2rem;
  margin-top: 3rem;
  text-align: center;
}

.terms-footer p {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

/* Mobile responsiveness for terms page */
@media (max-width: 768px) {
  .terms-main {
    padding: 1rem;
  }
  
  .terms-container {
    padding: 2rem 1.5rem;
  }
  
  .terms-container h1 {
    font-size: 2rem;
  }
  
  .terms-section h2 {
    font-size: 1.25rem;
  }
}

/* Responsive Design */
/*
@media (max-width: 1024px) {
  .info-bar-container {
    padding: 1.5rem 2rem;
  }
  
  .course-content-wrapper {
    flex-direction: column;
    gap: 2rem;
  }
  
  .course-sidebar {
    position: static;
    flex: 1 1 auto;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }
  
  .course-content {
    flex: 1 1 auto;
  }
  
  .topic-description {
    padding-left: 0;
  }
}
*/

@media (max-width: 768px) {
  .course-hero-title {
    font-size: 2rem;
  }
  
  .course-hero-container {
    padding: 0 1rem;
  }
  
  .info-bar-container {
    flex-wrap: wrap;
    padding: 1.5rem;
    gap: 1rem 0;
  }
  
  .info-bar-item {
    flex: 1 1 50%;
    min-width: 140px;
  }
  
  .info-bar-item:not(:last-child)::after {
    display: none;
  }
  
  .info-bar-item:nth-child(odd)::after {
    display: block;
    right: 0;
  }
  
  .info-bar-item:nth-child(3)::after {
    display: none;
  }
  
  .course-info-bar {
    width: calc(100% - 2rem);
    margin: 0 1rem;
  }
  
  .course-main-content {
    padding: 6rem 1rem 2rem;
  }
  
  .registration-form-container {
    padding: 1.5rem;
  }
  
  .registration-form-container h1 {
    font-size: 2rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .course-sidebar {
    display: none;
  }
}
