/* Common CSS */

/* Site color scheme; see the Colors section of lint/STYLE.md */
:root {
	--perl-blue: #019BC9;
	--effective-perl-teal: #1B7C73;
}

article > header {
	margin-top: 2lh;
}

#main, .page-width { max-width: 1024px; }

.post-body pre {
	background-color: var(--bs-tertiary-bg);
	border-left: 0.25rem solid var(--bs-border-color);
	border-radius: var(--bs-border-radius-lg);
	padding: 1rem;
	margin-top: 2lh;
	margin-bottom: 2lh;
}

.post-body .code-box {
	margin-top: 1lh;
	margin-left: 2rem;
	margin-right: 5%;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
	margin-top: 1.5lh;
}

.post-body figure {
	margin-top: 1lh;
}

.post-body video {
	display: block;
	margin-top: 2lh;
	margin-bottom: 2lh;
	margin-left: auto;
	margin-right: auto;
}

.post-body table {
	margin: 1lh auto;
}

.post-body th {
	background-color: lightyellow;
}

.post-body th,
.post-body td {
	border: 1px solid gray;
	padding-left: 1em;
	padding-right: 1em;
	hyphens: none;
}

.post-body blockquote {
	margin-top: 2lh;
	margin-bottom: 2lh;
	margin-left: 5%;
	margin-right: 5%;
}

.post-body ul,
.post-body ol {
	margin-top: 1lh;
	margin-bottom: 1lh;
}

.post-body pre code.hljs {
	background: transparent;
	padding: 0;
}

.navbar-nav .nav-item:first-child .nav-link {
	padding-left: 0;
}

#main > footer.post {
	background-color: #B8FFB8;
}

.post-body {
	font-size: 1.125rem;
	text-align: justify;
	hyphens: auto;
}

.post-body > p:first-of-type {
	margin-top: 2lh;
}

.scientific-name,
.book-title,
.magazine-title {
	font-style: italic;
}

/* Plain red text, with no "danger" meaning */
.text-red {
	color: var(--bs-red);
}

/* Note boxes. Each type has its own icon from Bootstrap Icons (MIT
   license), drawn as a mask so it takes the box's text color:
   * update (clock-history): a post is out of date
   * info (info-circle): a side note
   * warning (exclamation-circle): something to be careful about
   * danger (exclamation-octagon): something that can break or lose data
   update, info, and warning use the warning colors; danger uses red. */
.post-body .note:is(.update, .info, .warning, .danger) {
	position: relative;
	margin-top: 2lh;
	margin-bottom: 2lh;
	padding: 1rem 1.25rem 1rem 3.25rem;
	background-color: var(--bs-warning-bg-subtle);
	border-left: 0.25rem solid var(--bs-warning-border-subtle);
	border-radius: var(--bs-border-radius);
	font-size: 1rem;
	text-align: left;
	hyphens: none;
}

.post-body .note.danger {
	background-color: var(--bs-danger-bg-subtle);
	border-left-color: var(--bs-danger-border-subtle);
}

.post-body .note:is(.update, .info, .warning, .danger) > :last-child {
	margin-bottom: 0;
}

.post-body .note:is(.update, .info, .warning, .danger)::before {
	content: "";
	position: absolute;
	top: 1.125rem;
	left: 1.25rem;
	width: 1.25rem;
	height: 1.25rem;
	background-color: var(--bs-warning-text-emphasis);
	-webkit-mask: var(--note-icon) no-repeat center / contain;
	mask: var(--note-icon) no-repeat center / contain;
}

.post-body .note.danger::before {
	background-color: var(--bs-danger-text-emphasis);
}

.post-body .note.update {
	--note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022zm2.004.45a7 7 0 0 0-.985-.299l.219-.976q.576.129 1.126.342zm1.37.71a7 7 0 0 0-.439-.27l.493-.87a8 8 0 0 1 .979.654l-.615.789a7 7 0 0 0-.418-.302zm1.834 1.79a7 7 0 0 0-.653-.796l.724-.69q.406.429.747.91zm.744 1.352a7 7 0 0 0-.214-.468l.893-.45a8 8 0 0 1 .45 1.088l-.95.313a7 7 0 0 0-.179-.483m.53 2.507a7 7 0 0 0-.1-1.025l.985-.17q.1.58.116 1.17zm-.131 1.538q.05-.254.081-.51l.993.123a8 8 0 0 1-.23 1.155l-.964-.267q.069-.247.12-.501m-.952 2.379q.276-.436.486-.908l.914.405q-.24.54-.555 1.038zm-.964 1.205q.183-.183.35-.378l.758.653a8 8 0 0 1-.401.432z'/%3E%3Cpath d='M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0z'/%3E%3Cpath d='M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5'/%3E%3C/svg%3E");
}

.post-body .note.info {
	--note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16'/%3E%3Cpath d='m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0'/%3E%3C/svg%3E");
}

.post-body .note.warning {
	--note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16'/%3E%3Cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z'/%3E%3C/svg%3E");
}

.post-body .note.danger {
	--note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.54.146A.5.5 0 0 1 4.893 0h6.214a.5.5 0 0 1 .353.146l4.394 4.394a.5.5 0 0 1 .146.353v6.214a.5.5 0 0 1-.146.353l-4.394 4.394a.5.5 0 0 1-.353.146H4.893a.5.5 0 0 1-.353-.146L.146 11.46A.5.5 0 0 1 0 11.107V4.893a.5.5 0 0 1 .146-.353zM5.1 1 1 5.1v5.8L5.1 15h5.8l4.1-4.1V5.1L10.9 1z'/%3E%3Cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z'/%3E%3C/svg%3E");
}
