/* ========================================
   Base
======================================== */

:root {
    --km-text: #3d3d3d;
    --km-text-secondary: #777777;
    --km-text-dark: #262626;
    --km-text-muted: #8a8a8a;
    
    --km-border: #e5e5e5;
    --km-gold: #d3aa63;
    --km-bg: #ffffff;

    --km-primary: #d2aa68;
    --km-primary-dark: #b98a43;

    --km-file-bg: #fafafa;

    --km-category-bg: #dceeff;
    --km-category-text: #447ca4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #ffffff;
    color: var(--km-text);
    font-family: "Noto Sans Thai", sans-serif;
}


/* ========================================
   Container
======================================== */

.km-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 25px 28px 40px;
}


/* ========================================
   Section Header
======================================== */

.km-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 25px;
}

.km-section-title {
    margin: 0;
    font-size: 27px;
    font-weight: 400;
    line-height: 1.2;
}

.km-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 12px;

    color: #555;
    background: #f6f4f0;

    border-radius: 20px;

    font-size: 14px;
    font-weight: 500;
}


/* ========================================
   Knowledge Card
======================================== */
.km-card-container {
    margin-bottom: 25px;
}

.km-card {
    position: relative;

    height: 100%;

    background: #fff;

    border: 1px solid #dedede;
    border-radius: 10px;

    overflow: hidden;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.km-card:hover {
    transform: translateY(-4px);

    border-color: #d2d2d2;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);
}


/* ========================================
   Card Image
======================================== */

.km-image-wrapper {
    position: relative;

    display: block;

    width: 100%;
    height: 185px;

    overflow: hidden;

    text-decoration: none;
    background: #f2f2f2;
}

.km-image {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: transform 0.4s ease;
}

.km-card:hover .km-image {
    transform: scale(1.035);
}


/* ========================================
   Bookmark Button
======================================== */

.km-bookmark {
    position: absolute;

    top: 12px;
    right: 12px;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 7px;

    background: rgba(255, 255, 255, 0.95);

    color: var(--km-gold);

    font-size: 21px;

    cursor: pointer;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.06);

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.km-bookmark:hover {
    color: #ad823c;
    background: #ffffff;
    transform: scale(1.06);
}


/* ========================================
   Category
======================================== */

.km-category {
    position: absolute;

    left: 16px;
    bottom: -1px;

    z-index: 2;

    display: inline-block;

    padding: 5px 10px;

    border-radius: 6px 6px 0 0;

    font-size: 13px;
    font-weight: 500;

    line-height: 1.3;

    color: #454545;
}

/* Category Colors */

.category-blue {
    background: #cce6fb;
    color: #37617b;
}

.category-green {
    background: #d9efd2;
    color: #4f7250;
}

.category-orange {
    background: #f8e4c7;
    color: #795f3a;
}

.category-purple {
    background: #e8dcf5;
    color: #665178;
}

.category-pink {
    background: #f5dae2;
    color: #805664;
}

.category-cyan {
    background: #d3eeee;
    color: #456b6e;
}


/* ========================================
   Content
======================================== */

.km-content {
    display: flex;
    flex-direction: column;

    min-height: 180px;

    padding: 22px 23px 20px;
}

.km-title {
    margin: 0 0 25px;

    font-size: 20px;
    font-weight: 400;

    line-height: 1.55;

    color: var(--km-text);
}

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

.km-title a:hover {
    color: #b28b4b;
}


/* ========================================
   Meta
======================================== */

.km-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: auto;

    color: var(--km-text-secondary);

    font-size: 13px;
}

.km-author {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.km-info {
    display: flex;
    align-items: center;
    gap: 22px;

    flex-shrink: 0;
}

.km-info span {
    display: inline-flex;
    align-items: center;

    white-space: nowrap;
}

.km-info i {
    margin-right: 6px;

    font-size: 14px;
    color: #777;
}


/* ========================================
   Tablet
======================================== */

@media (max-width: 991.98px) {

    .km-container {
        padding: 25px 20px 40px;
    }

    .km-image-wrapper {
        height: 200px;
    }

    .km-title {
        font-size: 18px;
    }
}


/* ========================================
   Mobile
======================================== */

@media (max-width: 767.98px) {

    .km-container {
        padding: 20px 16px 35px;
    }

    .km-section-header {
        gap: 10px;
        margin-bottom: 20px;
    }

    .km-section-title {
        font-size: 22px;
    }

    .km-total {
        font-size: 12px;
        padding: 4px 10px;
    }

    .km-image-wrapper {
        height: 210px;
    }

    .km-content {
        min-height: auto;
        padding: 20px;
    }

    .km-title {
        margin-bottom: 20px;
        font-size: 18px;
    }

    .km-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .km-info {
        width: 100%;
        justify-content: space-between;
    }
}

.km-bookmark {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    background: rgba(255, 255, 255, 0.95) !important;

    border: 1px solid #e3e3e3 !important;
    border-radius: 6px !important;

    color: #d3aa63;

    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

    transition: all 0.2s ease;
}

button.km-bookmark {
   padding: 10px 0px;
}

.km-bookmark i {
    position: static !important;
    display: block;

    width: auto;
    height: auto;

    margin: 0 !important;
    padding: 0;

    font-size: 22px;
    line-height: 1;

    color: inherit;
}

.km-bookmark:hover {
    background: #d3aa63;
    color: #ffffff;
    border-color: #d3aa63;
}

/* =========================================================
   Container
========================================================= */

.km-detail-container {
    /* max-width: 800px; */

    padding-top: 30px;
    padding-bottom: 50px;
}


/* =========================================================
   Top Header
========================================================= */

.km-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 15px;
}


/* Category */

.km-category {
    display: inline-flex;
    align-items: center;

    padding: 5px 14px;

    background: var(--km-category-bg);

    color: var(--km-category-text);

    border-radius: 20px;

    font-size: 14px;
    font-weight: 600;
}


/* Bookmark */

.km-bookmark {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: #ffffff;

    border: 1px solid var(--km-border);
    border-radius: 7px;

    color: var(--km-primary);

    font-size: 20px;

    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.km-bookmark:hover {
    background: var(--km-primary);
    color: #ffffff;
    border-color: var(--km-primary);

    transform: translateY(-1px);
}


/* =========================================================
   Main Title
========================================================= */

.km-title2 {
    /* max-width: 650px; */

    margin: 0 0 24px 0;

    color: var(--km-text-dark);

    font-size: 30px;
    font-weight: 400;

    line-height: 1.45;
}


/* =========================================================
   Author
========================================================= */

.km-author {
    display: flex;
    align-items: center;

    margin-bottom: 5px;
}

.km-author-image {
    width: 68px;
    height: 68px;

    flex: 0 0 68px;

    margin-right: 18px;

    border-radius: 50%;

    object-fit: cover;

    background: #eeeeee;
}

.km-author-info {
    min-width: 0;
}

.km-author-name {
    margin-bottom: 3px;

    color: #686868;

    font-size: 14px;
}

.km-author-name strong {
    color: #555555;

    font-weight: 600;
}

.km-author-organization {
    margin-bottom: 5px;

    color: var(--km-text-muted);

    font-size: 13px;
}

.km-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 18px;

    color: var(--km-text-muted);

    font-size: 13px;
}

.km-meta span {
    display: inline-flex;
    align-items: center;
}

.km-meta i {
    margin-right: 5px;

    font-size: 14px;
}


/* =========================================================
   Divider
========================================================= */

.km-divider {
    margin: 28px 0;

    border: 0;
    border-top: 1px solid #dddddd;

    opacity: 1;
}


/* =========================================================
   Section
========================================================= */

.km-section {
    width: 100%;
}

.km-section-title {
    margin: 0 0 14px 0;

    color: #454545;

    font-size: 18px;
    font-weight: 400;
}


/* =========================================================
   Summary
========================================================= */

.km-summary {
    margin: 0;

    color: #767676;

    font-size: 15px;

    line-height: 1.9;
}


/* =========================================================
   File List
========================================================= */

.km-file-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


/* File row */

.km-file-item {
    min-height: 75px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 12px 16px;

    background: var(--km-file-bg);

    border-radius: 8px;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.025);

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.km-file-item:hover {
    background: #f7f7f7;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}


/* File information */

.km-file-info {
    min-width: 0;

    display: flex;
    align-items: center;
}

.km-file-icon {
    width: 38px;
    height: 44px;

    flex: 0 0 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 15px;

    font-size: 29px;
}


/* File Icon Colors */

.km-file-icon.pdf {
    color: #e65448;
}

.km-file-icon.ppt {
    color: #ef8b34;
}

.km-file-icon.excel {
    color: #63aa62;
}

.km-file-icon.word {
    color: #4e91cf;
}


/* File text */

.km-file-detail {
    min-width: 0;
}

.km-file-name {
    margin-bottom: 2px;

    color: #575757;

    font-size: 14px;
    font-weight: 500;

    line-height: 1.5;
}

.km-file-size {
    color: #999999;

    font-size: 12px;
}


/* =========================================================
   Download button
========================================================= */

.km-download-btn {
    min-width: 108px;

    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 9px 18px;

    background: #fff8ed;

    color: var(--km-primary-dark);

    border: 1px solid #ead9bc;
    border-radius: 7px;

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.km-download-btn:hover {
    background: var(--km-primary);

    color: #ffffff;

    border-color: var(--km-primary);
}


/* =========================================================
   Tablet
========================================================= */

@media (max-width: 991.98px) {

    .km-detail-container {
        max-width: 760px;
    }

}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 767.98px) {

    .km-detail-container {
        padding: 22px 18px 40px;
    }

    .km-title {
        font-size: 25px;

        line-height: 1.5;

        margin-bottom: 22px;
    }

    .km-author-image {
        width: 60px;
        height: 60px;

        flex-basis: 60px;

        margin-right: 14px;
    }

    .km-divider {
        margin: 24px 0;
    }

    .km-file-item {
        gap: 12px;
    }

}


/* =========================================================
   Small Mobile
========================================================= */

@media (max-width: 575.98px) {

    .km-category {
        font-size: 12px;

        padding: 5px 11px;
    }

    .km-bookmark {
        width: 36px;
        height: 36px;

        font-size: 18px;
    }

    .km-title {
        font-size: 22px;
    }

    .km-author {
        align-items: flex-start;
    }

    .km-author-image {
        width: 54px;
        height: 54px;

        flex-basis: 54px;

        margin-right: 12px;
    }

    .km-meta {
        gap: 12px;
    }


    /* File */

    .km-file-item {
        align-items: flex-start;
        flex-direction: column;

        padding: 14px;
    }

    .km-file-info {
        width: 100%;
    }

    .km-download-btn {
        width: 100%;

        margin-top: 2px;
    }

}