/* ============================================
   Neutral Tech Blog - Responsive CSS
   ============================================ */

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

:root {
    --bg-color: #fafafa;
    --text-color: #1a1a1a;
    --accent-color: #0066cc;
    --border-color: #e0e0e0;
    --code-bg: #f4f4f4;
    --header-bg: #ffffff;
    --max-width: 1200px;
    --reading-width: 80ch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--bg-color);
    font-size: clamp(16px, 2vw, 18px);
}

/* Header & Navigation */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Main Content Area */
main {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1rem;
}

article {
    max-width: var(--reading-width);
    margin: 0 auto 3rem;
    background: white;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

article h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 1rem;
    line-height: 1.3;
}

article h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    margin: 2rem 0 1rem;
}

article p {
    margin-bottom: 1.2rem;
}

article a {
    color: var(--accent-color);
    text-decoration: underline;
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1.5rem 0;
}

/* Code blocks */
pre, code {
    background: var(--code-bg);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border-radius: 4px;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

code {
    padding: 0.2rem 0.4rem;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

footer a {
    color: inherit;
    text-decoration: underline;
}

/* Forms & Buttons */
button, input[type="submit"] {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover, input[type="submit"]:hover {
    background: #0052a3;
}

input[type="text"], 
input[type="file"],
textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
}

textarea {
    min-height: 400px;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
}

/* Admin Panel Styles */
.panel {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.panel h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.file-list {
    list-style: none;
    padding: 0;
}

.file-list li {
    padding: 0.7rem;
    border-bottom: 1px solid var(--border-color);
}

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

.file-list a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.file-list a:hover {
    text-decoration: underline;
}

.success-msg {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

.error-msg {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    nav ul {
        gap: 1rem;
    }
    
    article {
        padding: 1.5rem;
    }
}

/* NicEdit overrides */
.nicEdit-main {
    background: white !important;
    min-height: 400px;
    padding: 10px;
    border: 1px solid var(--border-color) !important;
}
