/* Default Content Creator Theme - WordPuppi */

:root {
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
    --color-text: #1a1a1a;
    --color-text-muted: #666;
    --color-bg: #fff;
    --color-link: #0066cc;
    --color-link-hover: #004499;
    --color-border: #e5e5e5;
    --color-code-bg: #f5f5f5;
    --max-width: 56rem;
    --content-width: 42rem;
    --spacing: 1.5rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-text: #e5e5e5;
        --color-text-muted: #999;
        --color-bg: #1a1a1a;
        --color-link: #6699ff;
        --color-link-hover: #99bbff;
        --color-border: #333;
        --color-code-bg: #252525;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0 auto;
    padding: var(--spacing);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin: 1rem 0; }

a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--color-link-hover);
}

/* Header */
header {
    margin-bottom: calc(var(--spacing) * 2);
    padding-bottom: var(--spacing);
    border-bottom: 1px solid var(--color-border);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

/* Hamburger menu button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 100;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
    transition: background 0.2s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    left: 0;
    transition: transform 0.2s;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

/* Hamburger animation when open */
.menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav a {
    text-decoration: none;
}

header nav a:hover {
    text-decoration: underline;
}

/* Main content */
main {
    min-height: 60vh;
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-description {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Post list */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list li {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

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

.post-list article h2,
.post-list article h3 {
    margin: 0.25rem 0 0.5rem;
}

.post-list time {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Article */
article.post header,
article.page header {
    margin-bottom: 2rem;
    padding-bottom: 0;
    border-bottom: none;
}

article.post header h1,
article.page header h1 {
    margin: 0 0 0.5rem;
}

/* Posts stay narrow for readability, pages use full width */
article.post .content {
    max-width: var(--content-width);
}

.meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.featured-image {
    margin: 2rem 0;
}

.featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Content */
.content img {
    max-width: 100%;
    height: auto;
}

.content blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--color-border);
    color: var(--color-text-muted);
}

.content pre,
.content code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.content code {
    background: var(--color-code-bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.content pre {
    background: var(--color-code-bg);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
}

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

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

.pagination .page-info {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Footer */
footer {
    margin-top: calc(var(--spacing) * 2);
    padding-top: var(--spacing);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

article footer {
    border-top: none;
    margin-top: 2rem;
}

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

.error-page h1 {
    font-size: 4rem;
    margin: 0;
    color: var(--color-text-muted);
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.tag {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: var(--color-code-bg);
    border-radius: 3px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--color-text);
}

.tag:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.tag .count {
    color: var(--color-text-muted);
    font-size: 0.8em;
}

/* Tag list page */
.tag-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag-list li {
    margin: 0;
}

/* Reading time */
.reading-time {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Post card */
.post-card .excerpt {
    margin: 0.5rem 0;
    color: var(--color-text-muted);
}

/* Pagination disabled state */
.pagination .disabled {
    color: var(--color-text-muted);
    opacity: 0.5;
}

/* Subscribe Form */
.subscribe-form {
    margin: 2rem 0 1rem;
    padding: 1.5rem;
    background: var(--color-code-bg);
    border-radius: 8px;
}

.subscribe-form h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.subscribe-form form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.subscribe-form input {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.95rem;
}

.subscribe-form input:focus {
    outline: 2px solid var(--color-link);
    outline-offset: 1px;
}

.subscribe-form button {
    padding: 0.5rem 1.25rem;
    background: var(--color-link);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.subscribe-form button:hover {
    background: var(--color-link-hover);
}

.subscribe-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#subscribe-message {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 2rem 0;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
}

.auth-form input:focus {
    outline: 2px solid var(--color-link);
    outline-offset: 1px;
}

.auth-form button {
    padding: 0.75rem 1.5rem;
    background: var(--color-link);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.auth-form button:hover {
    background: var(--color-link-hover);
}

.auth-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.auth-message.success {
    background: rgba(0, 128, 0, 0.1);
    border: 1px solid rgba(0, 128, 0, 0.3);
    color: green;
}

.auth-message.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: red;
}

@media (prefers-color-scheme: dark) {
    .auth-message.success {
        color: #90EE90;
    }
    .auth-message.error {
        color: #FF6B6B;
    }
}

.auth-note {
    margin-top: 2rem;
    color: var(--color-text-muted);
}

.auth-error {
    color: red;
    padding: 1rem;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 4px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-link);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.member-page .welcome-message {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.member-page .member-email {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.member-actions,
.member-settings {
    margin: 2rem 0;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-link);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover {
    background: var(--color-link-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--color-text-muted);
}

.btn-danger {
    background: #dc3545;
    margin-left: 0.5rem;
}

.btn-danger:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    /* Show hamburger button */
    .menu-toggle {
        display: block;
    }

    /* Hide menu by default on mobile */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    /* Show menu when open */
    .nav-menu.open {
        display: flex;
    }

    header nav {
        position: relative;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
}
