/* ==========================================================================
   News Template — Home card grid (nt- component system)
   Six distinct card layouts for module keys 1–6, rebuilt from the
   whitelisted template variables only (no image/thumb fields).
   Class names use the nt- (news template) BEM-style prefix and reuse
   the MERIDIAN palette tokens from style.css.
   ========================================================================== */

/* ---- shared section shell ---- */
.nx-section { padding-top: 20px; }
.nx-section--pad { padding-top: 26px; }
.nx-section--banner { padding-top: 10px; }

/* ---- section header (module title + description + view-more) ---- */
.nx-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.nx-head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.nx-head__text { min-width: 0; }
.nx-head__title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    color: var(--ink);
    margin: 0;
}
.nx-head__desc {
    margin: 4px 0 0;
    color: var(--mute);
    font-size: 14px;
    line-height: 1.5;
}
.nx-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    font-family: var(--label);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--mute);
    padding: 7px 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    transition: color .25s ease, background .25s ease, border-color .25s ease, transform .25s ease;
}
.nx-more .bi { fill: currentColor; }
.nx-more:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    transform: translateX(2px);
}

/* ==========================================================================
   key == 1 : nt-trend — trending leaderboard (hero right column)
   Numbered rows via CSS counters; stroked serif numerals fill on hover.
   ========================================================================== */
.nx-trend {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.nx-trend__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.nx-trend__head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 56px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.nx-trend__title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.2;
    color: var(--ink);
}
.nx-trend__desc {
    margin: 0;
    color: var(--mute);
    font-size: 13px;
    line-height: 1.5;
}
.nx-trend__list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: trend;
    display: flex;
    flex-direction: column;
}
.nx-trend__item {
    counter-increment: trend;
    border-bottom: 1px solid var(--line);
}
.nx-trend__item:last-child { border-bottom: 0; }
.nx-trend__link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    text-decoration: none;
    transition: padding-left .3s ease;
}
.nx-trend__link::before {
    content: counter(trend, decimal-leading-zero);
    flex: none;
    width: 36px;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.1;
    color: transparent;
    -webkit-text-stroke: 1px var(--accent-3);
    transition: -webkit-text-stroke .3s ease, color .3s ease;
}
.nx-trend__item:hover .nx-trend__link { padding-left: 6px; }
.nx-trend__item:hover .nx-trend__link::before {
    -webkit-text-stroke: 1px var(--accent);
    color: var(--accent);
}
.nx-trend__thumb {
    flex: none;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
}
.nx-trend__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.nx-trend__item:hover .nx-trend__thumb img { transform: scale(1.06); }
.nx-trend__body { min-width: 0; flex: 1; }
.nx-trend__headline {
    display: block;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.45;
    color: var(--ink);
    transition: color .25s ease;
}
.nx-trend__item:hover .nx-trend__headline { color: var(--accent); }
.nx-trend__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--mute);
}

/* ==========================================================================
   key == 2 : nt-edit — editorial magazine grid (below hero)
   3-column text cards with an animated top accent rule + lift on hover.
   ========================================================================== */
.nx-edit {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.nx-edit__card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.nx-edit__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s ease;
}
.nx-edit__card:hover {
    border-color: var(--line-2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}
.nx-edit__card:hover::before { transform: scaleX(1); }
.nx-edit__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.nx-edit__thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-2);
}
.nx-edit__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}
.nx-edit__card:hover .nx-edit__thumb img { transform: scale(1.06); }
.nx-edit__body {
    padding: 22px 20px 18px;
}
.nx-edit__kicker {
    display: inline-block;
    font-family: var(--label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}
.nx-edit__title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 18px;
    line-height: 1.4;
    color: var(--ink);
    transition: color .25s ease;
}
.nx-edit__card:hover .nx-edit__title { color: var(--accent); }
.nx-edit__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--mute);
}

/* ==========================================================================
   key == 3 : nt-wire — news wire timeline (below hero)
   Vertical connector line + node dots, with a live "bolt" time badge.
   ========================================================================== */
.nx-wire {
    display: flex;
    flex-direction: column;
    position: relative;
}
.nx-wire::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2) 55%, transparent);
    z-index: 0;
}
.nx-wire__row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    position: relative;
    z-index: 1;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.nx-wire__row:last-child { border-bottom: 0; }
.nx-wire__node {
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}
.nx-wire__row:hover .nx-wire__node {
    transform: scale(1.3);
    box-shadow: 0 0 0 5px var(--accent-soft), 0 0 0 1px var(--accent);
}
.nx-wire__body { min-width: 0; flex: 1; }
.nx-wire__thumb {
    flex: none;
    width: 96px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
}
.nx-wire__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.nx-wire__row:hover .nx-wire__thumb img { transform: scale(1.06); }
.nx-wire__time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--label);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--accent-2);
    padding: 3px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--accent-soft);
}
.nx-wire__time i { color: var(--accent); font-size: 10px; }
.nx-wire__headline {
    display: block;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.45;
    color: var(--ink);
    transition: color .25s ease;
}
.nx-wire__row:hover .nx-wire__headline { color: var(--accent); }
.nx-wire__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--mute);
}

/* ==========================================================================
   key == 4 : nt-strip — featured banner strip (feature section)
   Full-width horizontal cards: thick left stripe + numbered index,
   headline body on the left, stats cluster on the right.
   ========================================================================== */
.nx-strip {
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: strip;
}
.nx-strip__card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 22px 26px;
    background: linear-gradient(100deg, var(--surface-2), var(--surface) 75%);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    text-decoration: none;
    counter-increment: strip;
    transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.nx-strip__card:hover {
    border-left-color: var(--accent-2);
    transform: translateX(6px);
    box-shadow: var(--shadow-sm);
}
.nx-strip__index {
    flex: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--accent-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    transition: all .3s ease;
}
.nx-strip__index::before { content: counter(strip, decimal-leading-zero); }
.nx-strip__card:hover .nx-strip__index {
    -webkit-text-stroke: 1px var(--accent);
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.nx-strip__thumb {
    flex: none;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
}
.nx-strip__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}
.nx-strip__card:hover .nx-strip__thumb img { transform: scale(1.06); }
.nx-strip__body { min-width: 0; flex: 1; }
.nx-strip__kicker {
    display: inline-block;
    font-family: var(--label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}
.nx-strip__title {
    display: block;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 19px;
    line-height: 1.4;
    color: var(--ink);
    transition: color .25s ease;
}
.nx-strip__card:hover .nx-strip__title { color: var(--accent); }
.nx-strip__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--mute);
}
.nx-strip__stats {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 22px;
    border-left: 1px solid var(--line);
    font-family: var(--label);
    font-size: 12.5px;
    color: var(--mute);
}
.nx-strip__stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.nx-strip__stats i { color: var(--accent); font-size: 11px; }

/* ==========================================================================
   key == 5 : nt-stats — stats highlight cards (feature section)
   3-column grid where each card leads with colored stat badges
   (view / share / click) above the headline.
   ========================================================================== */
.nx-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.nx-stats__card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.nx-stats__card::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .35s ease;
}
.nx-stats__card:hover {
    border-color: var(--line-2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}
.nx-stats__card:hover::after { transform: scaleX(1); }
.nx-stats__thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-2);
}
.nx-stats__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}
.nx-stats__card:hover .nx-stats__thumb img { transform: scale(1.06); }
.nx-stats__content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.nx-stats__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.nx-stats__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-family: var(--label);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
    border: 1px solid var(--line-2);
    background: var(--surface-2);
}
.nx-stats__badge i { font-size: 10px; }
.nx-stats__badge--view { color: var(--accent); }
.nx-stats__badge--view i { color: var(--accent); }
.nx-stats__badge--share { color: var(--accent-2); }
.nx-stats__badge--share i { color: var(--accent-2); }
.nx-stats__badge--click { color: var(--accent-3); }
.nx-stats__badge--click i { color: var(--accent-3); }
.nx-stats__title {
    display: block;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 12px;
    transition: color .25s ease;
}
.nx-stats__card:hover .nx-stats__title { color: var(--accent); }
.nx-stats__meta {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--mute);
}

/* ==========================================================================
   key == 6 : nt-spot — spotlight pull-quote cards (feature section)
   2-column editorial cards with a decorative quote glyph and a soft
   radial accent; the author attribution is highlighted in accent gold.
   ========================================================================== */
.nx-spot {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.nx-spot__card {
    display: flex;
    gap: 18px;
    padding: 28px 26px 24px;
    background: linear-gradient(150deg, var(--surface-2), var(--surface) 80%);
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.nx-spot__card::before {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    transition: opacity .3s ease;
}
.nx-spot__card:hover {
    border-color: var(--line-2);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.nx-spot__mark {
    display: block;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 48px;
    line-height: .8;
    color: var(--accent);
    opacity: .5;
    margin-bottom: 6px;
    transition: opacity .3s ease, color .3s ease;
}
.nx-spot__card:hover .nx-spot__mark { opacity: .7; color: var(--accent-2); }
.nx-spot__thumb {
    flex: none;
    width: 180px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-2);
    position: relative;
    z-index: 1;
}
.nx-spot__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.nx-spot__card:hover .nx-spot__thumb img { transform: scale(1.05); }
.nx-spot__body { min-width: 0; flex: 1; position: relative; z-index: 1; }
.nx-spot__title {
    display: block;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 14px;
    transition: color .25s ease;
}
.nx-spot__card:hover .nx-spot__title { color: var(--accent); }
.nx-spot__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--mute);
}
.nx-spot__meta .nx-spot__author { color: var(--accent); font-weight: 600; }
.nx-spot__meta .nx-spot__author i { color: var(--accent); }

/* ---- shared meta tag pills (kept for backward compat) ---- */
.nx-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--mute);
}
.nx-tag i { color: var(--accent); font-size: 11px; }
.nx-tag--accent { color: var(--accent); }

/* ---- generic metadata line inside cards ---- */
.nx-trend__meta span,
.nx-edit__meta span,
.nx-wire__meta span,
.nx-strip__meta span,
.nx-stats__meta span,
.nx-spot__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.nx-trend__meta i,
.nx-edit__meta i,
.nx-wire__meta i,
.nx-strip__meta i,
.nx-stats__meta i,
.nx-spot__meta i {
    color: var(--accent);
    font-size: 11px;
}

/* ============================ responsive ============================ */
@media (max-width: 991px) {
    .nx-edit { grid-template-columns: repeat(2, 1fr); }
    .nx-stats { grid-template-columns: repeat(2, 1fr); }
    .nx-strip__card { flex-direction: column; align-items: flex-start; gap: 14px; }
    .nx-strip__thumb { width: 100%; height: 160px; }
    .nx-strip__stats {
        flex-direction: row;
        flex-wrap: wrap;
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 12px;
        width: 100%;
    }
}
@media (max-width: 767px) {
    .nx-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .nx-more { align-self: flex-start; }
    .nx-trend__title { font-size: 19px; }
    .nx-strip__card { padding: 18px 20px; }
    .nx-spot__card { padding: 22px 20px; }
    .nx-spot__title { font-size: 18px; }
    .nx-spot__mark { font-size: 52px; }
}
@media (max-width: 575px) {
    .nx-edit { grid-template-columns: 1fr; }
    .nx-stats { grid-template-columns: 1fr; }
    .nx-spot { grid-template-columns: 1fr; }
    .nx-head__title { font-size: 21px; }
    .nx-trend__link::before { width: 30px; font-size: 19px; }
    .nx-trend__headline { font-size: 15px; }
    .nx-trend__thumb { width: 64px; height: 48px; }
    .nx-wire__thumb { width: 80px; height: 60px; }
    .nx-edit__title { font-size: 16px; }
    .nx-strip__title { font-size: 17px; }
    .nx-strip__index { width: 36px; height: 36px; font-size: 16px; }
    .nx-stats__title { font-size: 16px; }
    .nx-spot__card { flex-direction: column; gap: 14px; }
    .nx-spot__thumb { width: 100%; height: 170px; }
    .nx-spot__title { font-size: 17px; }
}
