/* ============================================================
   Nexus – Homepage Latest News & Notices Shortcodes
   Shortcodes: [nexus_latest_news]  [nexus_latest_notices]
   ============================================================ */

/* ── Shared variables ─────────────────────────────────────── */
:root {
    --nxh-primary:   #0b4547;
    --nxh-accent:    #1a7476;
    --nxh-gold:      #f0d060;
    --nxh-text:      #1a2020;
    --nxh-muted:     #5a6e6e;
    --nxh-border:    #e2eaea;
    --nxh-bg:        #f5fafa;
    --nxh-card:      #ffffff;
    --nxh-radius:    10px;
    --nxh-shadow:    0 2px 10px rgba(11,69,71,.07);
    --nxh-shadow-hv: 0 6px 20px rgba(11,69,71,.14);
    --nxh-trans:     .22s ease;
}

/* ── "View All" footer link (shared) ──────────────────────── */
.nx-lnews-footer,
.nx-lnotice-footer {
    margin-top: 28px;
    display: flex;
    justify-content: flex-end;
}

.nx-lhome-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nxh-accent);
    text-decoration: none;
    transition: gap var(--nxh-trans), color var(--nxh-trans);
}
.nx-lhome-view-all:hover {
    color: var(--nxh-primary);
    gap: 10px;
}

/* ============================================================
   LATEST NEWS
   ============================================================ */

/* ── Grid wrapper ─────────────────────────────────────────── */
.nx-lnews {
    display: grid;
    gap: 24px;
}

.nx-lnews-cols-1 { grid-template-columns: 1fr; }
.nx-lnews-cols-2 { grid-template-columns: repeat(2, 1fr); }
.nx-lnews-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Card ─────────────────────────────────────────────────── */
/*
 * .nx-lnews-card          – card root
 * .nx-lnews-thumb-wrap    – anchor wrapping the thumbnail
 * .nx-lnews-thumb         – bg-image div (aspect ratio 16:9)
 * .nx-lnews-cat-badge     – category pill overlaid on thumb (or inline)
 * .nx-lnews-cat-badge--inline – variant when no thumb exists
 * .nx-lnews-body          – text section
 * .nx-lnews-meta          – date + author row
 * .nx-lnews-date          – <time> element
 * .nx-lnews-sep           – · separator
 * .nx-lnews-author        – author name
 * .nx-lnews-title         – <h3> title
 * .nx-lnews-excerpt       – short excerpt <p>
 * .nx-lnews-readmore      – "Read More" CTA link
 * .nx-lnews-empty         – shown when no posts found
 * .nx-lnews-footer        – wrapper for View All link
 */

.nx-lnews-card {
    background: var(--nxh-card);
    border: 1px solid var(--nxh-border);
    border-radius: var(--nxh-radius);
    box-shadow: var(--nxh-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--nxh-trans), transform var(--nxh-trans);
}
.nx-lnews-card:hover {
    box-shadow: var(--nxh-shadow-hv);
    transform: translateY(-3px);
}

/* Thumbnail */
.nx-lnews-thumb-wrap {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
}

.nx-lnews-thumb {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    background-size: cover;
    background-position: center;
    background-color: var(--nxh-bg);
}

/* Category badge — overlaid on thumb */
.nx-lnews-cat-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: var(--nxh-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 10px;
    border-radius: 20px;
    line-height: 1;
}

/* Inline category badge when no thumb */
.nx-lnews-cat-badge--inline {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
}

/* Body */
.nx-lnews-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}

.nx-lnews-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.nx-lnews-date,
.nx-lnews-author {
    font-size: 12px;
    color: var(--nxh-muted);
}

.nx-lnews-sep {
    color: var(--nxh-border);
    font-size: 14px;
    line-height: 1;
}

.nx-lnews-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--nxh-text);
}
.nx-lnews-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--nxh-trans);
}
.nx-lnews-title a:hover {
    color: var(--nxh-accent);
}

.nx-lnews-excerpt {
    flex: 1;
    font-size: 14px;
    color: var(--nxh-muted);
    line-height: 1.6;
    margin: 0 0 14px;
}

.nx-lnews-readmore {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--nxh-accent);
    text-decoration: none;
    transition: gap var(--nxh-trans), color var(--nxh-trans);
}
.nx-lnews-readmore:hover {
    color: var(--nxh-primary);
    gap: 8px;
}

.nx-lnews-empty {
    color: var(--nxh-muted);
    font-size: 14px;
    text-align: center;
    padding: 32px 0;
}

/* ============================================================
   LATEST NOTICES
   ============================================================ */

/* ── List wrapper ─────────────────────────────────────────── */
/*
 * .nx-lnotice                    – list root <div>
 * .nx-lnotice-item               – single notice row
 * .nx-lnotice-item--expired      – modifier when notice has expired
 * .nx-lnotice-icon               – left icon column
 * .nx-lnotice-icon--pdf          – modifier: PDF color
 * .nx-lnotice-icon--image        – modifier: image color
 * .nx-lnotice-icon--doc          – modifier: generic doc color
 * .nx-lnotice-type-label         – tiny text below icon (PDF / IMG / DOC)
 * .nx-lnotice-body               – centre text column
 * .nx-lnotice-meta               – date + expiry row
 * .nx-lnotice-date               – <time> element
 * .nx-lnotice-expiry             – "Expires Jan 15" note
 * .nx-lnotice-expired-badge      – "Expired" pill
 * .nx-lnotice-title              – <h4> title
 * .nx-lnotice-desc               – short content excerpt <p>
 * .nx-lnotice-actions            – right action buttons column
 * .nx-lnotice-btn                – base button style
 * .nx-lnotice-btn--view          – "View" ghost variant
 * .nx-lnotice-btn--dl            – "Download" filled variant
 * .nx-lnotice-empty              – shown when no notices found
 * .nx-lnotice-footer             – wrapper for View All link
 */

.nx-lnotice {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--nxh-border);
    border-radius: var(--nxh-radius);
    overflow: hidden;
    box-shadow: var(--nxh-shadow);
}

/* Item row */
.nx-lnotice-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--nxh-card);
    border-bottom: 1px solid var(--nxh-border);
    transition: background var(--nxh-trans);
}
.nx-lnotice-item:last-child {
    border-bottom: none;
}
.nx-lnotice-item:hover {
    background: var(--nxh-bg);
}

.nx-lnotice-item--expired {
    opacity: 0.65;
}

/* Icon column */
.nx-lnotice-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
}

.nx-lnotice-icon--pdf {
    background: #fff1f1;
    color: #c0392b;
    border: 1px solid #f5c6c6;
}
.nx-lnotice-icon--image {
    background: #f0f7ff;
    color: #2980b9;
    border: 1px solid #bcd8f5;
}
.nx-lnotice-icon--doc {
    background: #f4f4f4;
    color: #555;
    border: 1px solid #ddd;
}

.nx-lnotice-type-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
}

/* Body column */
.nx-lnotice-body {
    flex: 1;
    min-width: 0;
}

.nx-lnotice-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.nx-lnotice-date {
    font-size: 12px;
    color: var(--nxh-muted);
}

.nx-lnotice-expiry {
    font-size: 11px;
    color: #e67e22;
    font-weight: 600;
}

.nx-lnotice-expired-badge {
    display: inline-block;
    background: #ffeaea;
    color: #c0392b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 7px;
    border-radius: 20px;
}

.nx-lnotice-title {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--nxh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nx-lnotice-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--nxh-trans);
}
.nx-lnotice-title a:hover {
    color: var(--nxh-accent);
}

.nx-lnotice-desc {
    font-size: 12.5px;
    color: var(--nxh-muted);
    line-height: 1.5;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Actions column */
.nx-lnotice-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.nx-lnotice-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    padding: 6px 12px;
    line-height: 1;
    transition: all var(--nxh-trans);
    white-space: nowrap;
}

.nx-lnotice-btn--view {
    color: var(--nxh-accent);
    border: 1.5px solid var(--nxh-border);
    background: transparent;
}
.nx-lnotice-btn--view:hover {
    border-color: var(--nxh-accent);
    background: var(--nxh-bg);
    color: var(--nxh-primary);
}

.nx-lnotice-btn--dl {
    color: var(--nxh-primary);
    background: var(--nxh-gold);
    border: 1.5px solid transparent;
}
.nx-lnotice-btn--dl:hover {
    background: #f5dc70;
    color: var(--nxh-primary);
}

.nx-lnotice-empty {
    color: var(--nxh-muted);
    font-size: 14px;
    text-align: center;
    padding: 32px 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .nx-lnews-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .nx-lnews-cols-2,
    .nx-lnews-cols-3 { grid-template-columns: 1fr; }

    .nx-lnotice-item { flex-wrap: wrap; gap: 12px; }
    .nx-lnotice-actions { flex-direction: row; width: 100%; }
    .nx-lnotice-desc { display: none; }
}
