@import url("https://fonts.googleapis.com/css2?family=Cabin&family=Major+Mono+Display&family=Tinos:ital,wght@0,400;0,700;1,400;1,700&display=swap");

/* Theme variables for article pages */
:root {
	--article-bg-color: #fdfefe;
	--article-text-color: #393232;
	--article-box-color: #c0c0c0;
	--article-border-light: #eee;
	--article-border-dark: #444;
	--article-heading-shadow-light: #eee;
	--article-heading-shadow-dark: #444;
}

[data-theme="dark"] {
	--article-bg-color: #1a1a1a;
	--article-text-color: #00ff00;
	--article-box-color: #2a2a2a;
	--article-border-light: #003300;
	--article-border-dark: #00ff00;
	--article-heading-shadow-light: #003300;
	--article-heading-shadow-dark: #00ff00;
}

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

body {
	font-family: "Cabin", serif;
	letter-spacing: 0.025em;
	line-height: 1.5;
	min-height: 100vh;
	color: var(--article-text-color);
	background-color: var(--article-bg-color);
	transition: background-color 0.3s ease, color 0.3s ease;
}

img {
	display: block;
	max-width: 100%;
}

article {
	width: 90%;
	max-width: 850px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 10vh;
	margin-bottom: 10vh;
	padding: 2em;
	background-color: var(--article-box-color);
	border-left: 2px solid var(--article-border-light);
	border-top: 2px solid var(--article-border-light);
	border-right: 2px solid var(--article-border-dark);
	border-bottom: 2px solid var(--article-border-dark);
	font-size: 1rem;
	position: relative;
	transition: background-color 0.3s ease, border-color 0.3s ease;
	& > * + * {
		margin-top: 1.25em;
	}

	&:after {
		content: "x";
		display: flex;
		align-items: center;
		justify-content: center;
		line-height: 1;
		padding-bottom: 0.25em;
		position: absolute;
		top: 0.75em;
		right: 0.75em;
		width: 1.75em;
		height: 1.75em;
		background-color: var(--article-box-color);
		border-left: 2px solid var(--article-border-light);
		border-top: 2px solid var(--article-border-light);
		border-right: 2px solid var(--article-border-dark);
		border-bottom: 2px solid var(--article-border-dark);
		transition: background-color 0.3s ease, border-color 0.3s ease;
	}
}

.headline {
	font-size: 2.5em;
	font-weight: 700;
}

.subhead {
	font-size: 1.25em;
	margin-top: 0.25em;
}

.article-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;

	svg {
		width: 3em;
		height: 3em;
		flex-shrink: 0;
	}

	div:first-of-type {
		margin-left: 0.75em;
		font-size: 0.875em;
		margin-right: auto;
		padding-right: 0.75em;
	}

	div:last-of-type {
		font-size: 0.875em;
	}
}

aside {
	padding: .1em;
	border-right: 5px solid var(--article-border-light);
	border-bottom: 1px solid var(--article-border-light);
	border-left: 1px solid var(--article-border-dark);
	border-top: 1px solid var(--article-border-dark);
	clear: both;
	transition: border-color 0.3s ease;
}

.tag {
	display: inline-block;
	margin-right: 0.5em;
	border-right: 1px solid var(--article-border-light);
	border-bottom: 1px solid var(--article-border-light);
	border-left: 1px solid var(--article-border-dark);
	border-top: 1px solid var(--article-border-dark);
	padding: 0.125em 0.375em;
	transition: border-color 0.3s ease;
}

h2:not(.subhead) {
	font-size: 1.5em;
	font-weight: 700;
	padding-bottom: 0.375em;
	box-shadow: 0 1px 0 0 var(--article-border-dark), 0 2px 0 0 var(--article-border-light);
	transition: box-shadow 0.3s ease;
}

figure {
	background-color: var(--article-box-color);
	box-shadow: 0 0 0 1px var(--article-border-light), 0 0 0 2px var(--article-box-color), 0 0 0 3px var(--article-border-dark);
	position: relative;
	margin-bottom: 1.25em;
	width: calc(100% + 1.5em + 2em);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	@media (min-width: 800px) {
		max-width: 50%;
	}
	&:nth-of-type(odd) {
		float: left;
		margin-right: 1.5em;
		margin-left: -3em;
	}

	&:nth-of-type(even) {
		float: right;
		margin-left: 1.5em;
		margin-right: -3em;
	}

	&:after {
		content: "";
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: block;
		position: absolute;
		background-image: linear-gradient(
				to top,
				rgba(#ff9100, 0.2) 0%,
				rgba(#ffe630, 0.2) 60%
			),
			linear-gradient(20deg, rgba(#ff0, 0.5) 0%, rgba(#ff0, 0) 35%);
		box-shadow: inset 0px 0px 100px rgba(0, 0, 20, 1);
		z-index: 1;
	}

	img {
		// opacity: 0;
		// filter: hue-rotate(90deg);
		// filter: sepia(20%) brightness(10%) contrast(130%)
	}
	figcaption {
		font-family: "DotGothic16", monospace;
		background-color: #8795e8;
		box-shadow: inset 0 -1px 0 0 #020202;
		color: #eee;
		text-align: center;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		padding: 0.25em;
		font-size: 0.875em;
		z-index: 2;
	}
}

 .center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  cursor: pointer;
}

.theme-toggle input[type="checkbox"] {
  display: none;
}

.theme-toggle label {
  display: block;
  width: 60px;
  height: 30px;
  background-color: var(--article-border-dark);
  border-radius: 15px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: 2px solid var(--article-border-dark);
}

.theme-toggle label::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.theme-toggle input[type="checkbox"]:checked + label {
  background-color: #00ff00;
}

.theme-toggle input[type="checkbox"]:checked + label::after {
  transform: translateX(30px);
  background-color: #1a1a1a;
}

/* Sun and Moon icons - using Unicode characters instead of emojis */
.theme-toggle label::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  z-index: 1;
  transition: opacity 0.3s ease;
  color: #ffd700;
}

.theme-toggle input[type="checkbox"]:checked + label::before {
  content: '';
  left: auto;
  right: 8px;
  color: #ffffff;
}

@media screen and (max-width: 768px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
    }
    
    .theme-toggle label {
        width: 50px;
        height: 25px;
    }
    
    .theme-toggle label::after {
        width: 17px;
        height: 17px;
        top: 2px;
        left: 2px;
    }
    
    .theme-toggle input[type="checkbox"]:checked + label::after {
        transform: translateX(25px);
    }
    
    .theme-toggle label::before {
        font-size: 14px;
        left: 6px;
    }
    
    .theme-toggle input[type="checkbox"]:checked + label::before {
        right: 6px;
    }
}