/* ============================================================
   GENERAL — Base element styles
   ============================================================ */

/*
  TOC
  1. Body & form elements
  2. Headings
  3. External link headings
  4. Inline elements
  5. Lists
  6. Code & pre
  7. Images
  8. Dark mode
*/


/* ---- 1. Body & form elements ---- */

body {
    background-color: var(--color-bg);
}

body,
button,
input,
select,
textarea {
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 18px;
	line-height: 1.4em;
}


/* ---- 2. Headings ---- */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: 900;
	line-height: 1.47em;
	padding: 1em 0;
	clear: both;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited,
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
	color: var(--color-text);
}

h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
	text-decoration: underline;
}


/* ---- 3. External link headings ---- */

h1.external-link,
h2.external-link,
.entry-title.external-link {
    font-size: 1.8em; /* ~33% smaller than the standard 2.7em entry-title */
}

/* Last word — keeps the arrow icon from orphaning on its own line */
.entry-title.external-link a .title-last-word {
    white-space: nowrap;
}

.entry-title.external-link a .title-last-word::after {
    content: '';
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    margin-left: 0.3em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
}


/* ---- 4. Inline elements ---- */

hr {
	background-color: var(--color-border);
	border: 0;
	height: 1px;
	margin-bottom: 24px;
}

a {
	color: var(--color-link);
	transition: color .15s ease-in-out;
}

a:visited {
	color: var(--color-link);
}

a:hover {
	color: var(--color-link-hover);
}

p {
	margin-bottom: 1em;
}

b, strong {
	font-weight: 700;
}

dfn, cite, em, i {
	font-style: italic;
}

cite {
	border-bottom: dotted 1px var(--color-border);
}

blockquote {
	font-style: italic;
	margin-bottom: 24px;
}

address {
	font-style: italic;
	margin-bottom: 24px;
}

abbr, acronym {
	border-bottom: 1px dotted var(--color-border);
	cursor: help;
}

mark, ins {
	background: #fff9c0;
	text-decoration: none;
}

sup,
sub {
	font-size: 75%;
	height: 0;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

small {
	font-size: 75%;
}

big {
	font-size: 125%;
}

caption {
	color: var(--color-text);
	margin-bottom: 8px;
	text-align: center;
}


/* ---- 5. Lists ---- */

ul {
	list-style: disc;
}

ol {
	list-style: decimal;
}

dt {
	font-weight: 700;
}

dd {
	margin: 0 0 24px 1em;
}


/* ---- 6. Code & pre ---- */

pre {
	background: var(--color-image-border);
	font-family: var(--font-mono);
	font-size: 14px;
	line-height: 20px;
	margin-bottom: 24px;
	max-width: 100%;
	overflow: auto;
	padding: 12px;
	word-wrap: normal;
}

code, kbd, tt, var {
	font-family: var(--font-mono);
	font-size: 14px;
}


/* ---- 7. Images ---- */

figure {
	margin: 0;
}

img {
	height: auto; /* scale correctly */
	max-width: 100%; /* adhere to container width */
	vertical-align: middle;
}


/* ---- 8. Dark mode ---- */

@media (prefers-color-scheme: dark) {
	input,
	select,
	textarea {
		color: var(--color-text);
		background-color: var(--color-bg);
	}
}
