/* ============================================================
   JTF News - Shared Stylesheet
   Elevated Minimal Design System
   Where CNN screams, JTF breathes.
   ============================================================ */


/* ============================================================
   1. RESET
   ============================================================ */

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


/* ============================================================
   2. DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */

:root {
    /* Backgrounds */
    --color-bg:         #0f172a;
    --color-bg-alt:     #1e293b;
    --color-surface:    rgba(15, 23, 42, 0.75);

    /* Borders */
    --color-border:     rgba(255, 255, 255, 0.1);
    --color-border-dim: rgba(255, 255, 255, 0.05);

    /* Brand: Gold */
    --color-gold:       #d4af37;
    --color-gold-dark:  #aa8723;

    /* Accent: Blue */
    --color-blue:       #60a5fa;
    --color-blue-dark:  #1e40af;

    /* Text hierarchy */
    --color-text:        #e2e8f0;
    --color-text-body:   #cbd5e1;
    --color-text-muted:  #94a3b8;
    --color-text-dim:    #64748b;
    --color-text-bright: #f8fafc;

    /* Semantic colors */
    --color-green:  #22c55e;
    --color-red:    #ef4444;
    --color-yellow: #eab308;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Layout */
    --max-width:    900px;
    --radius:       12px;
    --radius-sm:    8px;
    --radius-pill:  20px;
}


/* ============================================================
   3. BASE STYLES
   ============================================================ */

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */

h1 {
    color: var(--color-gold);
    font-size: clamp(1.75rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--color-text-muted);
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h3 {
    color: var(--color-text-bright);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

p {
    color: var(--color-text-body);
    margin-bottom: 1rem;
}


/* ============================================================
   5. LAYOUT
   ============================================================ */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
}


/* ============================================================
   6. NAVIGATION (.site-nav)
   ============================================================ */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.site-nav__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
}

.site-nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-nav__logo img {
    height: 28px;
    width: auto;
}

.site-nav__links {
    display: flex;
    gap: 6px;
    list-style: none;
    font-size: 13px;
}

.site-nav__links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.site-nav__links a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.site-nav__links a[aria-current="page"] {
    color: var(--color-gold);
}

/* Hamburger toggle - hidden on desktop */
.site-nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.site-nav__toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text-muted);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mobile overlay menu */
.site-nav__overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.site-nav__overlay.open {
    display: flex;
}

.site-nav__overlay a {
    color: var(--color-text-muted);
    font-size: 20px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav__overlay a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.site-nav__overlay a[aria-current="page"] {
    color: var(--color-gold);
}

/* Close button (X) in overlay */
.site-nav__close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.site-nav__close:hover {
    color: var(--color-text);
}

/* Mobile breakpoint — hamburger kicks in early with 9 nav items */
@media (max-width: 1024px) {
    .site-nav__links {
        display: none;
    }

    .site-nav__toggle {
        display: flex;
    }
}


/* ============================================================
   7. CARDS
   ============================================================ */

.card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.card > .btn:last-child,
.card > a.btn {
    margin-top: auto;
}

.card h3 {
    color: var(--color-gold);
    font-size: 16px;
    margin-bottom: 10px;
}

.card p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 30px 0;
}


/* ============================================================
   8. BUTTONS
   ============================================================ */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s ease, transform 0.15s ease;
    line-height: 1.4;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

/* Primary - Gold gradient */
.btn--primary {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: #1a1a1a;
}

/* Secondary - Blue dark */
.btn--secondary {
    background: var(--color-blue-dark);
    color: white;
}

.btn--secondary:hover {
    background: #2563eb;
}

/* Outline - Transparent with border */
.btn--outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.btn--outline:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}


/* ============================================================
   9. HERO SECTION (.hero)
   ============================================================ */

.hero {
    text-align: center;
    padding: 60px 20px 40px;
}

.hero__title {
    color: var(--color-gold);
    font-size: clamp(2.25rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero__subtitle {
    color: var(--color-text);
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 500;
    margin-bottom: 12px;
}

.hero__desc {
    color: var(--color-text-muted);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}


/* ============================================================
   10. LIVE STORY PREVIEW
   ============================================================ */

.live-preview {
    max-width: 700px;
    margin: 40px auto;
    position: relative;
}

/* "LIVE" badge with pulsing green dot */
.live-preview__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-green);
    margin-bottom: 12px;
}

.live-preview__badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-green);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50%      { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* Glassmorphism card */
.live-preview__card {
    background: var(--color-surface);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Blue gradient sources bar */
.live-preview__sources {
    background: linear-gradient(135deg,
        rgba(30, 64, 175, 0.7) 0%,
        rgba(23, 37, 84, 0.8) 100%);
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--color-border);
}

/* Fact text */
.live-preview__fact {
    padding: 24px 32px;
    font-size: 20px;
    font-weight: 400;
    color: white;
    line-height: 1.5;
}


/* ============================================================
   11. SECTION
   ============================================================ */

.section {
    margin-top: 60px;
}

.section__title {
    color: var(--color-text-muted);
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 1rem;
}


/* ============================================================
   12. COSTS WIDGET
   ============================================================ */

.costs-section {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.costs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.costs-header h3 {
    margin: 0;
    color: var(--color-gold);
    font-size: 16px;
}

.live-badge {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-green);
    border-radius: 10px;
    text-transform: uppercase;
}

.costs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 480px) {
    .costs-grid {
        grid-template-columns: 1fr;
    }
}

.cost-item {
    background: rgba(15, 23, 42, 0.6);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 12px;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cost-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text-bright);
    margin-top: 4px;
}

.cost-value.highlight {
    color: var(--color-gold);
}

.cost-detail {
    font-size: 11px;
    color: var(--color-text-dim);
    margin-top: 4px;
}

.budget-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.budget-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.budget-fill.green  { background: var(--color-green); }
.budget-fill.yellow { background: var(--color-yellow); }
.budget-fill.red    { background: var(--color-red); }

.costs-breakdown {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--color-border);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.breakdown-service {
    color: var(--color-text-muted);
}

.breakdown-cost {
    color: var(--color-green);
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-green);
}

.status-dot.offline {
    background: var(--color-red);
}

.status-text {
    color: var(--color-text-muted);
}

.transparency-note {
    font-size: 12px;
    color: var(--color-text-dim);
    margin-top: 15px;
    font-style: italic;
}

.dashboard-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
}


/* ============================================================
   13. PHILOSOPHY BLOCK
   ============================================================ */

.philosophy {
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--color-gold);
    padding: 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 20px 0;
}

.philosophy p {
    color: var(--color-text);
    font-size: 15px;
    margin-bottom: 10px;
}

.philosophy p:last-child {
    margin-bottom: 0;
}


/* ============================================================
   14. RULE LISTS
   ============================================================ */

.rule-list {
    margin: 15px 0;
    padding-left: 20px;
}

.rule-list li {
    color: var(--color-text-muted);
    margin-bottom: 8px;
    font-size: 14px;
}

.rule-list li strong {
    color: var(--color-text);
}


/* ============================================================
   15. CTA SECTION
   ============================================================ */

.cta-section {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}


/* ============================================================
   16. FOOTER (.site-footer)
   ============================================================ */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 40px 20px;
    margin-top: 60px;
    text-align: center;
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-footer__links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    margin-bottom: 20px;
    font-size: 14px;
}

.site-footer__links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__links a:hover {
    color: var(--color-text);
}

.site-footer__tagline {
    color: var(--color-text-dim);
    font-style: italic;
    font-size: 14px;
    margin-bottom: 12px;
}

.site-footer__copy {
    color: var(--color-text-dim);
    font-size: 12px;
}


/* ============================================================
   17. UTILITY CLASSES
   ============================================================ */

.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-dim    { color: var(--color-text-dim); }
.text-small  { font-size: 14px; }
.text-xs     { font-size: 12px; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
