/* ═══════════════════════════════════════════════════
   Mainspring News — Shared Stylesheet
   Used by: index.html, news.html, reviews.html,
            article.html, polls.html, watch-terms.html,
            about.html, privacy.html
   ═══════════════════════════════════════════════════ */

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

:root {
    --bg:          #0A0B0D;
    --surface:     #14161A;
    --gold:        #D4AF37;
    --gold-hover:  #BF9D2E;
    --gold-dim:    rgba(212, 175, 55, 0.15);
    --text:        #F5F5F7;
    --text-muted:  #A1A1A6;
    --border:      #1E2028;
    --border-gold: rgba(212, 175, 55, 0.3);
    --skeleton:    #1A1D24;
    --shadow:      0 1px 4px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
    --shadow-hover:0 8px 24px rgba(0,0,0,0.45), 0 2px 8px rgba(212,175,55,0.08);
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                 'Helvetica Neue', 'Roboto', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════
   Sticky Header
   ═══════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    text-align: center;
    padding: 20px 24px 0;
    background: rgba(10, 11, 13, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-border {
    display: block;
    height: 1px;
    background: var(--gold);
    border: none;
    margin-top: 14px;
    opacity: 0.35;
}

.logo-group {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.logo-group a { display: block; line-height: 0; }

.logo-img {
    max-height: 80px;
    width: auto;
    display: block;
    mix-blend-mode: screen;
}

.site-header .tagline {
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8E8E93;
    margin-bottom: 14px;
}

/* ── Nav ── */
.site-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
}

.nav-link {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #E0E0E0;
    background: none;
    border: none;
    padding: 8px 18px;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    text-decoration: none;
    display: inline-block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.25s ease;
}

.nav-link:hover         { color: var(--gold); }
.nav-link.active        { color: var(--gold); }
.nav-link.active::after { width: 22px; }

/* ═══════════════════════════════════
   Article Cards (shared grid)
   ═══════════════════════════════════ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.article-card {
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s, transform 0.3s ease, border-color 0.3s;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeUp 0.4s ease forwards;
}

.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--gold);
}

.card-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #101214;
    display: block;
    text-decoration: none;
}

.card-image-container > img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(0.9);
    transition: transform 0.4s ease;
}

.article-card:hover .card-image-container > img { transform: scale(1.04); }

.card-source {
    position: absolute;
    top: 10px; left: 10px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(10, 11, 13, 0.82);
    color: var(--gold);
    padding: 4px 9px;
    border-radius: 4px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(212, 175, 55, 0.12);
    z-index: 2;
}

.card-image-placeholder {
    position: absolute;
    inset: 0;
    background: #14161A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-placeholder img {
    width: auto;
    height: 50%;
    object-fit: contain;
    opacity: 0.5;
    mix-blend-mode: screen;
    filter: brightness(0.7);
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-headline {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #E0E0E0;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.card-headline a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.card-headline a:hover { color: var(--gold); }

.card-summary {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-date {
    font-size: 10px;
    color: #86868B;
    letter-spacing: 0.04em;
}

.card-read-time {
    font-size: 10px;
    color: #E0E0E0;
    letter-spacing: 0.04em;
    opacity: 0.55;
    white-space: nowrap;
}

/* ── No Results ── */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
}

.no-results h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.no-results p { font-size: 14px; color: var(--text-muted); }

/* ═══════════════════════════════════
   Ad Placeholder
   ═══════════════════════════════════ */
.ad-placeholder {
    background: var(--surface);
    border: 1px dashed rgba(30, 32, 40, 0.8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    position: relative;
}

.ad-label {
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #3A3A3C;
    user-select: none;
}

/* ═══════════════════════════════════
   Load More
   ═══════════════════════════════════ */
.load-more-wrapper { text-align: center; padding: 40px 24px 0; }

.load-more-btn {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--gold);
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 16px 48px;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

.load-more-btn:hover {
    background: var(--gold);
    color: var(--bg);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.load-more-btn.exhausted {
    border-color: var(--border);
    color: var(--text-muted);
    pointer-events: none;
}

/* ═══════════════════════════════════
   Back to Top
   ═══════════════════════════════════ */
.back-to-top {
    position: fixed;
    bottom: 32px; right: 32px;
    width: 42px; height: 42px;
    background: var(--gold);
    color: var(--bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    box-shadow: 0 2px 14px rgba(212, 175, 55, 0.3);
    z-index: 100;
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover   { transform: translateY(-2px); background: var(--gold-hover); }

/* ═══════════════════════════════════
   Footer
   ═══════════════════════════════════ */
.site-footer {
    text-align: center;
    padding: 28px 24px 36px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer-disclosure {
    font-size: 11px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.footer-link {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 8px;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.footer-link:hover   { color: var(--gold); }
.footer-link-sep     { color: #48484A; font-size: 11px; user-select: none; }
.footer-copy         { font-size: 10px; color: #86868B; letter-spacing: 0.04em; }

/* ═══════════════════════════════════
   Responsive
   ═══════════════════════════════════ */
@media (max-width: 1024px) {
    .articles-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}

@media (max-width: 640px) {
    .site-header  { padding: 16px 16px 0; }
    .logo-img     { max-height: 52px; }
    .site-header .tagline { font-size: 8.5px; letter-spacing: 0.12em; margin-bottom: 10px; }
    .nav-link     { font-size: 10px; padding: 6px 10px; }
    .articles-grid { grid-template-columns: 1fr; gap: 14px; }
    .back-to-top  { bottom: 20px; right: 20px; width: 38px; height: 38px; }
}

/* ═══════════════════════════════════
   Animations
   ═══════════════════════════════════ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

@keyframes spin { to { transform: rotate(360deg); } }
