/* ==========================================================
   News Timeline Widget — PathSoft-style CSS
   Plugin: News Timeline Widget for Elementor
   ========================================================== */

/* ── Core variables (fallback if PathSoft not present) ── */
.ntw-timeline {
    --ntw-main:        #186ADC;
    --ntw-border:      #D4D4E1;
    --ntw-bg:          #F0F4F8;
    --ntw-text:        #303036;
    --ntw-text-sec:    #63636b;
    --ntw-white:       #ffffff;
    --ntw-radius:      10px;
    --ntw-radius-min:  6px;
    --ntw-shadow:      2px 4px 20px 1px rgba(45,45,45,.13);

    position: relative;
    margin-left: auto;
    margin-right: auto;
}

/* ── Vertical spine ─────────────────────────────────────── */
.ntw-timeline::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    margin-left: -1px;
    height: 100%;
    background-color: var(--ntw-border);
    z-index: 0;
}

/* ── Year badge ─────────────────────────────────────────── */
.ntw-timeline-title {
    position: relative;
    background-color: var(--ntw-white);
    text-align: center;
    z-index: 2;
    padding: .625rem 0;
}

.ntw-timeline-title-mt {
    margin-top: 3.1875rem;
}

.ntw-timeline-year {
    display: inline-block;
    background-color: var(--ntw-white);
    color: var(--ntw-main);
    font-weight: 700;
    font-size: 1rem;
    padding: .25rem 1rem;
    border: 2px solid var(--ntw-main);
    border-radius: var(--ntw-radius-min);
    position: relative;
    z-index: 3;
}

/* ── Left / Right columns ───────────────────────────────── */
.ntw-timeline-item-left,
.ntw-timeline-item-right {
    position: relative;
    width: 50%;
    padding-bottom: 45px;
}

.ntw-timeline-item-left {
    padding-right: 3.5rem;
    left: 0;
}

.ntw-timeline-item-right {
    padding-left: 3.5rem;
    left: 50%;
}

/* ── Horizontal connector line ──────────────────────────── */
.ntw-timeline-item-left::after {
    content: "";
    position: absolute;
    right: 0;
    top: 3.1875rem;
    width: 3.5rem;
    height: 2px;
    background-color: var(--ntw-border);
    transition: background-color .2s;
}

.ntw-timeline-item-right::after {
    content: "";
    position: absolute;
    left: 0;
    top: 3.1875rem;
    width: 3.5rem;
    height: 2px;
    background-color: var(--ntw-border);
    transition: background-color .2s;
}

/* ── Dot on spine ───────────────────────────────────────── */
.ntw-timeline-item-left::before {
    content: "";
    position: absolute;
    right: -0.5rem;
    top: calc(3.1875rem - .4375rem);
    width: 1rem;
    height: 1rem;
    background-color: var(--ntw-border);
    border-radius: 50%;
    z-index: 2;
    transition: background-color .2s;
}

.ntw-timeline-item-right::before {
    content: "";
    position: absolute;
    left: -0.5rem;
    top: calc(3.1875rem - .4375rem);
    width: 1rem;
    height: 1rem;
    background-color: var(--ntw-border);
    border-radius: 50%;
    z-index: 2;
    transition: background-color .2s;
}

/* ── Hover: line + dot go blue ──────────────────────────── */
.ntw-timeline-item-left:hover::after,
.ntw-timeline-item-left:hover::before,
.ntw-timeline-item-right:hover::after,
.ntw-timeline-item-right:hover::before {
    background-color: var(--ntw-main);
}

/* ── Card ───────────────────────────────────────────────── */
.ntw-item-style {
    position: relative;
    background-color: var(--ntw-white);
    border-radius: var(--ntw-radius);
    overflow: hidden;
    color: var(--ntw-text);
    height: 100%;
    transition: box-shadow .2s;
}

.ntw-item-style::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--ntw-radius);
    border: 1px solid var(--ntw-border);
    pointer-events: none;
    transition: border-color .2s;
    z-index: 1;
}

.ntw-item-style:hover {
    box-shadow: var(--ntw-shadow);
}

.ntw-item-style:hover::after {
    border-color: transparent;
}

/* ── Thumbnail ──────────────────────────────────────────── */
.ntw-news-item-img {
    display: block;
    width: 100%;
    overflow: hidden;
}

.ntw-news-item-img img {
    display: block;
    width: 100%;
    height: 208px; /* default — overridden by Elementor slider */
    object-fit: cover;
    transition: transform .4s;
}

.ntw-item-style:hover .ntw-news-item-img img {
    transform: scale(1.04);
}

/* ── Info block ─────────────────────────────────────────── */
.ntw-news-item-info {
    position: relative;
    padding: 2.25rem 1.25rem 1.25rem;
}

/* ── Date badge ─────────────────────────────────────────── */
.ntw-news-item-date {
    position: absolute;
    left: 50%;
    top: -1.125rem;
    height: 2.25rem;
    line-height: 2.25rem;
    padding: 0 .75rem;
    background-color: var(--ntw-main);
    color: var(--ntw-white);
    font-size: .8125rem;
    border-radius: var(--ntw-radius-min);
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 2;
}

/* ── Post title ─────────────────────────────────────────── */
.ntw-news-item-heading {
    margin: 0 0 .625rem;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.ntw-news-item-heading a {
    color: var(--ntw-text);
    text-decoration: none;
    transition: color .2s;
}

.ntw-news-item-heading a:hover {
    color: var(--ntw-main);
}

/* ── Excerpt ────────────────────────────────────────────── */
.ntw-news-item-desc {
    color: var(--ntw-text-sec);
    font-size: .9375rem;
    line-height: 1.6;
    margin-bottom: .75rem;
}

.ntw-news-item-desc p {
    margin: 0;
}

/* ── Read more ──────────────────────────────────────────── */
.ntw-news-nav {
    margin-top: .75rem;
}

.ntw-read-more {
    display: inline-flex;
    align-items: center;
    color: var(--ntw-main);
    text-decoration: none;
    font-size: .9375rem;
    font-weight: 600;
    transition: gap .2s;
    gap: .25rem;
}

.ntw-read-more:hover {
    text-decoration: underline;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet: still two columns but narrower connectors */
@media (max-width: 991.98px) {
    .ntw-timeline::after {
        left: 1rem;
        margin-left: 0;
    }

    .ntw-timeline-title {
        text-align: left;
        padding-left: 3rem;
    }

    .ntw-timeline-item-left,
    .ntw-timeline-item-right {
        width: 100%;
        left: 0;
        padding-left: 3.5rem;
        padding-right: 0;
    }

    /* Connector left-side only */
    .ntw-timeline-item-left::after,
    .ntw-timeline-item-right::after {
        left: 0;
        right: auto;
        width: 2.5rem;
        top: 3.1875rem;
    }

    .ntw-timeline-item-left::before,
    .ntw-timeline-item-right::before {
        left: -0.5rem;
        right: auto;
        top: calc(3.1875rem - .4375rem);
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .ntw-timeline-item-left,
    .ntw-timeline-item-right {
        padding-left: 3rem;
        padding-bottom: 30px;
    }

    .ntw-news-item-img img {
        height: 160px;
    }

    .ntw-news-item-heading {
        font-size: 1rem;
        white-space: normal;
    }

    .ntw-timeline-item-left::after,
    .ntw-timeline-item-right::after {
        width: 2rem;
    }
}

@media (max-width: 480px) {
    .ntw-news-item-date {
        font-size: .75rem;
        padding: 0 .5rem;
    }
}
