/**
 * FIX THE DESIGN OF THE RTD THEME
 */

body,
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Ubuntu, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Visually hidden utility — element stays in the accessibility tree
   but is not visible on screen. Satisfies WCAG 3.3.2 / BITV 9.3.3.2
   for the search form label. */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Search input wrapper — positions the magnifying-glass icon inside
   the input so sighted users can identify the field without a label. */
.wy-form-search {
	position: relative;
}

.wy-form-search-icon {
	position: absolute;
	top: 50%;
	left: 10px;
	transform: translateY(-50%);
	color: #555;
	pointer-events: none;
}

.wy-form-search input[type="text"] {
	padding-left: 30px;
}

/* NC blue */
.wy-side-nav-search {
	background-color: #0082c9;
}

/* Content links — RTD default #2980b9 gives ~4.3:1 against white,
   below the 4.5:1 required by WCAG AA / BITV 9.1.4.1 and 9.1.4.3.
   #2474a4 yields ~5.1:1 while keeping the same blue visual style.
   Keep underlines so links are not distinguished by color only. */
.rst-content a,
.rst-content a:visited {
	color: #2474a4;
	text-decoration: underline;
}

/* Reduce size of logo in top left */
.wy-side-nav-search > a img.logo {
	max-width: 180px;
}

/* Remove unwanted background on top left logo on hover */
.wy-side-nav-search > a:hover {
	background: none;
}

/* Remove unwanted data on the bottom left sidebar */
.rst-versions.shift-up .rst-other-versions > dl:not(:nth-child(1)),
.rst-versions.shift-up .rst-other-versions > a,
.rst-versions.shift-up .rst-other-versions > hr {
	display:none
}
.rst-versions.shift-up .rst-other-versions {
	color: transparent;
	font-size: 0px;
}
.rst-versions.shift-up .rst-other-versions dt,.rst-versions.shift-up .rst-other-versions dl {
	color: #808080;
	font-size: 15px;
}

/* Remove readthedocs title in the sidebar bottom left section */
.rst-versions .rst-current-version .fa-book {
	display: none;
}

/* The version toggle is now a <button> element. Reset default button
   styling so it looks identical to the old <span>. */
button.rst-current-version {
	background: none;
	border: none;
	padding: 12px;
	font-family: inherit;
	font-size: 90%;
	width: 100%;
	cursor: pointer;
}
.rst-versions .rst-current-version:before {
	content: 'Nextcloud';
	margin-right: auto;
}
.rst-versions .rst-current-version {
	display: flex;
	align-items: center;
	/* Use white instead of #0082c9 — the NC blue at 3.7:1 on the dark
	   #272525 sidebar background fails WCAG AA (4.5:1 required). */
	color: #fff;
}
.rst-versions .rst-current-version .fa-caret-down {
	margin-left: 5px;
}

.rst-versions .rst-current-version .fa-caret-down:not(:last-of-type) {
	margin-right: 10px;
}

/* Code blocks */
.highlight {
	/* nc blue */
	background: rgba(0, 130, 201, 0.1)
}

/* Inline code — RTD uses #e74c3c on white which gives ~3.82:1, below
   the 4.5:1 required by WCAG AA / BITV 9.1.4.3. Use a darker shade. */
.rst-content code,
.rst-content tt,
code {
	color: #c0392b !important;
}

/* Fix code within tables - remove too big margins */
.rst-content td {
	div[class^="highlight"]:last-of-type,
	pre.literal-block:last-of-type {
		margin-block: 1px !important;
	}
}

/* Screenshots — add subtle shadow to distinguish from page background */
.rst-content img {
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .rst-content img {
	box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

/* Dark-theme overrides — sphinx-rtd-dark-mode sets data-theme="dark" on
   <html>. The selectors below restore proper contrast for values that
   were hardcoded for the light (white) background. */

/* Content links: #2474a4 gives only ~3.6:1 on the dark #141414 bg.
   Defer to the plugin's own variable (= #249ee8, ~6:1 on dark bg). */
html[data-theme="dark"] .rst-content a,
html[data-theme="dark"] .rst-content a:visited {
	color: var(--dark-link-color, #249ee8);
}

/* Inline code: #c0392b (dark red) gives ~2.4:1 on the #2d2d2d code bg,
   and the !important above defeats the plugin's dark-mode rule entirely.
   Use a lighter coral-red (~4.9:1 on #2d2d2d). */
html[data-theme="dark"] .rst-content code,
html[data-theme="dark"] .rst-content tt,
html[data-theme="dark"] code {
	color: #ff7878 !important;
}

/* Search icon: #555 is near-invisible on the dark #0b152d sidebar bg. */
html[data-theme="dark"] .wy-form-search-icon {
	color: #aaa;
}

/* ICONS LIST */
div#list-of-available-icons > blockquote {
	margin: 0;
}

div#list-of-available-icons > blockquote > div {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
}

div#list-of-available-icons > blockquote > div > div {
	width: 120px;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 30px;
}

div#list-of-available-icons > blockquote > div > div > a {
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 60px;
	height: 60px;
}

div#list-of-available-icons > blockquote > div > div > a.white-icon {
	background-color: #343131;
}

div#list-of-available-icons > blockquote > div > div > p {
	margin-top: 5px;
	font-size: 90%;
	font-style: normal;
	text-align: center;
}

/* Focus ring — the sidebar nav container clips outline to one edge
   (only bottom line visible). Use a negative outline-offset to draw
   the ring inside the element so it is never clipped (BITV 9.2.4.7). */
.wy-menu-vertical a:focus-visible,
.wy-menu-vertical button:focus-visible,
.wy-side-nav-search a:focus-visible,
.rst-versions .rst-current-version:focus-visible {
	outline: 2px solid #0082c9;
	outline-offset: -2px;
}

.wy-nav-content {
	max-width: clamp(800px, calc(100vw - 600px), 1200px) !important;
}

.wy-nav-content section {
	max-width: 900px;
}

table.docutils {
	min-width: 50%;
}

#code-style table.docutils {
	width: 100%;
}
