/* Basics. */

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

body {
    font-family: Verdana, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.6;
}

header {
    background: #542;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

footer {
    background: #f5f5f5;
    padding: 1.5rem 0;
    text-align: center;
    color: #666;
    border-top: 1px solid #ddd;
}

/* Named classes. */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.error-box {
    background: #fee;
    border: 1px solid #d44;
    color: #d44;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-width: 400px;
    padding: 2.5rem;
    width: 100%;
}

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

.login-button:hover {
    background: #431;
}

.tag {
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.9rem;
}


/* Elements in nav. */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

nav h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

nav a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

nav a:hover {
    color: #BA7;
}

main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Buttons. */

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #BA7;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn:hover {
    background: #a96;
}

.btn-primary {
    background: #542;
    color: #fff;
}

.btn-primary:hover {
    background: #431;
}

.btn-danger {
    background: #d44;
    color: #fff;
}

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

.btn-secondary {
    background: #58E;
    color: #fff;
}

.btn-secondary:hover {
    background: #47D;
}

/* Layout helpers */

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card h2 {
    color: #542;
    margin-bottom: 1rem;
    border-bottom: 2px solid #BA7;
    padding-bottom: 0.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Hacks for mobile */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul {
        margin-top: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Common utility classes */
.back-link {
    color: #542;
    text-decoration: none;
    margin-bottom: 2rem;
    display: inline-block;
}

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

.page-title {
    color: #542;
    margin-bottom: 1.5rem;
}

.section-title {
    color: #542;
    margin-bottom: 1rem;
}

.subsection-title {
    color: #542;
    margin-bottom: 0.5rem;
}

.text-muted {
    color: #666;
}

.text-small {
    font-size: 0.9rem;
}

.text-tiny {
    font-size: 0.85rem;
}

.help-text {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Form elements */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-textarea {
    min-height: 100px;
    font-family: inherit;
}

/* Tags and badges */
.tag {
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    display: inline-block;
}

.tag-category {
    background: #BA7;
}

.tag-type {
    background: #58E;
    color: #fff;
}

.tag-status {
    background: #5C9;
}

/* Content boxes */
.content-box {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.content-box-highlight {
    background: #f9f9f9;
    padding: 1rem;
    border-left: 3px solid #BA7;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* Dividers */
.divider {
    margin: 2rem 0;
    border: none;
    border-top: 2px solid #BA7;
}

.divider-thin {
    border-top: 2px solid #BA7;
    padding-top: 1rem;
}

/* Flex */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: 1rem;
}

.flex-gap {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Image grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.image-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-card-caption {
    padding: 0.75rem;
    background: #f9f9f9;
}

/* Thumbnails */
.thumb-preview {
    display: block;
    max-width: 200px;
    max-height: 120px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 0.75rem;
    object-fit: cover;
}

/* Links */
.link-primary {
    color: #58E;
}

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

/* Character counter */
.char-count {
    color: #666;
    font-weight: normal;
    font-size: 0.9rem;
}

/* Alert/Info boxes */
.alert-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fffbf0;
    border-left: 3px solid #BA7;
    border-radius: 4px;
    color: #666;
    font-size: 0.9rem;
}

/* List items */
.post-list {
    list-style: none;
}

.post-list-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.post-list-link {
    text-decoration: none;
    color: #542;
    font-weight: 500;
}

.post-list-link:hover {
    text-decoration: underline;
}

.post-list-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}
