/* ============================================
   POLK COUNTY NEWS - Modern News Site Design
   ============================================ */

:root {
    --font-size-base: 17px;
    --font-size-large: 20px;
    --font-size-xl: 24px;

    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f4f5f7;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #8888a0;
    --border: #e2e4e9;
    --accent: #c0392b;
    --accent-hover: #a93226;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --nav-bg: #1a1a2e;
    --nav-text: #e8e8f0;
    --header-bg: #ffffff;
    --card-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
    --card-hover-shadow: 0 8px 24px rgba(0,0,0,0.1);
    --breaking-bg: #c0392b;
    --breaking-text: #ffffff;
    --underreported-bg: #e67e22;
    --positive: #27ae60;
    --negative: #e74c3c;
    --neutral: #7f8c8d;
    --ticker-bg: #c0392b;
    --topbar-bg: #f4f5f7;
    --topbar-text: #666;
    --divider: #e2e4e9;
    --overlay: rgba(0,0,0,0.6);
    --radius: 8px;
    --max-width: 1200px;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #1e1e35;
    --text-primary: #e8e8f0;
    --text-secondary: #b0b0c8;
    --text-muted: #6868a0;
    --border: #2a2a45;
    --header-bg: #0f0f1a;
    --card-shadow: 0 1px 4px rgba(0,0,0,0.3);
    --card-hover-shadow: 0 8px 24px rgba(0,0,0,0.4);
    --topbar-bg: #0a0a15;
    --topbar-text: #888;
    --divider: #2a2a45;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f0f1a;
        --bg-secondary: #1a1a2e;
        --bg-card: #1e1e35;
        --text-primary: #e8e8f0;
        --text-secondary: #b0b0c8;
        --text-muted: #6868a0;
        --border: #2a2a45;
        --header-bg: #0f0f1a;
        --card-shadow: 0 1px 4px rgba(0,0,0,0.3);
        --card-hover-shadow: 0 8px 24px rgba(0,0,0,0.4);
        --topbar-bg: #0a0a15;
        --topbar-text: #888;
        --divider: #2a2a45;
    }
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}
html.font-large { font-size: var(--font-size-large); }
html.font-xl { font-size: var(--font-size-xl); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ---- Weather ---- */
.weather-box {
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.weather-temp {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* ---- Floating Accessibility Button ---- */
.a11y-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4a9fd5, #2563eb);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.a11y-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

/* ---- Accessibility Panel ---- */
.a11y-panel {
    position: fixed;
    bottom: 90px;
    left: 24px;
    z-index: 9001;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 260px;
    padding: 0;
    overflow: hidden;
}

.a11y-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--nav-bg);
    color: white;
    font-size: 0.9rem;
}

.a11y-panel-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
}

.a11y-option {
    padding: 14px 18px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.a11y-option:last-child { border-bottom: none; }

.a11y-buttons {
    display: flex;
    gap: 4px;
}

.a11y-buttons button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 36px;
    min-height: 36px;
    transition: all 0.15s;
}

.a11y-buttons button:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.a11y-buttons button.active,
.a11y-panel .font-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* ---- Buy Me a Coffee Floating Button ---- */
.bmc-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    height: 56px;
    border-radius: 28px;
    border: none;
    background: #FFDD00;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bmc-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    color: #000;
}

.bmc-text {
    font-family: 'Cookie', cursive, sans-serif;
    font-size: 1.1rem;
    color: #000;
    white-space: nowrap;
    font-weight: 400;
}

@media (max-width: 600px) {
    .bmc-fab {
        height: 48px;
        padding: 0 14px;
        bottom: 16px;
        right: 16px;
    }
    .bmc-text { font-size: 0.9rem; }
    .a11y-fab { bottom: 16px; left: 16px; width: 48px; height: 48px; }
}

/* Skip link */
.skip-link {
    position: absolute; top: -100%; left: 16px;
    background: var(--accent); color: white;
    padding: 12px 24px; border-radius: 0 0 8px 8px;
    z-index: 9999; font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ---- Breaking News Ticker ---- */
.ticker {
    background: var(--ticker-bg);
    color: white;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 36px;
}

.ticker-label {
    background: rgba(0,0,0,0.3);
    padding: 0 16px;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 2px;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.ticker-content a {
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
    animation: ticker-fade 0.5s ease;
}

.ticker-content a:hover {
    color: #ffd700;
    text-decoration: underline;
}

@keyframes ticker-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Top Bar ---- */
.top-bar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--divider);
    font-size: 0.75rem;
    color: var(--topbar-text);
}

.top-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ---- Header ---- */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--divider);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 20px 16px;
    text-align: center;
}

.brand a {
    text-decoration: none;
    color: var(--text-primary);
}

.site-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 0;
}

.site-tagline {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 500;
}

/* ---- Navigation ---- */
nav {
    background: var(--nav-bg);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

nav a {
    color: var(--nav-text);
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
}

nav a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}

nav a.active {
    color: #ffffff;
    border-bottom-color: var(--accent);
    background: rgba(255,255,255,0.05);
}

/* ---- Main ---- */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 70vh;
}

/* ---- Loading ---- */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* ---- Hero / Featured Story ---- */
.hero-card {
    position: relative;
    z-index: 1;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--bg-card);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: box-shadow 0.3s;
}

.hero-card:hover { box-shadow: var(--card-hover-shadow); }

.hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.hero-no-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--nav-bg) 0%, #2c3e50 100%);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 32px 28px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: white;
}

.hero-category {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hero-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 8px;
}

.hero-meta {
    font-size: 0.8rem;
    opacity: 0.8;
    display: flex;
    gap: 16px;
    align-items: center;
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--accent);
}

.section-header h2 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.section-header .view-all {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-section { margin-bottom: 40px; }

/* ---- Article Grid ---- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.article-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* ---- Article Card ---- */
.article-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.article-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

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

.article-card-category {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.article-card-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.article-card-title a {
    color: inherit;
    text-decoration: none;
}

.article-card-title a:hover {
    color: var(--accent);
}

.article-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.73rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--divider);
    margin-top: auto;
}

.article-card-source {
    font-weight: 600;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- List Card (sidebar style) ---- */
.list-card {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--divider);
    align-items: flex-start;
}

.list-card:last-child { border-bottom: none; }

.list-card-number {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--border);
    min-width: 32px;
    line-height: 1;
}

.list-card-content { flex: 1; }

.list-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
}

.list-card-title a { color: var(--text-primary); }
.list-card-title a:hover { color: var(--accent); }

.list-card-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    vertical-align: middle;
}

.badge-breaking {
    background: var(--breaking-bg);
    color: white;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.badge-underreported {
    background: var(--underreported-bg);
    color: white;
}

.badge-sentiment {
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.6rem;
}

.badge-sentiment.positive { color: var(--positive); border-color: var(--positive); }
.badge-sentiment.negative { color: var(--negative); border-color: var(--negative); }

/* Verification badges */
.badge-verify {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: help;
    vertical-align: middle;
}

.v-verified  { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.v-likely    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.v-singlebloc { background: #fce4ec; color: #7b1fa2; border: 1px solid #e1bee7; }
.v-unverified { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.v-disputed  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

[data-theme="dark"] .v-verified  { background: #1a3a2a; color: #7dd3a8; border-color: #2a5a3a; }
[data-theme="dark"] .v-likely    { background: #1a2a3a; color: #7dc3d3; border-color: #2a4a5a; }
[data-theme="dark"] .v-singlebloc { background: #2a1a30; color: #ce93d8; border-color: #4a2a5a; }
[data-theme="dark"] .v-unverified { background: #3a3520; color: #d3c87d; border-color: #5a5530; }
[data-theme="dark"] .v-disputed  { background: #3a1a1a; color: #d37d7d; border-color: #5a2a2a; }

/* Verification box (article detail page) */
.verification-box {
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    border-left: 4px solid;
}

.vbox-verified  { background: #d4edda; border-color: #28a745; }
.vbox-likely    { background: #d1ecf1; border-color: #17a2b8; }
.vbox-singlebloc { background: #fce4ec; border-color: #9c27b0; }
.vbox-unverified { background: #fff3cd; border-color: #ffc107; }
.vbox-disputed  { background: #f8d7da; border-color: #dc3545; }

[data-theme="dark"] .vbox-verified  { background: #1a3a2a; border-color: #28a745; }
[data-theme="dark"] .vbox-likely    { background: #1a2a3a; border-color: #17a2b8; }
[data-theme="dark"] .vbox-singlebloc { background: #2a1a30; border-color: #9c27b0; }
[data-theme="dark"] .vbox-unverified { background: #3a3520; border-color: #ffc107; }
[data-theme="dark"] .vbox-disputed  { background: #3a1a1a; border-color: #dc3545; }

.vbox-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.vbox-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.vbox-note {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.vbox-sources {
    font-size: 0.8rem;
    margin-top: 8px;
    color: var(--text-muted);
}

.topic-tag {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    margin: 2px 2px 2px 0;
}

/* ---- Single Article View ---- */
.article-full {
    max-width: 780px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.article-full-header {
    padding: 32px 36px 24px;
}

.article-full-category {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.article-full h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.article-full-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--divider);
}

.article-hero-img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
}

.article-full-body {
    padding: 28px 36px 36px;
}

.article-full-body .summary-text {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 28px;
}

.article-full-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.source-box {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    padding: 20px 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-top: 8px;
}

.source-box a {
    color: var(--accent-blue);
    font-weight: 600;
    word-break: break-all;
}

.source-box .verify {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.pagination button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ---- About Page ---- */
.about-page {
    max-width: 780px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 40px 36px;
}

.about-page h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 24px;
}

.about-page h2 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.3rem;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--accent);
}

.about-page p { margin-bottom: 12px; color: var(--text-secondary); line-height: 1.7; }
.about-page ul { margin: 12px 0; padding-left: 24px; }
.about-page li { margin-bottom: 6px; color: var(--text-secondary); }

/* ---- Forms ---- */
.site-form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group .optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-group .required {
    color: var(--accent);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-submit {
    display: inline-block;
    padding: 14px 36px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    min-height: 48px;
}

.form-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.form-status:not(:empty) { display: block; }

.form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

[data-theme="dark"] .form-success { background: #1a3a2a; color: #7dd3a8; border-color: #2a5a3a; }
[data-theme="dark"] .form-info { background: #1a2a3a; color: #7dc3d3; border-color: #2a4a5a; }

/* ---- Captcha Widget ---- */
.captcha-widget {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-verify-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 0;
}

.captcha-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.captcha-verify-btn:hover .captcha-checkbox {
    border-color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.05);
}

.captcha-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

.captcha-solved {
    color: var(--positive);
    font-weight: 600;
    border-color: var(--positive);
}

.captcha-check {
    font-size: 1.4rem;
    color: var(--positive);
}

.captcha-math label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 12px;
}

.captcha-math-input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Honeypot - invisible to humans, bots fill it */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    tab-index: -1;
}

.tip-notice {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-blue);
    padding: 16px 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 20px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---- Share Buttons ---- */
.share-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    vertical-align: middle;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.share-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
}

.share-bar-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.share-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
    color: white;
}

.share-social:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.share-x { background: #1a1a2e; }
.share-fb { background: #1877f2; }
.share-copy { background: var(--accent); font-size: 1rem; }

/* Toast notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nav-bg);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    animation: toast-in 0.3s ease, toast-out 0.3s ease 1.7s;
}

@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(20px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(-20px); } }

/* ---- Footer ---- */
footer {
    background: var(--nav-bg);
    color: #b0b0c8;
    margin-top: 48px;
    padding: 48px 20px 24px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p { font-size: 0.85rem; line-height: 1.6; }

.footer-col a {
    display: block;
    color: #b0b0c8;
    font-size: 0.85rem;
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-col a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .article-grid-2 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .hero-title { font-size: 1.4rem; }
    .hero-image { height: 280px; }
}

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

    .top-bar-inner { flex-direction: column; gap: 4px; padding: 4px 12px; }

    .header-inner { padding: 10px 16px 8px; }
    .site-title { font-size: 1.3rem; }
    .site-tagline { font-size: 0.6rem; letter-spacing: 1.5px; }

    .nav-inner {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-inner::-webkit-scrollbar { display: none; }

    nav a {
        padding: 10px 12px;
        font-size: 0.7rem;
        letter-spacing: 0;
    }

    .hero-image { height: 220px; }
    .hero-title { font-size: 1.2rem; }
    .hero-overlay { padding: 24px 16px 16px; }

    .article-card-img { height: 200px; }

    .article-full-header { padding: 20px 16px 14px; }
    .article-full-body { padding: 16px; }
    .article-full h1 { font-size: 1.4rem; }

    .about-page { padding: 24px 16px; }

    .footer-grid { grid-template-columns: 1fr; gap: 20px; }

    main { padding: 14px 10px; }

    .ticker-label { padding: 0 10px; font-size: 0.6rem; letter-spacing: 1px; }
    .ticker-track span { font-size: 0.75rem; }
}
