@import url(https://cdn.jsdelivr.net/npm/kiso.css@latest/kiso.css);
@import url(https://cdn.jsdelivr.net/npm/tailwindcss-colors-css-variables@1.1.2-rc.2/css/tailwindcss-colors.min.css);
@import url(https://use.fontawesome.com/releases/v6.2.0/css/all.css);

html {
	height: 100%;
}

body {
	display: flex;
	flex-direction: column;
	margin: 0;
	color: var(--tw-color-gray-900);
}

header {
	> div {
		display: flex;
		margin: 0 auto;
		padding: 8px;
		max-width: 1200px;
		border-bottom: 2px solid var(--tw-color-teal-800);

		> p a {
			display: flex;
			align-items: center;
			font-size: 1.5rem;
			color: var(--tw-color-teal-800);

			&:hover {
				text-decoration: underline;
			}

			&::before {
				content: "";
				display: block;
				margin-right: 16px;
				width: 32px;
				height: 32px;
				background: url(icon.png) center / contain;
			}
		}

		> ul {
			display: flex;
			align-items: end;
			margin-left: auto;
			gap: 16px;

			li a {
				color: var(--tw-color-teal-800);

				&:hover {
					color: var(--tw-color-teal-600);
				}

				&::before {
					font-size: 1.2rem;
					font-family: "Font Awesome 6 Brands";
					font-weight: 900;
				}

				&.twitter::before {
					content: "\f099";
				}

				&.github::before {
					content: "\f09b";
				}
			}
		}
	}
}

footer {
	> div {
		border-top: 1px solid var(--tw-color-teal-800);
		margin: 0 auto;
		padding: 8px;
		max-width: 1200px;
		line-height: 2em;
		color: var(--tw-color-teal-800);
	}
}

main {
	flex: 1;

	> div {
		margin: 48px auto 128px;
		padding: 8px;
		max-width: 1200px;
		line-height: 2em;

		h1 {
			margin: 0 -8px 48px;
			padding: 2px 8px;
			font-size: 2rem;
			color: var(--tw-color-teal-800);

			.created_at {
				display: block;
				font-size: 1rem;
				font-weight: normal;
			}
		}

		h2 {
			margin: 64px 0 32px;
			padding-bottom: 8px;
			border-bottom: 1px solid var(--tw-color-teal-800);
		}

		h3 {
			margin: 32px 0 16px;
		}

		:is(p, ul, ol) + :is(p, ul, ol) {
			margin-top: 32px;
		}

		ul:not(.blog_feed, .blog_prev_next) {
			list-style: disc;

			ul {
				list-style: circle;
			}

			li {
				margin-left: 32px;
			}

			li + li {
				margin-top: 8px;
			}
		}

		ol {
			list-style: decimal;

			li {
				margin-left: 32px;
			}

			li + li {
				margin-top: 8px;
			}
		}

		p{
			.tips {
				display: block;
				font-size: 0.8rem;
				color: var(--tw-color-gray-600);
				line-height: 1rem;
			}
		}

		*:not(.gh-card-container) {
			a:not(.button) {
				color: var(--tw-color-teal-800);
				text-decoration: underline;

				&:hover {
					background-color: var(--tw-color-teal-100);
				}

				&.external::after {
					/* リンクテキストと隙間を開けるためにスペースを含む */
					content: " \f08e";
					font-family: "Font Awesome 6 Free";
					font-weight: 900;
					margin-right: 4px;
				}
			}
		}

		div:has(> a.button) {
			margin: 16px 0;
		}

		a.button {
			padding: 8px 16px;
			border-radius: 4px;
			color: #fff;
			text-decoration: none;
			background-color: var(--tw-color-teal-600);

			&:hover {
				background-color: var(--tw-color-teal-700);
			}

			i {
				color: var(--tw-color-white);
				margin-right: 4px;
			}
		}

		pre {
			/* prettifyを上書き */
			border-style: none !important;
			padding: 16px !important;

			border-radius: 8px;
			font-size: 1rem;
			line-height: 1.5rem;
			background-color: var(--tw-color-gray-200);
		}

		/* markdownからも生成される */
		code {
			padding: 4px;
			border-radius: 4px;
			font-size: 0.8rem;
			background-color: var(--tw-color-gray-200);
		}

		ul.blog_feed li {
			margin-bottom: 16px;
			
			span.created_at {
				display: block;
				font-size: 0.875rem;
				line-height: 1rem;
			}
		}

		ul.blog_prev_next {
			display: flex;
			margin: 128px 0 -96px;

			li {
				border: 1px solid var(--tw-color-teal-800);
				padding: 24px 32px;

				&:hover {
					background-color: var(--tw-color-teal-100);
				}

				&.prev::before {
					font-family: "Font Awesome 6 Free";
					font-weight: 900;
					margin-right: 16px;
					content: "\f104";
				}

				&.next::after {
					font-family: "Font Awesome 6 Free";
					font-weight: 900;
					margin-left: 16px;
					content: "\f105";
				}
			}

			/* li.prev  */
			li.next {
				margin-left: auto;
			}
		}

	}
}

@media screen and (min-width:800px) {
	.columns {
		display: flex;
		gap: 32px;

		> * {
			display: block;
			flex: 1;
		}
	}
}

@media screen and (max-width:801px) {
	.columns {
		display: contents;
	}
}
