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

/* Base - Dark Revolutionary */
:root {
    --black: #0a0a0a;
    --dark: #111;
    --white: #f0f0f0;
    --red: #e63946;
    --gray: #888;
    --dark-gray: #333;
}

html {
    font-size: 18px;
}

body {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    background: var(--black);
    color: var(--white);
    line-height: 1.8;
}

/* Subtle grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    z-index: 1000;
}

/* Layout */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

/* Header */
header {
    padding: 4rem 0 3rem;
    border-bottom: 3px solid var(--red);
    margin-bottom: 3rem;
    position: relative;
}

header h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    line-height: 1;
}

header h1 a {
    color: var(--white);
    text-decoration: none;
    position: relative;
}

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

header p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--gray);
    margin-top: 0.75rem;
}

/* Circle-A accent */
header::after {
    content: 'Ⓐ';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    color: var(--red);
    opacity: 0.15;
    font-family: sans-serif;
}

.admin-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gray);
    text-decoration: none;
    border: 1px solid var(--dark-gray);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.admin-link:hover {
    color: var(--red);
    border-color: var(--red);
}

/* Articles */
article {
    margin-bottom: 4rem;
}

article.featured {
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--dark-gray);
    margin-bottom: 3rem;
}

article h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

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

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

article .meta {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

/* Article Content */
.content {
    font-size: 1.05rem;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

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

.content h2, .content h3, .content h4 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content h2 { font-size: 1.4rem; }
.content h3 { font-size: 1.2rem; }
.content h4 { font-size: 1rem; }

.content a {
    color: var(--red);
    text-decoration: none;
    border-bottom: 1px solid var(--red);
    transition: all 0.2s ease;
}

.content a:hover {
    color: var(--white);
    border-color: var(--white);
}

.content blockquote {
    border-left: 3px solid var(--red);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--gray);
}

.content blockquote p:last-child {
    margin-bottom: 0;
}

.content ul, .content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content code {
    font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85em;
    background: var(--dark-gray);
    padding: 0.2em 0.4em;
    border-radius: 2px;
}

.content pre {
    background: var(--dark);
    border-left: 3px solid var(--red);
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.content pre code {
    background: none;
    padding: 0;
}

.content hr {
    border: none;
    border-top: 1px solid var(--dark-gray);
    margin: 3rem 0;
}

.content strong {
    color: var(--white);
    font-weight: 600;
}

.content em {
    color: var(--gray);
}

/* Search Box */
.search-box {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--dark-gray);
    border-bottom: 1px solid var(--dark-gray);
}

.search-box form {
    display: flex;
    gap: 0;
}

.search-box input {
    flex: 1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    padding: 1rem;
    border: 2px solid var(--dark-gray);
    border-right: none;
    background: var(--dark);
    color: var(--white);
    letter-spacing: 0.05em;
}

.search-box input:focus {
    outline: none;
    border-color: var(--red);
}

.search-box input::placeholder {
    color: var(--gray);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.search-box button {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--red);
    background: var(--red);
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-box button:hover {
    background: transparent;
    color: var(--red);
}

.search-results-count {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

/* Preview */
.preview {
    color: var(--gray);
    margin-bottom: 1rem;
}

.read-more {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
}

.read-more a {
    color: var(--red);
    text-decoration: none;
    transition: color 0.2s ease;
}

.read-more a:hover {
    color: var(--white);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
    border-top: 1px solid var(--dark-gray);
    margin-top: 2rem;
}

.pagination a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.pagination .disabled {
    color: var(--dark-gray);
}

/* Single Post Navigation */
.post-nav {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--dark-gray);
}

.post-nav a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-nav a:hover {
    color: var(--red);
}

/* Footer */
footer {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 3px solid var(--red);
    font-size: 0.75rem;
    color: var(--gray);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.copyleft {
    display: inline-block;
    transform: rotate(180deg);
}

/* Empty State */
.empty {
    text-align: center;
    padding: 4rem 0;
    color: var(--gray);
}

.empty p {
    font-size: 1.25rem;
}

/* 404 Error Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1rem;
    color: var(--red);
    text-shadow: 4px 4px 0 var(--dark-gray);
}

.error-page .error-message {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-page .error-suggestion {
    color: var(--gray);
    margin-bottom: 2rem;
}

.error-page .back-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    border-bottom: 2px solid var(--red);
    padding-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.error-page .back-link:hover {
    color: var(--red);
}

/* Selection */
::selection {
    background: var(--red);
    color: var(--white);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--dark-gray);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--red);
}
