/* ========================================
   FREAKLORE - Paranormal News Aggregator
   Grid Theme • Black Background • Work Sans
   ======================================== */

:root {
    --bg-primary: #000000;
    --bg-card: #111111;
    --bg-card-hover: #1a1a1a;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --bg-overlay-hover: rgba(0, 0, 0, 0.55);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --accent-red: #e63946;
    --accent-purple: #9b5de5;
    --accent-green: #00f5d4;
    --accent-orange: #f77f00;
    --accent-blue: #00bbf9;
    --accent-pink: #f15bb5;
    --border-color: #222222;
    --font-main: 'Work Sans', sans-serif;
    --category-aliens: #00f5d4;
    --category-ghosts: #9b5de5;
    --category-demons: #e63946;
    --category-cryptids: #f77f00;
    --category-ufos: #00bbf9;
    --category-mysteries: #f15bb5;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-red);
}

/* ====== HEADER ====== */
.site-header {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 1rem;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    text-align: center;
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text-primary);
}

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

.main-nav {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--accent-red);
    background: rgba(230, 57, 70, 0.1);
}

/* Header social share */
.header-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.x-twitter { background: #000; color: white; border: 1px solid #333; }
.share-btn.reddit { background: #ff4500; color: white; }
.share-btn.tiktok { background: #010101; color: white; border: 1px solid #333; }

.share-btn:hover {
    transform: scale(1.1);
    opacity: 0.85;
}

/* ====== AD BANNERS ====== */
.ad-banner {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.ad-placeholder {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    border-radius: 4px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-inline {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.ad-inline .ad-placeholder {
    min-height: 60px;
}

.ad-sidebar {
    margin: 1rem 0;
}

.ad-sidebar .ad-placeholder {
    min-height: 250px;
}

/* ====== MAIN LAYOUT ====== */
.site-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

/* ====== HERO SECTION ====== */
.hero-section {
    margin-bottom: 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 4px;
}

.hero-card {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-card);
    overflow: hidden;
    cursor: pointer;
}

.hero-card-large {
    min-height: 380px;
}

.hero-card-small {
    min-height: 200px;
}

.hero-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 2rem 1.5rem 1.5rem;
    transition: background 0.3s ease;
}

.hero-card:hover .hero-card-overlay {
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
}

.hero-card-large h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.hero-card-large h2 a:hover {
    color: var(--accent-red);
}

.hero-card-small h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.hero-small-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

/* ====== CATEGORY BADGES ====== */
.card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    background: rgba(230, 57, 70, 0.9);
    color: white;
}

.card-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.25rem 0.6rem;
    border-radius: 2px;
    background: rgba(230, 57, 70, 0.9);
    color: white;
}

/* Category-specific badge colors */
.category-aliens .card-category,
.category-aliens .card-category-badge { background: var(--category-aliens); color: #000; }
.category-ghosts .card-category,
.category-ghosts .card-category-badge { background: var(--category-ghosts); }
.category-demons .card-category,
.category-demons .card-category-badge { background: var(--category-demons); }
.category-cryptids .card-category,
.category-cryptids .card-category-badge { background: var(--category-cryptids); color: #000; }
.category-ufos .card-category,
.category-ufos .card-category-badge { background: var(--category-ufos); color: #000; }
.category-mysteries .card-category,
.category-mysteries .card-category-badge { background: var(--category-mysteries); }

/* ====== CARD DESCRIPTION & SOURCE ====== */
.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.card-source {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-source a {
    color: var(--accent-red);
    font-weight: 500;
}

.card-source a:hover {
    text-decoration: underline;
}

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

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

/* ====== SOCIAL SHARE ON CARDS ====== */
.card-share {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.share-icon {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 2px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.share-icon.fb { background: #1877f2; color: white; }
.share-icon.tw { background: #000; color: white; border: 1px solid #333; }
.share-icon.wa { background: #25d366; color: white; }
.share-icon.pin { background: #e60023; color: white; }
.share-icon.rd { background: #ff4500; color: white; }
.share-icon.tk { background: #010101; color: white; border: 1px solid #333; }

.share-icon:hover {
    transform: scale(1.05);
    opacity: 0.85;
}

/* ====== CATEGORY SECTIONS ====== */
.category-section {
    margin-bottom: 2rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 3px solid var(--accent-red);
    margin-bottom: 1rem;
}

.category-title {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.category-more {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-more:hover {
    text-decoration: underline;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

/* ====== ARTICLE CARDS ====== */
.article-card {
    background: var(--bg-card);
    overflow: hidden;
    transition: background 0.2s ease;
    border: 1px solid var(--border-color);
}

.article-card:hover {
    background: var(--bg-card-hover);
}

.card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    position: relative;
}

.card-body {
    padding: 1rem;
}

.card-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.card-body h3 a:hover {
    color: var(--accent-red);
}

.card-body .card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.card-body .card-share {
    margin-top: 0.75rem;
}

/* ====== SIDEBAR ====== */
.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 1rem;
}

.sidebar-heading {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-red);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.sidebar-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-red);
    min-width: 30px;
    line-height: 1;
}

.sidebar-item-content h4 {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-item-content h4 a:hover {
    color: var(--accent-red);
}

.sidebar-source {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.sidebar-featured-item {
    display: flex;
    gap: 0.75rem;
}

.sidebar-featured-img {
    width: 60px;
    min-height: 60px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-card-hover);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ====== FOOTER ====== */
.site-footer {
    background: var(--bg-card);
    border-top: 2px solid var(--border-color);
    margin-top: 3rem;
    padding: 2rem 1rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.footer-col h3 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
    color: var(--accent-red);
}

.footer-col p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.35rem;
}

.footer-col ul li a {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-col ul li a:hover {
    color: var(--text-primary);
}

.footer-socials {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-socials a {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
}

.footer-socials a:hover {
    color: var(--accent-red);
}

.footer-bottom {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
    .site-main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-small-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 0.75rem;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-card-large {
        min-height: 280px;
    }

    .hero-small-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-card-small {
        min-height: 160px;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .logo-text {
        font-size: 1.6rem;
    }

    .header-share {
        display: none;
    }
}

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

    .category-grid {
        grid-template-columns: 1fr;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ====== LOADING STATE ====== */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: block;
}

.htmx-request.htmx-indicator {
    display: block;
}