/* app.css — global styles for TotalConventionWorkshop public pages */

/* ============================================================
   CSS Custom Properties — Defaults
   Overridden per-tenant by MainLayout inline style on .page
   ============================================================ */
:root {
    --color-primary: #1a1a2e;
    --color-secondary: #16213e;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    --color-shadow: rgba(0, 0, 0, 0.1);
}

/* ============================================================
   Base Reset & Typography
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--color-surface);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: underline;
}

a:hover {
    opacity: 0.8;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   Page Layout (used by MainLayout)
   ============================================================ */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
    background-color: var(--color-primary);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--color-shadow);
}

.site-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.site-name {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   Main Content Area
   ============================================================ */
main {
    flex: 1;
    padding: 0;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background-color: var(--color-secondary);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.875rem;
}

.site-footer p {
    margin: 0;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.text-muted {
    color: var(--color-text-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   Blazor Error UI (default error boundary styling)
   ============================================================ */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* ============================================================
   News Page — Category Pills (Plan 41-02)
   Uses --track-N CSS custom properties from Feature 34.
   Fallback hex values ensure display even without tenant overrides.
   ============================================================ */

.category-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background-color: var(--color-primary, #6366f1);
    color: #fff;
    text-transform: capitalize;
    vertical-align: middle;
}

.category-pill.track-1 { background-color: var(--track-1, #3b82f6); color: #fff; }
.category-pill.track-2 { background-color: var(--track-2, #10b981); color: #fff; }
.category-pill.track-3 { background-color: var(--track-3, #f59e0b); color: #1a1a2e; }
.category-pill.track-4 { background-color: var(--track-4, #ef4444); color: #fff; }
.category-pill.track-5 { background-color: var(--track-5, #8b5cf6); color: #fff; }
.category-pill.track-general { background-color: var(--color-primary, #6366f1); color: #fff; }

/* ============================================================
   News Page — Layout (Plan 41-02)
   ============================================================ */

.news-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.news-hero {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border, #dee2e6);
}

.news-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--color-text, #1a1a2e);
}

.news-hero-subtitle {
    color: var(--color-text-muted, #6c757d);
    margin: 0;
}

/* News card grid */
.news-listing-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    box-shadow: 0 1px 3px var(--color-shadow, rgba(0,0,0,0.08));
}

.news-card-thumbnail img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 6px;
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.25rem 0 0 0;
    color: var(--color-text, #1a1a2e);
}

.news-card-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted, #6c757d);
    margin: 0;
}

.news-card-author {
    font-weight: 600;
}

.news-card-sep {
    color: var(--color-border, #dee2e6);
}

.news-card-excerpt {
    color: var(--color-text, #1a1a2e);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Pagination */
.news-pagination {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

.news-pagination-list {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.news-pagination-link {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 4px;
    text-decoration: none;
    color: var(--color-text, #1a1a2e);
    font-size: 0.9rem;
    background: var(--color-surface, #fff);
    transition: background 0.15s;
}

.news-pagination-link:hover {
    background: var(--color-primary, #6366f1);
    color: #fff;
    border-color: var(--color-primary, #6366f1);
}

.news-pagination-current {
    background: var(--color-primary, #6366f1);
    color: #fff;
    border-color: var(--color-primary, #6366f1);
    font-weight: 700;
    cursor: default;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
