/* ============================================================
   pages.css – Responsive Pages Layout
   ============================================================ */

/* --- Print --- */
@media print {
	h1#page_title {
		margin-top: 3em;
	}
	h1#page_title button {
		display: none;
	}
}

.print_size {
	max-width: 19cm;
	hyphens: auto;
	-moz-hyphens: auto;
}

.hide_links {
	display: none;
}

.page_hr {
	border: 1px solid rgb(128, 128, 128);
	width: 100%;
	display: inline-flex;
	margin: 0;
}

/* --- Editor --- */
.note-editor .note-toolbar {
	top: 4.2rem !important;
}

.note-editable {
	border-right: 1px dotted #888;
	background-color: #fff;
}

.note-editing-area {
	background-color: #f5f5f5;
}

/* --- Status --- */
.inactive {
	color: red !important;
}

.hidden {
	display: none;
}

/* --- Content Actions Bar --- */
#content_actions {
	position: sticky;
	top: 0;
	z-index: 5;
}

#content_pane {
	overflow: auto;
}

/* --- Sidebar Selection --- */
#sidebar a.selected {
	font-weight: bold;
}

#sidebar ul {
	padding-inline-start: 0;
}

#sidebar_content, #sidebar_index, #sidebar_search {
	overflow: auto;
}

/* --- Side Menu Tabs --- */
.sidemenu {
	background-color: #e7e7e7;
}

.sidemenu.active {
    background-color: transparent;
    border-bottom: 3px solid transparent;
}

.sidemenu:hover {
    border-bottom: 3px solid #800;
}

.sidemenu a {
	color: #222;
    text-decoration: none;
}

/* --- Sidebar Index --- */
#sidebar_index>div {
	padding: 0.5em 1.5em;
	text-align: center;
}

#sidebar_index ul {
	list-style: none;
	margin: 0.5em 1.5em;
}

#sidebar_index li {
	vertical-align: middle;
}

#sidebar_index .list_page_hide:before {
	content: '\25b8';
}

#sidebar_index .list_page_show:before {
	content: '\25be';
}

#sidebar_index li>div {
	padding: 0 1.5em;
	overflow: hidden;
	white-space: nowrap;
}

#sidebar_index a {
	color: #222;
	line-height: 1.5em;
	text-decoration: none;
}

#sidebar_index a:hover {
	text-decoration: underline;
}

/* --- Sidebar Search --- */
#sidebar_search {
	overflow: auto;
	margin: 1em 0;
}

#sidebar_search a {
	color: #222;
	line-height: 1.5em;
	text-decoration: none;
}

#sidebar_search a:hover {
	text-decoration: underline;
}

#sidebar_search>div {
	padding: 0 1em;
}

#sidebar_search img {
	vertical-align: middle;
}
	
#sidebar_searchform {
	text-align: center;
	padding: .5em .5em 1em .5em;
}

/* --- Page Navigation Tree --- */
#page_navigation {
	margin: 0 1em;
	display: none;
	list-style: none;
}

#page_navigation li ul {
    margin: 0;
    margin-left: 1.5em;
    list-style: none;
}

#page_navigation li div {
    white-space: normal;
    overflow-wrap: break-word;
}

#page_navigation li div a {
	color: #222;
	line-height: 1.5em;
	text-decoration: none;
}

#page_navigation li div a:hover {
	text-decoration: underline;
}

#page_navigation li div img {
	line-height: 1.5em;
	vertical-align: middle;
	margin: 0 10px 0 5px;
}

#page_navigation span.ui-icon {
	display: inline-block;
	margin: 0;
	padding: 0;
}

#page_navigation .mjs-nestedSortable-error {
	background: #fbe3e4;
	border-color: transparent;
}

#page_navigation .placeholder {
	outline: 1px dashed #4183C4;
}

#page_navigation .unsortable {
	user-select: none;
}

#page_navigation .mjs-nestedSortable-collapsed {
	display: none;
}

/* --- Action Icons --- */
#copy_link:hover, #page_print:hover, #page_edit:hover, #page_exit:hover, #page_publish:hover, #page_unpublish:hover, #page_save:hover, #page_delete:hover {
	cursor: pointer;
    background-color: #d7d7d7;
}

/* --- Page Content Links --- */
#page a {
    color:#FC861D !important;
    text-decoration:none !important;
}

#page a:hover {
	text-decoration:underline !important;
}

/* Fix: Bootstrap overrides jQuery UI icon sprites on buttons */
.ui-dialog-titlebar-close {
	background-image: url("/css/images/ui-icons_777777_256x240.png");
}

/* ============================================================
   Content Pane Styles (Documentation Theme)
   ============================================================ */

:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-text: #000;
  --color-text-secondary: #5a6270;
  --color-accent: #000;
  --color-accent-light: #000;
  --color-accent-dark: #000;
  --color-border: #dde1e6;
  --color-border-light: #ebeef2;
  --color-code-bg: #f0f2f5;
  --color-code-text: #c7254e;
  --color-pre-bg: #1e2530;
  --color-pre-text: #d4d9e0;
  --color-table-header: #f0f3f7;
  --color-table-stripe: #fafbfc;
  --color-note-bg: #fff8e6;
  --color-note-border: #f0c040;
  --color-success: #2e7d32;
  --color-error: #c62828;
  --color-warning: #ef6c00;
  --font-body: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "JetBrains Mono", "Consolas", monospace;
  --font-size-base: 15px;
  --font-size-small: 13px;
  --font-size-code: 13.5px;
  --line-height: 1.7;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --max-width: 860px;
  --section-gap: 2.5rem;
}

/* --- Reset --- */
#content_pane *,
#content_pane *::before,
#content_pane *::after,
.note-editable *,
.note-editable *::before,
.note-editable *::after {
  box-sizing: border-box;
}

/* --- Container --- */
#content_wrapper_edit {
	padding: 1rem 2rem 1rem 1rem;
}

#content_pane,
.note-editable {
  margin: 10px;
  padding: 2rem 1.5rem 4rem;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Sections --- */
#content_pane section>section,
.note-editable section>section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: var(--section-gap);
  box-shadow: var(--shadow-card);
}

#content_pane section:first-child,
.note-editable section>section:first-child {
  border-left: 4px solid var(--color-accent);
}

/* --- Headings --- */
#content_pane h1, #content_pane h2, #content_pane h3,
#content_pane h4, #content_pane h5, #content_pane h6,
.note-editable h1, .note-editable h2, .note-editable h3,
.note-editable h4, .note-editable h5, .note-editable h6 {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

#content_pane h1, .note-editable h1 {
  font-size: 1.85rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
}

#content_pane h2, .note-editable h2 { font-size: 1.5rem; margin-bottom: 1rem; }
#content_pane h3, .note-editable h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

#content_pane h4, .note-editable h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent-dark);
}

#content_pane h4 br, .note-editable h4 br { display: none; }

#content_pane h5, .note-editable h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Paragraphs --- */
#content_pane p, .note-editable p { margin: 0 0 1rem; }
#content_pane p:last-child, .note-editable p:last-child { margin-bottom: 0; }

/* --- Notes / Warnings --- */
#content_pane p > strong:first-child,
.note-editable p > strong:first-child { color: var(--color-warning); }

#content_pane p:has(> strong:first-child),
.note-editable p:has(> strong:first-child) {
  background: var(--color-note-bg);
  border-left: 3px solid var(--color-note-border);
  padding: 0.65rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--font-size-small);
}

/* --- Code --- */
#content_pane code, .note-editable code {
  font-family: var(--font-mono);
  font-size: var(--font-size-code);
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  word-break: break-word;
}

#content_pane pre, .note-editable pre {
  background: var(--color-pre-bg);
  color: var(--color-pre-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-code);
  line-height: 1.6;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

#content_pane pre code, .note-editable pre code {
  background: none; color: inherit; padding: 0; border: none; border-radius: 0; font-size: inherit;
}

/* --- Tables --- */
#content_pane table, .note-editable table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  font-size: var(--font-size-small);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

#content_pane thead, .note-editable thead { background: var(--color-table-header); }

#content_pane th, .note-editable th {
  text-align: left; padding: 0.7rem 1rem; font-weight: 600;
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-secondary); border-bottom: 2px solid var(--color-border);
}

#content_pane td, .note-editable td {
  padding: 0.6rem 1rem; border-bottom: 1px solid var(--color-border-light); vertical-align: top;
}

#content_pane tbody tr:last-child td, .note-editable tbody tr:last-child td { border-bottom: none; }
#content_pane tbody tr:nth-child(even), .note-editable tbody tr:nth-child(even) { background: var(--color-table-stripe); }
#content_pane tbody tr:hover, .note-editable tbody tr:hover { background: var(--color-accent-light); transition: background 0.15s ease; }
#content_pane td code, .note-editable td code { font-size: 0.85em; white-space: nowrap; }

/* --- Lists --- */
#content_pane ul, #content_pane ol, .note-editable ul, .note-editable ol { margin: 0.75rem 0; padding-left: 1.5rem; }
#content_pane li, .note-editable li { margin-bottom: 0.4rem; line-height: 1.6; }
#content_pane li::marker, .note-editable li::marker { color: var(--color-accent); }

/* --- Links --- */
#content_pane a, .note-editable a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

#content_pane a:hover, .note-editable a:hover { border-bottom-color: var(--color-accent); }

/* --- HR --- */
#content_pane hr, .note-editable hr { border: none; height: 1px; background: var(--color-border); margin: 2rem 0; }

/* --- Selection --- */
#content_pane ::selection, .note-editable ::selection { background: var(--color-accent); color: #ffffff; }

/* --- Scrollbar --- */
#content_pane pre::-webkit-scrollbar, .note-editable pre::-webkit-scrollbar { height: 6px; }
#content_pane pre::-webkit-scrollbar-track, .note-editable pre::-webkit-scrollbar-track { background: transparent; }
#content_pane pre::-webkit-scrollbar-thumb, .note-editable pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }

/* ============================================================
   RESPONSIVE LAYOUT
   ============================================================ */

/* --- Desktop (>= 768px): Klassisches Sidebar + Content Layout --- */
@media (min-width: 768px) {
	#sidebar {
		overflow-y: auto;
		overflow-x: hidden;
	}

	#page {
		background-color: #fff;
		overflow-x: hidden;
		overflow-y: hidden;
	}

	h1#page_title {
		display: block;
		line-height: 3em;
		font-size: 42px;
		text-align: center;
		text-shadow: 1px 1px 3px silver;
	}

	h3#page_title {
		display: block;
		margin: 0;
	}
}

/* --- Mobile (< 768px): Sidebar als Offcanvas Overlay --- */
@media (max-width: 767.98px) {

	/* Main Row: Statt nebeneinander → untereinander */
	#main > .row {
		flex-direction: column;
		height: auto !important;
	}

	/* Sidebar: Offcanvas von links */
	#sidebar {
		position: fixed;
		top: 0;
		left: -85vw;
		width: 85vw;
		max-width: 320px;
		height: 100vh !important;
		z-index: 1030;
		background-color: #f7f7f7;
		transition: left 0.3s ease;
		overflow-y: auto;
		overflow-x: hidden;
		box-shadow: 2px 0 12px rgba(0,0,0,0.15);
		padding-top: 0;
	}

	#sidebar.mobile-open {
		left: 0;
	}

	/* Sidebar nimmt volle Breite statt col-3 */
	#sidebar.col-3,
	#sidebar.col-md-3 {
		flex: none;
		width: 85vw;
		max-width: 320px;
	}

	/* Content-Bereich: volle Breite */
	#page {
		width: 100% !important;
		flex: 1 1 auto !important;
		max-width: 100% !important;
		height: auto !important;
		overflow: visible !important;
		background-color: #fff;
	}

	#page.col-9,
	#page.col-md-9 {
		flex: none;
		width: 100%;
		max-width: 100%;
	}

	/* Content Actions Bar: horizontal scrollbar auf Mobile */
	#content_actions {
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
	}

	/* Page Info: unter den Action-Icons, nicht daneben */
	#page_info {
		float: none !important;
		text-align: left;
		font-size: 0.85em;
	}

	#page_info .container {
		padding: 0.25rem 0;
	}

	/* Titel kleiner auf Mobile */
	h1#page_title {
		font-size: 1.75rem;
		line-height: 1.4;
		text-align: left;
		text-shadow: none;
		padding: 0.5em 0;
	}

	h3#page_title {
		font-size: 1.1rem;
		margin: 0;
	}

	/* Content-Pane: weniger Padding */
	#content_pane {
		padding: 1rem 0.5rem 2rem;
		margin: 5px;
	}

	#content_pane h1 { font-size: 1.4rem; }
	#content_pane h2 { font-size: 1.2rem; }
	#content_pane h3 { font-size: 1.1rem; }

	/* Tabellen horizontal scrollbar */
	#content_pane table,
	.note-editable table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#content_pane th, #content_pane td,
	.note-editable th, .note-editable td {
		padding: 0.5rem 0.75rem;
	}

	/* Pre-Blöcke kleiner */
	#content_pane pre, .note-editable pre {
		padding: 0.75rem;
		font-size: 12px;
	}

	/* Editor-Wrapper: keine fixe Höhe */
	#content_wrapper_edit {
		padding: 0.5rem;
		height: auto !important;
	}

	#content_wrapper {
		height: auto !important;
	}

	/* Sidemenu Tabs: etwas kompakter */
	#sidemenu {
		font-size: 0.85em;
	}

	.sidemenu {
		padding: 0.3em 0.5em;
	}

	/* Navigation Tree: etwas weniger Einrückung */
	#page_navigation li ul {
		margin-left: 1em;
	}

	/* jQuery UI Dialog responsive */
	.ui-dialog {
		max-width: 95vw !important;
		left: 2.5vw !important;
	}
}

/* --- Small Mobile (< 480px) --- */
@media (max-width: 479.98px) {
	#content_pane,
	.note-editable {
		padding: 0.75rem 0.25rem 2rem;
		font-size: 14px;
	}

	#content_pane h1 { font-size: 1.25rem; }

	h1#page_title {
		font-size: 1.4rem;
	}

	/* Action Icons etwas kleiner */
	#copy_link, #page_print, #page_edit, #page_exit,
	#page_publish, #page_unpublish, #page_save, #page_delete {
		padding: 0.35em 0;
		width: 1.8em;
		font-size: 0.9em;
	}
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  #content_pane, .note-editable {
    background: #ffffff;
    padding: 0;
    font-size: 12pt;
  }

  #content_pane section, .note-editable section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #content_pane pre, .note-editable pre {
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ccc;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  #content_pane a, .note-editable a { color: var(--color-text); }

  #content_pane a[href]::after, .note-editable a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #666;
  }

  /* Sidebar und Header nicht drucken */
  #sidebar, header, footer, #content_actions, .sidebar-toggle-btn { display: none !important; }
  #page { width: 100% !important; max-width: 100% !important; }
}
