/* Isukato Wiki — Wikipedia-Style Layout */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Helvetica Neue', Helvetica, 'Liberation Sans', Arial, sans-serif;
  color: #202122;
  background: #f6f6f6;
  line-height: 1.6;
}

/* ─── Layout ─── */
#page { min-height: 100vh; display: flex; flex-direction: column; }

#page-header {
  background: #f8f9fa;
  border-bottom: 1px solid #a7d7f9;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.logo-mark {
  font-size: 38px;
  line-height: 1;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title {
  font-family: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: #000;
}
.logo-tagline {
  font-size: 11px;
  color: #54595d;
  margin-top: 2px;
}

.header-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  margin-left: auto;
}
.header-search input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #a2a9b1;
  border-right: none;
  border-radius: 2px 0 0 2px;
  font-size: 13px;
  background: white;
}
.header-search input:focus {
  outline: none;
  border-color: #36c;
  box-shadow: inset 0 0 0 1px #36c;
}
.header-search button {
  padding: 6px 14px;
  border: 1px solid #a2a9b1;
  background: linear-gradient(to bottom, #fff, #e6e6e6);
  cursor: pointer;
  border-radius: 0 2px 2px 0;
  font-size: 13px;
}
.header-search button:hover { background: linear-gradient(to bottom, #fff, #d0d0d0); }

.header-account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.header-account .hello { color: #54595d; }
.header-account a {
  color: #0645ad;
  text-decoration: none;
}
.header-account a:hover { text-decoration: underline; }

/* Tabs (Artikel/Bearbeiten/Versionen) — Wikipedia-typisch */
.page-tabs {
  background: #f8f9fa;
  border-bottom: 1px solid #a7d7f9;
}
.page-tabs ul {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  list-style: none;
  display: flex;
  gap: 0;
}
.page-tabs li {
  margin: 0;
  border-right: 1px solid #a7d7f9;
}
.page-tabs li:first-child { border-left: 1px solid #a7d7f9; }
.page-tabs li a {
  display: block;
  padding: 6px 14px;
  background: #f8f9fa;
  color: #0645ad;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 1px solid #a7d7f9;
}
.page-tabs li:hover a { background: #fff; }
.page-tabs li.active a {
  background: #fff;
  border-bottom: 1px solid #fff;
  color: #202122;
  font-weight: bold;
}

/* ─── Layout: Sidebar + Content ─── */
#layout {
  display: flex;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  gap: 0;
}
#sidebar {
  width: 11rem;
  background: #f6f6f6;
  padding: 16px 8px 16px 16px;
  font-size: 12px;
  flex-shrink: 0;
}
.sidebar-section {
  margin-bottom: 16px;
}
.sidebar-section h3 {
  font-size: 12px;
  font-weight: normal;
  color: #54595d;
  margin: 0 0 4px 0;
  padding-bottom: 2px;
  border-bottom: 1px solid #c8ccd1;
  text-transform: none;
}
.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-section li { padding: 1px 0; }
.sidebar-section a {
  color: #0645ad;
  text-decoration: none;
  font-size: 12px;
}
.sidebar-section a:hover { text-decoration: underline; }
.sidebar-section .muted { color: #72777d; font-size: 11px; }
.sidebar-meta { font-size: 11px; color: #54595d; }

/* ─── Content ─── */
#content {
  flex: 1;
  background: #fff;
  border-left: 1px solid #a7d7f9;
  padding: 20px 30px 40px;
  min-width: 0;
}
.article-page { max-width: 920px; }
.article-title {
  font-family: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
  font-weight: normal;
  font-size: 2rem;
  margin: 0 0 4px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #a2a9b1;
  line-height: 1.25;
}
.article-meta {
  font-size: 12px;
  color: #54595d;
  margin: 0 0 16px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #eaecf0;
}
.article-tagline {
  color: #54595d;
  font-style: italic;
  margin: 0 0 12px 0;
}
.article-lead {
  font-size: 1.05rem;
  margin: 0 0 14px 0;
  color: #202122;
}

/* Article body content */
.article-content {
  font-size: 14px;
  line-height: 1.65;
}
.article-content h1,
.article-content h2 {
  font-family: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
  font-weight: normal;
  border-bottom: 1px solid #a2a9b1;
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  padding-bottom: 3px;
  line-height: 1.3;
}
.article-content h1 { font-size: 1.8rem; }
.article-content h2 { font-size: 1.5rem; }
.article-content h3 {
  font-size: 1.2rem;
  margin: 1.2em 0 0.3em;
  font-weight: bold;
}
.article-content h4 {
  font-size: 1.05rem;
  margin: 1em 0 0.3em;
  font-weight: bold;
}
.article-content p { margin: 0.5em 0; }
.article-content a {
  color: #0645ad;
  text-decoration: none;
}
.article-content a:hover { text-decoration: underline; }
.article-content a:visited { color: #0b0080; }
.article-content a.wikilink { color: #0645ad; }
.article-content a.wikilink-new {
  color: #ba0000;
}
.article-content a.wikilink-new:visited { color: #a55858; }
.article-content ul, .article-content ol {
  margin: 0.4em 0 0.4em 1.6em;
  padding: 0;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin: 0.1em 0; }
.article-content blockquote {
  margin: 0.6em 0;
  padding: 0.4em 1em;
  border-left: 4px solid #c8ccd1;
  color: #54595d;
  background: #f8f9fa;
}
.article-content code {
  background: #f8f9fa;
  border: 1px solid #eaecf0;
  padding: 1px 4px;
  border-radius: 2px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.92em;
}
.article-content pre {
  background: #f8f9fa;
  border: 1px solid #eaecf0;
  border-radius: 2px;
  padding: 10px 14px;
  overflow-x: auto;
  margin: 0.6em 0;
  font-size: 0.92em;
}
.article-content pre code {
  background: none;
  border: none;
  padding: 0;
}
.article-content table {
  border-collapse: collapse;
  margin: 0.8em 0;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-size: 0.95em;
}
.article-content th, .article-content td {
  border: 1px solid #a2a9b1;
  padding: 6px 10px;
  text-align: left;
}
.article-content th {
  background: #eaecf0;
  font-weight: bold;
}
.article-content img {
  max-width: 100%;
  border: 1px solid #c8ccd1;
  padding: 2px;
  background: white;
  border-radius: 2px;
}
.article-content hr {
  border: none;
  border-top: 1px solid #c8ccd1;
  margin: 1.2em 0;
}

/* Categories at bottom */
.article-categories {
  margin-top: 30px;
  padding: 6px 12px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-size: 12px;
}
.article-categories a { color: #0645ad; text-decoration: none; }
.article-categories a:hover { text-decoration: underline; }

.article-attachments {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #eaecf0;
}
.article-attachments h3 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #54595d;
}
.article-attachments ul { list-style: none; padding: 0; margin: 0; }
.article-attachments li { padding: 2px 0; }

/* ─── Lists & Index ─── */
.article-list {
  list-style: disc;
  padding-left: 22px;
  margin: 0;
}
.article-list li {
  margin: 0.4em 0;
  line-height: 1.5;
}
.article-list a {
  color: #0645ad;
  text-decoration: none;
  font-size: 1rem;
}
.article-list a:hover { text-decoration: underline; }
.article-summary {
  color: #54595d;
  font-size: 0.92em;
  margin-top: 2px;
}

.article-index {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 30px;
}
.article-index li {
  padding: 2px 0;
  break-inside: avoid;
}
.article-index a { color: #0645ad; text-decoration: none; }
.article-index a:hover { text-decoration: underline; }

/* ─── Forms ─── */
.auth-form {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auth-form label.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.auth-form span {
  font-size: 12px;
  color: #54595d;
}
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="search"],
.auth-form input[type="file"] {
  padding: 6px 10px;
  border: 1px solid #a2a9b1;
  background: white;
  font-size: 14px;
  border-radius: 2px;
  font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: #36c; box-shadow: inset 0 0 0 1px #36c; }

.btn {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid #a2a9b1;
  background: linear-gradient(to bottom, #fff, #d4d4d4);
  color: #202122;
  font: inherit;
  font-size: 14px;
  font-weight: bold;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: linear-gradient(to bottom, #fff, #c0c0c0); }
.btn-link {
  background: none;
  border: none;
  color: #0645ad;
  font-weight: normal;
  padding: 6px 8px;
}
.btn-link:hover { background: none; text-decoration: underline; }

.link-btn {
  background: none;
  border: none;
  color: #0645ad;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn-danger { color: #c00; }

/* Edit page */
.edit-page .edit-form { display: flex; flex-direction: column; gap: 12px; max-width: 100%; }
.edit-page label { display: flex; flex-direction: column; gap: 3px; }
.edit-page label > span { font-size: 12px; color: #54595d; }
.edit-page input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #a2a9b1;
  font-size: 14px;
  background: white;
  font-family: inherit;
}
.edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  border: 1px solid #a2a9b1;
  border-bottom: none;
  background: #f8f9fa;
  align-items: center;
}
.edit-toolbar button {
  padding: 4px 10px;
  border: 1px solid #c8ccd1;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  border-radius: 2px;
}
.edit-toolbar button:hover { background: #eaecf0; }
.toolbar-spacer { flex: 1; }
#editor {
  width: 100%;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid #a2a9b1;
  background: white;
  resize: vertical;
  line-height: 1.5;
}
.edit-actions { display: flex; gap: 8px; }

/* History */
.history-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.history-list li {
  padding: 6px 8px;
  border-bottom: 1px solid #eaecf0;
  font-size: 13px;
}
.rev-time { color: #54595d; margin-right: 12px; }
.rev-user { font-weight: bold; }
.rev-comment { color: #54595d; margin-left: 8px; font-style: italic; }

/* Tables for admin / uploads */
.datatable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}
.datatable th,
.datatable td {
  border-bottom: 1px solid #eaecf0;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.datatable th {
  background: #f8f9fa;
  font-weight: bold;
  border-bottom: 2px solid #a2a9b1;
}
.datatable tr:hover td { background: #fafdff; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.stats-grid > div {
  border: 1px solid #c8ccd1;
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 2px;
}
.stats-grid dt { font-size: 11px; color: #54595d; text-transform: uppercase; letter-spacing: 0.05em; }
.stats-grid dd { margin: 4px 0 0 0; font-size: 1.6rem; font-weight: bold; color: #202122; }

/* Messages */
.msg {
  padding: 8px 12px;
  margin: 12px 0;
  border-radius: 2px;
  font-size: 13px;
  border: 1px solid;
}
.msg-info    { background: #eaf3ff; border-color: #a7d7f9; color: #0645ad; }
.msg-success { background: #d5fdf4; border-color: #14866d; color: #0d4f3f; }
.msg-error   { background: #fee7e6; border-color: #d33; color: #b32424; }

/* Footer */
#page-footer {
  background: #f8f9fa;
  border-top: 1px solid #c8ccd1;
  padding: 16px 20px;
  font-size: 11px;
  color: #54595d;
  margin-top: auto;
}
#page-footer p { max-width: 1400px; margin: 4px auto; }
.footer-meta { font-size: 12px; }
.footer-links a { color: #0645ad; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* Utility */
.muted { color: #72777d; }
.small { font-size: 0.85em; }
.search-form { display: flex; gap: 8px; margin: 12px 0 24px; }
.search-form input {
  flex: 1;
  max-width: 400px;
  padding: 6px 10px;
  border: 1px solid #a2a9b1;
  font-size: 14px;
  font-family: inherit;
  background: white;
}

/* ─── Sichtbarkeits-System (Privat) ─── */
.private-banner {
  background: #fff8e1;
  border: 1px solid #ffd54f;
  border-left: 4px solid #f9a825;
  padding: 10px 14px;
  margin: 0 0 14px 0;
  font-size: 13px;
  color: #6b4f00;
  border-radius: 2px;
}
.private-icon {
  color: #f9a825;
  font-size: 0.85em;
}
.private-article .article-title {
  background: linear-gradient(to right, rgba(249,168,37,0.05), transparent 30%);
}

.sidebar-private h3 {
  color: #b06d00;
  border-bottom-color: #ffd54f !important;
}
.sidebar-private a {
  color: #b06d00 !important;
}

.visibility-box {
  border: 1px solid #a2a9b1;
  border-radius: 4px;
  padding: 10px 14px;
  background: #f8f9fa;
  margin: 8px 0;
}
.visibility-box legend {
  font-size: 12px;
  color: #54595d;
  padding: 0 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.visibility-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}
.visibility-option:not(:last-child) {
  border-bottom: 1px dotted #c8ccd1;
  margin-bottom: 4px;
  padding-bottom: 8px;
}
.visibility-option input[type="radio"] { margin-top: 4px; }
.visibility-option .vis-icon { font-size: 1.1em; line-height: 1.4; }
.visibility-option .vis-text { line-height: 1.4; font-size: 13px; flex: 1; }
.visibility-option:has(input:checked) {
  background: rgba(249, 168, 37, 0.06);
  border-radius: 4px;
}

/* Responsive — Sidebar wandert nach unten auf schmalen Screens */
@media (max-width: 760px) {
  #layout { flex-direction: column; }
  #sidebar {
    width: 100%;
    border-bottom: 1px solid #a7d7f9;
    padding: 12px 16px;
  }
  #sidebar .sidebar-section {
    display: inline-block;
    margin-right: 16px;
    vertical-align: top;
  }
  #content {
    border-left: none;
    padding: 16px 18px 30px;
  }
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; flex: 1 100%; max-width: none; margin: 8px 0 0 0; }
  .article-index { columns: 1; }
}
