/* indicate which elements can be edited on hover with a green outline */
.hoverbox:hover { box-shadow: 0 0 0 2px rgba(51, 204, 0, .3), inset 0 0 0 2px rgba(51, 204, 0, .3); }

/* make hoverbuttons appear when hovering over the parent hoverbox
Note: functions_admin.js adds the hoverbox class to the parent of hoverbuttons */
.hoverbox:hover > .hoverbuttons { display: block; }

#bulk_action { width: 100%; }

#bulk_action:has(table):not(:has(tbody tr)),
.ajax_controlled:not(:has(#bulk_action tbody tr)) #table_filter,
.ajax_controlled:has(#bulk_action tbody tr) #empty_notice { display: none; }

p.bulk-actions-wrapper {
	margin-bottom: var(--default-space);
	float: left;
}

/*admin clearfixes*/
p.bulk-actions-wrapper::after,
.fab-container::after {
	content: '';
	display: table;
	clear: both;
}

.hover-reveal .bulk_select {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	transform: translate(75%, 75%);
	z-index: 1;
}

.hover-reveal:hover .bulk_select { display: block !important; }

/* make it obvious elements with class "handle" can be dragged */
.handle { cursor: move; }

/* remove empty icon space before and after drag-vertical handles */
.mdi-drag-vertical {
	margin-left: -.3em;
	margin-right: -.3em;
}

/* position to the top left visibility icons which apply to whole elements */
:has(> .element_visibility) { position: relative; }

:not(.marquee) .element_visibility {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-25%, -25%);
	z-index: 1;
	opacity: 50%;
}

.element_visibility:hover { opacity: 100%; }

/* indicate with a dotted outline which elements have special visibility */
:has(> .element_visibility),
:is([class^='visibility-'], [class*=' visibility-']) {
	outline: thin dotted #ccc;
	position: relative;
}

/* position visibility icon something like a superscript */
:is([class^='visibility-'], [class*=' visibility-'])::after {
	position: absolute;
	font: normal normal normal 80% 'Material Design Icons';
	opacity: 50%;
}

/* position visibility icon at top right WITHIN elements that are usually 'display: block'*/
:is(ul,ol,li,.custom_button):is([class^='visibility-'], [class*=' visibility-'])::after,
:is(.sidebar, nav) li > span:has(> a):is([class^='visibility-'], [class*=' visibility-'])::after {
	top: 5px;
	right: 5px;
}

:is([class^='visibility-'], [class*=' visibility-']):hover::after { opacity: 75%; }

.visibility-public-only::after { content: "\F0012"; }

.visibility-protected::after { content: "\F030B"; }

:is([class^='visibility-custom'], [class*=' visibility-custom'])::after { content: "\F0008"; }

.visibility-hidden::after { content: "\F0209"; }

/* indicate with a dashed outline which elements in edit mode */
.editable, .editable:focus {
	outline: thin dashed !important;
	min-height: 20px;
}

/* add placeholder text to empty editable elements */
[data-placeholder]:empty::before {
	content: attr(data-placeholder);
	opacity: 0.3;
	pointer-events: none;
}

[data-placeholder]:focus:empty::before { content: ''; }

/* style textareas used for adding code */
.codebox {
	font-family: monospace !important;
	white-space: pre-wrap;
}

/* make any links which open a dialog display the pointer cursor */
.dialog-open { cursor: pointer; }

/* floating action buttons (usually green plus circles) */
.fab-container { clear: both; }

.fab {
	float: right;
	position: sticky;
	z-index: 4;
	bottom: 15px;
	border-radius: 50%;
	box-shadow: 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28);
	text-align: center;
	color: white !important;
	text-decoration: none !important;
	text-shadow: none;
	cursor: pointer;
	font-size: 30px;
}

.fab i.mdi { font-size: 1em; }

.fab:hover, .fab:focus { box-shadow: 0 0 6px rgba(0, 0, 0, .16),0 6px 12px rgba(0, 0, 0, .32); }

.fab-main {
	line-height: 56px;
	width: 56px;
	height: 56px;
}

.fab-add:hover, .fab-add:focus { background-color: #5f9f0f; }

.fab-add, .fab-add:active { background-color: #509000; }

/* yet unused mini floating action buttons
.fab-mini {
	background-color: black;
	line-height: 40px;
	width: 40px;
	height: 40px;
	margin-right: 8px;
	visibility: hidden;
	margin-bottom: 10px;
}

/* yet unused floating action buttons hover effects
.fab-activated {
	visibility: visible;
	transition: .3s;
}

.fab-mini-1.fab-activated { bottom: 81px; }

.fab-mini-2.fab-activated { bottom: 131px; }

.fab-main.fab-add.fab-activated i { transform: rotate(45deg); }
*/

/* TinyMCE external toolbar (Editor+) */
#tinymce_bar {
	position: fixed;
	top: 0;
	left: 150px;
	z-index: 6;
}

@media screen and (max-width: 480px) {
	#tinymce_bar { left: 0; }
}

#tinymce_bar .tox-tinymce { box-shadow: 0 0 6px rgba(0, 0, 0, .1); }

#tinymce_bar .tox-menubar { cursor: grab; }

#tinymce_bar .tox-menubar::after {
	font-family: 'Material Design Icons';
	content: '\F01DB'; /* drag */
	position: absolute;
	top: 7px;
	right: 0;
	font-size: 26px;
	z-index: 1;
}

/* if not using external toolbar above, allow TinyMCE editor to overlay persistent headers and such */
.tox.tox-tinymce.tox-tinymce-inline { z-index: 99; }

/* make the overlay rendered behind tinymce modals semi-transparent */
.tox-dialog-wrap__backdrop--opaque { background-color: rgba(255,255,255,.75) !important; }

/* prevent dashed outline applied to elements with visibility classes from
appearing on corresponding options in the tinymce toolbar style dropdown */
.tox-collection__item-label > span { outline: none !important; }

/* workaround an issue with TinyMCE Link list (https://github.com/tinymce/tinymce/issues/6335) */
.tox-tiered-menu .tox-menu {
	width: fit-content;
	max-width: min(80%, 450px);
}

.tox-tiered-menu .tox-menu .tox-collection__item-label { word-break: normal; }

@media screen and (max-width: 890px) {
    .tox-tiered-menu > .tox-collection--list:not(:first-child) {
		left: auto !important;
		right: 0 !important;
	}
}

/* Admin Drawer only */
#admin_tab, #admin_drawer {
	all: initial;
	background-color: white;
	color: #222f3e;
}

#admin_tab {
	font-size: 22px;
	text-decoration: none;
	position: fixed;
	cursor: pointer;
	top: 20px;
	left: 0;
	padding: 5px 7px 5px 5px;
	border: thin solid #c5c5c5;
	border-left: none;
	border-radius: 0 50px 50px 0;
	z-index: 500;
	box-shadow: 0 0 6px rgba(0, 0, 0, .1);
}

#admin_drawer {
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
	position: fixed;
	border-right: thin solid #c5c5c5;
	font-size: 14px;
	width: 150px;
	height: 100%;
	top: 0;
	left: -151px;
	z-index: 1000;
	transition: all .3s ease;
	overflow-y: auto;
}

#admin_drawer a {
	text-decoration: none;
	color: inherit;
}

#admin_drawer.open_admin_drawer {
	left: 0;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#pin_admin {
	position: absolute;
	right: 10px;
	top: 10px;
	cursor: pointer;
	font-size: 16px;
}

#admin_drawer.pinned #pin_admin .mdi::before { content: '\F0403'; /* pin */ }

#admin_drawer_title {
	font-size: 20px;
	font-weight: bold;
	margin: 10px;
}

.admin_button {
	display: block;
	padding: var(--default-space);
	margin-right: 3px;
	border-radius: 0 500px 500px 0;
}

.admin_button:hover, .admin_button:focus { background-color: #efefef; }

.admin_button:active, .admin_button.current {
	color: white !important;
	background-color: #555c66;
}

.admin_button .mdi { padding: 0 calc(var(--default-space) / 2); }

#admin_drawer hr {
	color: transparent;
	border: none;
	border-bottom: thin solid #d9d9d9;
	margin: var(--default-space) 0;
}

#admin_drawer::-webkit-scrollbar {
	width: 4px;
	background-color: transparent;
	display: none;
}

#admin_drawer:hover::-webkit-scrollbar { display: block; }

#admin_drawer::-webkit-scrollbar-track { background-color: transparent; }

#admin_drawer::-webkit-scrollbar-thumb {
	border-radius: 2px;
	background-color: #999;
}

#admin_drawer::-webkit-scrollbar-thumb:hover { background-color: #666; }

#admin_drawer::-webkit-scrollbar-thumb:active { background-color: #333; }

.box { position: relative; }

.box.ui-sortable-handle { cursor: move; }

.box.ui-sortable-handle .editable { cursor: text; }

.edit_bar {
	position: sticky;
	display: block;
	bottom: 0;
	left: 0;
	z-index: 1;
	width: 100%;
	background-color: var(--cms-accent-color);
	border: thin solid #c5c5c5;
	padding: var(--default-space);
	text-align: center;
}

@media screen and (max-height: 480px) {
	.edit_bar { position: static; }
}

/* FancyBox (admin_images.php, and edit_slideshow.php, gallery.php) */
#fancybox-wrap, #fancybox-content { box-sizing: content-box; }

/* override nivoslider defaults to prepare for slideshow visibility icons */
.slideshow .nivoSlider a.nivo-imageLink {
	opacity: 1;
	filter: alpha(opacity=1);
	background-color: transparent;
	text-decoration: none; /* override any theme defaults */
}

/* slideshow visibility icons */
.nivoSlider a.nivo-imageLink::after {
	color: white;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.75);
	font-size: 20px !important;
	left: 2px;
}
