/* ============================================
   FACULTY DETAIL PAGE
   ============================================ */

/* ===== Hero ===== */
.fd-hero {
  position: relative;
  padding: 36px 0 80px;
  overflow: hidden;
  background: #fbfaf7;
}
.fd-hero__bg {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
}
.fd-hero__bg-img {
  position: absolute; inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(0.6) brightness(1.05);
  opacity: 0.18;
  transform: scale(1.1);
}
.fd-hero .container { position: relative; z-index: 2; }

.fd-hero__back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(20,24,31,0.08);
  margin-bottom: 36px;
  transition: background .2s ease, transform .2s ease;
}
.fd-hero__back:hover { background: #fff; transform: translateX(-4px); }
.fd-hero__back span:first-of-type { display:none; }

.fd-hero__grid {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 56px;
  align-items: center;
}

.fd-hero__photo {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 18px;
  overflow: hidden;
  background: #e5e7eb;
  box-shadow:
    0 24px 56px rgba(20,24,31,0.18),
    0 4px 12px rgba(20,24,31,0.08);
}
.fd-hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
}
.fd-hero__photo-frame {
  position: absolute;
  inset: -14px;
  border: 2px solid var(--red);
  border-radius: 22px;
  z-index: -1;
  transform: rotate(-2deg);
  pointer-events: none;
}

.fd-hero__copy { min-width: 0; }
.fd-hero__name {
  font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
  font-size: 48px;           /* JS fit-text จะปรับลงให้พอดี */
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-top: 14px;
  white-space: nowrap;       /* บรรทัดเดียว */
  overflow: hidden;          /* ซ่อนส่วนเกินขณะ JS ยังคำนวณ */
}
.fd-hero__name-en {
  font-size: 17px;
  color: var(--muted);
  font-style: italic;
  margin-top: 6px;
}
.fd-hero__title {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-2, #2a2a2a);
  display: inline-block;
  background: #fff;
  border: 1px solid rgba(20,24,31,0.08);
  padding: 6px 14px;
  border-radius: 999px;
}

.fd-hero__pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px;
}
.fd-pill {
  display: inline-flex; align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(229,52,63,0.10);
  color: var(--red);
  letter-spacing: 0.02em;
}
.fd-pill--accent {
  background: var(--red);
  color: #fff;
}

.fd-hero__contact {
  margin-top: 26px;
  display: flex; flex-direction: column; gap: 10px;
}
.fd-hero__contact-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
  color: #2a2a2a;
}
.fd-hero__contact-item svg { color: var(--red); flex-shrink: 0; }
.fd-hero__contact-item a { color: inherit; }
.fd-hero__contact-item a:hover { color: var(--red); }

.fd-hero__actions {
  margin-top: 28px;
  display: flex; gap: 12px; flex-wrap: wrap;
}

/* ===== Stats band ===== */
.fd-stats {
  background: var(--ink, #1a1a1a);
  color: #fff;
  padding: 32px 0;
}
.fd-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.fd-stat {
  text-align: center;
  padding: 6px;
  border-left: 1px solid rgba(255,255,255,0.1);
}
.fd-stat:first-child { border-left: none; }
.fd-stat__num {
  font-family: 'Prompt', sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.fd-stat__label {
  margin-top: 8px;
  font-size: 12.5px;
  color: #c4c4c4;
  letter-spacing: 0.02em;
}

/* ===== Body grid ===== */
.fd-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}
.fd-main { min-width: 0; }
.fd-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 110px; }

/* ===== Content blocks ===== */
.fd-block {
  position: relative;
  margin-bottom: 48px;
}
.fd-block__bar {
  width: 36px; height: 3px;
  background: var(--red);
  margin-bottom: 18px;
}
.fd-block__title {
  font-family: 'Prompt', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.fd-block__text {
  font-size: 15.5px;
  line-height: 1.8;
  color: #2a2a2a;
  text-wrap: pretty;
}

/* ===== Featured works ===== */
.fd-works {
  display: flex; flex-direction: column; gap: 14px;
}
.fd-works__main {
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1a1a;
}
.fd-works__main img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: fdFade .4s ease;
}
@keyframes fdFade { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
.fd-works__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.fd-works__thumb {
  aspect-ratio: 1/1;
  border-radius: 10px;
  overflow: hidden;
  background: #e5e7eb;
  padding: 0;
  border: 2px solid transparent;
  transition: border-color .25s ease, transform .25s ease;
  cursor: pointer;
}
.fd-works__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.fd-works__thumb:hover img { transform: scale(1.08); }
.fd-works__thumb.is-active {
  border-color: var(--red);
  transform: translateY(-2px);
}

/* ===== Lists (exhibitions, research) ===== */
.fd-list { display: flex; flex-direction: column; }
.fd-list__item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid #ececec;
  transition: padding-left .25s ease, background .25s ease;
}
.fd-list__item:hover { padding-left: 12px; background: rgba(229,52,63,0.02); }
.fd-list__item:last-child { border-bottom: none; }
.fd-list__year {
  font-family: 'Prompt', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}
.fd-list__title { font-weight: 600; font-size: 15px; line-height: 1.5; }
.fd-list__sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.fd-list__item--paper .fd-list__title { font-weight: 500; }

/* ===== Side cards ===== */
.fd-side__card {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 24px 22px;
}
.fd-side__card--red {
  background: var(--red);
  color: #fff;
  border-color: transparent;
}
.fd-side__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.fd-side__title::before {
  content: '';
  width: 4px; height: 14px;
  background: var(--red);
  border-radius: 2px;
}
.fd-side__card--red .fd-side__title::before {
  background: #fff;
}

/* Education timeline */
.fd-edu { display: flex; flex-direction: column; gap: 14px; position: relative; }
.fd-edu::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1px;
  background: #e5e7eb;
}
.fd-edu__item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  position: relative;
}
.fd-edu__item::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #fff;
  position: absolute;
  left: 3.5px; top: 6px;
  box-shadow: 0 0 0 2px var(--red);
}
.fd-edu__year {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.fd-edu__deg { font-weight: 600; font-size: 13.5px; margin-top: 2px; line-height: 1.4; }
.fd-edu__school { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Courses */
.fd-courses { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-course {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f6f4ef;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
}
.fd-course svg { color: var(--red); }

/* Awards */
.fd-awards { display: flex; flex-direction: column; gap: 14px; }
.fd-award {
  display: grid; grid-template-columns: 44px 1fr;
  gap: 12px;
}
.fd-award__year {
  font-family: 'Prompt', sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.fd-award__title { font-weight: 600; font-size: 13.5px; line-height: 1.4; color: #fff; }
.fd-award__org { color: rgba(255,255,255,0.75); font-size: 12px; margin-top: 3px; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .fd-body { grid-template-columns: 1fr; }
  .fd-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .fd-side__card { flex: 1; min-width: 260px; }
}
@media (max-width: 820px) {
  .fd-hero { padding: 28px 0 60px; }
  .fd-hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .fd-hero__photo { max-width: 260px; }
  .fd-hero__photo-frame { inset: -10px; }
  .fd-stats__grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .fd-stat:nth-child(3) { border-left: none; }
}
@media (max-width: 560px) {
  .fd-hero__back { margin-bottom: 22px; }
  .fd-hero__name { font-size: 30px; }
  .fd-hero__actions { flex-direction: column; align-items: stretch; }
  .fd-hero__actions .btn { justify-content: center; }
  .fd-block__title { font-size: 22px; }
  .fd-list__item { grid-template-columns: 54px 1fr; gap: 12px; padding: 14px 4px; }
  .fd-list__tag { grid-column: 2; }
  .fd-list__year { font-size: 18px; }
  .fd-stats__grid { grid-template-columns: 1fr 1fr; }
  .fd-side { flex-direction: column; }
  .fd-works__thumbs { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}
