/* ══════════════════════════════════════════════════════════════
   News Board – User-facing popup + Admin page styles
   ══════════════════════════════════════════════════════════════ */

/* ── Popup overlay ────────────────────────────────────────────── */
#newsBoardPopup {
    align-items: flex-start;
    padding: 16px 8px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ── Board container ──────────────────────────────────────────── */
.news-board-wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    background: #f5e6c8;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(180,140,80,.18) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(160,120,60,.13) 0%, transparent 50%);
    border-radius: 20px;
    box-shadow:
        0 8px 40px rgba(0,0,0,.22),
        inset 0 0 0 3px rgba(160,110,50,.25);
    padding: 28px 20px 32px;
    position: relative;
    animation: zoomIn .35s 1 cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

/* ── Board header ─────────────────────────────────────────────── */
.news-board-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px dashed rgba(140,100,40,.3);
}

.news-board-icon {
    width: 46px;
    height: 46px;
    background: var(--button-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(91,190,88,.35);
}

.news-board-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #5a3a10;
    line-height: 1.2;
}

.news-board-subtitle {
    font-size: .82rem;
    color: #9a7040;
    margin-top: 2px;
}

.news-board-close {
    margin-inline-start: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #9a7040;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.news-board-close:hover {
    background: rgba(0,0,0,.08);
    color: #5a3a10;
}

/* ── Board body: featured + archive side by side ─────────────── */
.news-board-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.news-featured {
    flex: 1 1 55%;
    min-width: 0;
}

/* ── Featured (latest) card ───────────────────────────────────── */
.news-card {
    background: #fffdf5;
    border-radius: 12px;
    padding: 20px 16px 16px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.07);
    border-top: 4px solid #f59e0b;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, border-top-color .35s;
}
.news-card:hover {
    transform: translateY(-3px) rotate(.3deg);
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
}
/* Seen state */
.news-card.seen {
    border-top-color: var(--button-bg);
}

/* Pin */
.news-card-pin {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    background: #f59e0b;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,.45);
    z-index: 1;
    transition: background .35s, box-shadow .35s;
}
.news-card-pin::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 10px;
    background: rgba(0,0,0,.2);
    border-radius: 0 0 2px 2px;
}
/* Green pin when seen */
.news-card.seen .news-card-pin {
    background: var(--button-bg);
    box-shadow: 0 2px 8px rgba(91,190,88,.45);
}

/* Card title */
.news-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d2d2d;
    margin: 6px 0 8px;
    line-height: 1.35;
}

/* Card content */
.news-card-content {
    font-size: .875rem;
    color: #555;
    line-height: 1.6;
    word-break: break-word;
}
.news-card-content.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Toggle button */
.news-card-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--button-bg);
    font-size: .8rem;
    font-weight: 600;
    padding: 4px 0 0;
    display: block;
    transition: opacity .2s;
}
.news-card-toggle:hover { opacity: .75; }

/* Card footer: date + eye */
.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}
.news-card-date {
    font-size: .75rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
}
.news-card-eye {
    font-size: 1rem;
    color: #ccc;
    transition: color .3s;
    flex-shrink: 0;
}
.news-card.seen .news-card-eye {
    color: var(--button-bg);
}

/* ── Archive (older news) list ────────────────────────────────── */
.news-archive {
    flex: 0 0 38%;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.news-archive-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #aaa;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Archive item */
.news-archive-item {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
    background: #fffdf5;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: box-shadow .2s;
}
.news-archive-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

/* Archive header row */
.news-archive-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
}

/* Colored pin dot */
.news-archive-pin {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform .2s;
}
.news-archive-item.open .news-archive-pin {
    transform: scale(1.3);
}

/* Archive title */
.news-archive-title {
    flex: 1;
    font-size: .84rem;
    font-weight: 600;
    color: #2d2d2d;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-archive-item.open .news-archive-title {
    white-space: normal;
}

/* Eye icon */
.news-archive-eye {
    font-size: .8rem;
    color: #ccc;
    flex-shrink: 0;
    transition: color .3s;
}
.news-archive-item.seen .news-archive-eye {
    color: var(--button-bg);
}

/* Chevron */
.news-archive-chevron {
    font-size: .72rem;
    color: #bbb;
    flex-shrink: 0;
    transition: transform .3s cubic-bezier(0.4,0,0.2,1);
}
.news-archive-item.open .news-archive-chevron {
    transform: rotate(180deg);
}

/* Slide body */
.news-archive-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(0.4,0,0.2,1),
                padding .35s cubic-bezier(0.4,0,0.2,1);
    padding: 0 14px;
}
.news-archive-item.open .news-archive-body {
    max-height: 600px;
    padding: 0 14px 14px;
}
.news-archive-content {
    font-size: .82rem;
    color: #555;
    line-height: 1.6;
    word-break: break-word;
    border-top: 1px solid rgba(0,0,0,.07);
    padding-top: 10px;
}

/* ── "Mark all read" footer ───────────────────────────────────── */
.news-board-footer {
    margin-top: 24px;
    text-align: center;
}
.news-board-footer .btn-mark-read {
    background: var(--button-bg);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.news-board-footer .btn-mark-read:hover { opacity: .85; }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .news-board-wrap {
        border-radius: 14px;
        padding: 20px 12px 24px;
    }
    .news-board-body {
        flex-direction: column;
    }
    .news-featured,
    .news-archive {
        flex: none;
        width: 100%;
        min-width: 0;
    }
    .news-archive-title {
        white-space: normal;
    }
    .news-board-title { font-size: 1.1rem; }
}


/* ══════════════════════════════════════════════════════════════
   News Admin page styles
   ══════════════════════════════════════════════════════════════ */

.news-admin-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.news-admin-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.news-admin-title i {
    color: var(--button-bg);
}

/* Stats row */
.news-stats-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 20px 0 28px;
}
.news-stat-box {
    flex: 1 1 120px;
    background: var(--background-color);
    border-radius: 14px;
    padding: 16px 14px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    border-top: 3px solid var(--button-bg);
}
.news-stat-box .stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--button-bg);
    line-height: 1;
}
.news-stat-box .stat-lbl {
    font-size: .78rem;
    color: var(--text-color);
    opacity: .65;
    margin-top: 4px;
}

/* Create form card */
.news-create-card {
    background: var(--background-color);
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    margin-bottom: 32px;
    border-top: 4px solid var(--button-bg);
}
.news-create-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.news-create-card h2 i { color: var(--button-bg); }

/* Field rows */
.na-field {
    margin-bottom: 16px;
}
.na-field label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: .7;
    margin-bottom: 6px;
}
.na-field input,
.na-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--calendar-background);
    color: var(--text-color);
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .2s;
    resize: vertical;
    margin-bottom: 12px;
}
.na-field input:focus,
.na-field textarea:focus {
    outline: none;
    border-color: var(--button-bg);
}
.na-field textarea { min-height: 100px; }

/* Date-time row */
.na-dt-row {
    display: flex;
    gap: 12px;
    align-items: baseline;
    flex-wrap: wrap;
}
.na-dt-row .na-field { flex: 1 1 220px; margin-bottom: 0; }

/* Duration presets */
.na-duration-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.na-preset-btn {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid var(--button-bg);
    background: transparent;
    color: var(--button-bg);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.na-preset-btn:hover { background: var(--button-bg); color: #fff; }
.na-preset-btn.na-preset-clear {
    border-color: var(--text-color);
    color: var(--text-color);
    opacity: .6;
}
.na-preset-btn.na-preset-clear:hover { background: var(--text-color); color: var(--calendar-background); opacity: 1; }

/* Buttons row */
.na-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.na-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: opacity .2s, transform .15s;
}
.na-btn:hover { opacity: .85; transform: translateY(-1px); }
.na-btn:active { transform: translateY(0); }

.na-btn-primary { background: var(--button-bg); color: #fff; }
.na-btn-fire    { background: #e63946; color: #fff; }
.na-btn-danger  { background: #e63946; color: #fff; }
.na-btn-edit    { background: var(--calendar-background); color: var(--text-color);
                  border: 1.5px solid var(--border-color); }

/* News items list */
.news-list-card {
    background: var(--background-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.news-list-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.news-list-card h2 i { color: var(--button-bg); }

/* Single news item row */
.na-news-item {
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    transition: border-color .2s;
}
.na-news-item:last-child { margin-bottom: 0; }
.na-news-item:hover { border-color: var(--button-bg); }

.na-news-item-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.na-news-item-title {
    font-weight: 700;
    font-size: .98rem;
    color: var(--text-color);
    flex: 1;
}
.na-status-badge {
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.na-status-badge.fired    { background: rgba(91,190,88,.15);  color: #2d7d2a; }
.na-status-badge.scheduled{ background: rgba(245,158,11,.15); color: #b45309; }
.na-status-badge.draft    { background: rgba(150,150,150,.12); color: #666; }

/* Audience badge */
.na-audience-badge {
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.na-audience-badge.all        { background: rgba(59,130,246,.12); color: #1d4ed8; }
.na-audience-badge.registered { background: rgba(139,92,246,.12); color: #6d28d9; }
.na-audience-badge.guests     { background: rgba(245,158,11,.12); color: #b45309; }

/* Audience radio group */
.na-audience-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.na-audience-opt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-color);
    transition: border-color .2s, background .2s, color .2s;
    user-select: none;
}
.na-audience-opt input[type="radio"] { display: none; }
.na-audience-opt:has(input:checked) {
    border-color: var(--button-bg);
    background: color-mix(in srgb, var(--button-bg) 10%, transparent);
    color: var(--button-bg);
    font-weight: 700;
}

.na-news-item-meta {
    font-size: .78rem;
    color: var(--text-color);
    opacity: .5;
    margin: 5px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.na-news-item-preview {
    font-size: .85rem;
    color: var(--text-color);
    opacity: .7;
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.na-news-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.na-action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: var(--calendar-background);
    color: var(--text-color);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .18s;
}
.na-action-btn:hover { border-color: var(--button-bg); color: var(--button-bg); }
.na-action-btn.danger:hover { border-color: #e63946; color: #e63946; }
.na-action-btn.fire-btn { border-color: #e63946; color: #e63946; }
.na-action-btn.fire-btn:hover { background: #e63946; color: #fff; }

/* Inline edit form */
.na-edit-form {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}
.na-edit-form.open { display: block; }

/* Empty state */
.na-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-color);
    opacity: .4;
    font-size: .95rem;
}

/* Loader spinner */
.na-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-color);
    opacity: .5;
}

/* ── Expired / archive badge ──────────────────────────────────────── */
.news-expired-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .7rem;
    font-weight: 600;
    color: #888;
    background: rgba(0,0,0,.06);
    border-radius: 20px;
    padding: 2px 8px;
    margin-bottom: 6px;
    letter-spacing: .02em;
}

.news-expired-date {
    color: #bbb !important;
    font-style: italic;
    opacity: .8;
}

.news-card.expired {
    opacity: .72;
    filter: grayscale(25%);
}

.news-card.expired:hover {
    opacity: 1;
    filter: none;
}

.news-archive-item.expired {
    opacity: .72;
}

.news-archive-item.expired:hover,
.news-archive-item.expired.open {
    opacity: 1;
}

/* Badge inside archive header — keep it inline */
.news-archive-header .news-expired-badge {
    margin-bottom: 0;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .news-admin-wrap { padding: 16px 10px 50px; }
    .news-admin-title { font-size: 1.25rem; }
    .na-dt-row { flex-direction: column; }
    .na-btn-row { flex-direction: column; }
    .na-btn { width: 100%; justify-content: center; }
}
