/*
Theme Name: AI Nexus Theme
Theme URI: https://example.com/ai-nexus
Author: AI Assistant
Author URI: https://example.com
Description: A high-tech, editorial WordPress theme inspired by The Verge and Wired.
Version: 3.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ai-nexus
Tags: blog, news, ai, dark-mode, editorial, brutalist
*/

:root {
    /* Color Palette - Light Mode */
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --text-main: #111111;
    --text-secondary: #444444;
    --text-muted: #767676;

    /* Brand Colors */
    --primary: #1A00FF;
    /* Electric Blue */
    --accent: #ff0055;
    /* Tech Pink/Red for highlights */
    --border-color: #e5e5e5;
    /* Softer border for premium feel */
    --border-strong: #111111;
    /* Strong border for accents */

    /* Typography */
    --font-main: 'Manrope', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Layout */
    --container-width: 1320px;
    /* Standard wide container */
    --header-height: 80px;
    --border-width: 1px;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 32px;
    --spacing-lg: 64px;
    --spacing-xl: 96px;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode */
    --bg-body: #050505;
    --bg-surface: #0a0a0a;
    --text-main: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    /* Brand Colors */
    --primary: #1A00FF;
    --accent: #00ffcc;
    --border-color: #27272a;
    --border-strong: #ffffff;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Removed grayscale for a more vibrant, premium look */
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Premium & Clean */
.site-header {
    height: var(--header-height);
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text-main);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo span {
    color: var(--primary);
}

.main-nav ul {
    display: flex;
    gap: 32px;
}

.main-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
}

.main-nav a:hover {
    color: var(--primary);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--text-main);
    background-color: var(--bg-surface);
}

.icon-sun {
    display: block;
}

.icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: block;
}

/* Stock Ticker */
.stock-ticker-wrapper {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    overflow: hidden;
}

.stock-ticker {
    display: flex;
    gap: 40px;
    align-items: center;
}

.stock-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-name {
    font-weight: 700;
    color: var(--text-main);
}

.stock-price {
    color: var(--text-secondary);
}

.stock-change {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.stock-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stock-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.stock-change.neutral {
    color: var(--text-muted);
    background: rgba(128, 128, 128, 0.1);
}

/* Sections General */
.section {
    padding: var(--spacing-lg) 0;
}

.section-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    position: relative;
    display: inline-block;
    line-height: 1;
}

/* Cards - Premium Editorial */
.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.03);
}

.card-image {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 4px;
    background-color: var(--bg-surface);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 12px;
    display: inline-block;
    letter-spacing: 0.05em;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.card-content h3 a {
    background-image: linear-gradient(var(--text-main), var(--text-main));
    background-size: 0% 2px;
    background-position: 0% 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
    padding-bottom: 2px;
}

.card-content h3 a:hover {
    background-size: 100% 2px;
}

.card-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Popular Section - Refined Grid */
.popular-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 48px;
    /* align-items: start; Removed to allow stretch */
}

.popular-main .card-image {
    aspect-ratio: 16/9;
    height: auto;
    width: 100%;
    margin-bottom: 24px;
}

.popular-main h3 {
    font-size: 2.5rem;
    /* Larger headline */
    margin-bottom: 16px;
}

.popular-main p {
    font-size: 1.1rem;
    -webkit-line-clamp: 4;
}

.popular-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Reduced gap to fit more items if needed, or let space-between handle it */
    height: 100%;
    justify-content: space-between;
}

.popular-small {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    align-items: start;
}

.popular-small .card-image {
    height: 100px;
    margin-bottom: 0;
}

.popular-small h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.popular-small .meta {
    border-top: none;
    padding-top: 0;
    margin-top: 8px;
}

/* Events Section - Compact & Clean */
.events-section.compact {
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface);
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.events-header .section-title.small {
    font-size: 1.1rem;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.see-all {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.events-scroller {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--primary);
    border-radius: 0;
    transition: border-color 0.2s, transform 0.2s;
}

.event-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(26, 0, 255, 0.2);
    transform: translateY(-2px);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding-right: 16px;
    border-right: 1px solid var(--primary);
    color: var(--text-main);
}

.event-date .day {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.event-date .month {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.event-info h4 {
    font-family: var(--font-main);
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.event-loc {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* Latest Articles (Pagination) */
.latest-section {
    background-color: var(--bg-body);
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.article-row {
    display: flex;
    flex-direction: row;
    /* Side by side */
    gap: 20px;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.article-row:last-child {
    border-bottom: none;
}

.article-row .row-image {
    width: 140px;
    height: 100px;
    /* Compact size */
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.article-row .row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-row:hover .row-image img {
    transform: scale(1.03);
}

.article-row .row-content {
    padding-top: 0;
}

.article-row h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

/* Pagination */
.pagination-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.pagination .nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers:focus {
    color: var(--primary);
}

.pagination .page-numbers.current {
    color: var(--text-main);
    font-weight: 700;
}

.pagination .page-numbers.dots {
    color: var(--text-muted);
    cursor: default;
}

/* Category Sections */
.category-section {
    padding-top: var(--spacing-lg);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.cards-grid .card-image {
    height: 240px;
}

/* Footer */
/* Footer */
.site-footer {
    background-color: var(--bg-body);
    color: var(--text-main);
    padding: 40px 0 20px;
    margin-top: 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.footer-col {
    flex: 1;
    min-width: 300px;
}

.footer-links-horizontal {
    text-align: right;
}

.horizontal-list {
    list-style: none;
    display: flex;
    gap: 30px;
    justify-content: flex-end;
    padding: 0;
    margin: 0;
}

.horizontal-list li {
    margin: 0;
}

.horizontal-list a {
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.horizontal-list a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .popular-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .popular-main .card-image {
        height: 400px;
    }

    .popular-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .popular-small {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .popular-small .card-image {
        height: 180px;
        width: 100%;
    }

    .events-scroller {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        /* More space for content */
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        overflow-wrap: break-word;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .post-title {
        font-size: 1.8rem;
        /* Smaller on mobile */
    }

    .post-intro {
        font-size: 1.1rem;
    }

    .content-body {
        font-size: 1rem;
        /* Standard readable size */
        line-height: 1.6;
    }

    .article-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .article-row .row-image {
        width: 100%;
        height: 200px;
        /* Larger image on mobile */
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .popular-side {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-col {
        min-width: 0;
        /* Reset min-width */
    }
}

/* Search Overlay */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--primary);
}

.search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 900;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.search-field {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-family: var(--font-main);
}

.search-field:focus {
    outline: none;
    border-color: var(--primary);
}

.search-submit {
    padding: 0 30px;
    background-color: var(--text-main);
    color: var(--bg-body);
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: var(--font-main);
    font-size: 1rem;
}

.search-submit:hover {
    background-color: var(--primary);
    color: white;
}

.search-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 15px;
}

.search-close:hover {
    color: var(--text-main);
}

/* Fix Bullets */
ul {
    list-style: none;
    /* Global reset for UI elements */
}

.content-body ul {
    list-style: disc;
    /* Restore for article content */
    margin-left: 20px;
}

.content-body ol {
    list-style: decimal;
    margin-left: 20px;
}


/* Force Uppercase Titles */
h1,
h2,
h3,
h4,
h5,
h6 {
    text-transform: uppercase;
}

.card-content h3,
.row-content h3,
.post-title,
.page-title,
.archive-title {
    text-transform: uppercase;
    letter-spacing: -0.02em;
    /* Slight adjustment for uppercase readability */
}


/* Single Post Refinements */
.single-post-section {
    padding-top: 60px;
}

.post-header {
    text-align: left;
    max-width: 1000px;
    margin: 0 auto 60px;
}

.post-meta-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.post-meta-top .sep {
    color: var(--border-color);
}

.post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.post-intro {
    font-family: var(--font-main);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
    max-width: 800px;
    margin: 0;
    font-weight: 400;
    text-transform: none;
}

.post-intro p {
    font-family: var(--font-main);
    font-weight: 400;
    text-transform: none;
    font-size: 1.15rem;
    margin-bottom: 0;
}

.post-featured-image {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    margin-bottom: 60px;
    border-radius: 4px;
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content-layout {
    display: grid;
    grid-template-columns: 1fr 250px;
    /* Content + Sidebar */
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

.content-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
    max-width: 100%;
    /* Let grid handle width */
}

.content-body p {
    margin-bottom: 24px;
}

.content-body h2,
.content-body h3 {
    font-family: var(--font-main);
    font-size: 2rem;
    margin-top: 48px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Share Sidebar */
.post-sidebar {
    position: relative;
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
    padding-top: 20px;
    border-top: 2px solid var(--primary);
}

.sticky-sidebar h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.share-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background-color: var(--text-main);
    color: var(--bg-body);
    transform: translateY(-2px);
}

@media (max-width: 1024px) {
    .post-content-layout {
        grid-template-columns: 1fr;
    }

    .sticky-sidebar {
        position: static;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
        margin-bottom: 40px;
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .sticky-sidebar h4 {
        margin-bottom: 0;
    }

    .share-buttons {
        flex-direction: row;
    }
}


/* Comments Section */
.comments-wrapper {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.comments-wrapper h3 {
    margin-bottom: 30px;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}


/* Global Section Header */
.section-header {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    gap: 30px;
}

.slider-controls {
    display: flex;
    gap: 10px;
}

.slider-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.slider-btn:hover {
    background-color: var(--text-main);
    color: var(--bg-body);
}

.slider-container {
    overflow: hidden;
    width: 100%;
}

.slider-track {
    display: flex;
    gap: 30px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slider-card {
    min-width: calc(33.333% - 20px);
    /* Show 3 cards at a time */
    flex-shrink: 0;
}

.slider-card .card-image {
    height: 200px;
}

.slider-card h3 {
    font-size: 1.2rem;
}

@media (max-width: 1024px) {
    .slider-card {
        min-width: calc(50% - 15px);
        /* Show 2 cards */
    }
}

@media (max-width: 600px) {
    .slider-card {
        min-width: 100%;
        /* Show 1 card */
    }
}


/* Single Event Styles */
.event-main-info {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
    padding: 30px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-item .label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-register {
    display: block;
    width: 100%;
    padding: 16px 0;
    background-color: var(--primary);
    color: white;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-mono);
    margin-bottom: 30px;
    transition: background-color 0.2s;
}

.btn-register:hover {
    background-color: var(--text-main);
}

.event-map {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.map-placeholder {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Archive Event Refinements */
.event-row-large {
    transition: transform 0.2s, border-color 0.2s;
    background-color: var(--bg-surface);
}

.event-row-large:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.event-meta-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.event-tag {
    color: var(--primary);
    font-weight: 700;
}

.event-loc-badge {
    color: var(--text-muted);
}


/* Map Styling */
.map-container {
    height: 400px;
    width: 100%;
    border: 1px solid var(--border-color);
    overflow: hidden;
    filter: grayscale(100%);
    /* Editorial look */
    transition: filter 0.3s;
}

.map-container:hover {
    filter: grayscale(0%);
}

/* Dark Mode Map Adjustment */
[data-theme='dark'] .map-container iframe {
    filter: invert(90%) hue-rotate(180deg);
}


/* Improved Events Archive */
.events-list-large {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.event-row-large {
    display: grid;
    grid-template-columns: 100px 1fr 180px;
    /* Date | Content | Action */
    gap: 40px;
    padding: 30px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    align-items: center;
    transition: all 0.3s ease;
}

.event-row-large:hover {
    border-color: var(--primary);
    transform: translateX(10px);
    box-shadow: -5px 5px 0px rgba(37, 99, 235, 0.1);
}

.event-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--text-main);
    padding: 15px 5px;
    text-align: center;
    background-color: var(--bg-body);
}

.event-date-box .day {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-main);
}

.event-date-box .month {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
}

.event-date-box .year {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.event-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-meta-row {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.event-type-badge {
    background-color: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 2px;
    font-weight: 700;
}

.event-loc-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
}

.event-title {
    font-size: 1.8rem;
    margin: 0;
    line-height: 1.1;
}

.event-title a {
    color: var(--text-main);
}

.event-title a:hover {
    color: var(--primary);
}

.event-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.event-action {
    text-align: right;
}

.btn-event-details {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-event-details:hover {
    background-color: var(--text-main);
    color: var(--bg-body);
}

@media (max-width: 900px) {
    .event-row-large {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .event-date-box {
        width: 100px;
        margin: 0 auto;
    }

    .event-meta-row {
        justify-content: center;
    }

    .event-excerpt {
        margin: 0 auto;
    }

    .event-action {
        text-align: center;
    }
}


/* Page Styling */
.page-header-styled {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.page-subtitle {
    display: block;
    font-family: var(--font-mono);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-title {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 20px;
}

.page-bar {
    width: 60px;
    height: 4px;
    background-color: var(--text-main);
    margin: 0 auto;
}

/* Contact Page Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 80px;
    align-items: start;
}

.contact-info .lead {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: var(--text-secondary);
}

.info-block {
    margin-bottom: 30px;
}

.info-block h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-family: var(--font-mono);
}

.info-block a,
.info-block p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.social-links {
    margin-top: 40px;
    display: flex;
    gap: 20px;
}

.social-links a {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid transparent;
}

.social-links a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Styled Form */
.contact-form-wrapper {
    background-color: var(--bg-surface);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.contact-form-wrapper h3 {
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
}

.styled-form input,
.styled-form select,
.styled-form textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.styled-form input:focus,
.styled-form select:focus,
.styled-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-submit {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--text-main);
    color: var(--bg-body);
    border: none;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: var(--primary);
    color: white;
}

@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .page-title {
        font-size: 2.5rem;
    }
}


/* Logo Styling */
.logo img {
    display: block;
    max-height: 60px;
    width: auto;
}

.footer-logo img {
    display: block;
    max-height: 50px;
    width: auto;
}

/* Mobile Excerpt Hiding */
@media (max-width: 768px) {

    .card-content p,
    .row-content p,
    .popular-main p {
        display: none;
    }

    /* Ensure titles have enough margin since paragraph is gone */
    .card-content h3,
    .row-content h3 {
        margin-bottom: 10px;
    }
}


/* Scrollable Stock Ticker (Manual) */
.stock-ticker-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    cursor: grab;
}

.stock-ticker-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.stock-ticker {
    animation: none !important;
    /* Disable auto-scroll */
    width: max-content;
    padding: 0 20px;
    /* Add some padding for scroll start/end */
    justify-content: flex-start;
    /* Ensure items start from left */
}

.stock-ticker-wrapper:active {
    cursor: grabbing;
}


/* Increase spacing for Popular Section */
.popular-section {
    padding-top: 40px !important;
    margin-top: 0 !important;
}

/* Contact Form Fixes */
.styled-form textarea {
    min-height: 150px;
    resize: vertical;
    width: 100%;
}

.styled-form select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
    cursor: pointer;
}

/* Dark mode arrow fix */
[data-theme='dark'] .styled-form select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
}


/* Archive Header Refinements */
.archive-header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.archive-subtitle {
    display: block;
    font-family: var(--font-mono);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    font-weight: 700;
}

.archive-title {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.archive-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.theme-toggle:hover {
    color: var(--primary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

[data-theme='dark'] .theme-toggle .icon-sun {
    display: block;
}

:root:not([data-theme='dark']) .theme-toggle .icon-moon {
    display: block;
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 0;
}

.mobile-menu-toggle:hover {
    color: var(--primary);
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 80px;
        /* Adjust based on header height */
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--bg-body);
        padding: 40px 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        border-top: 1px solid var(--border-color);
        overflow-y: auto;
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .main-nav ul li a {
        font-size: 1.5rem;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* Ensure 2-column grid on desktop for latest articles */
@media (min-width: 769px) {
    .articles-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        border-top: 1px solid var(--border-color);
    }

    .article-row {
        padding: 40px;
        border-bottom: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
    }

    /* Remove right border from even items (2nd column) */
    .article-row:nth-child(2n) {
        border-right: none;
    }

    /* Remove bottom border from the last row (last 2 items) */
    .article-row:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

/* Community Section (Tags & Poll) */
.community-section {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

.community-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-item {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tag-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Poll */
.poll-card {
    background-color: var(--bg-body);
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.poll-question {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.poll-option {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-main);
    text-align: left;
    width: 100%;
}

.poll-option:hover {
    border-color: var(--primary);
}

.poll-option.selected {
    border-color: var(--primary);
    font-weight: 700;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(37, 99, 235, 0.1);
    width: 0;
    z-index: 0;
    transition: width 0.5s ease;
}

.option-text,
.option-percent {
    position: relative;
    z-index: 1;
}

.option-percent {
    font-weight: 700;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.poll-card.voted .option-percent {
    opacity: 1;
}

.poll-footer {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
}

/* Newsletter Section */
/* Newsletter Section */
.newsletter-section {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.newsletter-text h2 {
    color: var(--text-main);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.newsletter-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 16px 20px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-mono);
    /* Tech font for input */
    color: var(--text-main);
}

.newsletter-form input::placeholder {
    color: var(--text-muted);
}

.newsletter-form button {
    padding: 16px 32px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--font-mono);
    /* Tech font for button */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
}

.newsletter-form button:hover {
    background-color: #1d4ed8;
}

@media (max-width: 900px) {

    .community-grid,
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-text {
        text-align: center;
    }
}

/* Tags Scroller */
.tags-section {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    overflow: hidden;
    /* Hide scrollbar */
    padding: 60px 0;
}

.tags-scroller-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.tags-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: scrollTags 40s linear infinite;
    padding: 10px 0;
    /* Prevent hover clipping */
}

.tags-track:hover {
    animation-play-state: paused;
}

.tag-item {
    white-space: nowrap;
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
}

.tag-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@keyframes scrollTags {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Recommended Section Responsive */
@media (max-width: 900px) {
    .recommended-section .cards-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links-horizontal,
    .horizontal-list {
        text-align: center;
        justify-content: center;
    }
}

.footer-desc {
    margin-top: 20px;
    color: var(--text-secondary);
}

/* Fix logo color in light footer */
.footer-logo img {
    filter: none !important;
    /* Reset invert */
}

[data-theme='dark'] .footer-logo img {
    filter: brightness(0) invert(1) !important;
}

/* Article Summary Box */
.article-summary-box {
    background-color: var(--bg-surface);
    border-left: 3px solid var(--primary);
    padding: 24px;
    margin-bottom: 32px;
}

.article-summary-box h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 700;
}

.article-summary-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-summary-box li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.article-summary-box li::before {
    content: '•';
    color: var(--primary);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}