
.teachers-page main section,
.teacher-detail-page main section {
  padding: 0;
}

.teachers-page .teachers-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px calc(20px + var(--rail-gutter, 0px)) 90px 20px;
}

.teacher-detail-page .teacher-detail-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 calc(20px + var(--rail-gutter, 0px)) 90px 20px;
}

.teachers-page .teachers-intro {
  max-width: 58ch;
  margin: 0 0 40px;
  color: var(--ink-70);
  font-size: 15px;
  line-height: 1.9;
}

.teachers-grid {
  display: grid;
  /* 手機放大字級後可用寬度會小於 280px，
     不加 min() 的話欄位會硬撐 280px，卡片右側被 .page 的 overflow 切掉。 */
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 28px;
}

.teacher-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.teacher-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 134, 11, 0.35);
  box-shadow: var(--shadow);
}

.teacher-card-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid rgba(184, 134, 11, 0.25);
}

.teacher-card-name {
  margin: 0 0 6px;
  text-align: center;
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  color: var(--primary-jade);
}

.teacher-card-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.teacher-card-bio {
  margin: 0;
  font-size: 14px;
  color: var(--ink-70);
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.teacher-detail-page .hero-section {
  width: 100%;
  background-color: var(--bg-color);
  padding: 40px 0 90px;
  padding-right: var(--rail-gutter);
}

.teacher-detail-page .hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "copy visual"
    "text visual";
  gap: 0 40px;
  align-items: start;
}

.teacher-detail-page .hero-copy {
  grid-area: copy;
  max-width: 560px;
}

.teacher-detail-page .hero-kicker {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

.teacher-detail-page .hero-title {
  font-family: "Noto Serif TC", serif;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--primary-jade);
}

.teacher-detail-page .hero-slogan {
  font-size: 18px;
  color: var(--accent-gold);
  font-style: italic;
  margin: 12px 0 16px;
}

.teacher-detail-page .hero-text {
  grid-area: text;
  max-width: 560px;
  font-size: 15px;
  color: var(--ink-70);
  line-height: 1.95;
}

.teacher-detail-page .hero-visual {
  grid-area: visual;
}

.teacher-detail-page .teacher-body {
  max-width: var(--container, 1100px);
  margin: 0 auto;
  padding: 0 calc(20px + var(--rail-gutter, 0px)) 60px 20px;
}

.teacher-detail-page .teacher-content-grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 48px;
  align-items: start;
}

.teacher-detail-page .teacher-portrait-wrap {
  position: relative;
  border-radius: 30% 10px 30% 10px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(28, 74, 60, 0.12);
  min-height: 380px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.teacher-detail-page .teacher-portrait-wrap img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(0.08) saturate(0.92);
  transition: transform 0.55s ease, filter 0.55s ease;
}

.teacher-detail-page .teacher-portrait-wrap:hover img {
  transform: scale(1.04);
  filter: grayscale(0) saturate(1);
}

.teacher-detail-page .teacher-content-text {
  min-width: 0;
}

.teacher-detail-page .teacher-body h2,
.teacher-detail-page .teacher-content-text h2 {
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  color: var(--primary-jade);
  margin: 0 0 16px;
}

.teacher-detail-page .teacher-body p,
.teacher-detail-page .teacher-content-text p {
  font-size: 15px;
  color: var(--ink-70);
  line-height: 1.95;
  margin: 0 0 18px;
}

.teacher-detail-page .teacher-courses {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px dashed var(--rule);
}

.teacher-detail-page .teacher-experience {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px dashed var(--rule);
}

.teacher-detail-page .teacher-experience h2,
.teacher-detail-page .teacher-courses h2 {
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  color: var(--primary-jade);
  margin: 0 0 24px;
}

.teacher-detail-page .teacher-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.teacher-detail-page .teacher-timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0 20px;
  position: relative;
  padding-bottom: 28px;
}

.teacher-detail-page .teacher-timeline-item:last-child {
  padding-bottom: 0;
}

.teacher-detail-page .teacher-timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(28, 74, 60, 0.35), rgba(184, 134, 11, 0.2));
}

.teacher-detail-page .teacher-timeline-marker {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.35);
  justify-self: center;
}

.teacher-detail-page .teacher-timeline-period {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.teacher-detail-page .teacher-timeline-title {
  font-family: "Noto Serif TC", serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary-jade);
  margin: 0 0 8px;
}

.teacher-detail-page .teacher-timeline-text {
  font-size: 14px;
  color: var(--ink-70);
  line-height: 1.85;
  margin: 0;
}

.teacher-detail-page .teacher-courses-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.teacher-detail-page .teacher-courses-list a {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--paper-edge);
  background: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  color: var(--primary-jade);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.teacher-detail-page .teacher-courses-list a:hover {
  border-color: rgba(184, 134, 11, 0.45);
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .teacher-detail-page .hero-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "visual"
      "text";
    gap: 16px;
  }

  .teacher-detail-page .hero-copy,
  .teacher-detail-page .hero-text {
    max-width: none;
  }

  .teacher-detail-page .teacher-content-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .teacher-detail-page .teacher-portrait-wrap {
    max-width: 420px;
    margin: 0 auto;
    min-height: 320px;
  }

  .teacher-detail-page .teacher-portrait-wrap img {
    min-height: 320px;
  }
}
