* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto";
    color: var(--color-text-base);
}

/* ====== Utilities ====== */
.sticky {
    position: sticky;
    top: 20px;
}

/* ====== Article Detail Section ====== */
.article-detail {
    background-color: var(--color-bg-light);
    padding: 112px 0 60px;
}

.article-detail .container {
    max-width: 1240px;
    margin: 0 auto;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
}

/* ====== Detail Content (Left) ====== */
.detail-content {
    position: relative;
    background-color: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    max-width: 936px;
}
.detail-content figure img {
    max-width: 100%;
    height: auto;
}
.detail-content p img {
    max-width: 100%;
    height: auto;
}

/* Title Banner */
.detail-title-banner {
    background-color: var(--color-primary);
    border-radius: 0px 0 10px 10px;
    padding: 20px 40px;
    margin: 9px 31px 32px 31px;
}

.detail-title-banner h1 {
    color: var(--color-bg-white);
    font-size: 22px;
    font-weight: 700;
    font-family: "Inter";
    text-align: center;
    line-height: 1.5;
    text-transform: uppercase;
}

/* Meta Info */
.detail-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.meta-author,
.meta-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    font-family: "Inter";
}

/* Card Wrapper: Social + White Card */
.detail-card-wrapper {
    position: relative;
    margin-top: 42px;
}

.detail-card-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 1px;
    background-color: var(--color-primary);
}

/* Social Share (floating left) */
.detail-social-share {
    position: absolute;
    left: 20px;
    top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-social-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.3s;
}

.detail-social-share a:hover {
    transform: scale(1.1);
}

.detail-social-share a img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* White Card */
.detail-card {
    margin-left: 70px;
    margin-right: 41px;
    padding-top: 24px;
    padding-bottom: 20px;
}

/* Table of Contents */
.detail-toc {
    border: 1px solid var(--color-primary);
    border-radius: 22px;
    padding: 24px 28px;
    margin-bottom: 30px;
}

.toc-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 14px;
    font-family: "Inter";
}

.toc-toggle {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.toc-toggle:hover {
    text-decoration: underline;
}

.toc-list {
    padding-left: 20px;
    font-size: 16px;
    line-height: 2;
    color: var(--color-text-dark);
    font-family: "Inter";
    list-style: none;
}

.toc-list li {
    padding-left: 4px;
}

.toc-list .toc-parent {
    list-style: none;
}

.toc-list .toc-child {
    margin-left: 30px;
    list-style-type: disc;
}

.toc-list.hidden {
    display: none;
}

/* Article Body */
.detail-body {
    font-family: "Inter";
}

.detail-body p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--color-text-dark);
    margin-bottom: 20px;
    text-align: justify;
    font-weight: 400;
    font-family: "Inter";
}

.detail-body h2 {
    font-size: 25px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Table Styles */
.detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 15px;
    font-family: "Inter";
}

.detail-body table th,
.detail-body table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    vertical-align: top;
}

.detail-body table th {
    background-color: var(--color-primary);
    color: var(--color-bg-white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
}

.detail-body table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.detail-body table tr:hover {
    background-color: #f5f5f5;
}

/* Table responsive wrapper */
.detail-body .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.detail-body .table-responsive table {
    margin-bottom: 0;
    min-width: 600px;
}

/* ====== Sidebar (Right) ====== */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-block {
    background-color: var(--color-bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    font-family: "Inter";
    text-transform: uppercase;
    padding: 20px 30px;
    text-align: center;
    background-color: var(--color-bg-sidebar-title);
    margin: 0;
    border-radius: 8px;
}

.sidebar-content {
    padding: 20px;
}

/* Sidebar: Job Opportunities */
.sidebar-job-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-job-tag {
    display: block;
    padding: 10px 16px;
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    font-family: "Inter";
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

.sidebar-job-tag:hover {
    background-color: var(--color-primary);
    color: var(--color-bg-white);
}

/* Sidebar: Related Articles */

.sidebar-related-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-related-item {
    display: block;
    text-decoration: none;
    transition: opacity 0.3s;
}

.sidebar-related-item:hover {
    opacity: 0.85;
}

.sidebar-related-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 8px;
}

.sidebar-related-item span {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    font-family: "Inter";
    line-height: 1.4;
    display: block;
}

/* Sidebar: MBTI Test */

.sidebar-mbti a {
    display: block;
}

.sidebar-mbti img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* ====== Other Articles Section ====== */
.other-articles {
    position: relative;
    margin-top: 40px;
    padding-top: 30px;
    padding-bottom: 30px;
}

.other-articles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background-color: var(--color-primary);
}

.other-articles-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
    font-family: "Inter";
    margin-bottom: 24px;
}

.other-articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.other-article-item {
    display: flex;
    gap: 20px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.other-article-item:hover {
    opacity: 0.85;
}

.other-article-item img {
    width: 180px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.other-article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.other-article-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    font-family: "Inter";
    font-style: italic;
    text-transform: uppercase;
    line-height: 1.4;
    margin-bottom: 8px;
}

.other-article-content p {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-dark);
    font-family: "Inter";
    line-height: 1.6;
    margin: 0;
}

/* ====== Apply Form Section ====== */
.apply-form-section {
    background-color: var(--color-bg-light);
    padding: 60px 0;
}

.apply-form-section .container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.apply-form-wrapper {
    background-image: url('../images-test/bg-apply-form.png');
    background-size: cover;
    background-position: center;
    background-color: var(--color-primary);
    border-radius: 8px;
    padding: 42px 47px;
    text-align: center;
}

.apply-form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-bg-white);
    font-family: "Inter";
    text-transform: uppercase;
    margin-bottom: 18px;
    line-height: 32px;
}

.apply-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.apply-input {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-family: "Inter";
    color: var(--color-text-base);
    background-color: var(--color-bg-white);
}

.apply-input::placeholder {
    color: var(--color-text-placeholder);
}

/* Select dropdown styling */
.apply-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
}

.apply-select option {
    padding: 10px;
}

.apply-file-upload {
    display: flex;
    align-items: center;
    background-color: var(--color-bg-white);
    border-radius: 8px;
    padding: 0 20px;
    gap: 14px;
}

.apply-file-label {
    font-size: 15px;
    font-family: "Inter";
    color: var(--color-text-base);
}

.apply-file-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--color-btn-secondary);
    border-radius: 6px;
    font-size: 14px;
    font-family: "Inter";
    color: var(--color-text-base);
    cursor: pointer;
    transition: background-color 0.3s;
}

.apply-file-btn:hover {
    background-color: var(--color-btn-secondary-hover);
}

.apply-submit-btn {
    background-color: var(--color-accent);
    color: var(--color-bg-white);
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: "Inter";
    cursor: pointer;
    transition: background-color 0.3s;
}

.apply-submit-btn:hover {
    background-color: var(--color-accent-hover);
}

/* Tags Section */
.detail-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.detail-tags strong {
    font-size: 14px;
    color: var(--color-text-dark);
    font-family: "Inter";
}

.detail-tag {
    display: inline-block;
    padding: 4px 12px;
    margin: 4px;
    background-color: var(--color-bg-light);
    border-radius: 4px;
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
    font-family: "Inter";
    transition: all 0.3s;
}

.detail-tag:hover {
    background-color: var(--color-primary);
    color: var(--color-bg-white);
}

/* ====== Job Overview (Sidebar) ====== */
.job-overview-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.job-overview-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.job-overview-item i {
    color: var(--color-primary);
    font-size: 18px;
    margin-top: 2px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.job-overview-label {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    font-family: "Inter";
    margin-bottom: 2px;
}

.job-overview-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    font-family: "Inter";
}

.btn-apply-now {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background-color: var(--color-primary);
    color: var(--color-bg-white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: "Inter";
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.3s;
    cursor: pointer;
}

.btn-apply-now:hover {
    background-color: var(--color-primary-hover);
    color: var(--color-bg-white);
}

/* Sidebar CTA */
.sidebar-cta-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    font-family: "Inter";
    margin-bottom: 16px;
    text-align: center;
}

.sidebar-cta-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
}

.sidebar-cta-list li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    color: var(--color-text-dark);
    font-family: "Inter";
    line-height: 1.6;
    margin-bottom: 8px;
}

.sidebar-cta-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-primary);
}

/* ====== Mobile Responsive ====== */
@media (max-width: 768px) {
    .article-detail {
        padding: 80px 0 40px;
        overflow-x: hidden;
    }

    .article-detail .container {
        padding: 0 15px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Đảm bảo content ở trên, sidebar ở dưới */
    .detail-content {
        order: 1;
        max-width: 100%;
        overflow-x: hidden;
    }

    .detail-sidebar {
        order: 2;
        position: relative;
        top: 0;
    }

    /* Điều chỉnh title banner */
    .detail-title-banner {
        padding: 15px 20px;
        margin: 9px 15px 20px 15px;
    }

    .detail-title-banner h1 {
        font-size: 18px;
    }

    /* Điều chỉnh meta info */
    .detail-meta {
        flex-wrap: wrap;
        gap: 15px;
    }

    .meta-author,
    .meta-date {
        font-size: 13px;
    }

    /* Điều chỉnh social share */
    .detail-social-share {
        position: relative;
        left: 0;
        top: 0;
        flex-direction: row;
        justify-content: center;
        padding: 15px 0;
    }

    /* Điều chỉnh card */
    .detail-card {
        margin-left: 15px;
        margin-right: 15px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Điều chỉnh body - ngăn tràn */
    .detail-body {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Điều chỉnh TOC */
    .detail-toc {
        padding: 15px 18px;
    }

    .toc-title {
        font-size: 14px;
    }

    .toc-list {
        font-size: 14px;
    }

    /* Điều chỉnh body */
    .detail-body p {
        font-size: 15px;
    }

    .detail-body h2 {
        font-size: 20px;
    }

    /* Điều chỉnh table responsive */
    .detail-body .table-responsive {
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        width: 100%;
        display: block;
    }

    /* Table <= 3 cột: vừa màn hình */
    .detail-body table.table-fit {
        width: 100%;
        min-width: unset;
        table-layout: fixed;
        font-size: 13px;
    }

    .detail-body table.table-fit th,
    .detail-body table.table-fit td {
        padding: 8px 6px;
        font-size: 12px;
        word-wrap: break-word;
        white-space: normal;
    }

    .detail-body table.table-fit th {
        font-size: 11px;
    }

    /* Table > 3 cột: scroll ngang */
    .detail-body table.table-scroll {
        min-width: 600px;
        font-size: 13px;
    }

    .detail-body table.table-scroll th,
    .detail-body table.table-scroll td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .detail-body table.table-scroll th {
        font-size: 11px;
    }

    /* Điều chỉnh other articles */
    .other-article-item {
        flex-direction: column;
        gap: 12px;
    }

    .other-article-item img {
        width: 100%;
        height: auto;
    }

    /* Điều chỉnh sidebar */
    .sidebar-title {
        font-size: 16px;
        padding: 15px 20px;
    }

    .sidebar-content {
        padding: 15px;
    }

    .sidebar-related-item img {
        height: 120px;
    }

    /* Điều chỉnh job overview */
    .job-overview-item i {
        font-size: 16px;
    }

    .job-overview-label {
        font-size: 11px;
    }

    .job-overview-value {
        font-size: 13px;
    }

    .btn-apply-now {
        padding: 12px 16px;
        font-size: 15px;
    }

    .sidebar-cta-title {
        font-size: 15px;
    }

    .sidebar-cta-list li {
        font-size: 13px;
    }

    /* Điều chỉnh apply form */
    .apply-form-wrapper {
        padding: 25px 20px;
    }

    .apply-form-title {
        font-size: 20px;
        line-height: 1.4;
    }

    .apply-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .apply-input {
        padding: 12px 15px;
        font-size: 14px;
    }

    .apply-file-upload {
        padding: 12px 15px;
    }

    .apply-submit-btn {
        width: 100%;
        padding: 12px 30px;
        font-size: 15px;
    }
}
