@import url('https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700');
@import url('https://fonts.googleapis.com/css?family=Raleway:300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i');

/* นำ Class นำหน้าทุก Selector เพื่อบังคับให้มีผลแค่ในหน้านี้ */

.custom-article-page {
  font-family: sans-serif;
  background-color: #e0e0e0;
  padding: 40px 0;
  min-height: 100vh;
}

.custom-article-page * {
  box-sizing: border-box;
}

.custom-article-page .container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.custom-article-page .cards {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
    /*max-width: 1100px;*/
    max-width: 1400px;
    margin: 0 auto; /* จัดให้อยู่กึ่งกลาง */
    padding: 0;
}

.custom-article-page .card {
  margin: 20px; 
  transition: all .4s cubic-bezier(0.175, 0.885, 0, 1);
  background-color: #fff;
  /*width: calc(33.33% - 40px); */
  width: calc(33.33% - 40px); 
  position: relative;
  /*border-radius: 12px;*/
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.custom-article-page .card:hover {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  transform: scale(1.10, 1.10);
  z-index: 10; /* ให้การ์ดที่ hover ลอยขึ้นมาทับใบอื่น */
}

.custom-article-page .card__img {
    visibility: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 235px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.custom-article-page .card__img--hover {
    transition: 0.2s all ease-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    position: absolute;
    height: 235px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    top: 0;
}

.custom-article-page .card:hover .card__img--hover {
    /*height: 100%;*/
    height: 70%;
    /*opacity: 0.3;*/
}

.custom-article-page .card__info {
  position: relative;
  z-index: 2;
  background-color: #fff;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  padding: 16px 24px 24px 24px;
}

.custom-article-page .card__category {
    font-family: sans-serif;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 2px;
    font-weight: 500;
    color: #868686;
}

.custom-article-page .card__title {
    margin-top: 5px;
    margin-bottom: 10px;
    font-family: 'Kanit', sans-serif;
}

.custom-article-page .card__title a {
    text-decoration: none;
    /*color: #333;*/
    color: #494949;
}

.custom-article-page .card__excerpt p {
    color: #808080;
    font-size: 14px;
    line-height: 1.5;
}

.custom-article-page .card__by {
    font-size: 12px;
    font-family: sans-serif;
    font-weight: 500;
    display: block;
    margin-top: 15px;
}

.custom-article-page .card__author {
    font-weight: 600;
    text-decoration: none;
    color: crimson;
}

/* =========================================
   Media Queries สำหรับหน้าจอขนาดต่างๆ
========================================= */

@media (max-width: 992px) {
  .custom-article-page .card {
    width: calc(50% - 40px); 
  }
}

@media (max-width: 768px) {
  .custom-article-page .card {
    width: 100%;
    margin: 15px 20px; 
  }
  
  .custom-article-page .card:hover {
    transform: scale(1.03, 1.03);
  }
}