/* Basic */
@import "fonts.css";

:root {
    --card-border-radius: 0.5em;
    --card-margin: 1.5em;
    --icon-margin-left: 1em;
    --icon-margin-top: 1em;
}


html {
    /*
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
	*/
	font-family: 'IBM Plex Mono', monospace, sans-serif;
	
    /* 1 */
    -ms-text-size-adjust: 100%;
    /* 2 */
    -webkit-text-size-adjust: 100%;
    /* 2 */
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-size: 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    color: var(--font-color);
	background: var(--page-bg-color);
	background-attachment: fixed;
}

.pattern {
	position: fixed;
	background: url("/pattern/diamonds.svg");
	background-repeat: repeat;
	color: var(--bg-color);
	z-index: -2; 
	width: 100%;
    height: 100vh;
    overflow: hidden;
	background-size: 160px;
	animation: 64s linear infinite AnimatedBackground;
}

.vignette {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	box-shadow: 0 0 500px rgba(0,0,0,0.3) inset;
	z-index: -2;
}

@keyframes AnimatedBackground {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 1024px 1024px;
  }
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section {
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto 0 auto;
    background: var(--bg-color);
    border: solid;
    border-color: var(--bg-color);
    border-left-width: 20px;
    border-right-width: 20px;
}

main {
    outline: none;
}

/* Table of Contents */

.toc {
    cursor: zoom-in;
    display: block;

    margin-top: 1em;
    margin-bottom: 1em;
    padding: 0.5em 1em;
    /* top & bottom, left & right */

    border: 1px solid var(--card-border-color);
    border-radius: var(--card-border-radius);
    background: var(--card-color);

    font-size: 14px;
    font-weight: bold;
}

.toc.expanded {
    cursor: zoom-out;
}

.toc .inner {
    margin: 0px;
    padding: 0px;
}

/* Headers */
h1 {
    font-size: 1.35em;
}

h2 {
    font-size: 1.2em;
    margin-top: 1em;
}

h2:first-of-type {
    margin-top: 1em;
}

h3 {
    font-size: 1.1em;
}

/* Links */

a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

a:hover,
a:focus,
a:active {
    color: var(--link-state-color);
    border-bottom: 1px solid var(--link-state-border-color);
}

a:active,
a:hover {
    outline: 0;
}

a:active {
    opacity: 0.9;
}

a.skip-main {
    left: -999px;
    position: absolute;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -999;
}

a.skip-main:focus,
a.skip-main:active {
    left: auto;
    top: 0px;
    width: auto;
    height: auto;
    overflow: auto;
    z-index: 999;
    padding: 4px 6px 4px 6px;
    text-decoration: underline;
    border: none;
}

/* Table */
thead {
    background: var(--thead-bg-color);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    max-width: 100%;
    display: block;
    overflow: scroll;
    border-spacing: 0;
    border-collapse: collapse;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-size: 14px;
}

th,
td {
    padding: 0.25em 0.5em;
    border: 1px double var(--table-border-color);

}

/* Code */
mark {
    border-radius: 4px;
}

code,
pre,
kbd {
    color: var(--pre-color);
    background-color: var(--pre-bg-color);
    font-family: 'Menlo', 'Courier New', 'Consolas', monospace;
    font-size: 14.4px;
    /* 18px * 0.6 */
    line-height: 154%;
    border-radius: 6px;
    border: 1px solid var(--pre-border-color);
    overflow: scroll;
}

/* <code> tag */
code {
    font-size: 14.4px;
    /* 18px * 0.6 */
    padding: 0.1em 0.3em;
}

pre {
    padding: 0.3em;
}

/* <kbd> inside <p> */
/* <kbd> inside <pre> */
/* p kbd,
pre kbd {
    background-color: transparent;
    border: none;
} */
p kbd,
pre kbd,
p kbd kbd,
pre kbd kbd {
    font-size: 14.4px;
    /* 18px * 0.6 */
    background-color: var(--kbd-bg-color);
    border: 1px solid var(--pre-border-color);
    border-width: 1px 2px 2px 1px;
    padding: 0.1em 0.3em;
    margin-left: 0.2em;
    margin-right: 0.2em;
}

p code,
p kbd {
    padding: 0.1em 0.3em;
    /* top, bottom */
    /* margin-right: 4px; */
}

td pre {
    border: none;
    /* padding: 0px; */
    border-radius: 0px;
}

td:first-child pre {
    padding-right: 0;
}

td:last-child pre {
    padding-left: 0;
}

td pre code {
    /* when there is a line number grid */
    padding: 0px;
    display: flex;
    flex-direction: column;
    border-radius: 0px;
    /* padding-top: 4px; */
    /* padding-bottom: 4px; */
}

div.highlight {
    border-radius: 6px;
    border: 1px solid var(--pre-border-color);
    margin-bottom: 14px;
}

div.highlight div {
    overflow: scroll;
}

div.highlight pre {
    border: none;
    display: grid;
    margin: 0px;
    overflow: auto;
    /* Have to add this line, otherwise the "pre" and "code" will have different width */
    /* padding-left: 10px; */
    /* padding-right: 10px; */
    /* padding-top: 10px; */
    /* padding-bottom: 10px; */
}

div.highlight code {
    padding-left: 0px;
    padding-right: 0px;
    overflow: unset;
}

div.highlight code a:hover,
div.highlight code a:focus {
    color: white;
    border-bottom: 1px solid white;
    /*for markup.highlight.anchorLineNos = true*/
}

pre code,
pre kbd {
    color: inherit;
    background-color: inherit;
    border: none;
    padding: 0em;
}

/* Styles */

blockquote {
    border-left: 2px solid var(--bq-color);
    padding: 0.1em 1em;
    margin-left: 0.75em;
}

p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

hr {
    color: var(--hr-color);
    background-color: var(--hr-color);
    border: none;
    height: 1px;
}

/* Header */

.common-header {
    padding-bottom: 1.5em;
    /* border-bottom: thin solid var(--hr-color); */
}

header a {
    color: var(--font-color);
}

header h1 {
    font-size: 1em;
    margin-top: 1em;
    margin-bottom: 0;
    font-weight: normal;
}

header h2 {
    font-size: 1em;
    margin: 0;
    font-weight: normal;
}

.header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    vertical-align: middle;
    margin-top: 1em;
}

.header-top-left {
    display: table;
    align-items: center;
    justify-content: space-between;
}

.header-top-right {
    display: table;
    align-items: center;
    justify-content: space-between;
    padding-top: 0em;
    margin-top: -3em;
    font-size: 14px;
    margin-bottom: 0em;
    color: var(--pagination-link-color);
}

.site-title {
    display: inline;
    white-space: nowrap;
    font-weight: 700;
}

header nav:not(:empty) {
    background: var(--nav-bg-color);
    margin-top: var(--card-margin);
    max-width: 100%;
    text-align: center;
    padding: 0.5em 0;
    border: 1px solid var(--card-border-color);
    border-radius: var(--card-border-radius);
    font-size: 16px;
    font-weight: bold;
}

header nav a {
    display: inline-block;
    margin: 0 2%;
}

/* Social icons */
.social-icons {
    display: inline;
    margin: var(--icon-margin-top) 0 0 var(--icon-margin-left);
    padding: 0;
    list-style-type: none;
}

.social-icons li {
    display: inline;
}

.social-icons li:not(:first-of-type) {
    margin-left: var(--icon-margin-left);
}

.social-icons a:hover,
.social-icons a:focus,
.social-icons a:active {
    color: inherit;
    border-bottom: none;
    text-decoration: none;
}

.inline-svg {
    display: inline-block;
    height: 1.15rem;
    width: 1.15rem;
    top: 0.15rem;
    position: relative;
}


/* Pages */
main h1 {
    margin-top: 1em;
    font-weight: normal;
    line-height: 1.1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.post-card {
    border: 1px solid var(--card-border-color) !important;
    border-radius: 0.5em;
    padding: 0em 1em 1em 1em;
    background: var(--card-color);
}

article:not(:last-of-type) {
    margin-bottom: var(--card-margin);
}

.post-short-list:first-of-type {
    margin-top: 1em;
}

.post-short-list img {
    max-width: 100%;
    display: block;
    height: auto;
    margin: 0 auto .5em;
}

.post-short-list video {
    max-width: 100%;
    display: block;
    height: auto;
    margin: 0 auto .5em;
}

/* Articles */

.post-header {
    margin-top: 1em;
    line-height: 1.1em;
    margin-bottom: 1em;
}

.post-header header {
    display: inline;
}

.post-navigation {
    background: var(--nav-bg-color);
    text-align: center;
    margin-top: 1em;
    max-width: 100%;
    padding: 0.5em 0;
}

.post-navigation a:first-of-type {
    margin-left: 0;
}

.post-navigation a {
    color: var(--nav-link-color);
    margin-left: 2em;
}

.post-navigation a:hover,
.post-navigation a:focus,
.post-navigation a:active {
    color: var(--link-state-color);
}

.post-list {
    border: #777;
}

.post-short-list .post-title {
    display: inline;
}

.post-title.favorite::after {
    content: "🌟";
    display: inline-block;
    margin-left: 0.2em;
}

.post-title.draft::after {
    content: "✏️";
    display: inline-block;
    margin-left: 0.2em;
}

.post-title.favorite.draft::after {
    content: "🌟 ✏️";
    display: inline-block;
    margin-left: 0.2em;
}

/* article:not(:last-of-type) {
    border-bottom: thin solid var(--hr-color);
    padding-bottom: 2em;
} */

article header h1 {
    font-size: 1.35em;
    line-height: 1.1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    display: inline;
}

article header h1 a {
    color: var(--font-color);
    border: none;
    text-decoration: none;
}

.post h1,
.post h2,
.post h3,
.post h4,
.post h5,
.post h6 {
    position: relative;
}

.post h1 a,
.post h2 a,
.post h3 a,
.post h4 a,
.post h5 a,
.post h6 a {
    opacity: 1;
    border-bottom: none;
}

.post h1:hover a,
.post h2:hover a,
.post h3:hover a,
.post h4:hover a,
.post h5:hover a,
.post h6:hover a {
    opacity: 1;
    border-bottom: none;
}

.post h1 a:hover,
.post h1 a:focus,
.post h1 a:active,
.post h2 a:hover,
.post h2 a:focus,
.post h2 a:active,
.post h3 a:hover,
.post h3 a:focus,
.post h3 a:active,
.post h4 a:hover,
.post h4 a:focus,
.post h4 a:active,
.post h5 a:hover,
.post h5 a:focus,
.post h5 a:active,
.post h6 a:hover,
.post h6 a:focus,
.post h6 a:active {
    border-bottom: none;
}

.post h1 svg,
.post h2 svg,
.post h3 svg,
.post h4 svg,
.post h5 svg,
.post h6 svg {
    stroke: var(--svg-color);
}

.post h1 svg:hover,
.post h1 svg:focus,
.post h1 svg:active,
.post h2 svg:hover,
.post h2 svg:focus,
.post h2 svg:active,
.post h3 svg:hover,
.post h3 svg:focus,
.post h3 svg:active,
.post h4 svg:hover,
.post h4 svg:focus,
.post h4 svg:active,
.post h5 svg:hover,
.post h5 svg:focus,
.post h5 svg:active,
.post h6 svg:hover,
.post h6 svg:focus,
.post h6 svg:active {
    stroke: var(--svg-state-color);
}

.post-list .post-info {
    color: var(--post-info-color);
    font-size: 0.75em;
    margin-top: 1em;
    margin-bottom: 1em;
    display: block;
    gap: 1em;
}

.post-info {
    color: var(--post-info-color);
    font-size: 0.75em;
    margin-top: 1em;
    margin-bottom: 1em;
    display: flex;
    gap: 1em;
}

.post-info a {
    color: var(--post-info-color);
}

.post-info a:hover {
    color: var(--link-state-color);
}

.post-short-list .post-info {
    margin-top: 0;
    margin-bottom: 1.5em;
}

.post-taxonomies {
    display: inline;
}

.post-hidden-url {
    display: none;
}

.post-hidden-author {
    display: none;
}

.post-date {
    white-space: nowrap;
}

.post-categories {
    display: inline;
    list-style-type: none;
    padding: 0;
}

.post-categories li {
    display: inline;
    margin-right: 1em;
}

.post-tags {
    display: inline;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.post-tags li {
    display: inline;
    margin-right: 1em;
}

.post-authors {
    display: inline;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.post-authors li {
    display: inline;
    margin-right: 1em;
}

article img {
    max-width: 100%;
    display: block;
    height: auto;
    margin: 0 auto .5em;
}

article figcaption {
    color: grey;
    text-align: center;
    font-size: 0.85em;
    margin-bottom: 2em;
}

article video {
    max-width: 100%;
    display: block;
    height: auto;
    margin: 0 auto .5em;
}

code.has-jax {
    -webkit-font-smoothing: antialiased;
    background: inherit !important;
    border: none !important;
    font-size: 100%;
}

.read-more {
    margin: 1em 0;
}

.divider {
    border-top: thin solid var(--hr-color);
    display: block;
    height: 1px;
    border: 0;
    width: 25%;
    margin: 1em auto;
}

.post-summary {
    margin-top: 0.5em;
    display: block;
}

.post-summary>p {
    display: block;
}

.post-translations {
    margin-left: 0.5em;
    list-style: none;
    padding: 0;
    display: inline;
    font-size: 14px;
}

.post-translations>li {
    display: inline;
}

.post-translations>li:not(:last-child)::after {
    content: "|";
    display: inline-block;
    margin-left: 4px;
    margin-right: 4px;
}

.post-translations>li a {
    color: var(--link-color);
}

.post-translations>li a:hover,
.post-translations>li a:focus {
    color: var(--link-state-color);
}

.read-next-title {
    margin-bottom: 0;
    margin-top: 3em;
    padding-top: 1em;
    border-top: 1px dashed var(--thead-bg-color);
}

.read-next-posts {
    margin-top: 5px;
    list-style-type: "- ";
    padding-inline-start: 20px;
}

/* Other pages */
.terms {
    list-style-type: none;
    padding: 0;
    line-height: 2em;
}

/* Pagination */

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 3em;
    text-align: center;
    clear: both;
}

.pagination-item {
    border: 1px solid var(--pagination-border-color);
    border-radius: var(--pagination-border-radius);
    background: var(--pagination-bg-color);
    padding: 0.25em 0.75em;
}

.pagination-item a {
    color: var(--pagination-link-color);
}

.pagination-item a:hover,
.pagination-item a:focus {
    color: var(--link-state-color);
}

.disabled {
    visibility: hidden;
}

.pagination-item a:hover,
.pagination-item a:focus {
    border-bottom: 0;
}

.post-pagination .pagination-item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 16em;
}

/* Footer */

.common-footer {
    padding-top: 1.5em;
    margin-top: 3em;
    font-size: 12px;
    margin-bottom: 1.5em;
    color: var(--pagination-link-color);
}

.common-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

ul.language-select,
ul.footer-menu {
    padding-left: 0;
    list-style: none;
    display: flex;
}

ul.language-select>li,
ul.footer-menu>li {
    margin-right: 1em;
}

.theme-switcher {
    color: var(--switcher-color);
    /* padding: 0.5em 1em; */
    margin: var(--icon-margin-top) 0 0 var(--icon-margin-left);
    cursor: pointer;
}

.h-card {
    display: none;
}

/* Copy code  */
.highlight {
    position: relative;
    overflow: hidden;
}

.highlight:hover .highlight-copy-btn {
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.5);
}

.highlight-copy-btn {
    display: none;
    position: absolute;
    top: 0px;
    right: 0px;
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    padding: 1px;
    font-size: 0.7em;
    line-height: 1.8;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    min-width: 22px;
    text-align: center;
    transition: border 0.3s;
    transition: background-color 0.3s;
}

.highlight-copy-btn:hover {
    transition-duration: .1s;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.highlight-copy-btn,
.highlight-copy-btn svg {
    vertical-align: middle;
    margin: 8px;
}

/* Others */
.noselect {
    -webkit-touch-callout: none;
    /* iOS Safari */
    -webkit-user-select: none;
    /* Safari */
    -khtml-user-select: none;
    /* Konqueror HTML */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* Internet Explorer/Edge */
    user-select: none;
    /* Non-prefixed version, currently
                                    supported by Chrome and Opera */
}

.button {
	max-width: 100%;
	display: inline;
	width: 88px;
	height: 31px;
	margin: 0 auto -0.6em;
	image-rendering: pixelated;
	position: relative;
	bottom: 2px;
	right: 2px;
	box-shadow: 4px 4px var(--page-bg-color);
	margin-top: 10px;
}

.button:hover {
	bottom: 0px;
	right: 0px;
	box-shadow: 2px 2px var(--page-bg-color);
}

.cord {
	position: absolute;
	z-index: 1;
	top: -50px;
	right: 150px;
	border: 0px;
	background-color: transparent;
}

.pulled {
	animation-name: pull;
	animation-duration: 0.2s;
	animation-timing-function: ease;
}

.post-poster {
    margin: 0em 1em 1em 1em;
    float: right;
    max-width: 30%;
    max-height: 80vh;
    box-shadow: 8px 8px var(--page-bg-color);
    background: var(--card-color);
    padding: 8px;
}

@keyframes pull {
	from {
	    top: -50px;
	}
	50% {        
	    top:0;
	}
	to {
	    top: -50px;
	}
}

/* Media Queries */

@media (max-width: 840px) {
    .main-wrapper {
        margin: 0;
        max-width: none;
        overflow-x: hidden;
        padding-left: 25px;
        padding-right: 25px;
    }

    .container {
        max-width: 90%;
        margin: 0 auto;
        word-wrap: break-word;
    }

    .pagination-item {
        padding: 0.5em 0.5em;
        font-size: 14px;
    }

    .post-navigation {
        background: var(--pagination-bg-color);
        text-align: center;
        padding: 0.5em 0;
    }

    .post-navigation a {
        margin-left: 0.5em;
    }

    .post-pagination .pagination-item {
        max-width: 10em;
    }

	.pattern {
		animation: none;
	}

}

@media (max-width: 1300px) {
	.common-header {
		padding-right: 32px;
	}
	
    .cord {
    	top: -100px;
    	right: 10px;
    }
}

.warning-tape {
  background-image: repeating-linear-gradient(
    45deg,
    var(--font-color),
    var(--font-color) 25px,
    var(--bg-color) 25px,
    var(--bg-color) 50px
  );
  background-size: 71px 50px;
  font-weight: bold;
  color: var(--font-color);
  text-align: center;
  display: flex;
  justify-content:center;
  
  border-bottom: 0px solid var(--font-color);
  border-top: 0px solid var(--font-color);  
  animation: move-stripes 1s infinite;
  animation-timing-function: linear;
  margin: 0px -20px auto -20px;
}  
@keyframes move-stripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 71px 0px;
  }
}

.password-tape {
  background-image: repeating-linear-gradient(
    45deg,
    var(--font-color),
    var(--font-color) 25px,
    var(--bg-color) 25px,
    var(--bg-color) 50px
  );
  background-size: 71px 50px;
  font-weight: bold;
  color: var(--font-color);
  text-align: center;
  display: flex;
  justify-content:center;
  
  border-bottom: 0px solid var(--font-color);
  border-top: 0px solid var(--font-color);  
  animation: move-stripes-1 1s infinite;
  animation-timing-function: linear;
  margin: 0px -20px auto -20px;
}  


@keyframes move-stripes-1 {
  0% {
    background-position: 71px 0;
  }
  100% {
    background-position: 0 0;
  }
}

figure.polaroid {
	/* border: 3px var(--card-border-color) solid; */
	background: var(--card-color); 
	padding: 10px;
	max-width: fit-content;
	margin: auto;
	box-shadow: 8px 8px var(--page-bg-color);
	display: inline-block;
	position: relative;
	margin: 8px;
}

figure.polaroid:hover {
	bottom: -4px;
	right: -4px;
	box-shadow: 4px 4px var(--page-bg-color);
}

figcaption.polaroid {
	color: var(--post-info-color);
	text-align: center;
	font-size: 0.85em;
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}

#splash {
	text-align: center;
	color: var(--link-color);
	text-shadow: 1px 1px 0px var(--bg-color);
	font-weight: bold;
	position: relative;
	left: 115px;
	bottom: 22px;
	rotate: -8deg;
	margin-bottom: -1.8em;
	animation: subtitle 2s;
	animation-direction: alternate;
	animation-iteration-count: infinite;
	line-height: 1;
}

.iine-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--link-color);

    .icon {
        display: inline-flex;
        align-items: center;
    }

    &:focus {
    	color: inherit;
    }
}

.iine-button.clicked {
    border-color: var(--link-state-color);
    background: transparent;
    color: var(--link-state-color);
}

@-webkit-keyframes subtitle{
	0% {
		transform: scale(0.975);
		}
	100% {
		transform: scale(1);
		}
}

@media print{
	body{
		background: none;
	}

	.container{
		border: none;
	}
	
	.banner {
		filter:	none;
	}

	figure.polaroid {
		border: 3px var(--card-border-color) solid;
		background: lightgray;
		width: 50%;
		padding: 10px;
		max-width: fit-content;
		margin: auto;
		box-shadow: 8px 8px var(--page-bg-color);
		display: inline-block;
		position: relative;
		margin-top: 15px;
	}
			
	aside,
	details,
	/* figcaption, */
	/* figure, */
	footer,
	/* header, */
	.common-header,
	/* hgroup, */
	.pattern,
	.vignette,
	.warning-tape,
	menu,
	nav,
	footer,
	.no-print,
	.read-next-title,
	section{
		display: none !important;
	}

	
}
