/* Global */

:root {
	--border-color: hsl(0 0% 80% / 60%);
	--accent-color: hsl(225 90% 50%);
	--accent-color-pressed: hsl(225 90% 35%);
	--color-muted: hsl(0 0% 50%);
	--radius-s: 0.25em;
	--radius-m: 0.5em;
	--font-size-m: 1rem;
	--font-size-s: 0.85rem;
	--font-size-xs: 0.75rem;
	--font-size-l: 1.25rem;
	--box-shadow: 0 2px 0 hsl(0 0% 50% / 20%);
}

html {
	box-sizing: border-box;
	font-family: system-ui, sans-serif;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	line-height: 1.5;
	background-color: hsl(0 0% 98%);
}

*,
*::before,
*::after {
	box-sizing: inherit;
}

* {
	margin: 0;
}

body {
	line-height: 1.5;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

input,
button,
textarea,
select {
	font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
	font-size: inherit;
	font-weight: inherit;
}

table,
th,
tr,
td {
	text-align: inherit;
	border-collapse: collapse;
}

a {
	color: var(--accent-color);
	font-weight: 500;
	text-decoration: none;
	transition: color 120ms;
}

a:hover {
	color: var(--accent-color-pressed);
}

ins {
	background-color: hsl(120 100% 95%);
	text-decoration-color: hsl(120 50% 75% / 50%);
}

del {
	background-color: hsl(0 100% 95%);
	text-decoration-color: hsl(0 50% 40% / 50%);
}

.diff-before ins {
	display: none;
}

.diff-after del {
	display: none;
}

code {
	font-size: inherit;
}

summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
}

summary::-webkit-details-marker {
	display: none;
}

summary::before {
	content: url('data:image/svg+xml,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.1714 12.0007L8.22168 7.05093L9.63589 5.63672L15.9999 12.0007L9.63589 18.3646L8.22168 16.9504L13.1714 12.0007Z"></path></svg>');
	display: grid;
	place-content: center;
	transition: transform 120ms;
	margin-left: -0.25rem;
	margin-top: 0.25rem;
}

details[open] summary::before {
	transform: rotate(90deg);
}

/* Layout */

.header {
	padding-top: 1rem;
	padding-bottom: 1rem;
	background-color: white;
}

.header:not(.header-extended) {
	border-bottom: 1px solid var(--border-color);
	margin-bottom: 2rem;
}

.header .container {
	display: flex;
	align-items: center;
	gap: 2rem;
}

.header nav {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.header-link-home {
	color: inherit;
	text-decoration: none;
}

.header h1 {
	font-size: 1.5rem;
	font-weight: 700;
}

.header h1 .del {
	text-decoration: line-through;
	text-decoration-thickness: 2px;
}

.header h1 .ins {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-decoration-style: wavy;
}

.main {
	margin-bottom: auto;
}

.footer {
	margin-top: 4rem;
	padding: 1.5rem 0;
	color: hsl(0 0% 60%);
	font-size: var(--font-size-s);
	font-weight: 500;
}

.footer a {
	color: inherit;
}

.footer a:hover {
	color: hsl(0 0% 40%);
}

.footer-container {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.footer-colophon {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.footer-colophon svg {
	display: block;
	fill: currentColor;
	transition: fill 120ms;
}

.footer-item:not(:last-child)::after {
	content: " ยท ";
	opacity: 0.5;
	margin: 0 0.25rem;
}

/* Utils & components */

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

.inline-icon {
	display: inline-block;
	fill: currentColor;
	width: 1.25em;
}

.input {
	border-radius: var(--radius-s);
	border: 1px solid var(--border-color);
	padding: 0.375rem 0.75rem;
	font-size: var(--font-size-m);
	transition: border-color 120ms, box-shadow 120ms;
}

.input:focus {
	border-color: var(--accent-color);
	box-shadow: 0 0 0 2px hsl(225 90% 40% / 50%);
	outline: none;
}

.button {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	gap: 0.5em;
	border-radius: var(--radius-s);
	border: 1px solid var(--border-color);
	padding: 0.375rem 0.75rem;
	background: hsl(0 0% 95%);
	font-size: var(--font-size-m);
	transition: background-color 120ms;
	color: hsl(0 0% 40%);
	font-weight: 500;
	font-size: 0.9em;
	line-height: 1.5rem;
}

.button:not(:disabled) {
	cursor: pointer;
}

.button:hover {
	background: hsl(0 0% 90%);
}

.card {
	border: 1px solid var(--border-color);
	border-radius: var(--radius-m);
	background-color: white;
	box-shadow: 0 2px 0 hsl(0 0% 50% / 20%);
	overflow: hidden;
}

.pagination-container {
	overflow-x: auto;
}

.pagination {
	list-style-type: none;
	padding: 0;
	display: flex;
	margin-bottom: 1rem;
}

.page-link {
	display: block;
	padding: 0.5em 1em;
	text-decoration: none;
	color: inherit;
}

.page-item {
	border: 1px solid var(--border-color);
	background: hsl(0 0% 95%);
	transition: background-color 120ms;
	color: hsl(0 0% 40%);
	font-weight: 500;
	font-size: 0.85em;
	line-height: 1.5rem;
}

.page-item:not(.active):hover {
	background: hsl(0 0% 90%);
}

.page-item:first-of-type {
	border-radius: var(--radius-s) 0 0 var(--radius-s);
}

.page-item:last-of-type {
	border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

.page-item:not(:last-of-type) {
	border-right-width: 0px;
}

.page-item.active {
	background-color: var(--accent-color);
	color: white;
	border-color: transparent;
}

.pagination-page-info {
	color: var(--color-muted);
}

.prose p:not(:last-of-type) {
	margin-bottom: 1rem;
}

/* Index */

.filters {
	margin-bottom: 2rem;
	position: sticky;
	top: 0;
	background-color: white;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--border-color);
}

.filters form {
	display: flex;
	gap: 0.5rem;
}

.filters [name="search"] {
	width: 100%;
	max-width: 20rem;
}

.changesets {
	margin-bottom: 2rem;
}

.changeset {
	padding: 1rem 1.5rem;
	margin-bottom: 1rem;
}

.changeset-actions {
	display: flex;
	column-gap: 1rem;
	row-gap: 0.5rem;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
}

.changeset-feed-name,
.changeset-time,
.changeset-action {
	font-weight: 500;
	font-size: var(--font-size-s);
	flex-shrink: 0;
}

.changeset-action {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-weight: 500;
	color: var(--color-muted);
	text-decoration: none;
	transition: color 200ms;
}

.changeset-title {
	font-size: var(--font-size-l);
}

.changeset table th {
	font-size: var(--font-size-s);
	font-weight: 500;
	color: var(--color-muted);
	padding-right: 1rem;
	vertical-align: top;
}

/* Article detail */

.article-detail h1 {
	margin-bottom: 1rem;
	font-size: var(--font-size-l);
}

.page-heading {
	font-size: var(--font-size-l);
	margin-bottom: 2rem;
}

.article-detail-diffs th,
.article-detail-diffs td {
	padding: 0.5rem 0.75rem;
}

.article-detail-diffs td:last-child {
	width: 100%;
}

.article-detail-diffs th {
	font-size: var(--font-size-xs);
	color: var(--color-muted);
	font-weight: 500;
}

.article-detail-diffs tr:not(:last-of-type) {
	border-bottom: 1px solid var(--border-color);
}

/* About */

.page-about-prose {
	font-size: var(--font-size-l);
	max-width: 800px;
}