/*
|--------------------------------------------------------------------------
| SECTION ARTICLE
|--------------------------------------------------------------------------
*/
html,
body {
    overflow-x: hidden;
}

.modal-open {
    overflow: auto;
}

.text-article {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.company-header-avatar {
    width: 100px;
    height: 100px;
    -webkit-border-radius: 60px;
    -webkit-background-clip: padding-box;
    -moz-border-radius: 60px;
    -moz-background-clip: padding;
    border-radius: 60px;
    background-clip: padding-box;
    margin: 7px 0 0 5px;
    float: left;
    background-size: cover;
    background-position: center;
}

.company-header-avatar-article-list {
    width: 60px;
    height: 60px;
    -webkit-border-radius: 60px;
    -webkit-background-clip: padding-box;
    -moz-border-radius: 60px;
    -moz-background-clip: padding;
    border-radius: 60px;
    background-clip: padding-box;
    margin: 7px 0 0 5px;
    float: left;
    background-size: cover;
    background-position: center center;
}

.user-icon {
    color: black;
}

.banner {
    height: 32px;
    color: white;
    width: 100%;
    background-color: var(--bs-primary);
    padding-top: 5px;
    text-align: center;
}

.banner a {
    color: white;
    text-decoration: underline;
}

.text-line {
    font-family: "Kanit", sans-serif;
    font-style: italic;
    width: 100%;
    text-align: center;
    border-bottom: 2px solid #efefef;
    line-height: 0.1em;
    margin: 20px 0 25px;
    color: #7d8399;
}

.text-line .new {
    background-color: #f9fafc;
    padding: 0 10px;
}

.text-line span {
    background: #fff;
    padding: 0 10px;
}

.underline-header {
    margin-top: -50px;
    --color: var(--bs-secondary) !important;
    --position: center bottom;
    --width: 50px;
    --height: 5px;
    background: linear-gradient(var(--color), var(--color)) var(--position) / var(--width) var(--height) no-repeat;
}

.media-type-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.media-type-content label {
    font-weight: 600;
    font-size: 20px;
    display: block;
    color: #3a4056;
}

.media-type-content a {
    margin-top: 50px;
    text-decoration: none;
    transition: transform 0.2s;
}

.media-type-content a:hover {
    transform: scale(1.2);
}

.media-type {
    padding-bottom: 70px;
    padding-top: 50px;
}

.card-book {
    margin: 0 30px 30px 30px;
    border: none;
    text-align: center;
    display: grid;
    grid-template-rows: auto 48px;
}

.card-body {
    padding: 10px 0px 0px 0px;
}

.card-body a {
    color: #000;
}

.title-book {
    height: 48px;
}

.img-book {
    display: flex;
    align-items: flex-end;
}

.slick-track {
    display: flex !important;
}

.slick-slide {
    height: inherit !important;
    margin: 10px 10px;
}

.footer-news {
    background-color: white;
    border-top: 0px;
}

a:link {
    text-decoration: none;
}

.font-20 {
    font-size: 0.9vw;
}

/* .dropdown-item - dropdown เดียวในหน้านี้คือของ top nav
   สีอยู่ที่ .nav-dd-menu .dropdown-item (header.css) แหล่งเดียว */

.icon_more {
    position: relative;
    top: 3px;
    font-size: 16px;
}

.icon_view {
    position: relative;
    top: 1px;
    font-size: 16px;
}

/*
|--------------------------------------------------------------------------
| SECTION SEARCH
|--------------------------------------------------------------------------
*/
.bg-search {
    background: var(--bs-gradient-1);
}

/* .search-group ของเดิม (width: 600px) ถูกลบ - markup ช่องค้นหาเก่าไม่มีแล้ว
   แต่กฎนี้ยังโหลดทีหลัง search.css เลยไปทับกล่องค้นหาปัจจุบันอยู่
   source of truth อยู่ที่ search.css */

.form-control.form_search {
    width: 100%;
    box-sizing: border-box;
    border: unset;
    border-radius: 4px;
    font-size: 16px;
    background: url(../img/goodkit/search-g.svg);
    background-position: 10px 10px;
    background-repeat: no-repeat;
    padding: 10px 20px 10px 40px;
    background-color: #ffffff;
    border-radius: 25px !important;
}

.btn_search {
    border-radius: 25px;
    font-size: 1.2rem;
}

#search_section {
    gap: 10px;
}

.input-group-append {
    z-index: 100;
    position: absolute;
    right: 0;
}

#frm_home_search .input-group-append {
    margin-top: 0;
    width: 25%;
}

#frm_home_search .input-group-append>.btn {
    width: 100%;
}

.search-select {
    border-radius: 5px 0px 0px 5px;
    width: auto;
}

.search-btn {
    border-radius: 0px 5px 5px 0px;
    border: 2px #fff solid !important;
}

/*
|--------------------------------------------------------------------------
| SECTION LIBRARIAN
|--------------------------------------------------------------------------
*/
/* .img-header: source of truth อยู่ที่ main.css (global) */

.section-lib {
    background-color: #DFE4F3;
}

#lib-slide .owl-stage-outer {
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-lib {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 10px;
    position: relative;
    border: 0;
    height: 200px;
    border-radius: 15px;
    padding: 0 30px;
}

.card-lib-img {
    display: flex;
    justify-content: center;
}

.lib-img {
    width: 150px !important;
    position: absolute;
    top: -20%;
    border-radius: 15px;
}

.card-lib-content {
    display: flex;
    flex-direction: column;
    color: #fff;
    text-align: start;
}

.lib-type {
    border-bottom: 1px solid #e7eaee4d;
}

.lib-author {
    font-weight: 300;
}

#lib-slide .owl-nav {
    display: flex;
    justify-content: space-between;
}

#lib-slide .owl-nav button {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    background-color: var(--bs-secondary);
    border-radius: 5px;
    width: 25px;
    height: 25px;
}

#lib-slide .owl-nav button.owl-prev {
    position: absolute;
    top: 50%;
    left: -1%;
}

#lib-slide .owl-nav button.owl-next {
    position: absolute;
    right: -1%;
    top: 50%;
}

/*
|--------------------------------------------------------------------------
| SECTION NEW ARIVALS
|--------------------------------------------------------------------------
*/
.btn-arrivals {
    background-color: var(--bs-secondary) !important;
    color: var(--bs-white) !important;
    border: 1px var(--bs-secondary) !important;
}

.btn-outline-arrivals {
    background-color: transparent !important;
    color: var(--bs-white) !important;
    border: 1px solid var(--bs-white) !important;
}

.new-arivals {
    background-image: url("../img/goodkit/home/bg-arrivals.webp");
    background-size: cover;
}

.new-arivals-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

@media (max-width: 1200px) {
    .new-arivals-content {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

@media (max-width: 991px) {
    .media-type-content {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .new-arivals-content {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    .font-20 {
        font-size: 15px;
    }

    .search-btn {
        margin-top: 10px !important;
        border-radius: 5px !important;
        border: 0px !important;
    }

    .search-input {
        border-radius: 5px !important;
        border: 0px !important;
    }

    .search-select {
        padding: 5px !important;
        margin-bottom: 10px !important;
        border-radius: 5px !important;
        border: 0px !important;
    }
}

@media (max-width: 767px) {
    .media-type-content {
        grid-template-columns: 1fr 1fr;
    }

    .new-arivals-content {
        grid-template-columns: 1fr 1fr;
    }
}

/*
|--------------------------------------------------------------------------
| SECTION Popular
|--------------------------------------------------------------------------
*/

.section-popular {
    position: relative;
    background-color: #BDC6E3;
}

.popular-bg {
    height: 200px;
    width: 100%;
    background: var(--bs-gradient-d);
    position: absolute;
    z-index: 1;
    top: 50%;
}

.section-article {
    background-color: #DFE4F3;
}

#popular-slide .owl-stage-outer {
    height: 415px;
}

.card-knowledgehub {
    padding: 20px 15px;
    border-radius: 10px;
    background: var(--bs-gradient-a);
    max-width: 250px;
    color: #fff;
    margin-top: 5px;
}

.img-knowledgehub {
    width: 100%;
    height: 250px;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-knowledgehub img {
    width: 80% !important;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    border-radius: 15px;
    object-position: 0% 90%;
}

.img-knowledgehub img.watch {
    width: 95% !important;
    height: 150px;
}

.card-knowledgehub-body .type {
    border-bottom: 1px solid #e7eaee4d;
    margin-bottom: 5px;
}

.card-knowledgehub .ribon {
    position: absolute;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    top: -2%;
    left: 3%;
    padding-top: 5px;
}

.card-knowledgehub .ribon img {
    width: 100%;
    height: 55px;
}

.card-knowledgehub .ribon .number {
    position: absolute;
    font-size: 1.3rem;
    font-weight: 500;
}

#popular-slide .owl-nav {
    display: flex;
    justify-content: space-between;
}

#popular-slide .owl-nav button {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    background-color: var(--bs-secondary);
    border-radius: 5px;
    width: 25px;
    height: 25px;
}

#popular-slide .owl-nav button.owl-prev {
    position: absolute;
    top: 50%;
    left: -1%;
}

#popular-slide .owl-nav button.owl-next {
    position: absolute;
    right: -1%;
    top: 50%;
}

/*
|--------------------------------------------------------------------------
| SECTION ARTICLE
|--------------------------------------------------------------------------
*/
/* การ์ดขาว: รูป / หัวข้อ 2 บรรทัด / เส้นคั่น / แถวสถิติ - 3 ใบต่อแถว (แท็บเล็ต 2 / มือถือ 1) */
.ha-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding: 0;
    text-align: start;
}

.ha-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px 10px 14px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(33, 48, 105, .12);
    text-decoration: none;
    transition: box-shadow .2s, transform .2s;
}

.ha-card:hover {
    box-shadow: 0 8px 24px rgba(33, 48, 105, .18);
    transform: translateY(-2px);
}

.ha-cover {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    line-height: 0;
}

.ha-cover .ha-cover-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.ha-title {
    margin: 16px 6px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #e3e8f0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    color: #1a3f99; /* บนพื้นขาว 8.4:1 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.6em * 2 + 14px);
}

.ha-card:hover .ha-title {
    text-decoration: underline;
}

/* แถวสถิติ (x-article.stats) อยู่ล่างสุดของการ์ดเสมอ แม้หัวข้อสั้น */
.ha-meta {
    margin: auto 6px 0 !important;
    padding-top: 12px;
    font-size: 12.5px;
    color: #454f69; /* บนพื้นขาว 8.2:1 (AAA) */
}

@media (max-width: 991.98px) {
    .ha-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ha-grid {
        grid-template-columns: 1fr;
    }
}

/*
|--------------------------------------------------------------------------
| Optimize for all devices
|--------------------------------------------------------------------------
*/
@media (max-width: 1200px) {}

@media (max-width: 992px) {}

@media (max-width: 768px) {
    #frm_home_search .input-group-append {
        margin-top: 0;
        width: 20%;
    }

    #frm_home_search .input-group-append>.btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    #frm_home_search .input-group-append {
        margin-top: 10px;
        width: 100%;
        position: relative;
    }

    #frm_home_search .input-group-append>.btn {
        width: 100%;
    }
}

@media (max-width: 320px) {
    #frm_home_search .input-group-append {
        margin-top: 10px;
        width: 100%;
    }

    #frm_home_search .input-group-append>.btn {
        width: 100%;
    }
}

.a-link:hover {
    text-decoration: underline !important;
}