/* Add comment textarea placeholder color */
.add-comment-textarea::placeholder {
    color: #7B8189;
    opacity: 1;
}
.add-comment-rating-and-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}
.add-comment-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    justify-content: flex-end;
}
.btn-age-group {
     position: relative;
     padding-left: 10px !important;
     padding-right: 10px !important;
     font-size: 15px;
     white-space: nowrap;
     border-radius: 5px !important;
     background: #fff;
     color: #00B6DF;
     font-weight: 500;
     z-index: 1;
     border: none;
    /* เอา border-image ออก */
}
 .btn-age-group::before {
     content: "";
     position: absolute;
     inset: 0;
     border-radius: 5px;
     padding: 1px;
    /* ความหนาของกรอบ */
     background: linear-gradient(0deg, #00B6DF 0%, #60E1FE 100%);
     -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
     -webkit-mask-composite: xor;
     mask-composite: exclude;
     z-index: -1;
}
 .btn-age-group:hover {
     background: linear-gradient(0deg, #00B6DF 0%, #60E1FE 100%);
     color: #fff;
}
/* เพื่อให้ ::before (กรอบ) ไม่บัง background ตอน hover */
 .btn-age-group:hover::before {
     background: transparent;
}
 .custom-card {
    background: linear-gradient(180deg, #F5BBDD 0%, #FFACC5 100%);
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    color: #fff;
    padding: 0;
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: 275px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 32px;
}

.col-lg-3, .col-md-6 {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
}
 .custom-card-img {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-bottom: 5px;
}
 .custom-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 18px 24px 0 24px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.custom-card-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.4);
    margin: 12px 24px 12px 24px;
}
 .custom-card-info {
    font-size: 15px;
    margin: 0 24px;
    display: flex;
    align-items: center;
    gap: 0px;
    flex-wrap: nowrap;
}
 .custom-card-info-row {
     margin: 0 24px 0 24px;
     display: flex;
     align-items: center;
     gap: 5px;
     flex-wrap: wrap;
     margin-top: 8px;
}
.custom-card-vdivider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: rgba(255,255,255);
    margin: 0 4px;
    vertical-align: middle;
    border-radius: 1px;
}
 .custom-card-btn {
     background: #fff;
     color: #FFACC5;
     border-radius: 50px;
     border: none;
     font-weight: 700;
     font-size: 16px;
     padding: 10px 32px 10px 24px;
     margin: 24px auto 24px auto;
     display: flex;
     align-items: center;
     gap: 10px;
     box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
 .custom-card-btn:hover {
    transform: translateY(-4px);
}
 .custom-card-icon {
     width: 18px;
     height: 18px;
     vertical-align: middle;
     margin-right: 4px;
     filter: brightness(0) invert(1);
}
 .custom-card-btn-arrow {
     width: 18px;
     height: 18px;
     vertical-align: middle;
     margin-left: 4px;
     filter: none;
    transition: transform 0.2s;
}

.pagination-number {
    font-family: 'IBM Plex Sans Thai', sans-serif !important;
    font-size: 20px;
    font-weight: 500 !important;
    font-style: normal !important;
    color: #CFCFCF !important;
    background-color: transparent !important;
    border: none !important;
}

.pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

.pagination .page-item {
    margin: 0 -8px; 
}

.pagination .page-link {
    padding: 8px 12px; 
}

.pagination .page-item:first-child {
    margin-right: 15px; 
}

.pagination .page-item:last-child {
    margin-left: 15px; 
}

.pagination .page-item.active .pagination-number {
    color: #60E1FE !important;
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link,
.pagination .page-item.disabled .page-link {
    color: #7B8189 !important;
    border: none !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
}

.pagination .page-item:first-child .page-link:hover,
.pagination .page-item:last-child .page-link:hover,
.pagination .page-item.disabled .page-link:hover {
    color: #60E1FE !important;
    background-color: rgba(96, 225, 254, 0.1) !important;
    transform: translateY(-2px) !important;
    border: none !important;
}

.article-flex {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.article-main {
    flex: 1 1 0;       /* ยืดเต็ม แต่ shrink ได้ */
    min-width: 0;      /* สำคัญมาก ป้องกัน overflow */
    overflow: hidden;  /* ป้องกันรูปล้น */
}


.article-popular {
    width: 340px;
    min-width: 260px;
}
.article-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 18px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.05rem;
    color: #7B8189;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.article-meta-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
    filter: grayscale(100%) brightness(0.6);
}
.article-meta-item {
    display: flex;
    align-items: center;
    color: #7B8189;
    font-weight: 500;
}
.article-meta-divider {
    display: inline-block;
    width: 1px;
    height: 15px;
    background: #7B8189;
    margin: 0 1px;
    vertical-align: middle;
    border-radius: 1px;
}
.article-content {
    margin-bottom: 32px;
    color: #222;
    font-size: 1.08rem;
    line-height: 1.7;
}


.article-content img {
    width: auto;        /* ปรับตามสัดส่วนจริง */
    max-width: 100%;    /* ไม่เกิน parent */
    display: block;
    margin: 16px auto;  /* จัดกลางคอลัมน์ */
    border-radius: 8px;
    object-fit: cover;
}


.article-main .article-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 16px 0 !important;
    border-radius: 8px !important;
}

.article-hr {
    border: none;
    border-bottom: 4px solid #FFACC5;
    margin: 32px 0 0 0;
}
.article-share-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}
.article-share-label {
    font-weight: 600;
    color: #7B8189;
    margin-right: 8px;
}

.article-share-like {
    margin-left: auto;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #7B8189;
    gap: 6px;
}
.article-share-like img {
    filter: invert(44%) sepia(7%) saturate(0%) hue-rotate(175deg) brightness(95%) contrast(90%);
    width: 24px;
    height: 24px;
}

.article-comments-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 18px;
    line-height: 1.3;
}
.article-comments-num {
    color: #FFACC5;
}
.article-comments-text {
    color: #424242;
}
.article-comments-colon {
    color: #FFACC5;
}
.article-comments {
    margin-bottom: 32px;
}
    .comment-box {
        position: relative;
        width: 100%;
        min-height: 120px;
        background: #fff;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .comment-profile {
        position: absolute;
        left: 40px;
        top: 32px;
        width: 80px;
        height: 80px;
    }

    .comment-profile img {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
    }

    .comment-top-right {
        position: absolute;
        top: 24px;
        right: 40px;
        display: flex;
        gap: 18px;
        align-items: center;
    }

    .comment-time {
        font-family: 'IBM Plex Sans Thai';
        font-weight: 300;
        font-size: 14px;
        color: #7B8189;
    }

    .comment-name {
        font-family: 'IBM Plex Sans Thai';
        font-weight: 900;
        font-size: 18px;
        line-height: 28px;
        color: #424242;
        margin-bottom: 24px;
    }

    .comment-text {
        font-family: 'IBM Plex Sans Thai';
        font-weight: 300;
        font-size: 16px;
        line-height: 26px;
        color: #424242;
        white-space: normal;
        word-break: break-word;
    }
.btn-more {
    background: linear-gradient(90deg, #00B6DF 0%, #60E1FE 100%);
    color: #fff;
    border-radius: 24px;
    font-weight: 600;
    padding: 8px 32px;
    border: none;
    font-size: 1.08rem;
}
.article-popular-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 18px;
    line-height: 1.3;
}
.article-popular-main {
    color: #FFACC5;
}
.article-popular-articles {
    color: #424242;
}
.article-popular-colon {
    color: #FFACC5;
    font-weight: 900;
}
.article-popular-item {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    align-items: flex-start;
}
.article-popular-img {
    width: 150px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
}
.article-popular-content {
    flex: 1 1 0;
    min-width: 0;
}
.article-popular-headline {
    font-size: 1.05rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.article-popular-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.98rem;
    color: #7B8189;
    flex-wrap: wrap;
}
.article-add-comment-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
}
.article-comments-colon {
  color: #FFACC5;
  font-weight: 900;
}
.add-comment-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 32px;
}

.add-comment-profile img {
    width: 90px;      /* ให้เล็กกว่ากรอบนิดนึง */
    height: 90px;
    border-radius: 50%;  /* ทำให้เป็นวงกลม */
    border: 3px solid #ffffff; /* กรอบรอบโปรไฟล์ */
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    object-fit: cover; /* จัดภาพไม่ให้เบี้ยว */
}



.add-comment-input {
  flex: 1 1 0;
  position: relative;
}
.add-comment-textarea {
        width: 100%;
        min-height: 150px;
        border-radius: 10px;
        border: none;
        font-family: 'IBM Plex Sans Thai', sans-serif;
        font-size: 16px;
        color: #7B8189;
        padding: 18px;
        background: #F7F7F7;
        margin-bottom: 0;
        resize: none;
        box-sizing: border-box;
        outline: none;
        transition: box-shadow 0.2s;
    }
.add-comment-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  right: 18px;
  bottom: 18px;
}
.add-comment-rating-label {
  color: #7B8189;
  font-size: 1.02rem;
  font-weight: 500;
}
.add-comment-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
  /* ลบ position: absolute; right; bottom; */
}
.add-comment-input {
  position: relative;
}
.add-comment-stars {
        display: flex;
        gap: 6px;
    }

    .add-comment-stars .fas {
        font-size: 22px;
        color: #CFCFCF;
        cursor: pointer;
        transition: color 0.2s;
        z-index: 1;
    }

    .add-comment-stars .fas.hovered {
        color: #FFD02A !important;
    }

    .add-comment-rating-and-btn {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        width: fit-content;
        min-width: 220px;
        max-width: 300px;
    }

    .add-comment-btn {
        width: 100%;
        margin-top: 10px;
        align-self: flex-end;
    }

    .add-comment-btn:hover {
        background: linear-gradient(0deg, #FFACC5 0%, #FF7CA5 100%);
        color: #fff;
    }

    .narrow-container {
        max-width: 1140px;
        margin: 0 auto;
        padding-left: 0;
        padding-right: 0;
    }

    .hidden-comment {
    display: none;
}

/* Mobile responsiveness for article upper and lower sections */
@media (max-width: 768px) {
    /* Upper section mobile styles */
    .about-title {
        font-size: 20px !important;
        margin-top: 15px !important;
    }
    
    .about-us-title {
        font-size: 18px !important;
        gap: 8px !important;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .about-us-title .dot {
        width: 8px !important;
        height: 8px !important;
    }
    
    .about-us-content {
        font-size: 14px !important;
        margin-top: 15px !important;
        padding: 0 10px;
        text-align: center !important;
        line-height: 1.6;
    }
    
    /* Lower section mobile styles */
    .container.my-4 {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .row.justify-content-center {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center !important;
    }
    
    .col-auto {
        flex: none;
        padding: 0 4px;
        margin-bottom: 8px;
    }
    
    .btn-age-group {
        font-size: 12px !important;
        padding: 6px 12px !important;
        white-space: nowrap;
        min-width: auto;
    }
    
    /* Custom card mobile styles */
    .custom-card {
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 24px !important;
        min-height: auto !important;
    }
    
    .col-lg-3, .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .custom-card-title {
        font-size: 16px !important;
        margin: 14px 20px 0 20px !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .custom-card-divider {
        margin: 10px 20px !important;
    }
    
    .custom-card-info {
        font-size: 13px !important;
        margin: 0 20px !important;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .custom-card-info-row {
        margin: 6px 20px 0 20px !important;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .custom-card-icon {
        width: 14px !important;
        height: 14px !important;
    }
    
    .custom-card-btn {
        font-size: 14px !important;
        padding: 8px 24px !important;
        margin: 20px auto !important;
    }
    
    .custom-card-btn-arrow {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Pagination mobile styles */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    
    .pagination .page-item {
        margin: 0 2px;
    }
    
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .pagination-number {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    /* Ultra-mobile styles */
    .about-title {
        font-size: 18px !important;
    }
    
    .about-us-title {
        font-size: 16px !important;
        gap: 6px !important;
    }
    
    .about-us-content {
        font-size: 13px !important;
        padding: 0 5px;
    }
    
    .btn-age-group {
        font-size: 11px !important;
        padding: 5px 8px !important;
    }
    
    .row.justify-content-center {
        gap: 6px;
    }
    
    .custom-card-title {
        font-size: 15px !important;
        margin: 12px 16px 0 16px !important;
    }
    
    .custom-card-info {
        margin: 0 16px !important;
        font-size: 12px !important;
    }
    
    .custom-card-info-row {
        margin: 6px 16px 0 16px !important;
    }
    
    .custom-card-btn {
        font-size: 13px !important;
        padding: 6px 20px !important;
        margin: 16px auto !important;
    }
    
    .pagination .page-link {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .pagination-number {
        font-size: 14px !important;
    }
}
