/*
Theme Name: HackerNews Cyber
Theme URI: https://hackernews.com.br
Author: Antigravity
Author URI: https://google.com
Description: An ideal hacker-themed WordPress template. Deep dark mode, neon green and cyan accents, terminal aesthetics, and high performance.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hackernews-cyber
*/

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,300;0,400;0,600;0,700;1,300&family=Share+Tech+Mono&display=swap');

/* CSS Variables & Theme Settings (GitHub Dark Inspired with Cyber Accents) */
:root {
    --bg-darkest: #0d1117;
    --bg-darker: #161b22;
    --bg-dark: #161b22;
    --bg-card: #21262d;
    --border-dim: #30363d;
    --border-hover: #8b949e;
    
    --neon-green: #39d353;
    --neon-cyan: #58a6ff;
    --neon-cyan-glow: #00f0ff;
    --neon-pink: #ff7b72;
    
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-header: 'Share Tech Mono', monospace;
    
    --glow-cyan: 0 0 10px rgba(88, 166, 255, 0.45);
    --glow-green: 0 0 10px rgba(57, 211, 83, 0.45);
    --glow-cyan-large: 0 0 20px rgba(88, 166, 255, 0.15);
}

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

body {
    background-color: var(--bg-darkest);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Scanline overlay (subtle and high-tech) */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
    z-index: 99999;
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.15;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: var(--neon-cyan-glow);
    text-shadow: var(--glow-cyan);
}

/* Header & Navigation */
.site-header {
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-dim);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-extra-link {
    font-family: var(--font-header);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    border: 1px solid var(--border-dim);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}

.brand-extra-link:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan-glow);
    box-shadow: var(--glow-cyan);
}

.site-title {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-title a::before {
    content: "[HN]";
    color: var(--neon-cyan-glow);
    text-shadow: var(--glow-cyan);
}

.site-title a::after {
    content: " _";
    color: var(--neon-green);
    animation: blink 1s infinite;
}

/* Main Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.main-navigation a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 0.4rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    border-color: var(--border-dim);
    background-color: var(--bg-card);
    color: var(--neon-cyan-glow);
}

/* Main Layout Grid */
.site-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .site-content {
        grid-template-columns: 9.3fr 2.7fr;
        gap: 3.5rem;
    }
}

/* Content Area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

/* Post Cards */
.post-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-dim);
    border-left: 4px solid var(--neon-cyan);
    border-radius: 6px;
    padding: 2.2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
    border-color: var(--neon-cyan-glow);
    border-left-color: var(--neon-green);
    box-shadow: var(--glow-cyan-large), 0 0 15px rgba(0, 240, 255, 0.1);
    transform: translateY(-2px);
}

.post-title {
    font-size: 1.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.25;
}

.post-title a {
    color: var(--text-primary);
}

.post-title a:hover {
    color: var(--neon-cyan-glow);
}

.post-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.post-meta span {
    display: inline-block;
    white-space: nowrap;
}

.post-meta a {
    color: var(--text-secondary);
}

.post-meta a:hover {
    color: var(--neon-cyan-glow);
}

.post-thumbnail {
    margin-bottom: 1.2rem;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--bg-darkest);
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: cover;
    filter: grayscale(10%) contrast(100%);
    transition: filter 0.25s ease;
}

.post-card:hover .post-thumbnail img {
    filter: grayscale(0%) contrast(100%);
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.read-more-btn::before {
    content: "> ";
    color: var(--neon-green);
    font-weight: bold;
}

.read-more-btn:hover {
    color: var(--neon-cyan-glow);
    text-shadow: var(--glow-cyan);
    background: transparent;
}

/* Cyber Placeholders */
.cyber-placeholder,
.cyber-placeholder-large {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    width: 100%;
    letter-spacing: 1px;
}

.cyber-placeholder {
    height: 160px;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.cyber-placeholder::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(0deg, rgba(88, 166, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 166, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.cyber-placeholder-large {
    height: 250px;
    background: radial-gradient(circle, #161b22 0%, #0d1117 100%);
    color: var(--neon-cyan);
    font-size: 0.9rem;
    text-shadow: var(--glow-cyan);
}

.cyber-placeholder-large::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(0deg, rgba(88, 166, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 166, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.cyber-placeholder-large .matrix-effect {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cyber-placeholder-large .pulse-code {
    font-size: 0.7rem;
    color: var(--text-muted);
    animation: blink 1.5s infinite;
}

.post-card:hover .cyber-placeholder {
    color: var(--neon-cyan-glow);
    text-shadow: var(--glow-cyan);
}

/* Featured Story overrides */
.featured-news-card {
    margin-bottom: 3rem;
}

.featured-flex {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* News Feed Container */
.news-feed-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* News feed is stacked in a single column for clean vertical flow */

/* Grid Card layout overrides */
.grid-news-card {
    padding: 1.5rem;
    height: 100%;
}

.grid-thumbnail {
    max-height: 180px;
    overflow: hidden;
}

.grid-content-wrap {
    margin-top: 0.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.grid-title {
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
}

.grid-meta {
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
}

.grid-excerpt {
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
}

.grid-read-link {
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.grid-read-link:hover {
    color: var(--neon-cyan-glow);
    text-shadow: var(--glow-cyan);
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-width: 0;
}

.widget {
    background-color: transparent;
    border: none;
    border-bottom: 1px dashed var(--border-dim);
    border-radius: 0;
    padding: 0 0 2rem 0;
}

.widget:last-child {
    border-bottom: none;
}

.widget-title {
    font-family: var(--font-header);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    border-bottom: 1px dashed var(--border-dim);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--neon-cyan);
}

.widget-title::after {
    content: "[INFO]";
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-dim);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.85rem;
}

.widget li:last-child {
    border-bottom: none;
}

.widget li a {
    color: var(--text-secondary);
    line-height: 1.4;
    transition: color 0.2s ease;
}

.widget li a:hover {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

/* Single Post styling */
.single-post-container {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    padding: 2.5rem;
}

.post-content {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2, .post-content h3, .post-content h4 {
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
    font-weight: 700;
}

.post-content code {
    background-color: var(--bg-darkest);
    color: var(--neon-pink);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.post-content pre {
    background-color: var(--bg-darkest);
    border: 1px solid var(--border-dim);
    padding: 1.5rem;
    overflow-x: auto;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.post-content pre code {
    background-color: transparent;
    border: none;
    padding: 0;
    color: var(--text-primary);
}

.post-content blockquote {
    border-left: 4px solid var(--neon-cyan-glow);
    padding: 0.8rem 1.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
}

.post-tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-dim);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-link {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.tag-link:hover {
    border-color: var(--neon-cyan-glow);
    color: var(--neon-cyan-glow);
    box-shadow: var(--glow-cyan-large);
}

/* Footer Styling */
.site-footer {
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-dim);
    margin-top: 4rem;
    padding: 2rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.site-info {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 3.5rem 0;
}

.pagination .page-numbers {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.pagination .page-numbers.current {
    background-color: var(--bg-card);
    border-color: var(--neon-cyan-glow);
    color: var(--neon-cyan-glow);
    box-shadow: var(--glow-cyan-large);
}

.pagination a.page-numbers:hover {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: var(--glow-green);
}

/* Search Form Widget */
.search-form {
    display: flex;
    gap: 5px;
}

.search-field {
    flex-grow: 1;
    background-color: var(--bg-darkest);
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.search-field:focus {
    outline: none;
    border-color: var(--neon-cyan-glow);
}

.search-submit {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.search-submit:hover {
    background-color: var(--border-dim);
    border-color: var(--neon-cyan-glow);
}

/* Animations */
@keyframes blink {
    50% { opacity: 0; }
}

/* WordPress Core Required classes */
.aligncenter {
    display: block;
    margin: 1.5rem auto;
}
.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1.5rem 0;
}
.alignright {
    float: right;
    margin: 0.5rem 0 1.5rem 1.5rem;
}
.wp-caption {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-dim);
    padding: 5px;
    text-align: center;
    border-radius: 6px;
    max-width: 100%;
}
.wp-caption img {
    margin: 0;
    max-width: 100%;
    height: auto;
}
.wp-caption-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 5px 0 0;
}
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Content images: keep bot/hotlinked full-res images inside the column */
.post-content img,
.entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
}
.post-content figure,
.entry-content figure,
.post-content .wp-block-image,
.entry-content .wp-block-image {
    max-width: 100%;
    margin: 1.5rem 0;
}
.post-content .wp-block-image img,
.entry-content .wp-block-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}
.post-content .alignleft,
.post-content .alignright {
    max-width: 45%;
}
