/* =========================
   Section: Instructor
========================= */
.instructor {
  padding: 0px 16px;
}

.instructor-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.instructor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}

.instructor-header h2 {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* WHO WE ARE */
.who-tags {
  display: flex;
  gap: 3px;
}

.who-tags span {
  border: 2px solid;
  padding: 0px 7px;
  font-size: 11px;
  border-radius: 16px;
  letter-spacing: 1px;
  background: transparent;
}

.star-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  animation: spin 10s linear infinite;
  transform-origin: 50% 50%;
}
/* rotate icon */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Grid dashed table */
.instructor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px dashed #cfc7bc;
  border-left: 1px dashed #cfc7bc;
}

/* Each cell */
.instructor-card {
  position: relative;
  padding: 36px 18px 56px;
  border-right: 1px dashed #cfc7bc;
  border-bottom: 1px dashed #cfc7bc;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 520px;
  background: transparent;
  transition: background 0.3s ease;
}

.card-top {
  min-height: 88px;
  transition: all 0.28s ease;
}

.card-middle {
  text-align: center;
}

.card-bottom {
  margin-top: auto;
}

/* Ribbon title */
.card-title {
  position: absolute;
  top: 0;
  left: 0;
  background: #dcd6e8;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* cut corner ribbon */
.card-title::after {
  content: "";
  position: absolute;
  top: 0;
  right: -11px;
  width: 2px;
  height: 0;
  border-top: 26px solid #dcd6e8;
  border-right: 11px solid transparent;
}

/* Description */
.card-desc {
  font-size: 11px;
  line-height: 1.3;
  max-height: 240px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 1.08s ease, opacity 1s ease;
}

/* Avatar */
.card-avatar {
  margin-top: auto;
}

.card-avatar img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  margin: 8px 0 12px;
}

/* Role + Name center */
.card-role {
  text-align: center;
  color: #8b6b4a;
  font-size: 14px;
  margin-bottom: 5px;
  font-weight: 600;
}

.card-name {
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.card-meta {
  font-size: 11px;
  line-height: 1.3;
}

.card-extra {
  font-size: 11px;
  line-height: 1.3;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 1.08s ease, opacity 1s ease;
}

/* ===== HOVER (not active) ===== */
.instructor-card:not(.active):hover {
  background: #f7f2e9;
}

.instructor-card:not(.active):hover .card-desc {
  max-height: 0;
  opacity: 0;
}

.instructor-card:not(.active):hover .card-extra {
  max-height: 240px;
  opacity: 1;
  margin-top: 8px;
}

.instructor-card:not(.active):hover .card-top {
  min-height: unset;
}

.instructor-card:not(.active):hover .icon-circle {
  transform: rotate(180deg);
  background: #8b6b4a;
}

.instructor-card:not(.active):hover .icon-circle .arrow-icon {
  color: #fff;
}

/* ===== ACTIVE (High prioritize) ===== */
.instructor-card.active {
  background: #f7f2e9;
}

.instructor-card.active .card-desc {
  max-height: 0;
  opacity: 0;
}

.instructor-card.active .card-extra {
  max-height: 240px;
  opacity: 1;
  margin-top: 8px;
}

.instructor-card.active .card-top {
  min-height: unset;
}

.instructor-card.active .icon-circle {
  transform: rotate(180deg);
  background: #8b6b4a;
}

.instructor-card.active .icon-circle .arrow-icon {
  color: #fff;
}

/* Icon */
.icon-circle {
  background: transparent;
  border: 1px solid #ccc;
  transition: all 0.3s ease;
}

.card-bottom-icon {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

/* =========================
   Section: Instructor messages
========================= */
.instructor-messages {
  position: relative;
  background: url("../img/message-bg.png") center/cover no-repeat;
  color: #fff;
  padding: 90px 16px;
  overflow: hidden;
}

.instructor-messages::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.instructor-messages .container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Layout 3 columns */
.instructor-messages__container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
  align-items: stretch;
}

/* Card */
.instructor-messages__card {
  position: relative;
  padding: 26px 22px 32px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  min-height: 385px;
}

.instructor-messages__card:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* small horizontal line at bottom */
.instructor-messages__card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

/* Quote icon */
.instructor-messages__icon {
  width: 22px;
  height: 16px;
  opacity: 0.75;
  margin-bottom: 18px;
}

/* Text */
.instructor-messages__text {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

/* Bottom author */
.instructor-messages__author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.instructor-messages__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.instructor-messages__title {
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
}

/* ============ */
/* Responsive = */
/* ============ */
/* Desktop large: 1200px+ */
@media (min-width: 1200px) {
}

/* Tablet + small desktop: 768px - 1199px */
@media (min-width: 768px) and (max-width: 1199px) {
  .instructor-grid {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    scroll-behavior: smooth;
  }

  .instructor-card {
    border-right: 1px dashed #cfc7bc;
    border-bottom: 1px dashed #cfc7bc;
    transition: background 0.3s ease;
  }

  .instructor-messages__container {
    display: flex;
    gap: 28px;
    overflow-x: auto;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    padding: 0 60px 10px;
    scroll-padding-left: 60px;
    scroll-padding-right: 60px;
  }

  .instructor-messages__container::-webkit-scrollbar {
    display: none;
  }

  .instructor-messages__card {
    flex: 0 0 365px;
    scroll-snap-align: center;
    min-height: 400px;
    margin-left: 100px;
  }
}

/* Mobile: 1px - 767px */
@media (max-width: 767px) {
  .instructor-grid {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    scroll-behavior: smooth;
  }

  .instructor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .who-tags {
    flex-wrap: wrap;
  }

  .instructor-card {
    border-right: 1px dashed #cfc7bc;
    border-bottom: 1px dashed #cfc7bc;
  }

  .instructor-messages {
    padding: 70px 0;
  }

  .instructor-messages__container {
    display: flex;
    gap: 18px;
    overflow-x: auto;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    padding: 0 22px;
    scroll-padding-left: 22px;
    scroll-padding-right: 22px;
  }

  .instructor-messages__container::-webkit-scrollbar {
    display: none;
  }

  .instructor-messages__card {
    flex: 0 0 85%;
    scroll-snap-align: center;
    min-height: unset;
    padding: 22px 18px 26px;
  }
  

  .instructor-messages__text {
    font-size: 11px;
    line-height: 1.3;
  }

  .instructor-messages__avatar {
    width: 48px;
    height: 48px;
  }

  .instructor-messages__title {
    font-size: 13px;
  }
}