/* ========================================
   Detail Pages Content Styles
   Styles cho nội dung chi tiết của article-detail, service-detail, project-detail
   ======================================== */

/* Container chính cho nội dung chi tiết */
.article-detail,
.service-detail,
.project-detail {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

/* Header section */
.article-header,
.service-header,
.project-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Title */
.article-title,
.service-title {
    font-family: "Saira", sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0 0 0 0;
    text-transform: none;
}

/* Meta information */
.article-meta {
    font-size: 14px;
    color: #666;
    margin-top: 15px;
}

.article-date {
    color: #888;
    font-weight: 400;
}

.article-footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

.article-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #fff;
}

.article-tags strong {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* Featured Image */
.article-featured-image,
.service-featured-image,
.project-featured-image {
    margin-bottom: 35px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-featured-image img,
.service-featured-image img,
.project-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.article-featured-image:hover img,
.service-featured-image:hover img,
.project-featured-image:hover img {
    transform: scale(1.02);
}

/* Short Description */
.article-short-description,
.service-short-description,
.project-short-description {
    font-size: 18px;
    line-height: 1.8;
    color: #444;
    font-weight: 400;
    margin-bottom: 35px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #005904;
    border-radius: 4px;
}

.article-short-description p,
.service-short-description p,
.project-short-description p {
    margin: 0;
}

/* Main Content Area - Sử dụng class .hl-editor */
.hl-editor {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    word-wrap: break-word;
}

/* Typography trong nội dung */
.hl-editor h1,
.hl-editor h2,
.hl-editor h3,
.hl-editor h4,
.hl-editor h5,
.hl-editor h6 {
    font-family: "Saira", sans-serif;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 35px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.hl-editor h1 {
    font-size: 28px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 10px;
}

.hl-editor h2 {
    font-size: 24px;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 8px;
}

.hl-editor h3 {
    font-size: 20px;
}

.hl-editor h4 {
    font-size: 18px;
}

.hl-editor h5 {
    font-size: 17px;
}

.hl-editor h6 {
    font-size: 16px;
}

/* Paragraphs */
.hl-editor p {
    margin-bottom: 15px;
    text-align: justify;
}

.hl-editor p:last-child {
    margin-bottom: 0;
}

/* Links */
.hl-editor a {
    color: #005904;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.hl-editor a:hover {
    color: #003d03;
    text-decoration: none;
}

/* Lists */
.hl-editor ul,
.hl-editor ol {
    margin: 20px 0;
    padding-left: 30px;
}

.hl-editor ul li,
.hl-editor ol li {
    margin-bottom: 12px;
    line-height: 1.4;
}

.hl-editor ul {
    list-style-type: disc;
}

.hl-editor ol {
    list-style-type: decimal;
}

.hl-editor ul ul {
    list-style-type: circle;
    margin-top: 10px;
    margin-bottom: 10px;
}

.hl-editor ol ol {
    list-style-type: lower-alpha;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Images trong nội dung */
.hl-editor img {
    max-width: 100%;
    height: auto;
    margin: 25px 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.hl-editor img.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.hl-editor img.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

.hl-editor img.aligncenter {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Blockquotes */
.hl-editor blockquote {
    margin: 30px 0;
    padding: 20px 25px;
    border-left: 4px solid #005904;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
    border-radius: 4px;
}

.hl-editor blockquote p {
    margin-bottom: 10px;
}

.hl-editor blockquote p:last-child {
    margin-bottom: 0;
}

/* Tables */
.hl-editor table {
    width: 100%;
    margin: 25px 0;
    border-collapse: collapse;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.hl-editor table th,
.hl-editor table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.hl-editor table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.hl-editor table tr:last-child td {
    border-bottom: none;
}

.hl-editor table tr:hover {
    background: #f8f9fa;
}

/* Code */
.hl-editor code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #d63384;
}

.hl-editor pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 25px 0;
    border: 1px solid #e8e8e8;
}

.hl-editor pre code {
    background: transparent;
    padding: 0;
    color: #333;
}

/* Strong và Emphasis */
.hl-editor strong,
.hl-editor b {
    font-weight: 700;
    color: #1a1a1a;
}

.hl-editor em,
.hl-editor i {
    font-style: italic;
}

/* Horizontal Rule */
.hl-editor hr {
    border: none;
    border-top: 2px solid #e8e8e8;
    margin: 35px 0;
}

/* Iframes (YouTube, etc.) */
.hl-editor iframe {
    max-width: 100%;
    margin: 25px 0;
    border-radius: 6px;
    display: block;
}

/* Video tags */
.hl-editor video {
    max-width: 100%;
    height: auto;
    margin: 25px 0;
    border-radius: 6px;
    display: block;
}

/* Video wrapper (responsive video container) */
.hl-editor .videoWrapper,
.hl-editor .mediaembed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 25px 0;
    border-radius: 6px;
}

.hl-editor .videoWrapper iframe,
.hl-editor .mediaembed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
}

/* Figure and Figcaption (CKEditor image captions) */
.hl-editor figure {
    margin: 25px 0;
    text-align: center;
}

.hl-editor figure img {
    margin: 0;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.hl-editor figcaption {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    text-align: center;
}

/* Text Alignment Classes */
.hl-editor .text-left {
    text-align: left;
}

.hl-editor .text-center {
    text-align: center;
}

.hl-editor .text-right {
    text-align: right;
}

.hl-editor .text-justify {
    text-align: justify;
}

/* Image Alignment Classes (CKEditor default classes) */
.hl-editor img.left,
.hl-editor .alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
    margin-top: 5px;
}

.hl-editor img.right,
.hl-editor .alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
    margin-top: 5px;
}

.hl-editor img.center,
.hl-editor .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    float: none;
}

/* Text Formatting (CKEditor) */
.hl-editor u {
    text-decoration: underline;
}

.hl-editor strike,
.hl-editor del {
    text-decoration: line-through;
}

.hl-editor sub {
    vertical-align: sub;
    font-size: 0.8em;
    line-height: 0;
}

.hl-editor sup {
    vertical-align: super;
    font-size: 0.8em;
    line-height: 0;
}

.hl-editor small {
    font-size: 0.875em;
}

.hl-editor big {
    font-size: 1.25em;
}

.hl-editor mark,
.hl-editor .marker {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
}

.hl-editor ins {
    text-decoration: underline;
    background-color: #e8f5e9;
    padding: 2px 4px;
    border-radius: 2px;
}

.hl-editor del {
    background-color: #ffebee;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Typography Elements */
.hl-editor cite {
    font-style: italic;
    color: #555;
}

.hl-editor q {
    quotes: '"' '"' "'" "'";
    font-style: italic;
}

.hl-editor q::before {
    content: open-quote;
}

.hl-editor q::after {
    content: close-quote;
}

.hl-editor abbr {
    text-decoration: underline dotted;
    cursor: help;
}

.hl-editor acronym {
    text-decoration: underline;
    cursor: help;
}

.hl-editor address {
    font-style: italic;
    margin: 20px 0;
    padding-left: 20px;
    border-left: 3px solid #e8e8e8;
}

/* Code Elements */
.hl-editor kbd {
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #333;
}

.hl-editor samp {
    font-family: 'Courier New', monospace;
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.hl-editor var {
    font-style: italic;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

.hl-editor tt {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Divs với các class từ CKEditor */
.hl-editor div {
    margin: 15px 0;
}

.hl-editor div[style*="text-align: left"] {
    text-align: left;
}

.hl-editor div[style*="text-align: center"] {
    text-align: center;
}

.hl-editor div[style*="text-align: right"] {
    text-align: right;
}

.hl-editor div[style*="text-align: justify"] {
    text-align: justify;
}

/* Indentation */
.hl-editor [style*="padding-left"],
.hl-editor [style*="margin-left"] {
    /* Giữ nguyên indentation nhưng đảm bảo responsive */
    max-width: 100%;
    overflow-x: auto;
}

/* Direction (RTL/LTR) */
.hl-editor [dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.hl-editor [dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Clear floats */
.hl-editor::after,
.hl-editor::after {
    content: "";
    display: table;
    clear: both;
}

/* Nested elements spacing */
.hl-editor p + p {
    margin-top: 0;
}

.hl-editor h1 + p,
.hl-editor h2 + p,
.hl-editor h3 + p {
    margin-top: 0;
}

/* Sidebar Styling */
.sidebar.sidebar-right {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.sidebar .widget-area {
    margin-bottom: 0;
}

.sidebar .widget {
    margin-bottom: 25px;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

.project-item{
    overflow: hidden;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-title  {
    padding: 10px;
    text-align: center;
    margin-bottom: 0;
}
h1.project-title {
    font-family: "Saira", sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0 0 0 0;
    text-transform: none;
    text-align: left !important;
}
.project-title a {
    display: inline-block;
    width: 100%;
    font-size: 16px;
    line-height: 1.4;
    font-weight: bold;
    margin-bottom: 6px;
    color: #000;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Related Items Section */
.related-articles,
.related-services,
.related-projects,
.related-products {
    margin-top: 20px !important;
    padding-top: 20px;
}

.related-articles h2,
.related-services h2,
.related-projects h2,
.related-products h2 {
    font-family: "Saira", sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.related-articles h2::after,
.related-services h2::after,
.related-projects h2::after,
.related-products h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #005904;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 991px) {
    .sidebar.sidebar-right {
        position: static;
        margin-top: 40px;
    }

    .related-articles,
    .related-services,
    .related-projects,
    .related-products {
        margin-top: 40px;
        padding-top: 30px;
    }

    .related-articles h2,
    .related-services h2,
    .related-projects h2,
    .related-products h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .article-detail,
    .service-detail,
    .project-detail {
        padding: 30px;
        margin-bottom: 30px;
    }

    .article-title,
    .service-title {
        font-size: 28px;
    }

    .article-short-description,
    .service-short-description,
    .project-short-description {
        font-size: 17px;
        padding: 18px;
    }

    .hl-editor {
        font-size: 15.5px;
    }

    .hl-editor h1 {
        font-size: 26px;
    }

    .hl-editor h2 {
        font-size: 22px;
    }

    .hl-editor h3 {
        font-size: 19px;
    }
}

@media (max-width: 767px) {
    .article-detail,
    .service-detail,
    .project-detail {
        padding: 25px 20px;
        margin-bottom: 25px;
        border-radius: 8px;
    }

    /* Reset float trên mobile cho images */
    .hl-editor img.left,
    .hl-editor img.right,
    .hl-editor .alignleft,
    .hl-editor .alignright {
        float: none;
        display: block;
        margin-left: auto;
        margin-right: auto;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    /* Video wrapper trên mobile */
    .hl-editor .videoWrapper,
    .hl-editor .mediaembed {
        margin: 20px 0;
    }

    /* Figure trên mobile */
    .hl-editor figure {
        margin: 20px 0;
    }

    .article-header,
    .service-header,
    .project-header {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }

    .article-title,
    .service-title {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .article-featured-image,
    .service-featured-image,
    .project-featured-image {
        margin-bottom: 25px;
        border-radius: 6px;
    }

    .article-short-description,
    .service-short-description,
    .project-short-description {
        font-size: 16px;
        padding: 15px;
        margin-bottom: 25px;
    }

    .hl-editor {
        font-size: 15px;
        line-height: 1.8;
    }

    .hl-editor h1 {
        font-size: 22px;
        margin-top: 30px;
    }

    .hl-editor h2 {
        font-size: 20px;
        margin-top: 28px;
    }

    .hl-editor h3 {
        font-size: 18px;
        margin-top: 25px;
    }

    .hl-editor h4 {
        font-size: 17px;
    }

    .hl-editor p {
        margin-bottom: 18px;
        text-align: left;
    }

    .hl-editor ul,
    .hl-editor ol {
        margin: 18px 0;
        padding-left: 25px;
    }

    .hl-editor img {
        margin: 20px 0;
        border-radius: 4px;
    }

    .hl-editor blockquote {
        margin: 25px 0;
        padding: 15px 20px;
    }

    .hl-editor table {
        font-size: 14px;
        margin: 20px 0;
    }

    .hl-editor table th,
    .hl-editor table td {
        padding: 10px 12px;
    }
}

@media (max-width: 575px) {
    .article-detail,
    .service-detail,
    .project-detail {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    h1.project-title {
        font-size: 22px;
        margin-bottom: 0;
    }
    .article-title,
    .service-title {
        font-size: 22px;
        margin-bottom: 0;
    }

    .article-short-description,
    .service-short-description,
    .project-short-description {
        font-size: 15px;
        padding: 12px;
    }

    .hl-editor {
        font-size: 14.5px;
        line-height: 1.75;
    }

    /* Đảm bảo tất cả images không float trên mobile */
    .hl-editor img {
        float: none !important;
        display: block;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 20px;
    }

    /* Tables responsive trên mobile */
    .hl-editor table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        width: 100%;
    }

    .hl-editor table thead,
    .hl-editor table tbody,
    .hl-editor table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    /* Blockquotes trên mobile */
    .hl-editor blockquote {
        padding: 15px;
        font-size: 14px;
    }

    /* Pre code trên mobile */
    .hl-editor pre {
        padding: 15px;
        font-size: 13px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Figure caption trên mobile */
    .hl-editor figcaption {
        font-size: 13px;
        margin-top: 8px;
    }
}
