/* Wikipedia-style CSS for globaluprising.wiki */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Lato, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #222;
    background-color: #fff;
}

/* Header and Navigation */
.header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #a2a9b1;
    padding: 0;
}

.header-top {
    background-color: #eaecf0;
    padding: 5px 0;
    font-size: 12px;
}

.header-top .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: right;
}

.header-top a {
    color: #0645ad;
    text-decoration: none;
    margin-left: 15px;
}

.header-top a:hover {
    text-decoration: underline;
}

.main-nav {
    padding: 10px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    color: #0645ad;
    text-decoration: none;
    padding: 5px 10px;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Main Content Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.content-wrapper {
    display: flex;
    gap: 20px;
}

.main-content {
    flex: 1;
    background-color: #fff;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

/* Page Title */
.page-title {
    font-size: 32px;
    font-weight: normal;
    color: #000;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 3px solid #a2a9b1;
    font-family: 'Linux Libertine', Georgia, Times, serif;
}

/* Page Actions */
.page-actions {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #a2a9b1;
}

.page-actions a {
    color: #0645ad;
    text-decoration: none;
    margin-right: 15px;
    font-size: 13px;
}

.page-actions a:hover {
    text-decoration: underline;
}

/* Article Content */
.article-content {
    line-height: 1.6;
    font-size: 14px;
}

.article-content h2 {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0 10px 0;
    padding-bottom: 2px;
    border-bottom: 1px solid #a2a9b1;
    font-family: 'Linux Libertine', Georgia, Times, serif;
}

.article-content h3 {
    font-size: 16px;
    font-weight: bold;
    margin: 15px 0 8px 0;
    font-family: 'Linux Libertine', Georgia, Times, serif;
}

.article-content p {
    margin-bottom: 12px;
}

.article-content ul {
    margin: 10px 0 10px 30px;
}

.article-content li {
    margin-bottom: 5px;
}

/* Infobox */
.infobox {
    width: 300px;
    float: right;
    margin: 0 0 20px 20px;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    font-size: 13px;
    line-height: 1.5;
}

.infobox-title {
    background-color: #eaecf0;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #a2a9b1;
}

.infobox-content {
    padding: 10px;
}

.infobox-row {
    display: flex;
    margin-bottom: 8px;
}

.infobox-label {
    font-weight: bold;
    width: 100px;
    flex-shrink: 0;
}

.infobox-value {
    flex: 1;
}

.infobox-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 200px;
    margin-bottom: 10px;
    border: 1px solid #a2a9b1;
    object-fit: cover;
    display: block;
}

.infobox-image-container {
    text-align: center;
    margin-bottom: 10px;
    padding: 5px;
    max-width: 100%;
    overflow: hidden;
}

/* Wiki Images */
.wiki-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border: 1px solid #a2a9b1;
    padding: 3px;
    background-color: #f8f9fa;
    display: block;
}

.wiki-image.thumb {
    max-width: 300px;
    max-height: 250px;
    float: right;
    margin: 0 0 15px 15px;
    object-fit: cover;
}

.wiki-image.left {
    float: left;
    margin: 0 15px 15px 0;
    max-width: 300px;
    max-height: 250px;
    object-fit: cover;
}

.wiki-image.center {
    display: block;
    margin: 15px auto;
    max-width: 600px;
    max-height: 400px;
    object-fit: contain;
}

/* Image upload styles */
.image-upload-container {
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 20px;
    margin: 20px 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.image-item {
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 10px;
    text-align: center;
}

.image-item img {
    width: 100%;
    height: 150px;
    max-width: 100%;
    object-fit: cover;
    border: 1px solid #a2a9b1;
    display: block;
}

.image-item-info {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #a2a9b1;
    font-family: inherit;
    font-size: 14px;
}

.form-group textarea {
    height: 200px;
    resize: vertical;
}

.btn {
    background-color: #0645ad;
    color: white;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.btn:hover {
    background-color: #0b0080;
}

.btn-secondary {
    background-color: #eaecf0;
    color: #222;
    border: 1px solid #a2a9b1;
}

.btn-secondary:hover {
    background-color: #ddd;
}

/* Messages */
.message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 3px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Page List */
.page-list {
    list-style: none;
    margin: 20px 0;
}

.page-list li {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #eaecf0;
}

.page-list a {
    color: #0645ad;
    text-decoration: none;
    font-weight: bold;
}

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

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.history-table th,
.history-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #a2a9b1;
}

.history-table th {
    background-color: #eaecf0;
    font-weight: bold;
}

.history-table tr:hover {
    background-color: #f8f9fa;
}

/* Search Box */
.search-box {
    margin: 20px 0;
}

.search-box input {
    width: 300px;
    padding: 8px;
    border: 1px solid #a2a9b1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: -1;
    }
    
    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
    }
    
    .infobox-image {
        max-height: 150px;
    }
    
    .wiki-image.thumb,
    .wiki-image.left {
        float: none;
        max-width: 100%;
        margin: 10px 0;
    }
    
    .wiki-image.center {
        max-width: 100%;
        max-height: 300px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Additional image constraints */
img {
    max-width: 100%;
    height: auto;
}

/* Ensure all images respect container boundaries */
.article-content img,
.infobox img,
.image-item img,
.wiki-image {
    box-sizing: border-box;
}

/* Footer */
.footer {
    background-color: #f8f9fa;
    border-top: 1px solid #a2a9b1;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

