@import url("https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap");

:root {
  /* Main color */
  --primary-color: #222831;
  --primary-color-dark: #e52020;
  --white: #fff;
  --gray-light: #f8f9fa;
  --gray: #6b7280;
  --gray-dark: #333;

  /* Navbar color */
  --nav-dropdown-color: #000;
  --nav-dropdown-background-color: #fff;
  --nav-dropdown-hover-color: var(--primary-color-dark);

  /* Typography */
  --font-main: "Sarabun", sans-serif;

  /* Layout */
  --max-width: 1200px;
}

/* ===== Font size ===== */

h1 {
  font-size: 28px !important;
  font-weight: bold !important;
}

h2 {
  font-size: 20px !important;
  font-weight: bold !important;
}

h3 {
  font-size: 18px !important;
  font-weight: bold !important;
}

h4 {
  font-size: 17px !important;
  font-weight: bold !important;
}

h5 {
  font-size: 16px !important;
}

h6 {
  font-size: 14px !important;
}

/* ===== Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--gray-light);
  color: var(--gray-dark);
  scroll-behavior: smooth;
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== Underline ===== */
.hr_underline {
  all: unset;
  display: block;
  width: 100%;
  height: 4px;
  background-color: var(--primary-color-dark);
  margin-bottom: 30px;
}

/* ===== img ratio ===== */
.img_ratio_3x2 {
  aspect-ratio: 3 / 2;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.img_ratio_1x1 {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ===== Search Section ===== */
.search-section-container {
  display: flex;
  justify-content: center; /* Center the content */
  align-items: center; /* Align items vertically */
  flex-wrap: wrap;
  width: 100%;
  margin: 0 auto; /* Center the section horizontally */
  background-color: var(--white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-section {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: var(--max-width);
  gap: 2rem;
  margin: 60px;
}

.search-background {
  background-image: url(../img/b.png);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.search-box {
  display: flex;
  flex: 1;
  min-width: auto;
  gap: 0.5rem;
}

.search-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  font-size: 1rem;
}

.search-box button {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.popular-tags {
  margin: 0 0;
}

.popular-tags h5 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.tag {
  background-color: #ccc;
  color: #333;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tag:hover {
  background-color: #666;
  color: var(--white);
}

/* ===== Banner & Promo Section ===== */
.banner-promo-container {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 2rem;
  justify-content: center;
}

.banner-banner img {
  max-width: 650px;
  width: 100%;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ===== News Section ===== */
.news-section {
  max-width: var(--max-width);
  margin: auto;
  padding: 3rem 2rem;
}

.news-section h3 {
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 24px;
}

.news-content {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.news-featured {
  flex: 1;
  background-color: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.news-featured img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.news-featured .info {
  padding: 20px;
}

.news-featured .info {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 10px;
}

.news-featured .info p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.news-featured .info .date {
  font-size: 12px;
  color: #999;
  margin-top: 12px;
}

.news-list {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  display: flex;
  gap: 12px;
  background-color: var(--white);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
}

.news-item-img {
  width: 170px !important;
  height: 120px !important;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.news-item-content {
  flex: 1;
}

.news-item-content h5 {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: #000;
}

.news-item-content p {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.news-item-content .date {
  font-size: 12px;
  color: #999;
}

.news-wrap-text,
.news-wrap-text p {
  word-break: break-word;
}

.card {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card a {
  text-decoration: none;
  color: inherit;
}

.card a:hover {
  text-decoration: none;
}

.list-group-item {
  border: 1px solid rgba(0, 0, 0, 0.175);
}

.list-group-item-action {
  color: #000 !important;
}

.list-text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.4em;
  max-height: 2.8em;
  white-space: normal;
  position: relative;
}

.responsive-card {
  display: none !important;
  margin-bottom: 24px;
  padding: 0px !important;
}
.responsive-list {
  display: flex !important;
}

/* ===== Directory Section ===== */
.directory-section {
  padding: 3rem 2rem;
}

.directory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
}

.directory-header h2 {
  font-size: 1.3rem;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  max-width: var(--max-width);
  margin-top: 10px;
  margin-bottom: 10px;
}

.logo-card {
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}

.logo-card:hover {
  transform: translateY(-5px);
}

.container {
  max-width: var(--max-width);
  width: 100%;
  padding: 0;
}

/* ===== Job Section ===== */
.job-section {
  padding: 3rem 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 2rem;
  text-align: center;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: auto;
}

.job-card {
  display: flex;
  width: 100%;
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.job-image {
  width: 240px;
  height: 140px;
  object-fit: cover;
  flex-shrink: 0;
}

.job-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.job-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-black);
}

.job-description {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 8px;
}

.job-date {
  font-size: 0.8rem;
  color: #999;
}

.job-table-img {
  max-width: 90px !important;
  height: auto;
}

/* Responsive Adjust sizes and positions for smaller screens */

@media (min-width: 992px) {
  .search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 999px;
    font-size: 1rem;
    outline: none;
    max-width: 480px;
    margin: 0 auto;
  }

  .container,
  .news-section,
  .directory-section,
  .job-section,
  .search-section,
  .banner-promo-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 991px) {
  .search-section {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: var(--max-width);
    gap: 2rem;
    margin: 0px;
  }

  .search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 999px;
    font-size: 1rem;
    outline: none;
  }

  .job-card {
    flex-direction: column;
  }

  .job-image {
    width: 100%;
    height: 180px;
  }

  .container,
  .news-section,
  .directory-section,
  .job-section,
  .search-section,
  .banner-promo-container {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .job-table-img {
    max-width: 180px !important;
    max-height: 80px !important;
    height: auto;
  }
}

@media (max-width: 720px) {
  .responsive-card {
    display: block !important;
  }
  .responsive-list {
    display: none !important;
  }

  .list-group-item {
    padding: 0 0;
    background-color: var(--gray-light);
    border: 0px solid rgba(0, 0, 0, 0.175);
  }
}

@media (max-width: 480px) {
  .responsive-card {
    display: block !important;
  }
  .responsive-list {
    display: none !important;
  }

  .list-group-item {
    padding: 0 0;
    background-color: var(--gray-light);
    border: 0px solid rgba(0, 0, 0, 0.175);
  }
}
