@import url('https://cdn.jsdelivr.net/npm/@r3dz0n3/fontawesome-pro/css/all.min.css');

/* Base Reset & Typography */
body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    font-size: 14px;
    color: #202122;
    background-color: #ffffff;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: #0645ad;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #0b0080;
}

h1, h2, h3 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-weight: normal;
    color: #000;
    margin-bottom: 0.25em;
}

h1, h2 {
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 0.2em;
    overflow: hidden;
}

/* Top Header Navigation */
.top-header {
    display: grid;
    grid-template-columns: 1fr minmax(0, 625px) 1fr;
    align-items: center;
    padding: 10px 24px;
    border-bottom: 1px solid #a2a9b1;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Linux Libertine', 'Georgia', serif;
    font-size: 1.5em;
    font-weight: normal;
    color: #000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo div {
    display: flex;
    flex-direction: column;
}

.logo span {
    font-size: 0.5em;
    color: #54595d;
    font-family: sans-serif;
    font-style: italic;
    display: block;
    margin-top: -5px;
}

.search-box {
    display: flex;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: 7px 10px;
    width: 100%;
    max-width: 625px;
    justify-self: center;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.user-tools {
    font-size: 0.85em;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-self: end;
}

/* Main Layout */
.page-container {
    display: flex;
    max-width: 100%;
    margin: 0;
    padding: 15px 30px 30px 30px;
    box-sizing: border-box;
    flex: 1;
    width: 100%;
}

/* Sidebars */
.sidebar {
    width: 176px;
    padding: 10px 20px 10px 0;
    flex-shrink: 0;
}

.sidebar h3 {
    font-family: sans-serif;
    font-size: 0.85em;
    color: #54595d;
    border: none;
    text-transform: none;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: normal;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85em;
}

.sidebar li {
    margin-bottom: 0.4em;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 0 20px;
    min-width: 0;
    border-left: 1px solid #a2a9b1;
    padding-left: 20px;
}

/* Page Tabs (Main Page, Talk, Read, Edit) */
.page-tabs {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #a2a9b1;
    margin-bottom: 1.5em;
    font-size: 0.85em;
}

.tabs-left, .tabs-right {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-tabs li {
    margin: 0 10px;
    padding-bottom: 5px;
}

.page-tabs li.selected {
    border-bottom: 2px solid #000;
}

.page-tabs li.selected a {
    color: #202122;
    text-decoration: none;
    font-weight: bold;
}

/* Welcome Banner */
.welcome-banner {
    text-align: center;
    margin-bottom: 20px;
}

.welcome-banner h1 {
    font-size: 1.8em;
    border-bottom: none;
    margin: 0;
}

.welcome-banner p {
    margin: 5px 0 0 0;
    font-size: 0.9em;
}

/* Grid for Content Boxes */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Main Page Boxes */
.box {
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    margin-bottom: 15px;
}

.box-header {
    padding: 5px 10px;
    font-weight: bold;
    font-size: 1.1em;
    border-bottom: 1px solid #a2a9b1;
}

.box-green .box-header {
    background-color: #cef2e0;
}

.box-blue .box-header {
    background-color: #cedff2;
}

.box-yellow .box-header {
    background-color: #fef6e7;
    border-bottom: 1px solid #f0e0c9;
}

.box-content {
    padding: 15px;
    font-size: 0.95em;
    background-color: #ffffff;
}

.box-content ul {
    padding-left: 20px;
    margin-top: 0;
}

.box-content li {
    margin-bottom: 0.5em;
}

/* Images placeholder inside boxes */
.placeholder-img {
    float: left;
    width: 120px;
    height: 120px;
    background-color: #eaecf0;
    border: 1px solid #c8ccd1;
    margin-right: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: #72777d;
    text-align: center;
    padding: 5px;
}

.placeholder-img.right {
    float: right;
    margin-right: 0;
    margin-left: 15px;
}

.rule-text {
    color: #d33;
    font-weight: bold;
}

/* Memorial Tag */
.memorial-tag {
    background-color: #202122;
    color: #ffffff;
    text-align: center;
    padding: 8px 20px;
    font-size: 0.9em;
    font-family: 'Linux Libertine', 'Georgia', serif;
}

.memorial-tag a {
    color: #36c;
    color: #a7d1ff;
    text-decoration: underline;
    margin-left: 10px;
}

.memorial-tag a:hover {
    color: #ffffff;
}

/* Site Footer */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 0.85em;
    color: #54595d;
    border-top: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    clear: both;
}

.site-footer .footer-links {
    margin-bottom: 10px;
}

.site-footer .footer-links a {
    margin: 0 15px;
    font-weight: normal;
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 1.2em;
}

/* Node Creator Styles */
.editor-container {
    max-width: 1200px;
    margin: 20px 0;
}

.field-group {
    margin-bottom: 25px;
}

.field-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #202122;
}

.field-group input[type="text"], 
.field-group textarea,
.field-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    font-family: inherit;
    font-size: 1em;
}

.field-group textarea {
    height: 300px;
    line-height: 1.5;
}

.form-help {
    font-size: 0.85em;
    color: #54595d;
    margin-top: 5px;
}

.legal-text h2 {
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 5px;
    margin-top: 1.5em;
}

.legal-text p {
    margin-bottom: 1.2em;
    text-align: justify;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

input[type="text"],
input[type="search"],
select,
textarea {
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: 8px;
    background-color: #ffffff;
    color: #202122;
    transition: border-color 0.1s, box-shadow 0.1s;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: #36c;
    outline: none;
    box-shadow: inset 0 0 0 1px #36c;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.search-box input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

button {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    background-color: #f8f9fa;
    color: #202122;
    cursor: pointer;
    transition: background-color 0.1s, border-color 0.1s;
}

button:hover {
    background-color: #ffffff;
    border-color: #858b94;
}

button:active {
    background-color: #eaecf0;
}

button.primary {
    background-color: #36c;
    color: #ffffff;
    border-color: #36c;
    font-weight: bold;
}

button.primary:hover {
    background-color: #447ff5;
    border-color: #447ff5;
}

button.primary:active {
    background-color: #2a4b8d;
}

/* Picture Views (Thumbnails) */
.thumb {
    margin-bottom: 0.5em;
}

.thumbinner {
    border: 1px solid #c8ccd1;
    padding: 3px;
    background-color: #f8f9fa;
    font-size: 94%;
    overflow: hidden;
}

.tright {
    float: right;
    clear: right;
    margin-left: 1.4em;
}

.tleft {
    float: left;
    clear: left;
    margin-right: 1.4em;
}

.thumbimage {
    border: 1px solid #c8ccd1;
    max-width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.thumbcaption {
    padding: 3px;
    font-size: 0.9em;
    line-height: 1.4em;
    text-align: left;
    color: #54595d;
}

/* Fullscreen Modal (Lightbox) */
.modal {
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.9); 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
}

.modal-caption {
    margin-top: 15px;
    color: #ccc;
    text-align: center;
    max-width: 80%;
    font-size: 1.1em;
    font-family: inherit;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

/* Wiki Editor Styles */
.wiki-editor {
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    background: #fff;
    margin-top: 5px;
}
.wiki-editor-toolbar {
    display: flex;
    align-items: center;
    background: #eaecf0;
    border-bottom: 1px solid #a2a9b1;
    padding: 5px;
    gap: 5px;
}
.wiki-btn {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 2px;
    color: #202122;
}
.wiki-btn:hover {
    background: #c8ccd1;
}
.wiki-editor-tabs {
    display: flex;
    gap: 8px;
}
.wiki-tab {
    background: #eaecf0;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    color: #202122;
}
.wiki-tab.active {
    background: #fff;
    box-shadow: inset 0 3px 0 #36c;
}
.wiki-area {
    width: 100%;
    min-height: 300px;
    border: none;
    padding: 15px;
    box-sizing: border-box;
    font-family: sans-serif;
    resize: vertical;
    outline: none;
}
.wiki-area.source-mode {
    font-family: monospace;
    background: #f8f9fa;
}

/* Custom Tooltips for Editor Buttons */
.wiki-btn {
    position: relative;
}
.wiki-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #202122;
    color: #fff;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-family: sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.wiki-btn::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #202122 transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
}
.wiki-btn:hover::after,
.wiki-btn:hover::before {
    opacity: 1;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.lightbox-modal .lightbox-img {
    max-width: 80vw;
    max-height: 80vh;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border-radius: 0;
    background-color: #ffffff;
    padding: 8px;
}
.lightbox-modal .lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.2s;
}
.lightbox-modal .lightbox-close:hover {
    color: #ccc;
}
img.thumbimage:not(.wiki-image-placeholder) {
    cursor: zoom-in;
}

.wiki-infobox-field-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    background-color: transparent;
    border: none;
    padding: 0;
}

.wiki-infobox-field-img.is-signature {
    max-width: 80%;
    margin: 4px auto;
}

/* Lightbox Caption */
.lightbox-modal .lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    font-size: 16px;
    background: transparent;
    padding: 0;
    max-width: 80%;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    pointer-events: none;
}

/* Additional Thumbnail Alignments */
.thumb.tleft {
    float: left;
    margin: 0.5em 1.4em 1.3em 0;
}
.thumb.tcenter {
    margin: 0.5em auto 1.3em auto;
    display: table;
}
.thumb.tnone {
    float: none;
    margin: 0.5em 0 1.3em 0;
}
.wiki-infobox .thumb {
    margin: 0.5em auto 1.3em auto !important;
    display: table !important;
    float: none !important;
}

/* Custom Image Format Modal */
.wiki-format-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}
.wiki-format-content {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #a2a9b1;
    width: 250px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-family: sans-serif;
}
.wiki-format-content h4 { margin-top: 0; margin-bottom: 15px; }
.wiki-format-content label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: bold;}
.wiki-format-content input, .wiki-format-content select { width: 100%; box-sizing: border-box; padding: 5px; margin-top: 5px; border: 1px solid #a2a9b1; border-radius: 2px;}
.wiki-format-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px;}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #36c;
    color: #fff;
    padding: 12px 24px;
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-family: sans-serif;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000;
}
.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Article Preview Modal */
.preview-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 20px;
}
.preview-content {
    background: #fff;
    width: 100%;
    max-width: 900px;
    padding: 30px 40px;
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    min-height: 400px;
}

/* Infobox Styles */
.wiki-infobox {
    width: 22em;
    float: right;
    clear: right;
    margin: 0.5em 0 0.5em 1em;
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    padding: 0.2em;
    font-size: 88%;
    line-height: 1.5em;
    border-collapse: collapse;
}

.wiki-infobox th {
    text-align: left;
    vertical-align: top;
    padding: 0.2em 0.4em;
}

.wiki-infobox td {
    vertical-align: top;
    padding: 0.2em 0.4em;
}

.wiki-infobox-header {
    text-align: center !important;
    font-size: 125%;
    font-weight: bold;
    background-color: #eaecf0;
    padding: 0.4em !important;
}

.wiki-infobox-map-container {
    text-align: center;
    padding-top: 0.5em !important;
}

.wiki-leaflet-map {
    width: 100%;
    height: 200px;
    background: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #54595d;
    font-weight: bold;
    border: 1px solid #c8ccd1;
    border-radius: 2px;
    overflow: hidden;
}

.ethnic-branch {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px;
    font-size: 11px;
    color: #202122;
    border: 1px solid #a2a9b1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
    cursor: default;
    transition: background 0.2s, border-color 0.2s;
}

.ethnic-branch:hover {
    background: #ffffff;
    border-color: #36c;
}

.ethnic-branch a:hover {
    text-decoration: underline !important;
}

.ethnic-branch img {
    border: 1px solid #eee;
    border-radius: 1px;
    box-shadow: 0 0 1px rgba(0,0,0,0.1);
}

.wiki-infobox-ethnicity {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: flex-start !important;
    gap: 4px;
    padding: 6px !important;
    min-height: 24px;
    background: transparent;
}

.ethnic-search-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
}

.ethnic-search-content {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.ethnic-search-results {
    flex-grow: 1;
    overflow-y: auto;
    margin: 15px 0;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
}

.ethnic-search-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eaecf0;
    cursor: pointer;
}

.ethnic-search-item:hover {
    background: #f8f9fa;
}

.ethnic-search-item input {
    margin-right: 10px;
}

#previewView .wiki-infobox .infobox-data-row:has(td.empty-cell) {
    display: none;
}

#previewView .wiki-infobox tr:has(.wiki-image-placeholder) {
    display: none;
}

#previewView .wiki-infobox tr:has(.wiki-leaflet-map[data-born=""][data-resides=""]) {
    display: none;
}

a[href^="#cite_note"], .wiki-citation { font-size: 0.75em; vertical-align: super; color: #2563eb; text-decoration: none; }
