@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #FFF9EF;
    --text: #3a2518;
    --text-body: #5C3E2A;
    --text-muted: #8c705c;
    --accent: #C59A63;
    --accent-light: #DDB89C;
    --border: rgba(197, 154, 99, 0.2);
    --font-brand: 'JetBrains Mono', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* === MAIN CONTAINER === */
.news-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
}

/* === CATEGORY FILTERS === */
.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.news-filter-btn {
    font-family: var(--font-brand);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    outline: 0;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.news-filter-btn:hover {
    color: var(--accent);
    background: none;
    box-shadow: none;
}
.news-filter-btn:focus,
.news-filter-btn:focus-visible,
.news-filter-btn:active {
    outline: 0;
    box-shadow: none;
    background: none;
}
.news-filter-btn.active {
    opacity: 1;
    color: var(--text);
    font-weight: 700;
}

/* === NEWS ITEMS === */
.news-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}
.news-item:first-child {
    padding-top: 0;
}
.news-item:last-child {
    border-bottom: none;
}

/* --- Title: king of the hierarchy --- */
.news-item-title {
    font-family: var(--font-brand);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
}
.news-item-title a {
    color: var(--text);
    text-decoration: none;
}
.news-item-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --- Why it matters: editorial hook (after impact strip) --- */
.news-item-why {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    margin: 0.6rem 0 0.35rem;
    padding-left: 13px;
    line-height: 1.5;
}

/* --- Structured impact: triage strip directly under title --- */
.news-item-impact {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0.3rem 0 0;
    padding: 0.3rem 0 0.3rem 12px;
    border-left: 2px solid var(--accent-light);
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.2rem;
}
.news-item-impact-label {
    font-weight: 600;
    color: var(--text-body);
}

/* --- Summary: optional detail --- */
.news-item-summary {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0.3rem 0 0.5rem;
    line-height: 1.6;
}

/* --- Meta: infrastructure --- */
.news-item-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-family: var(--font-brand);
    font-size: 10px;
    margin-top: 0.25rem;
}
.source-badge {
    color: var(--text-muted);
}
.source-badge a {
    color: var(--text-muted);
    text-decoration: none;
}
.source-badge a:hover {
    text-decoration: underline;
}
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}
.category-icon {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* --- Source type badge --- */
.source-type-badge {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 3px;
    border-radius: 1px;
}
.source-type-badge[data-type="primary"] {
    color: var(--text);
    border: 1px solid var(--text-body);
}
.source-type-badge[data-type="major-media"] {
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.source-type-badge[data-type="social"] {
    color: var(--text-muted);
    opacity: 0.7;
    border: 1px solid var(--border);
}
.source-type-badge[data-type="company"] {
    color: var(--accent);
    border: 1px solid var(--border);
}

/* === LOADING / EMPTY === */
.loading, .empty {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* === ADMIN STYLES === */
.admin-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 2rem;
}

#loginOverlay {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    border: 2px solid var(--text);
    padding: 24px;
    box-shadow: 4px 4px 0px var(--text);
    z-index: 1000;
    text-align: center;
}
#loginOverlay h2 {
    margin-bottom: 12px;
    font-family: var(--font-brand);
    font-size: 14px;
}

.admin-form {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.admin-form h2 {
    font-family: var(--font-brand);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

input, textarea, select {
    font-family: var(--font-body);
    font-size: 13px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-body);
    padding: 8px 10px;
    width: 100%;
    margin-bottom: 6px;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}
label {
    display: block;
    font-family: var(--font-brand);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 2px;
    margin-top: 8px;
}
label.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: none;
    font-weight: 500;
    cursor: pointer;
}
label.checkbox-label input {
    width: auto;
    margin: 0;
}

button {
    font-family: var(--font-brand);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--text);
    background: var(--bg);
    color: var(--text);
    padding: 8px 16px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
button:hover {
    background: var(--text);
    color: var(--bg);
}
button.danger {
    border-color: #c44;
    color: #c44;
}
button.danger:hover {
    background: #c44;
    color: #fff;
}

/* === ADMIN ITEM LIST === */
.admin-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(197, 154, 99, 0.1);
}
.admin-item-content {
    flex: 1;
    min-width: 0;
}
.admin-item-title {
    font-size: 13px;
    font-weight: 600;
}
.admin-item-meta {
    font-family: var(--font-brand);
    font-size: 10px;
    color: var(--text-muted);
}
.admin-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.admin-item-actions button {
    font-size: 10px;
    padding: 4px 10px;
}
.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .news-filters { gap: 0.5rem 0.8rem; }
    .news-container { padding: 3.5rem 1rem 2rem; }
    .admin-container { padding: 1rem 1rem; }
    .news-item-title { font-size: 14px; }
    .news-item-why { font-size: 12px; }
    .news-item-impact { font-size: 10px; flex-direction: column; gap: 0.15rem; }
    .news-item { padding: 1rem 0; }
    .admin-item { flex-direction: column; gap: 0.25rem; }
}
