/* news.php: server news list (filter tabs, featured post, card grid, pages) and the article view. */

.page-news .nw-section {
    position: relative;
    overflow: hidden;
    padding-top: 36px;
    padding-bottom: 80px;
}

.nw-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(214, 176, 106, .13), transparent 34rem),
        linear-gradient(180deg, rgba(11, 9, 6, .80) 0%, rgba(11, 9, 6, .95) 38%, #0b0906 100%),
        #0b0906 url("../../img/mf/art/coast.jpg") center top / cover no-repeat;
}

.nw-page {
    position: relative;
    z-index: 1;
    max-width: 1240px;
}

/* ---- header ---- */
.nw-header {
    text-align: center;
    margin: 10px auto 34px;
    max-width: 720px;
}

.nw-kicker {
    display: inline-block;
    color: var(--mf-gold);
    font-size: .78rem;
    letter-spacing: .32em;
    text-transform: uppercase;
    opacity: .85;
}

.nw-header__title {
    margin: 10px 0 14px;
    color: #f7efdd;
    font-family: var(--mf-head);
    font-size: clamp(2.1rem, 4.2vw, 3.1rem);
    letter-spacing: .06em;
    text-transform: uppercase;
    text-shadow: 0 10px 36px rgba(0, 0, 0, .6);
}

.nw-header__title::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, transparent, var(--mf-gold), transparent);
    box-shadow: 0 0 18px rgba(214, 176, 106, .5);
}

.nw-header__desc {
    margin: 0 auto;
    color: var(--mf-muted);
    font-size: 1rem;
    line-height: 1.65;
}

/* ---- category tabs ---- */
.nw-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 26px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .035), transparent 46%), rgba(13, 10, 7, .82);
    border: 1px solid rgba(214, 176, 106, .14);
    border-radius: 4px;
    backdrop-filter: blur(12px);
}

.nw-tabs::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(214, 176, 106, .6), transparent);
}

.nw-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 60px;
    padding: 0 12px;
    color: #a99a7c;
    text-decoration: none;
    background: rgba(255, 255, 255, .02);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 3px;
    transition: transform .2s, color .2s, background .2s, border-color .2s;
}

.nw-tab svg {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 8px;
    color: #b39a6b;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 3px;
}

.nw-tab__label {
    display: -webkit-box;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nw-tab__count {
    flex: none;
    min-width: 24px;
    padding: 2px 7px;
    color: #cdbb94;
    font-size: .78rem;
    text-align: center;
    background: rgba(214, 176, 106, .08);
    border-radius: 10px;
}

.nw-tab:hover {
    color: #e6d6b4;
    background: rgba(214, 176, 106, .06);
    border-color: rgba(214, 176, 106, .2);
    transform: translateY(-2px);
}

.nw-tab.is-active {
    color: #f1e1bd;
    background: radial-gradient(circle at 18% 25%, rgba(222, 185, 109, .2), transparent 48%), linear-gradient(145deg, rgba(214, 176, 106, .14), rgba(214, 176, 106, .04));
    border-color: rgba(214, 176, 106, .42);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .3), inset 0 1px rgba(255, 255, 255, .06);
}

.nw-tab.is-active svg {
    color: #1b140a;
    background: linear-gradient(145deg, #ecd08e, #a97f3a);
    border-color: rgba(236, 208, 142, .7);
}

/* ---- category badges ---- */
.nw-badge {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 2;
    padding: 5px 12px;
    color: #160f06;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    border-radius: 2px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
    background: linear-gradient(145deg, #e6c47c, #a8813c);
}

.nw-badge--patch { background: linear-gradient(145deg, #a9c8ea, #5b7fa6); }
.nw-badge--event { background: linear-gradient(145deg, #8fe0a8, #3c9a63); }
.nw-badge--announce { background: linear-gradient(145deg, #f0a58e, #b3543d); }

/* ---- cards ---- */
.nw-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.nw-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, .03), transparent 48%), rgba(16, 12, 8, .9);
    border: 1px solid rgba(214, 176, 106, .12);
    border-top-color: rgba(214, 176, 106, .3);
    border-radius: 4px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
    transition: transform .25s, border-color .25s, box-shadow .25s;
}

.nw-card:hover {
    transform: translateY(-4px);
    border-color: rgba(214, 176, 106, .34);
    box-shadow: 0 24px 54px rgba(0, 0, 0, .45), 0 0 26px rgba(214, 176, 106, .12);
}

.nw-card__image {
    position: relative;
    display: block;
    height: 210px;
    overflow: hidden;
    background: #17120c;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.nw-card__image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, transparent 45%, rgba(11, 9, 6, .78) 100%);
}

.nw-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s;
}

.nw-card:hover .nw-card__image img {
    transform: scale(1.05);
}

.nw-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px 22px 18px;
}

.nw-card__date {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    color: #8f846f;
    font-size: .84rem;
}

.nw-card__date svg {
    color: var(--mf-gold);
    opacity: .8;
}

.nw-card__title {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    font-family: var(--mf-head);
    font-size: 1.16rem;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nw-card__title a {
    color: #efe5cf;
    text-decoration: none;
    transition: color .2s;
}

.nw-card__title a:hover {
    color: var(--mf-gold2);
}

.nw-card__excerpt {
    display: -webkit-box;
    margin: 0 0 16px;
    overflow: hidden;
    color: #9a8f79;
    font-size: .94rem;
    line-height: 1.6;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.nw-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
    color: var(--mf-gold);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-decoration: none;
    text-transform: uppercase;
    border-top: 1px solid rgba(255, 255, 255, .06);
    transition: gap .2s, color .2s;
}

.nw-card__link:hover {
    gap: 12px;
    color: var(--mf-gold2);
}

/* featured (newest post, first page of "All") */
.nw-card--featured {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    margin-bottom: 26px;
}

.nw-card--featured .nw-card__image {
    height: 100%;
    min-height: 330px;
    border-bottom: 0;
    border-inline-end: 1px solid rgba(255, 255, 255, .05);
}

.nw-card--featured .nw-card__image::after {
    background: linear-gradient(90deg, transparent 55%, rgba(11, 9, 6, .55) 100%);
}

[dir="rtl"] .nw-card--featured .nw-card__image::after {
    background: linear-gradient(270deg, transparent 55%, rgba(11, 9, 6, .55) 100%);
}

.nw-card--featured .nw-card__content {
    justify-content: center;
    padding: 34px 36px;
}

.nw-card--featured .nw-card__title {
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    -webkit-line-clamp: 3;
}

.nw-card--featured .nw-card__excerpt {
    font-size: 1.02rem;
    -webkit-line-clamp: 4;
}

.nw-card--featured .nw-card__link {
    margin-top: 8px;
}

.nw-card__latest {
    position: absolute;
    bottom: 16px;
    inset-inline-start: 16px;
    z-index: 2;
    padding: 4px 10px;
    color: var(--mf-gold2);
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    background: rgba(11, 9, 6, .7);
    border: 1px solid rgba(214, 176, 106, .35);
    border-radius: 2px;
}

.nw-empty {
    padding: 50px 0;
    color: var(--mf-muted);
    text-align: center;
}

/* ---- pages ---- */
.nw-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.nw-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    color: #a99a7c;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, .02);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 3px;
    transition: all .2s;
}

.nw-page-btn:hover {
    color: #e6d6b4;
    background: rgba(214, 176, 106, .06);
    border-color: rgba(214, 176, 106, .25);
}

.nw-page-btn.is-active {
    color: #f1e1bd;
    background: linear-gradient(145deg, rgba(214, 176, 106, .18), rgba(214, 176, 106, .05));
    border-color: rgba(214, 176, 106, .42);
    box-shadow: inset 0 -2px var(--mf-gold);
}

/* ---- article ---- */
.nw-back {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--mf-gold);
    text-decoration: none;
}

.nw-back:hover {
    color: var(--mf-gold2);
}

.nw-article {
    overflow: hidden;
    background: rgba(16, 12, 8, .92);
    border: 1px solid rgba(214, 176, 106, .16);
    border-top-color: rgba(214, 176, 106, .38);
    border-radius: 4px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.nw-article__hero {
    position: relative;
    max-height: 440px;
    overflow: hidden;
}

.nw-article__hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(16, 12, 8, .95) 100%);
}

.nw-article__hero img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: cover;
}

.nw-article__body {
    max-width: 820px;
    margin: -40px auto 0;
    padding: 0 30px 40px;
    position: relative;
    z-index: 1;
}

.nw-article__title {
    margin: 4px 0 14px;
    color: #f7efdd;
    font-family: var(--mf-head);
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    line-height: 1.25;
}

.nw-article__lead {
    margin: 0 0 24px;
    padding-bottom: 22px;
    color: #c9bb9c;
    font-size: 1.1rem;
    line-height: 1.7;
    border-bottom: 1px solid rgba(214, 176, 106, .14);
}

.nw-article__text {
    color: #d8ccb3;
    font-size: 1.02rem;
    line-height: 1.75;
}

.nw-article__text p {
    margin: 0 0 14px;
}

.nw-article__h {
    margin: 26px 0 10px;
    color: var(--mf-gold2);
    font-family: var(--mf-head);
    font-size: 1.25rem;
}

.nw-article__list {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.nw-article__list li {
    position: relative;
    margin: 0 0 9px;
    padding-inline-start: 22px;
}

.nw-article__list li::before {
    content: "";
    position: absolute;
    top: .66em;
    inset-inline-start: 2px;
    width: 7px;
    height: 7px;
    background: var(--mf-gold);
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(214, 176, 106, .5);
}

.nw-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    padding: 12px 22px;
    color: #160f06;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(145deg, #ecd08e, #a97f3a);
    border-radius: 3px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
    transition: transform .2s, box-shadow .2s;
}

.nw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .45), 0 0 18px rgba(214, 176, 106, .25);
}

.nw-more-title {
    margin: 44px 0 18px;
    color: #f1e1bd;
    font-family: var(--mf-head);
    font-size: 1.5rem;
}

/* an image inside the article body (body line "img:img/news/...") */
.nw-article__fig {
    margin: 18px 0 22px;
    overflow: hidden;
    border: 1px solid rgba(214, 176, 106, .22);
    border-radius: 4px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}

.nw-article__fig img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---- right-to-left ---- */
[dir="rtl"] .nw-card__link svg,
[dir="rtl"] .nw-btn svg {
    transform: scaleX(-1);
}

[dir="rtl"] .nw-kicker,
[dir="rtl"] .nw-header__title,
[dir="rtl"] .nw-badge,
[dir="rtl"] .nw-card__link,
[dir="rtl"] .nw-card__latest {
    letter-spacing: 0;
}

/* ---- smaller screens ---- */
@media (max-width: 1080px) {
    .nw-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 760px) {
    .nw-card--featured {
        grid-template-columns: 1fr;
    }

    .nw-card--featured .nw-card__image {
        min-height: 220px;
        height: 220px;
        border-inline-end: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
    }

    .nw-card--featured .nw-card__image::after,
    [dir="rtl"] .nw-card--featured .nw-card__image::after {
        background: linear-gradient(180deg, transparent 45%, rgba(11, 9, 6, .78) 100%);
    }

    .nw-card--featured .nw-card__content {
        padding: 22px;
    }
}

@media (max-width: 640px) {
    .nw-grid {
        grid-template-columns: 1fr;
    }

    .nw-tabs {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nw-tabs::-webkit-scrollbar {
        display: none;
    }

    .nw-tab {
        flex: none;
        min-height: 52px;
    }

    .nw-article__body {
        padding: 0 18px 30px;
    }
}
