* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background-color: #f4f4f4;
}

.header-title {
  background-color: #001776;
  color: white;
  text-align: center;
  padding: 25px;
  font-size: 28px;
  font-weight: bold;
  font-family: "Calistoga", serif;
}

.course-container {
  position: relative;
  display: flex;
  justify-content: center; /* Centers the 3 cards */
  gap: 20px; /* Space between cards */
  flex-wrap: wrap; /* Allows wrapping on mobile */
  padding: 60px 20px 40px; /* Increased top padding ensure don't hit the title */
  /* max-width: 1200px;       Keeps the row from getting too wide */
  margin: 0 auto; /* Centers the whole container */
}

.course-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../images/courses-background.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.5;
  z-index: -1;
}

.course-card {
  position: relative;
  background: white;
  border-radius: 20px;
  /* CHANGE THIS: allows image to hang outside the box */
  overflow: visible;
  flex: 0 1 calc(30% - 100px);
  min-width: 300px;
  /* Space for the image to sit above */
  margin-top: 100px;
  margin-bottom: 40px;
  margin-left: 30px;
  padding-top: 100px;
  border: 2px solid #00127a;
  box-shadow: 12px 12px 0px #4169e1;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.course-img {
  width: 100%;
  /* Slightly smaller than the card width */
  height: 240px !important;
  object-fit: cover;
  border-radius: 20px;
  /* Matching the card's roundness */
  /* border: 2px solid #00127a; */

  /* POSITIONING IT OUTSIDE */
  position: absolute;
  top: -140px;
  /* Pulls it halfway up and out */
  /* left: 5%;            Centers it (since width is 90%) */
  z-index: 2;
  /* Keeps it in front of the card */
  /*margin*/
  margin-top: 20px;
}

.course-card:hover {
  /* Move the card to "cover" the shadow on hover */
  transform: translate(8px, 8px);
  box-shadow: 4px 4px 0px #4169e1;
}

.course-details {
  padding-top: 20px;
  padding-bottom: 30px;
  text-align: center;
  flex: 1 1 auto;
  /* was: flex-grow: 1; */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 70px;
}

.course-details h3 {
  margin: 10px 0;
  font-size: 15px;
  font-weight: bold;
}

.course-details p {
  margin: 6px 0;
  font-size: 15px;
}

.course-details hr {
  margin: 20px 0;
  border: none;
  border-top: 5px solid #033d81;
}

.btn-info {
  background-color: #ff2828;
  color: white;
  /* border: 1px solid #000; */
  border-radius: 50px;
  padding: 12px 25px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 0 #000;
  width: 200px;
  text-align: center;
  display: inline-block;
  /* ensures some breathing room above */
  margin-bottom: 0;
  /* always flush with .course-details' bottom padding */
  align-self: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-info:hover {
  background-color: #911111;
}

.btn-info:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #000;
}

.pending {
  visibility: hidden;
}

/* Ensure space between reusable header and content */
#main-header {
  margin-bottom: 20px;
}

@media (max-width: 992px) {
  .course-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 130px;
    padding: 60px 15px;
  }

  .course-card {
    width: 80%;
  }

  .course-details h3 {
    font-size: 23px;
  }

  .course-details p {
    font-size: 21px;
  }
}

@media (max-width: 768px) {
  .course-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 130px;
    padding: 60px 15px;
  }

  .course-card {
    width: 70%;
    max-width: 200px;
    min-height: 150px;
    height: 200px !important;
    margin-top: 90px;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .course-details {
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 130px;
  }

  .course-img {
    top: -130px;
    /* display: none; */
  }

  .course-details h3 {
    font-size: 20px;
  }

  .course-details p {
    font-size: 18px;
  }

  .mobile-hide-hr {
    position: relative;
    top: 25px;
  }
}

@media (max-width: 480px) {
  .course-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 130px;
    padding: 60px 15px;
  }

  .course-card {
    width: 70%;
    max-width: 200px;
    min-height: 150px;
    height: 200px !important;
    margin-top: 90px;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .course-details {
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 170px;
  }

  .course-img {
    top: -110px;
    /* display: none; */
  }

  .course-details h3 {
    font-size: 17px;
  }

  .course-details p {
    font-size: 16px;
  }

  .mobile-hide-hr {
    position: relative;
    top: 20px;
  }


  .btn-info {
    position: relative;
    bottom: 10px;
  }
}
