/* ################################ */
html {
    scroll-behavior: smooth;
}
.modal-backdrop {
  z-index: 1;
  opacity: 0 !important;
}

#directory {
  max-width: 1174px;
  margin: auto;
  background: #fff;
  padding-bottom: 64px;
}

#news {
  max-width: 1174px;
  margin: auto;
  background: #fff;
}

.top-menu {
  display: flex;
  gap: 8px;
  margin: 40px 0;
  overflow-x: auto;
  flex-wrap: wrap;
}
.top-menu a {
  text-decoration: none;
  color: #717680;
  padding: 8px 12px;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 9999px;
  border: 1px solid #ebebeb;
  font-size: 14px;
  font-weight: 600;
}

.top-menu a:hover {
  color: #188152;
  background: #e9f8f1;
  font-weight: bold;
  border: 1px solid #e9f8f1;
}

.top-menu a.active {
  color: #188152;
  background: #e9f8f1;
  font-weight: bold;
  border: 1px solid #e9f8f1;
}

.card-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
  max-width: 1140px;
  margin: auto;
}

#directory .card-grid-container {
  padding-bottom: 40px;
  border-bottom: 1px solid #E9EAEB;
}

#directory .pagination-container {
  padding-top: 20px !important;
}

.card {
  background-color: #fff;
  border: 1px solid #fff;
  border-radius: 8px;
  display: none;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: default;
}

.card-normal:hover {
  border: 1px solid #eee;
  box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  transform: translateY(-16px);
}

.card-news:hover {
  background: #eefdf6;
  border: 1px solid #eefdf6;
}

.card.active-card {
  display: block;
}

@media screen and (max-width: 767px) {
  .card-normal:hover {
    border: unset;
    box-shadow: unset;
    transition: unset;
    transform: unset;
  }
  .card.active-card {
    display: flex;
    flex-direction: row;
    border: 0;
    gap: 16px;
    box-shadow: 0px 10px 12px 0px rgb(0 0 0 / 5%);
  }

  .norm-card-flex {
    display: flex;
    flex-direction: column;
  }
  .card-normal {
    min-height: unset !important;
    padding: 8px 8px 20px 8px !important;
  }
  .card-normal .card-image-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ebebeb;
    aspect-ratio: 1 / 1;
    height: fit-content;
    flex: 35%;
  }
  .card-normal .card-image-container .card-image {
    aspect-ratio: 1 / 1;
    margin-bottom: unset;
    object-fit: cover;
    transform: scale(0.8);
    border-radius: 8px;
    border: unset;
  }

  .card.card-news {
    flex-direction: column;
  }

  #news {
    padding: 32px 16px;
  }
  #directory {
    padding: 32px 16px;
  }
  .card-grid-container {
    margin-bottom: 32px;
  }
  #directory .card-grid-container {
    padding-bottom: 32px;
    margin-bottom: 0;
  }
}

.card-normal {
  padding: 16px 16px 40px 16px;
  min-height: 250px;
}

.card-news {
  padding: 16px 16px 32px 16px;
  box-shadow: 0 8px 12px 0 rgba(0, 0, 0, 0.05);
  min-height: 250px;
}

.card-image {
  margin-bottom: 16px;
      border: 1px solid #EBEBEB;
    border-radius: 8px;
}

.card-image-placeholder {
  width: 100%;
  padding-top: 75%;
  background-color: #ccc;
  margin-bottom: 15px;
}
.card-logo {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}
.card-logo img {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}
.card-title {
  font-size: 16px;
  font-weight: bold;
  color: #181d27;
  margin-top: 0;
  margin-bottom: 8px;
}
.card-subtitle {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.card-link-out:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  cursor: pointer !important;
}

.card-highlight {
  border: 2px solid #ffaa00;
  background-color: #fff8e1;
  box-shadow: 0 4px 8px rgba(255, 170, 0, 0.2);
}
.highlight-bg {
  background-color: #ffaa00;
}
.highlight-text {
  color: #ffaa00 !important;
}
.tag {
  display: inline-block;
  background-color: #a00037;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  margin-top: 5px;
}

.news-image-container {
  width: 100%;
  padding-top: 75%;
  position: relative;
  overflow: hidden;
}
.news-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-content {
  padding: 16px 0 0 0;
  display: flex;
  flex-direction: column;
  height: 160px;
  justify-content: space-between;
}
.news-date {
  font-size: 13px;
  color: #535862;
  font-weight: 500;
  margin-bottom: 5px;
}
.news-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 10px 0;
}
.news-footer {
  /* margin-top: auto; */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 5px;
}
.news-category {
  color: #181d27;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid #99ddbf;
  border-radius: 9999px;
  background: #e9f8f1;
  padding-inline: 10px;
  transition: all 0.3s ease;
}
.news-category:hover {
  background: #6bcda1;
  color: #ffffff;
  border-color: #6bcda1;
}
.arrow-icon {
  font-size: 20px;
  color: #333;
  font-weight: normal;
  transition: color 0.2s;
}
.card.card-news:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
.card.card-news .news-footer .arrow-icon img {
  transition: rotate 0.3s ease;
}
.card.card-news:hover .news-footer .arrow-icon img {
  rotate: 45deg;
}

.pagination-container {
  display: flex;
  justify-content: center;
  position: relative;
  padding: 20px 0 64px 0;
  /* border-top: 1px solid #e9eaeb;
  margin-top: 40px; */
}
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

@media screen and (max-width: 767px) {
  .page-link {
    border-radius: 8px;
    padding: 8px !important;
    border: 1px solid #d5d7da !important;
  }
  .page-link span.text {
    display: none;
  }
  .pagination-container {
    margin-top: unset;
    padding: 16px 0 0 0;
  }
  .page-number {
    display: none;
  }
  .page-number.active {
    display: block;
    background: unset !important;
    color: #717680 !important;
  }
  .page-number:last-child {
    display: block;
  }
  .ellipsis {
    display: none;
  }

  .page-link:focus {
    border: 1px solid #D5D7DA !important;
    background: #E9F8F1 !important;
    box-shadow: unset !important;
  }

  .page-link:active {
    border: 1px solid #D5D7DA !important;
    background: #E9F8F1 !important;
    box-shadow: unset !important;
  }

  .page-link:focus .arrow-icon-right {
    background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-right-active.svg") !important;
  }


  .page-link:hover .arrow-icon-right {
    background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-right-active.svg") !important;
  }

  .page-link.disabled .arrow-icon-right {
    background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-right.svg") !important;
  }

  .page-link:focus .arrow-icon-left {
    background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-left-active.svg") !important;
  }

  .page-link:hover .arrow-icon-left {
    background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-left-active.svg") !important;
  }

  .page-link.disabled .arrow-icon-left {
    background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-left.svg") !important;
  }

  .top-menu {
    display: none;
  }
  #mobile-menu-container {
    display: flex !important;
    width: 100%;
  }
  .mobile-menu-custom {
    position: relative;
    width: 100%;
    margin: 0 auto 24px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      sans-serif;
  }

  .mobile-menu-trigger {
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;

    position: relative;
    padding-right: 40px;
  }

  .mobile-menu-custom.open .mobile-menu-trigger {
    border: 2px solid #188152;
    border-radius: 8px;
  }

  .mobile-menu-trigger::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

    width: 20px;
    height: 20px;

    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 20px;

    transition: transform 0.2s ease-in-out;
  }

  .mobile-menu-custom.open .mobile-menu-trigger::after {
    transform: translateY(-50%) rotate(180deg);
  }

  .mobile-menu-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);

    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;

    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 4px;
    padding: 8px 12px 8px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
  }

  .mobile-menu-custom.open .mobile-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .mobile-option {
    padding: 10px;
    font-size: 16px;
    color: #717680;
    cursor: pointer;
    font-weight: 600;

    position: relative;
    padding-right: 40px;
  }

  .mobile-option:hover {
    background-color: #f4f4f4;
  }

  .mobile-option.active {
    background-color: #fafafa;
    border-radius: 6px;
    color: #188152;
    font-weight: 600;
  }

  .mobile-option.active::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;

    /* 1. กำหนดสีที่ต้องการให้ไอคอนเป็น ที่นี่ครับ! */
    background-color: green; /* หรือใช้ currentColor เพื่อให้เป็นสีเดียวกับตัวอักษร */

    /* 2. นำ SVG มาเป็น "หน้ากาก" */
    mask-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/check-green.svg");

    /* 3. ปรับขนาดและตำแหน่งของหน้ากาก */
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;

    /* content: '✓'; */
    color: #188152;

    font-size: 20px;
    font-weight: bold;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }
}

#mobile-menu-container {
  display: none;
}

.page-link {
  text-decoration: none;
  color: #717680;
  padding: 0;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.page-link img {
  max-width: 20px;
}
.page-link.disabled {
  color: #ccc;
  cursor: default;
  pointer-events: none;
}

.page-numbers {
  display: flex;
  gap: 2px;
}
.page-number {
  text-decoration: none;
  color: #717680;
  padding: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
  width: 40px;
  max-width: 40px;
  height: 40px;
  max-height: 40px;
  text-align: center;
  align-content: center;
  padding-top: 11px;
}
.page-number.active {
  color: #fff;
  background: #1fa569;
  border-radius: 9999px;
}

.page-number:hover {
  color: #333;
  background: #dcfae6;
  border-radius: 9999px;
}

.page-number.active:hover {
  color: #fff;
  background: #1fa569;
  border-radius: 9999px;
}

.page-numbers .ellipsis {
  align-content: center;
}

.page-link {
  text-decoration: none;
  color: #717680;
  padding: 0;
  font-size: 14px;
  transition: color 0.2s;
  cursor: pointer;
  font-weight: 600;
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.page-link .text {
  color: #717680;
  font-weight: 600;
}

.page-link:hover .text {
  color: #188152;
}

.arrow-icon-right {
  display: inline-block;
  width: 20px;
  height: 20px;

  background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-right-active.svg");
  background-repeat: no-repeat;
  background-size: contain;
}

.page-link.disabled .arrow-icon-right {
  background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-right.svg");
}

.page-link:hover .arrow-icon-right {
  background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-right-green.svg");
}

.arrow-icon-left {
  display: inline-block;
  width: 20px;
  height: 20px;

  background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-left-active.svg");
  background-repeat: no-repeat;
  background-size: contain;
}

.page-link.disabled .arrow-icon-left {
  background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-left.svg");
}

.page-link:hover .arrow-icon-left {
  background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/arrow-left-green.svg");
}

.page-link.disabled .text {
  color: #ccc !important;
  cursor: default;
  pointer-events: none;
}

.page-link:hover {
  background: #E9F8F1;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

.new-popup.card-popup {
  padding: 0 !important;
  overflow: hidden;
}

.new-popup.card-popup .modal-content {
  margin-top: 0 !important;
}

.card-popup .modal-content {
  background-color: #fefefe;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid #888;
  width: 100%;
  max-width: 792px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-popup .popup-modal-close {
  content: "";
  width: 36px;
  height: 36px;
  background-image: url("/SiteCollectionDocuments/business/ccrc/thaicbn/assets/image/icon/x-close.svg");
  background-repeat: no-repeat;
  background-size: auto;
  background-position: center;
  top: 16px;
  right: 16px;
  position: absolute;
  cursor: pointer;
  opacity: 1;
  border-radius: 9999px;
  padding: 16px;
  box-shadow: 0 1px 3px 0 rgba(10, 13, 18, 0.1);
  z-index: 2;
}

#modalBody {
  padding-top: 10px;
  text-align: center;
}
.modal-logo img {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
}
#modalUniversity {
  color: #a00037;
  font-size: 24px;
  margin-bottom: 10px;
}
#modalSubtitle {
  color: #555;
  font-size: 16px;
  margin-bottom: 20px;
}
.card-popup .modal-content {
  padding: 0 !important;
}

.directory-flex {
  display: flex;
  flex-direction: row;
}

.directory-image {
  max-width: 300px;
  border-radius: 16px 0 0 16px;
  overflow: hidden;
}

.directory-desc {
  max-width: 396px;
  margin: 0 48px 0 48px;
  padding: 48px 0;
}

.directory-desc h3 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 16px;
}

.directory-desc p {
  margin-bottom: 16px;
  color: #181d27;
  font-weight: 500;
}

.directory-line {
  border-top: 1px solid #e9eaeb;
}
.desc-info {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.icon-desc-info {
  width: 43.2px;
}

.info-link {
  color: #181d27;
  font-size: 16px;
  font-weight: 500;
  text-decoration: unset;
  transition: all ease-in-out 1000ms;
}

.info-link:hover {
  color: #181d27;
  font-size: 16px;
  font-weight: 500;
  text-decoration: unset;
  transition: all ease-in-out 1000ms;
}

@media screen and (max-width: 767px) {
  .directory-flex {
    flex-direction: column;
  }
  .directory-image {
    max-width: 100%;
    aspect-ratio: 16 / 9;
    margin: 48px 16px 0 16px;
    border-radius: 0;
  }
  .directory-image img {
    object-fit: cover;
    transform: translateY(-35%);
  }
  .directory-desc {
    margin: 0 16px 0 16px;
    padding: 32px 0 32px 0;
  }

.modal-content {
    max-height: 95vh;
    overflow: hidden;
    position: relative;
}

.modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    z-index: 10;
    border-bottom: 1px solid #eaeaea;
    border-radius: 0.3rem 0.3rem 0 0;
}

.popup-modal-close {
    position: absolute;
    z-index: 20 !important;
    top: 10px;
    right: 15px;
}

.detail-section {
    margin-top: 60px;
    overflow-y: auto;
    max-height: calc(95vh - 60px);
}

}
