/* =========================================================
   PHELIEUHOAPHAT.VN - NEWS DETAIL
   File: /public/theme/css/news-detail.css
   Desktop: article + professional latest-news sidebar.
   Mobile: latest news 2 cards / row.
   ========================================================= */

:root {
    --news-primary: #087d45;
    --news-primary-dark: #056536;
    --news-text: #252525;
    --news-muted: #6f7671;
    --news-border: #e6ebe7;
    --news-soft: #f7faf8;
    --news-white: #fff;
    --news-radius: 9px;
}

/* ===== Main detail layout ===== */
.space-ptb {
    padding-top: 32px;
    padding-bottom: 40px;
}

.space-ptb .container {
    max-width: 1140px;
}

.blog-detail .blog-post-title h1 {
    margin: 0 0 16px;
    color: #202420;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.38;
}

.blog-detail .blog-post-content {
    color: var(--news-text);
    font-size: 15.5px;
    line-height: 1.72;
}

.blog-detail .blog-post-content p {
    margin-bottom: 12px;
}

.blog-detail .blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 7px;
}

.blog-detail .blog-post-content h2 {
    margin: 27px 0 11px;
    color: #202420;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.blog-detail .blog-post-content h3 {
    margin: 22px 0 10px;
    color: #292d29;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.45;
}

.blog-detail hr {
    margin: 22px 0 16px;
    border: 0;
    border-top: 1px solid var(--news-border);
}

/* ===== Related news ===== */
.related-news-section {
    margin-top: 22px;
    padding: 17px 18px;
    background: var(--news-soft);
    border: 1px solid var(--news-border);
    border-radius: var(--news-radius);
}

.related-news-heading {
    position: relative;
    margin: 0 0 11px !important;
    padding-left: 12px;
    color: var(--news-primary) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.4;
}

.related-news-heading::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 4px;
    background: var(--news-primary);
    border-radius: 10px;
}

.related-news-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-news-list li {
    position: relative;
    margin: 0;
    padding: 5px 0 5px 16px;
}

.related-news-list li::before {
    content: "";
    position: absolute;
    top: 13px;
    left: 1px;
    width: 5px;
    height: 5px;
    background: var(--news-primary);
    border-radius: 50%;
}

.related-news-list a {
    color: #343934;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: color .2s ease;
}

.related-news-list a:hover {
    color: var(--news-primary);
}

/* ===== Latest news sidebar ===== */
.latest-news-section {
    position: sticky;
    top: 18px;
}

.latest-news-section .widget {
    padding: 18px;
    background: var(--news-white);
    border: 1px solid var(--news-border);
    border-radius: var(--news-radius);
    box-shadow: 0 6px 24px rgba(25, 55, 37, .06);
}

.latest-news-section .widget-title {
    margin: 0 0 16px;
}

.latest-news-heading {
    position: relative;
    margin: 0 !important;
    padding: 0 0 11px;
    color: #202420;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1.3;
}

.latest-news-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42px;
    height: 3px;
    background: var(--news-primary);
    border-radius: 10px;
}

.latest-news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.latest-news-card {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px 0;
    border-bottom: 1px solid var(--news-border);
}

.latest-news-card:first-child {
    padding-top: 0;
}

.latest-news-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.latest-news-thumb {
    display: block;
    width: 105px;
    overflow: hidden;
    background: #f2f4f3;
    border-radius: 7px;
    aspect-ratio: 4 / 3;
}

.latest-news-thumb img {
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    border-radius: 0 !important;
    transition: transform .32s ease;
}

.latest-news-card:hover .latest-news-thumb img {
    transform: scale(1.045);
}

.latest-news-body {
    min-width: 0;
}

.latest-news-title {
    display: block;
    margin: 0 0 6px !important;
    padding: 0;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.latest-news-title a {
    display: -webkit-box;
    overflow: hidden;
    color: #252525;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    transition: color .2s ease;
}

.latest-news-title a:hover {
    color: var(--news-primary);
}

.latest-news-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--news-muted);
    font-size: 12.3px;
    font-weight: 400;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ===== Tablet ===== */
@media (max-width: 991.98px) {
    .space-ptb {
        padding-top: 23px;
        padding-bottom: 32px;
    }

    .latest-news-section {
        position: static;
        margin-top: 28px !important;
    }

    .latest-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .latest-news-card,
    .latest-news-card:first-child,
    .latest-news-card:last-child {
        display: block;
        padding: 0;
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--news-border);
        border-radius: 8px;
    }

    .latest-news-thumb {
        width: 100%;
        border-radius: 0;
        aspect-ratio: 16 / 10;
    }

    .latest-news-body {
        padding: 10px;
    }
}

/* ===== Mobile: 2 articles / row ===== */
@media (max-width: 767.98px) {
    .space-ptb {
        padding-top: 16px;
        padding-bottom: 26px;
    }

    .space-ptb .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .blog-detail .blog-post-title h1 {
        margin-bottom: 14px;
        font-size: 22px;
        line-height: 1.4;
    }

    .blog-detail .blog-post-content {
        font-size: 15px;
        line-height: 1.7;
    }

    .related-news-section {
        margin-top: 20px;
        padding: 14px;
    }

    .related-news-heading {
        font-size: 17px !important;
    }

    .related-news-list li {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .related-news-list a {
        font-size: 13.5px;
    }

    .latest-news-section .widget {
        padding: 14px;
    }

    .latest-news-heading {
        font-size: 18px !important;
    }

    .latest-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .latest-news-card,
    .latest-news-card:first-child,
    .latest-news-card:last-child {
        display: flex;
        min-width: 0;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--news-border);
        border-radius: 8px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, .035);
    }

    .latest-news-thumb {
        width: 100%;
        flex-shrink: 0;
        border-radius: 0;
        aspect-ratio: 16 / 10;
    }

    .latest-news-body {
        padding: 9px 9px 10px;
    }

    .latest-news-title {
        margin-bottom: 5px !important;
        font-size: 13.5px !important;
        line-height: 1.4 !important;
    }

    .latest-news-description {
        font-size: 12px;
        line-height: 1.45;
        -webkit-line-clamp: 2;
    }
}

/* ===== Small mobile: still 2 / row ===== */
@media (max-width: 420px) {
    .latest-news-section .widget {
        padding: 11px;
    }

    .latest-news-grid {
        gap: 9px;
    }

    .latest-news-body {
        padding: 8px;
    }

    .latest-news-title {
        font-size: 13px !important;
    }

    .latest-news-description {
        font-size: 11.5px;
    }
}


/* =========================================================
   FINAL CARD LAYOUT
   Namespace only for News Detail - does not alter global
   Bootstrap .row / .col-lg-8 / .breadcrumb site-wide.
   ========================================================= */

/* ===== Breadcrumb card ===== */
.news-breadcrumb-wrap {
    margin-top: 14px;
    margin-bottom: 0;
}

.news-breadcrumb-wrap > .row {
    margin-left: 0;
    margin-right: 0;
}

.news-breadcrumb-wrap > .row > .col-12 {
    padding-left: 0;
    padding-right: 0;
}

.news-breadcrumb-wrap .breadcrumb {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0 !important;
    padding: 10px 14px;
    background: var(--news-soft);
    border: 1px solid var(--news-border);
    border-radius: var(--news-radius);
    color: #727973;
    font-size: 13.5px;
    line-height: 1.5;
}

.news-breadcrumb-wrap .breadcrumb-item {
    min-width: 0;
}

.news-breadcrumb-wrap .breadcrumb-item a {
    color: #5e665f;
    text-decoration: none;
    transition: color .2s ease;
}

.news-breadcrumb-wrap .breadcrumb-item a:hover {
    color: var(--news-primary);
}

.news-breadcrumb-wrap .breadcrumb-item.active {
    overflow: hidden;
    color: #3e4540;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Main row spacing ===== */
.news-detail-layout {
    align-items: flex-start;
    margin-left: -10px;
    margin-right: -10px;
}

.news-detail-layout > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

/* ===== Article card ===== */
.news-article-card {
    padding: 24px 26px;
    background: var(--news-white);
    border: 1px solid var(--news-border);
    border-radius: 10px;
    box-shadow: 0 5px 22px rgba(25, 55, 37, .045);
}

/* The related-news box already has its own visual separation. */
.news-article-card .related-news-section {
    margin-bottom: 0;
}

/* Keep both columns visually consistent. */
.news-detail-layout .latest-news-section .widget {
    border-radius: 10px;
    box-shadow: 0 5px 22px rgba(25, 55, 37, .045);
}

/* ===== Tablet / Mobile ===== */
@media (max-width: 991.98px) {
    .news-breadcrumb-wrap {
        margin-top: 10px;
    }

    .news-detail-layout {
        margin-left: -7px;
        margin-right: -7px;
    }

    .news-detail-layout > [class*="col-"] {
        padding-left: 7px;
        padding-right: 7px;
    }

    .news-article-card {
        padding: 20px;
    }
}

@media (max-width: 767.98px) {
    .news-breadcrumb-wrap {
        padding-left: 14px;
        padding-right: 14px;
        margin-top: 8px;
    }

    .news-breadcrumb-wrap .breadcrumb {
        min-height: 40px;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 12.5px;
    }

    .news-breadcrumb-wrap .breadcrumb-item.active {
        max-width: 68vw;
    }

    .news-detail-layout {
        margin-left: -7px;
        margin-right: -7px;
    }

    .news-article-card {
        padding: 16px 14px;
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(25, 55, 37, .04);
    }

    .news-detail-layout .latest-news-section .widget {
        border-radius: 8px;
    }
}
