main {
  max-width: none;
  width: 100%;
  padding: 40px 0;
}

.castle-section {
  padding: 2rem 0;
}

.castle-grid {
  max-width: 1125px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 30px;
  padding: 0 15px;
}

.castle-card {
  display: flex;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.castle-card:hover {
  transform: translateY(-5px);
}

.castle-card img {
  width: 200px;
  height: auto;
  object-fit: cover;
}

.castle-details {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.castle-details h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: #333;
}

.castle-details p {
  font-family: "Fredoka", sans-serif;
  line-height: 1.7;
  font-weight: 500;
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.price {
  font-weight: bold;
  font-size: 2rem;
  color: #00b8ff;
}

.more-info {
  color: #333;
  background-color: #e9e9e9;
  text-decoration: none;
  font-weight: bold;
  padding: 10px 16px;
  border-radius: 50px;
  display: inline-block;
  transform-origin: center;
  overflow: visible;
  font-family: "Fredoka", sans-serif;
  font-size: 1.3rem;
  max-width: fit-content;
}

.more-info:hover {
  border-radius: 50px;
  padding: 10px 16px;
}

/* Hire Button Colors */
.NrRed:hover {
  background-color: #ff1e1e;
}

.NrBlue:hover {
  background-color: #00b8ff;
}

.NrGreen:hover {
  background-color: #33dd00;
}

.NrYellow:hover {
  background-color: #ffff00;
}

.NrPurple:hover {
  background-color: #8a2be2;
}

.NrPink:hover {
  background-color: #ff69b4;
}

.NrOrange:hover {
  background-color: #ffa000;
}

/* Back to top button */
#backToTop {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background-color: #00b8ff;
  color: white;
  border: none;
  border-radius: 50%;
  padding: 14px 18px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#backToTop:hover {
  background-color: #8a2be2;
  transform: scale(1.1);
}

/* Welcome Section */
.welcome-p-rentals {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  text-align: center;
  padding-bottom: 2rem;
  color: #666;
  font-weight: 800;
}

/* Buy Page Styles */

/* Adaptations for different screen sizes */
@media (max-width: 1245px) {
  .castle-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .castle-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 360px;
    margin: 0 auto; /* center the card */
  }

  .castle-card img {
    width: 100%;
    height: auto;
    max-width: 360px;
  }

  .castle-details {
    padding: 16px;
    width: 100%;
  }

  .castle-grid {
    padding: 0 10px;
    justify-content: center;
  }

  .more-info {
    align-self: center;
    padding: 12px 0;
    width: 100%;
    box-sizing: border-box;
    max-width: none;
    text-align: center;
    align-self: stretch;
  }
}
