@charset "utf-8";
/* CSS Document */

@view-transition {
    navigation: auto;
}

/* main */
main {
	display: flex;
}

@media screen and (max-width:980px){
main {
	display: block;
	}
}

/* article */
article {
	width: calc(97% - 191px);
	flex: 1;
	text-align:center;

	&:has(.charalist):has(input:checked){
		height: 825px;
	}
}

article h1:nth-of-type(2) {
	margin-block: 20px 1em;
}

/* section */

section.chara {
	--shc: 0 0 0;
	opacity: 0;
	height: 600px;
	max-width: 800px;
	margin-inline: auto;
	display: grid;
	visibility: hidden;
	gap: 0.8em 0;
	grid-template-rows: 6em 3em 200px 100px 1fr;
	grid-template-columns: 1fr 275px;
	place-content: center;
	position: relative;
	overflow: hidden;
	transition: 0s;
	font-family: 'Kaisei Opti';

	h1 {
		grid-area: 1 / 1;
		margin-top: 1.3em;
		font: 2.2em "Aoboshi One";
	}

	h2 {
		grid-area: 2 / 1;
		height: fit-content;
	}

	.img_cs {
		--sch: attr(id);
		height: 500px;
		object-fit: cover;
		width: initial;
		filter: drop-shadow(20px -5px 0.5px rgb(var(--shc) /.5));
		inset: 0;
		margin: auto auto 0;
		user-select: none;
		webkit-user-select: none;
	}

	.cutin {
		width: 100%;
		height: 200px;
		object-fit: cover;
		grid-row: 3;
		grid-column: 1 / 3;
	}


	.capt {
		grid-column: 1;
		margin: 0;
	}

	.img_thumb {
		grid-row: 1;
		grid-column: 2;
		appearance: none;
		-webkit-appearance: none;
		height: 2.8em;
		aspect-ratio: 1 / 1;
		background-color: transparent;
		border:none;
		margin: -1.3em -0.05em auto auto;

	}
}

.ham_o {
	cursor: pointer;
	grid-row: 1;
	grid-column: 2;
	justify-self: end;
	width: 2.6em;
	aspect-ratio: 1 / 1;
	z-index: 1;
	transition: .3s;

	&::before,
	&::after {
		content: '';
		display: block;
		height: 0.2em;
		width: 2.6em;
		border-radius: 3px;
		background: #333;
		position: absolute;
		margin-top: 2em;
	}

	&::before {
		rotate: 45deg;
	}

	&::after {
		rotate: -45deg;
	}

	&:hover {
		scale: 1.1;
	}
}

[class^="trig_"] {
	cursor: pointer;
	background-color: #333;
	display: block;
	height: 50px;
	width: 30px;
	position: absolute;
	inset: 0;
	margin: auto;
	z-index: 2;
	transition: .3s;
}

.trig_left {
	clip-path: polygon(100% 0, 0 50%, 100% 100%);
	margin-left: 0.2em;
	
	&:hover {
		transform:translateX(-0.2em);
		filter: brightness(2);
	}

}

.trig_right {
	clip-path: polygon(0 0, 0 100%, 100% 50%);
	margin-right: 0.2em;

	&:hover {
		transform:translateX(0.2em);
		filter: brightness(2);
	}

}

@media screen and (min-width: 1920px){
section.chara {
	overflow: initial;
	}

	.trig_left {
	margin-left: -5em;
	}

	.trig_right {
	margin-right: -5em;
	}
}

@media screen and (max-width:980px){
section.chara {
		height: 700px;

		h1 {
			font-size: 1.3em;
		}

		h2 {
			font-size: 1.2em;
		}

		.img_cs {
			height: 600px;
		}
	}

.ham_o {

	& span::before,
	& span::after {
		margin: 1em 0 0 -3em;
		}
	}
}

article:has(.charalist):has(input:checked) section.chara {
	visibility: initial;
	opacity: 1;
	transition: 1s;
	/*animation: opa 1s both;*/
	margin-top: 0;

	.cutin {
		animation: slidin 2s;
	}

	.img_cs {
		animation: slidin2 2s both;
	}
}

.changeanm {
	animation: chang3 1s;
}

@keyframes chang3 {
	from {
		transform: rotateY(360deg);
		filter: contrast(0) brightness(2) drop-shadow(0 0 0 rgb(var(--shc) /.0));
	}

	to {
		transform: none;
		filter: contrast(1) brightness(1) drop-shadow(20px -5px 0.5px rgb(var(--shc) /.5));
	}
}

@keyframes slidin2 {
	from {
		transform: translateY(100px) rotateX(30deg) rotateY(360deg);
		filter: contrast(0) brightness(2) drop-shadow(0px 80px 20px rgb(var(--shc) /.0));
	}

	to {
		transform: none;
		filter: contrast(1) brightness(1) drop-shadow(20px -5px 0.5px rgb(var(--shc) /.5));
	}
}

@keyframes slidin {
	0% {
		transform: translateX(-500px);
	}

	50% {
		transform: translateX(5px);
	}

	100% {
		transform: translateX(0px);
	}
}

@keyframes opa {
	50% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}
}

.charalist {
	margin-top: calc(-600px);
	transition: 0s;

	div label {
		width: 100%;
		display: grid;
		grid-template-columns: auto 1fr;
		grid-template-rows: auto 1fr; 

		.img_c {
			 grid-area: 1 / 1 / 3 / 2;
		}

		h3 {
			 grid-area: 1 / 2 / 2 / 3;
		}

		p {
			grid-area: 2 / 2 / 3 / 3;
		}
	}

	&:has(div input:checked) {
		margin-top: 0;
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		flex-wrap: initial;
		transition: 1s;
		/*animation: slide 1s both;*/

		div, label {
			border-radius: 10px;
			scroll-snap-align: center;
			text-align: center;
			display: initial;

			p {
				display:none;
			}

			.img_c {
				margin-inline: 1.5em;
			}
		}
	}

	input {
		display: none;
	}

	label {
		width: 45%;
		margin: 0;
		cursor: pointer;
	}
}

@media screen and (max-width:980px){
.charalist {
		margin-top: -700px;
		}
}

@keyframes slide {
	from {
		transform: translateY(-600px);
	}
	to {
		transform: translateY(0px);
	}
}

h1 {
	width: 100%;
	color: #0d0015;
	letter-spacing: -0.5px;
	border: none;
	margin: 5px 0;
	float: none;
	text-align: center;

	&:first-of-type::before{
		display: none;
	}
}


h2 {
	width: 100%;
	font-weight: bold;
	font-size: 1.4em;
	line-height: 1;
	margin: 0 0 10px;
	color: #556;
	border-bottom: 1px solid #b0c4de;
	text-align: center;
}

@media screen and (max-width: 980px){
h2 {
	margin: 0 0 1.5em;
     }
}

h3 {
	color: #555;
}

h4{
	width: 100%;
	font-size: 1.04em;
	font-weight: bold;
	margin: 0;
	float: left;
}

rt{
	font-size: 45%;
	letter-spacing: -1px;
}

/* aside */
aside {
	width: 150px;
	height: 100%;
	margin:20px 0 20px 20px;
	padding: 10px;
	border: 1px solid #666;
	text-align:left;

	& h1{
		font-size: 16px;
		margin-top: 5px;
		border-bottom: 1px solid #b0c4de;
		-webkit-text-size-adjust: 110%;
		text-align: left;
	}
}

@media screen and (max-width:980px){
aside {
	width: 100%;
	margin: 0 0 1% 1%;
	padding: 0.7em 0 0;
	top: 0;
	background: #FFF;
	border: 0;
	text-align: center;
	font-size: 1.3em;

	& label {
		display: inline;
	}
	}
}

/* div */
.relat {
	grid-row: 4;
	grid-column: 1 / 2;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	margin-inline: auto;
	width: 70%;

	& label {
		width: fit-content;
		height: initial;
		margin: 0;
	}

	& div {
		text-align: center;

		&:not(div:only-of-type){
		aspect-ratio: 1/1;
		}

		& a {
			text-decoration: none;
			color: #666;

			& h3 {
				text-decoration: initial;
				color: initial;
			}
		}
	}
}

@media screen and (max-width: 980px){
.relat {
	width: 100%;

	& div h3 {
		letter-spacing: -0.1em;
    		}
	}
}

.charalist div {

	&:hover {
		opacity: .7;
		transition: .3s;
	}

	&:has(:checked){
		background-color: #EEE;
		transition: .3s;
	}
}

aside:has(#king:checked) ~ article .charalist div:not(.king),
aside:has(#prince:checked) ~ article .charalist div:not(.prince),
aside:has(#duke:checked) ~ article .charalist div:not(.duke),
aside:has(#marquis:checked) ~ article .charalist div:not(.marquis),
aside:has(#earl:checked) ~ article .charalist div:not(.earl),
aside:has(#president:checked) ~ article .charalist div:not(.president):not(.knight),
.line,.caption {
		display: none;
}

/* p */
p.chara {
	overflow: visible;
	min-width: 200px;
	max-width: 100%;
	grid-area: 1 / 2 / 6;
	align-self: end;
}

p.m0 {
	margin: 0;
}

p.summon {
	margin-top: -60px;
	text-align: center;
}

/* img */
.img_c {
	width: 100px;
	aspect-ratio: 2 / 3;
	object-fit: cover;
}

.img_li {
	width: 100px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	object-position:50% 0%;
	opacity: 1;
	-webkit-transition: .5s ease-in-out;
	transition: .5s ease-in-out;
	user-select: none;
	webkit-user-select: none;

	&:hover {
		opacity: 0.7;
	}
}

.noimg {
	object-position: center;
}

.magcir {
	width: 500px;
	height: 50px;
	inset: 0;
	margin: auto auto 0;
	z-index: 1;
	user-select: none;
	webkit-user-select: none;
}

button {
	width: 10%;
	height: 3%;
	margin: 20px auto;
	border-radius: 10px;
}

input[name="fash"] {
		text-align: center;
	}

/* a */
.chlk {
	cursor: pointer;
	z-index: 2;
}