/* =========================================
   0. ROOT VARIABLES
   ========================================= */
:root {
    --bg-main: #050505;
    --bg-panel: #161616;
    --bg-header: #111;
    --accent-cyan: #00bcd4;
    --accent-red: #ff0000;
    --accent-pink: #ff0055;
    --text-main: #e0e0e0;
    --text-muted: #666;
    --border-subtle: #222;

    --header-height: 90px;  /* mobile: taller to fit stacked logo + buttons */
    --ticker-height: 40px;
}

/* =========================================
   1. CORE RESET & BODY
   ========================================= */
* { margin:0; padding:0; box-sizing:border-box; }

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: calc(var(--header-height) + var(--ticker-height));
}

/* =========================================
   2. HEADER & BRANDING
   ========================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 9999;
}

/* Mobile: centre everything */
.header-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;        /* centred on mobile */
    justify-content: center;
    padding: 10px 16px;
    gap: 6px;
}

.brand-logo {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: var(--text-main);
    line-height: 1;
}

.brand-know { color: var(--accent-red); }

.header-actions {
    display: flex;
    justify-content: center;    /* buttons centred on mobile */
    gap: 6px;
}

.station-button, .webtv-button {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid;
    border-radius: 2px;
    white-space: nowrap;        /* FIX: prevent buttons wrapping to separate rows on Android */
    transition: background 0.2s, color 0.2s;
}

.station-button { color: var(--accent-pink); border-color: var(--accent-pink); }
.webtv-button   { color: var(--accent-cyan); border-color: var(--accent-cyan); }

/* =========================================
   3. NEWS TICKER (LOCKED)
   ========================================= */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: #0a0a0a;
    border-bottom: 1px solid var(--accent-cyan);
    height: var(--ticker-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: var(--header-height);
    left: 0;
    z-index: 9998;
}

.ticker-label {
    background: var(--accent-red);
    color: #fff;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 900;
    font-size: 0.8rem;
    z-index: 20;
}

.ticker {
    display: flex;
    white-space: nowrap;
    width: max-content;
    animation: ticker-move 120s linear infinite;
    will-change: transform;
}

.ticker-item {
    display: inline-block;
    padding: 0 80px;
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    line-height: var(--ticker-height);
    font-size: 0.95rem;
    font-weight: bold;
}

@keyframes ticker-move {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   4. CARDS GRID
   ========================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.news-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: #444;
}

.card-image { 
    height: 200px; 
    background: #000; 
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
}

.card-image img { width:100%; height:100%; object-fit:cover; opacity:0.8; transition:0.3s; }
.news-card:hover .card-image img { opacity: 1; }

.card-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-size: 1.2rem; color: #fff; font-weight: 700; margin-bottom: 12px; }

.card-link {
    color: var(--accent-red);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 15px 0;
    margin-top: auto;
    border-top: 1px solid #222;
}

/* =========================================
   5. FOOTER (CENTERED)
   ========================================= */
.site-footer {
    padding: 60px 20px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 40px;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.system-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: #444;
}

.system-status {
    display: inline-flex;
    align-items: center;
    color: var(--accent-cyan);
    font-weight: bold;
}

.system-status .pulse {
    width: 6px; height: 6px; background: var(--accent-cyan);
    border-radius: 50%; margin-right: 10px; animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* =========================================
   6. RESPONSIVENESS
   ========================================= */
@media (min-width: 768px) {
    :root { --header-height: 70px; }

    /* Desktop: single row, aligned to card edges (matches cards-grid max-width + padding) */
    .header-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        max-width: 1400px;      /* same as .cards-grid */
        margin: 0 auto;
        padding: 0 20px;        /* same as .cards-grid */
        width: 100%;
    }

    .header-actions { justify-content: flex-end; }
}

@media (max-width: 400px) {
    .header-actions {
        flex-direction: column;
        align-items: center;    /* keep centred even when stacked */
    }
}