* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "微軟正黑體";
}
a {
  text-decoration: none;
}
header {
  text-align: center;
  background-color: #ececec;
}
.logo img {
  transform: scale(0.7);
}
nav {
  background-color: #1d1d1d;
  padding: 8px 0;
}
nav ul {
  display: flex;
  gap: 20px;
  justify-content: center;
}
nav ul li {
  list-style: none;
}

li a {
  color: #fff;
}

li a:link {
  color: #fff;
  transition: all 0.2s ease-in;
  border-bottom: 2px solid transparent; /* 預設為透明 */
}
li a:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
main {
  position: relative;
  max-width: 850px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  padding: 9px;
}

.container {
  border: 5px solid #e14f47;
  background: linear-gradient(180deg, #ffffff 50%, #f7e6e5 100%);
  margin-bottom: 8px;
}

.cover {
  z-index: 99;
  width: 100%;
  aspect-ratio: 5 / 4; /* 或直接填 16 / 9, 4 / 3 等比例 */
  background-image: url(https://www.1111edu.com.tw/edm/edu/ETG_Valentine_20250825/images/cover-bg.png);
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 100px 50px;
}

.cover h1 {
  font-size: 30px;
  text-align: end;
  text-decoration: underline 2px solid;
  text-underline-offset: 7px; /* 調整底線與文字的距離 */
  margin-top: 20px;
  line-height: 1.5;
}
.cover h3 {
  font-weight: 500;
  font-size: 16px;
  word-break: break-all;
  max-width: 225px;
  text-align: right;
}
.content {
  width: 100%;
  padding: 50px 5% 0px 5%;
}
.content .title {
  font-family: "Noto Serif HK";
  display: flex;
  align-items: center;
  justify-content: center;
}
.title {
  display: inline-block;
  font-size: 36px;
  line-height: 36px;
  font-weight: 700;
  color: #761412;
  padding-bottom: 4px;
}

.course-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 18px;
  row-gap: 36px;
  margin: 55px 0;
}

.course-card {
  font-family: "Noto Sans TC";
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
  border: 1px solid #faadac;
  background-color: #fff;
  transition: all 0.3s ease-in;
}

.course-card:hover {
  transform: translateY(-2%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.icon {
  position: absolute;
  top: -22px;
  left: -15px;
}

.course-img {
  width: 100%;
}

.course-info-container {
  padding: 0 14px 28px 14px;
  display: flex;
  flex-direction: column;
}

.course-heading {
  font-size: 16px;
  font-weight: 600;
  margin-top: 18px;
  margin-bottom: 18px;
  text-align: center;
  line-height: 1.2;
  flex: 0 0 auto;
}

.course-text {
  flex: 0 0 80px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.4;
  text-align: justify;
}

.course-text strong {
  color: #e14f47;
  font-weight: 500;
}

.signUp-btn {
  display: flex;
  align-items: center;
  width: fit-content;
  background-color: #e14f47;
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  padding: 6px 18px;
  border: none;
  transition: all 0.2s ease-in;
  margin: 0 auto;
  cursor: pointer;
}
.signUp-btn:hover {
  background-color: #c62018;
}
.back-cover {
  position: relative;
  width: 100%;
}
.back-cover img {
  width: 100%;
  transition: all 0.1s ease-in;
}
.back-cover:hover img {
  filter: saturate(180%); /* 提高飽和度 */
}
.more-btn {
  position: absolute;
  background-color: #065d82;
  padding: 8px 20px 8px 30px;
  border-radius: 50px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 15px;
  letter-spacing: 2px;
  bottom: 10%;
  left: 20%;
  cursor: pointer;
  transition: all 0.2s ease;
}
.more-btn:hover {
  background-color: #013f5a;
}
footer {
  position: relative;
  top: -5px;
  background-color: #ccc;
}
.social-links {
  display: flex;
  gap: 20px;
  background-color: #000;
  color: #fff;
  font-size: 14px;
  letter-spacing: 2px;
  justify-content: center;
  padding: 0 30%;
}

.social-link {
  text-align: center;
  padding: 15px 0;
  flex: 1;
}
.social-link svg,
p {
  transition: all 0.1s ease-in;
}
.social-link p {
  margin-top: 8px;
  color: #fff;
}
.social-link:hover p {
  color: #ccc;
}
.social-link:hover svg path {
  fill: #ccc;
}
.company-info {
  background-color: #ececec;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.company-info p a {
  color: #12389a;
  font-weight: 600;
}

/* RWD start*/
@media (max-width: 768px) {
  main {
    width: 100%;
  }
  .cover {
    padding: 100px 50px;
  }
  .content {
    padding: 20px 6% 0 6%;
  }

  .section-course {
    padding: 16px 32px;
  }

  .course-cards {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 48px;
  }

  .course-info-container {
    padding: 0 28px 28px;
  }
  .social-links {
    padding: 0 15%;
  }
}

@media (max-width: 430px) {
  .cover {
    width: 100%;
    background-size: cover;
    padding: 45px 25px;
    display: inline-block;
    /* gap: 25px; */
  }
  .cover h1 {
    font-size: 22px;
  }
  .cover h3 {
    font-size: 14px;
    max-width: 200px;
  }
  .content .title {
    justify-content: center;
    font-size: 28px;
  }
  .title span {
    font-size: 24px;
    line-height: 24px;
  }

  .section-course {
    padding: 8px 40px;
  }

  .course-info-container {
    padding: 0 14px 14px;
  }

  .course-cards {
    grid-template-columns: 1fr;
    column-gap: 48px;
    margin: 28px 0;
  }

  .course-text {
    font-size: 14px;
  }
  .course-heading {
    font-size: 18px;
  }
  .social-links {
    padding: 0 5%;
  }
  .more-btn {
    padding: 6px 10px 6px 15px;
    font-size: 12px;
    left: 13%;
    gap: 10px;
  }
  .course-info {
    gap: 8px;
  }
  .social-link p {
    font-size: 13px;
  }
  .course-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .course-sidebar img {
    transform: scale(0.8);
    margin-bottom: 0;
  }
  .signUp-btn {
    width: 70%;
  }
}
