.hero {
  background-size: auto; 
  background-position: top;
  background-repeat: no-repeat;
  color: var(--text-color-on-primary);
  padding: 150px 0px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 10vh;
  background-attachment: fixed; 
  animation: fadeInBackground 2s ease-in-out forwards;
}

.theme-career .hero {
  background-image: url('../img/bg_network01.jpg');
}

.theme-part-timer .hero {
  background-image: url('../img/part-top-hero.jpg');
  min-height: 10vh;
  padding: 75px 20px;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  50% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 1;
    transform: translateY(-20px);
  }
}

@keyframes fadeInBackground {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.menu-button {
  display: inline-block; 
  background: var(--menu-button-bg);
  color: var(--text-color-on-primary);
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 6px var(--menu-button-shadow);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.panel-box {
  text-align: center; 
  margin-top: 30px;
}

.menu-button:hover {
  background: var(--menu-button-hover-bg);
  box-shadow: 0 2px var(--menu-button-shadow);
}

.card {
  margin-bottom: 20px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  background-color: #fff;
  width: 380px;
}

.card-image-container {
  height: 250px;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 5px 5px 10px rgba(0,0,0,0.2);
}

.card-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 20px;
  text-align: center;
}

.card-content h2 {
  margin-bottom: 15px;
  color: var(--primary-color);
  text-align: center;
}

@media (max-width: 768px) {
  .card-container {
    flex-direction: column;
    align-items: center;
    padding: 0 10px; /* Adjusted padding for horizontal spacing */
  }

  .card {
    width: 100%; /* Make card take full width of container */
    max-width: 100%; /* Allow card to shrink on smaller screens */
    box-sizing: border-box; /* Include padding in the width calculation */
    margin-bottom: 20px;
  }

  /* 追加するスタイル */
  #faq .card-image-container img {
    max-height: 280px;
    width: auto; /* 高さを制限すると横幅がはみ出る可能性があるので、autoにする */
    object-fit: contain; /* 画像がはみ出さないように調整 */
  }
}

@media (min-width: 769px) {
  .top-page-content .card-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 10px; /* Adjusted padding for horizontal spacing */
  }

  .card {
    display: flex;
    flex-direction: column;
    height: 450px; /* Set a fixed height for the entire card */
  }

  .card-image-container {
    height: 200px;
  }

  .card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
  }

  .card-content p {
    flex-grow: 1; /* Allow p to grow */
    overflow: auto; /* Add scroll for overflow */
    margin-bottom: 15px;
  }
}

.panel-box a,
.panel-box a:hover {
  color: #fff;
  text-decoration: none;
}