/*----------------------------------------*/
/* CSS Page News Index
/*----------------------------------------*/
/* Custom title - page */
.title-page {
    font-size: 60px;
    margin-bottom: 40px;
    transition: font-size 200ms;
}

/* Custom Shadow header-title */
.header-title {
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4);
}

/* Custom .intro-text -> Span */
.intro-text span {
    background: #e8342c;
    padding: 0 10px;
    display: inline-block;
}

/* News post */
.news-post article {
    background-color: #ffffff;
    padding: 30px;
    height: 100%;
    transition: transform 0.15s ease-out;
    will-change: transform;
    contain: layout style paint;
}

.news-post .news-img {
    overflow: hidden;
    display: inline-block;
    max-height: 222px;
    margin: -16px -23px 0 -23px;
    transition: margin 250ms ease-in-out;
}

.news-post .title {
    font-size: 20px;
    font-weight: 700;
    padding: 0;
    margin: 20px 0 0 0;
}

.news-post .title a {
    color: #222222;
    transition: 0.3s;
    text-decoration: auto;
}

.news-post .title a:hover {
    color: #222222;
}

.news-post .meta-top {
    margin-top: 15px;
    color: color-mix(in srgb, #666666, transparent 40%);
}

.news-post .meta-top ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    align-items: center;
    padding: 0;
    margin: 0;
}

.news-post .meta-top ul li:last-child {
    margin-left: auto;
}

.news-post .meta-top ul li {
    font-size: 14px;
}

.news-post .meta-top i {
    font-size: 16px;
    margin-right: 8px;
    line-height: 0;
    color: color-mix(in srgb, #666666, transparent 40%);
}

.news-post .content {
    margin-top: 20px;
}

.news-post .read-more a {
    display: inline-block;
    color: #222222;
    padding: 2px 0px;
    font-size: 14px;
    font-weight: 500;
    background-color: transparent;
    -webkit-transition: all 0.4s;
    -o-transition: all 0.4s;
    transition: all 0.4s;
}

.news-post .read-more a:hover {
    background: #d22f26;
    color: #ffffff;
    padding: 2px 10px;
}

.news-post article:hover .img-cover,
.news-post article:focus-within .img-cover {
    transform: scale(1.2);
}

.news-post article:hover,
.news-post article:focus {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.news-post article hr {
    border-top: 1px solid #e8342c;
    opacity: 1;
}

.news-gutters {
    --bs-gutter-y: 2rem;
    --bs-gutter-x: 2rem;
}

/* Border top news card */
.line-card-news {
    position: relative;
    display: inline-block;
    overflow: hidden;
    display: block;
    width: 100%;
    height: auto;
}

.line-card-news::before,
.line-card-news::after {
    content: "";
    position: absolute;
    top: 0;
    height: 7px;
    transition: width 0.8s ease;
    z-index: 1;
    pointer-events: none;
}

.line-card-news::before {
    left: 0;
    background: linear-gradient(45deg, #e8342c 90%, #333 10%);
    width: 20%;
}

.line-card-news::after {
    right: 0;
    background: #333;
    width: 80%;
}

.line-card-news:hover::before {
    width: 90%;
}

.line-card-news:hover::after {
    width: 10%;
}

/* Border logo */
.border-logo {
    border: 1px solid #e8342c !important;
}

/* Summernote custome */
.note-editor > .note-editing-area > .note-editable{
    background-color: #FFFFFF !important;
    padding: 0px !important;
}

.content .note-editor{
    margin-bottom:  0px !important;
    border: none !important;
    max-height: 150px !important;
}

.content-news-detail .note-editor{
    margin-bottom:  0px !important;
    border: none !important;
}

.note-airframe {
    border: none !important;
}

/* More text custome */
.text-truncate-content {
    position: relative;
    max-height: 6em;
    line-height: 1.5em;
    overflow: hidden;
}

.more-line-content {
    overflow: hidden !important;
    text-overflow: ellipsis;
}

.text-truncate-content::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2em;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 1) 100%
    );
    pointer-events: none;
}

/* News post pagination */
.pagination {
    display: flex;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
}

.page-item:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.page-item:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.page-item:not(:first-child) {
    margin-left: calc(1px * -1);
}

.page-active {
    font-size: 16px !important;
    color: #ffffff !important;
    background-color: #e8342c !important;
    border-color: #e8342c !important;
    cursor: default !important;
    margin-left: 0px !important;
}

li.page-active + li.page-item {
    margin-left: 0px !important;
}

.pagination li {
    font-size: 16px;
    font-weight: 400;
    color: rgba(33, 37, 41, 0.75);
}

.page-link:focus {
    box-shadow: none;
}

.page-link:not(.page-active):hover,
.page-link:not(.page-active):focus {
    color: #E8342C !important;
}

.page-item:not(.disabled) {
    cursor: pointer;
}


/* Empty news */
.empty-news i {
    font-size: 100px !important;
    opacity: 0.1 !important
}

.empty-news span{
    font-weight: 500 !important;
    color: #666666 !important;
}

/* More text title */
.text-truncate-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    color: #E8342C;
    transition: 0.3s;
}

.text-truncate-title:hover {
    color: #d22f26 !important;
}

/* Custom bg-danger */
.news-post .bg-danger {
    background-color: #ffffff !important;
    font-size: 13px !important;
    color: #222222 !important;
    border: 1px solid #222222;
}

.pin-news {
    top: 8px !important;
    right: 8px !important;
}

.pin-news span {
    background-color: transparent !important;
    border: 1px solid #e8342c !important;
    padding: 0.375rem 0.575rem !important;
}

.pin-news i {
    color: #e8342c !important;
    font-size: 1.1rem !important;
}

/* Custom filter-news */
.projects-filter-nav li {
    margin-left: 15px;
    transition: margin 200ms ease-in-out;
}

.projects-filter-nav {
    margin-top: 15px;
    transition: margin 200ms ease-in-out;
}

/* Custom title-page when width < 767 */
@media only screen and (max-width: 767px) {
    .title-page {
        font-size: 45px;
    }
}

/* Custom title-page when width < 1400 and > 1200 */
@media only screen and (min-width: 1200px) and (max-width: 1400px) {
    .title-page {
        font-size: 50px;
    }
}

/* Custom .col-lg-4, title-page, filter-news when width < 1200 and > 992 */
@media only screen and (min-width: 992px) and (max-width: 1200px) {
    #loadNews .col-lg-4 {
        flex: 0 0 auto;
        width: 50%;
    }

    .projects-filter-nav {
        margin-top: 5px;
        text-align: right;
    }

    .projects-filter-nav li {
        margin-left: 4px;
    }

    .title-page {
        font-size: 42px;
    }
}

/* Custom news-img, article, li when width < 980 */
@media only screen and (max-width: 980px) {
    #loadNews .news-img {
        margin: -6px -13px 0 -13px;
    }

    #loadNews article {
        padding: 20px;
    }
}

/* Custom title-page when width < 430 */
@media only screen and (max-width: 430px) {
    .title-page {
        font-size: 40px;
    }
}

/*----------------------------------------*/
/* CSS Page News Details
/*----------------------------------------*/
/* Title news post */
.title-news {
    font-size: 60px;
    margin-bottom: 10px;
    transition: font-size 200ms;
}

/* Background News */
.bg-news {
    background-color: #8b1f1a;
}

/* Long line */
.lined-heading {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    margin: 1em 0;
}

/* Long line on the left */
.lined-heading::before {
    content: '';
    flex: 1 1 auto;
    border-top: 2px solid #e8342c;
    margin-right: 0.75em;
}

/* Short line on the right */
.lined-heading::after {
    content: '';
    flex: 0 0 50px;
    border-top: 2px solid #e8342c;
    margin-left: 0.75em;
}

.lined-heading p {
    color: #696969;
}

.border-related {
    border: 1px solid #e8342c;
    opacity: 1;
}

.text-color {
    color: #e8342c;
}

/* Custom container-news-details */
.container-news-details {
    padding: 3rem;
    transition: padding 250ms ease-in-out;
}

/* Custom section-news-details */
.section-news-details {
    padding: 15px;
    transition: padding 250ms ease-in-out;
}

/* Custom btn-back-news */
.btn-back-news {
    font-size: 14px;
    font-weight: 500;
    color: #222222;
    background-color: #ffffff;
    display: inline-block;
    padding: 2px 0px;
    background-color: transparent;
    -webkit-transition: all 0.4s;
    -o-transition: all 0.4s;
    transition: all 0.4s;
    cursor: pointer;
}

.btn-back-news:hover {
    background-color: #e8342c;
    color: #ffffff;
    padding: 2px 10px;
}

/* Custom lined-heading p when width < 460 */
@media only screen and (max-width: 460px) {
    .lined-heading p:first-child {
        display: none;
    }
}

/* Custom container-news-details, section-news-details, title-news when width < 500 */
@media only screen and (max-width: 500px) {
    .container-news-details {
        padding: 1rem;
    }

    .section-news-details {
        padding: 0.7rem;
    }

    .title-news {
        font-size: 40px;
    }
}

/* Custom news-img, article, li when width < 390 */
@media only screen and (max-width: 390px) {
    #related-news .news-img {
        margin: -6px -13px 0 -13px;
    }

    #related-news article {
        padding: 20px;
    }
}

/* Custom col-lg-4 when width < 1200 and > 820 */
@media only screen and (min-width: 820px) and (max-width: 1200px) {
    #related-news .col-lg-4 {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* Custom col-md-6 when width < 840 and > 500 */
@media only screen and (min-width: 500px) and (max-width: 840px) {
    #related-news .col-md-6 {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* Custom container-news-details, title-news when width < 1024 and > 500 */
@media only screen and (min-width: 500px) and (max-width: 1024px) {
    .container-news-details {
        padding: 1.8rem;
    }

    .title-news {
        font-size: 45px;
    }
}

/*--------------------------------------------------------------
# Scroll Top Button
--------------------------------------------------------------*/
.scroll-top {
    position: fixed;
    visibility: hidden;
    opacity: 0;
    right: 15px;
    bottom: 15px;
    z-index: 99999;
    background-color: #e8342c;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translate3d(0, 0, 0);
    text-decoration: auto;
    cursor: pointer;
}

.scroll-top i {
    font-size: 24px;
    color: #ffffff;
    line-height: 0;
}

.scroll-top:hover {
    background-color: #d22f26;
    color: #ffffff;
}

.scroll-top.active {
    visibility: visible;
    opacity: 1;
}

/* Custom scroll-top when width < 768 */
@media screen and (max-width: 768px) {
    .scroll-top {
        width: 30px;
        height: 30px;
    }

    .scroll-top i {
        font-size: 15px;
    }
}

/*--------------------------------------------------------------
# Animation show more news (Optimized for performance)
--------------------------------------------------------------*/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 15px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.news-animated {
    animation: fadeInUp 0.25s ease-out forwards;
    will-change: transform, opacity;
}

.news-animated.animation-complete {
    will-change: auto;
}

/*--------------------------------------------------------------
# Loading States and Performance Optimizations
--------------------------------------------------------------*/
.loading-indicator {
    opacity: 0.7;
    font-size: 14px;
    color: #666;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.5;
    }
    to {
        opacity: 1;
    }
}

/* Performance optimizations */
.news-post .news-img img {
    transform: translate3d(0, 0, 0);
    will-change: transform;
    transition: transform 0.4s ease-out;
}

.news-post article:hover .news-img img {
    transform: translate3d(0, 0, 0) scale(1.15);
}

/* Prevent layout shifts during loading */
.news-post article {
    min-height: 400px;
}

/* Smooth transitions for better UX */
.projects-filter-nav li {
    transition: background-color 0.15s ease, color 0.15s ease;
}

/*--------------------------------------------------------------
# Skeleton Loading Animation
--------------------------------------------------------------*/
.news-skeleton {
    background-color: #ffffff;
    padding: 30px;
    height: 450px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.skeleton-img {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 20px;
}

.skeleton-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 15px;
}

.skeleton-meta {
    height: 14px;
    width: 60%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 20px;
}

.skeleton-content {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 8px;
}

.skeleton-content:last-child {
    width: 80%;
}

@keyframes loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/*--------------------------------------------------------------
# Countdown news
--------------------------------------------------------------*/
.countdown {
    display: flex;
    justify-content: left;
    gap: 15px;
    margin: 25px 0 20px 0;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-item span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e8342c;
    background-color: #f3f4f6;
    border-radius: 5px;
    padding: 10px 15px;
    min-width: 60px;
    text-align: center;
}

.countdown-item .label {
    font-size: 1rem;
    color: #666;
    background-color: transparent;
    font-weight: normal;
    text-align: center;
}

.news-maintenance,
.pe-img {
    padding-right: 3rem;
}

.img-news {
    width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.img-cover {
    width: 100%;
    height: 221px;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s ease;
}

/* Custom countdown when width < 360 */
@media screen and (max-width: 360px) {
    .countdown {
        display: block;
    }
}

/* Custom news-maintenance when width < 991 */
@media only screen and (max-width: 991px) {
    .news-maintenance,
    .pe-img {
        padding-right: .75rem;
    }
}
