/* Basic reset and typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header and navigation */
header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

nav {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 a {
    color: #495057;
    text-decoration: none;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links span {
    color: #6c757d;
    font-weight: 500;
}

.nav-links a {
    color: #007bff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-links a:hover {
    background-color: #f8f9fa;
}

/* Main content */
main {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* Messages */
.messages {
    margin-bottom: 1rem;
}

.message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* Login form */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #495057;
}

.login-container p {
    text-align: center;
    margin-bottom: 2rem;
    color: #6c757d;
}

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

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.login-form button {
    width: 100%;
    padding: 0.75rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-form button:hover {
    background-color: #0056b3;
}

/* Posts list */
.posts-container h2 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.posts-container > p {
    margin-bottom: 2rem;
    color: #6c757d;
}

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

.post-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-preview {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.post-preview:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.post-preview h3 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.post-link:hover .post-preview h3 {
    color: #007bff;
}

.post-meta {
    display: flex;
    gap: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.access-info {
    font-style: italic;
}

.no-posts {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

/* Individual post */
.post-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.post-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.post-header h1 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.post-content {
    padding: 2rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child,
.post-content h4:first-child,
.post-content h5:first-child,
.post-content h6:first-child {
    margin-top: 0;
}

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

.post-content ul,
.post-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.25rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-navigation {
    padding: 1rem 2rem 2rem 2rem;
}

.back-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #fff;
    border-top: 1px solid #e9ecef;
    padding: 1rem 0;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .post-header,
    .post-content,
    .post-navigation {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}