:root {
    --bg: #000;
    --text: #e8e8e8;
    --text-muted: #a0a0a0;
    --border: #2a2a2a;
    --hover: #1a1a1a;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}


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


body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 18px;
}


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


a:hover {
    border-color: var(--text);
}


img {
    max-width: 100%;
    height: auto;
    display: block;
}


hr {
    display: none !important;
}


.title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin: 1.5rem 0 0.5rem;
    letter-spacing: -0.5px;
}


nav {
    text-align: center;
    padding: 0.25rem 0 0 0;
    margin: 0;
    width: 100%;
    border: none !important;
    box-shadow: none !important;
}


nav a {
    margin: 0 1.5rem;
    font-size: 1rem;
    border: none;
    color: var(--text-muted);
}


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


.search-icon {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    transition: color 0.2s;
}


.search-icon:hover {
    color: var(--text);
}


.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.5rem 2rem 4rem;
    width: 100%;
}


.posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 0 auto;
    max-width: 980px;
}


.card {
    display: grid;
    grid-template-rows: 180px 72px auto;
    gap: 0.5rem;
    min-height: 450px;
    transition: opacity 0.2s;
}


.card:hover {
    opacity: 0.8;
}


.card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #000;
}


.post img {
    width: 100%;
    margin: 2.5rem 0;
    border: 1px solid var(--border);
}


.card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


.card h2 a {
    color: var(--text);
    border: none;
}


.card h2 a:hover {
    color: var(--text-muted);
}


.card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    align-self: start;
}


.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


.card .text-post {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    align-self: start;
}


.card>a {
    font-size: 0.85rem;
    color: var(--text);
    border: none;
    text-decoration: none;
    align-self: flex-start;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s, transform 0.2s;
}


.card>a::after {
    content: '→';
    transition: transform 0.2s;
}


.card>a:hover {
    color: #4a9eff;
}


.card>a:hover::after {
    transform: translateX(4px);
}


.card a.read-more {
    font-size: 0.85rem;
    color: var(--text);
    border: none;
    text-decoration: none;
    font-weight: 600;
}


.card a.read-more::after {
    content: '→';
    margin-left: 0.4rem;
    transition: transform 0.2s;
}


.card a.read-more:hover {
    color: #4a9eff;
}


.card a.read-more:hover::after {
    transform: translateX(4px);
}


.pagination {
    text-align: center;
    margin: 3rem auto 2rem;
    padding-top: 2rem;
}


.pagination a {
    margin: 0 1rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    color: var(--text);
}


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


.post {
    max-width: 720px;
    margin: 3rem auto;
    padding: 0 2rem;
}


.post h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}


.post h2+p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}


.post img {
    width: 100%;
    margin: 2.5rem 0;
    border: 1px solid var(--border);
}


.post p {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}


.post .content p:has(br):only-child {
    display: none;
}


.about {
    max-width: 720px;
    margin: 3rem auto;
    padding: 0 2rem;
}


.about h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}


.about p {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}


.about hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 30px 0;
}


.admin-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid var(--border);
}


.admin-container h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}


.post-list {
    margin-bottom: 2rem;
}


.post-item {
    padding: 1rem 1.5rem;
    background: var(--hover);
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}


.post-item:hover {
    background: var(--bg);
}


.post-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.post-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}


.post-actions a {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}


.post-actions a:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}


.create-post-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--text);
    color: var(--bg);
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
}


.create-post-button:hover {
    background: var(--text-muted);
}


.admin-form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid var(--border);
}


.admin-form-container h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}


.input-group {
    margin-bottom: 1.5rem;
}


.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}


.input-group input[type="text"] {
    width: 100%;
    padding: 0.875rem;
    background: var(--hover);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
}


.input-group input:focus {
    outline: 2px solid var(--text-muted);
    outline-offset: 0;
}


/* Editor Quill */
.ql-toolbar {
    background: var(--hover) !important;
    border: 1px solid var(--border) !important;
}


.ql-toolbar .ql-stroke {
    stroke: var(--text) !important;
}


.ql-toolbar .ql-fill {
    fill: var(--text) !important;
}


.ql-toolbar .ql-picker-label {
    color: var(--text) !important;
}


.ql-toolbar .ql-picker-item {
    color: var(--text) !important;
}


.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button:hover .ql-picker-label {
    stroke: var(--text-muted) !important;
    color: var(--text-muted) !important;
}


.ql-toolbar button:hover .ql-fill {
    fill: var(--text-muted) !important;
}


.ql-toolbar button.ql-active .ql-stroke,
.ql-toolbar .ql-picker-label.ql-active {
    stroke: var(--text) !important;
    color: var(--text) !important;
}


.ql-toolbar button.ql-active .ql-fill {
    fill: var(--text) !important;
}


.ql-picker-options {
    background-color: var(--hover) !important;
    border-color: var(--border) !important;
}


.ql-picker-options .ql-picker-item:hover {
    color: var(--text) !important;
}


.ql-container {
    background: var(--hover);
    border: 1px solid var(--border) !important;
    border-top: none !important;
    min-height: 350px;
}


.ql-editor {
    color: var(--text);
    font-family: var(--font) !important;
    font-size: 1.05rem !important;
    line-height: 1.7;
}


.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
}


.form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}


.btn {
    padding: 0.875rem 1.75rem;
    border: 1px solid var(--border);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    font-size: 1rem;
}


.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}


.btn-primary:hover {
    background: var(--text-muted);
    border-color: var(--text-muted);
}


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


.btn-secondary:hover {
    background: var(--hover);
}


body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}


.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border: 1px solid var(--border);
}


.login-container .title {
    font-size: 2.5rem;
    margin: 0 0 2rem 0;
}


.login-form .input-group {
    margin-bottom: 1.5rem;
}


.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}


.login-form input {
    width: 100%;
    padding: 0.875rem;
    background: var(--hover);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
}


.login-form input:focus {
    outline: 2px solid var(--text-muted);
    outline-offset: 0;
}


.login-button {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    background: var(--text);
    color: var(--bg);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    font-size: 1rem;
}


.login-button:hover {
    background: var(--text-muted);
}


.flash-messages {
    list-style: none;
    padding: 1rem;
    margin: 1.5rem 0 0;
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff6464;
}


footer {
    text-align: center;
    padding: 2rem;
    margin: 3rem auto 0;
    max-width: 1000px;
    color: var(--text-muted);
    font-size: 0.9rem;
}


footer a {
    color: var(--text-muted);
    border: none;
}


footer a:hover {
    color: var(--text);
}


.social-links {
    margin-top: 1rem;
}


.social-icon {
    margin: 0 0.5rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    border: none;
}


.social-icon:hover {
    color: var(--text);
}


.back-link {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
}


.back-link:hover {
    background: var(--hover);
    color: var(--text);
}


.delete-button {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    font-family: var(--font);
    font-size: inherit;
}


.delete-button:hover {
    color: var(--text);
}


@media (max-width: 768px) {
    body {
        font-size: 16px;
    }


    .title {
        font-size: 2rem;
        margin: 1.5rem 0 0.5rem;
    }


    nav {
        padding: 0.25rem 0;
    }


    nav a {
        display: inline;
        margin: 0 0.75rem;
    }


    .container {
        padding: 0.5rem 1.5rem 3rem;
    }


    .posts {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }


    .card img {
        height: 140px;
    }


    .post,
    .about {
        padding: 0 1.5rem;
    }


    .post h2 {
        font-size: 1.8rem;
    }
}


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


    nav a {
        display: block;
        margin: 0.5rem 0;
    }
}


.search-link {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    transition: color 0.2s;
}


.search-link:hover {
    color: var(--text);
}


.search-link i {
    font-size: 0.9rem;
}


.search-form {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 1rem auto 0;
    max-width: 600px;
    padding: 0 2rem;
}


.search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}


.search-input::placeholder {
    color: var(--text-muted);
}


.search-input:focus {
    border-bottom-color: var(--text-muted);
}


.search-button {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}


.search-button:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}


.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}


.error-content {
    max-width: 600px;
    text-align: center;
}


.error-title {
    font-size: 8rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.05em;
}


.error-message {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}


.error-link {
    font-size: 1.1rem;
}


.error-link a {
    color: var(--text);
    border-bottom: 1px solid var(--text);
}


.error-link a:hover {
    color: var(--text-muted);
    border-bottom-color: var(--text-muted);
}