/*********************** TEOS POPUP */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&display=swap');


/* Koko ruudun tumma tausta */

body.teos-open {
	overflow: hidden;
}

#teos-overlay {
	display: flex;
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0);
	z-index: 20000;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.35s ease,
		background 0.35s ease,
		visibility 0.35s;
}


#teos-overlay.open {
	opacity: 1;
	visibility: visible;
	background: rgba(0,0,0,0.8);
}


/* Varsinainen laatikko */

#teos-popup {
	box-sizing: border-box;
	width: 650px;
	max-width: 90%;
	height: 90vh;
	padding: 20px 40px 15px 40px;
	background: #151515;
	border-radius: 20px;
	color: #eee;
	display: flex;
	flex-direction: column;
	opacity: 0;
	transform: translateY(15px);
	transition:
		opacity 0.35s ease,
		transform 0.35s ease;
}

#teos-overlay.open #teos-popup {
	opacity: 1;
	transform: translateY(0);
}


/* Otsikko */

#teos-title {
	flex: 0 0 auto;
	text-align: center;
	font-family: "Cormorant Garamond", serif;
	font-size: 27px;
	margin: 0 0 20px 0;
	padding: 0;
}


/* Kuva-alue */

#teos-image-area {
	flex: 0 0 auto;
	width: calc(100% + 50px);
	margin-left: -25px;
	margin-right: -25px;
	min-height: 0;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}


/* Varsinainen kuva */

#teos-image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	object-fit: contain;
	opacity: 1;
	transition: opacity 0.3s ease;
}

#teos-image.fade {
	opacity: 0;
}


/* Nuolet */

#teos-prev, #teos-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 40px;
	line-height: 1;
	color: rgba(255,255,255,0.6);
	cursor: pointer;
	z-index: 2;
	transition:
		color 0.25s ease,
		opacity 0.25s ease;
	background: rgba(0,0,0,0.6);
	border-radius: 50%;
	width: 42px;
	padding: 4px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
}

#teos-prev {
	left: 12px;
}

#teos-next {
	right: 12px;
}

#teos-prev:hover, #teos-next:hover {
	color: rgba(255,255,255,0.6);
}


/* Pisteet */

#teos-dots {
	flex: 0 0 auto;
	margin: 0;
	padding: 8px 0 0 0;
	text-align: center;
	font-size: 16px;
	letter-spacing: 3px;
	color: #777;
	pointer-events: none;
}


#teos-dots .active {
	color: #eee;
}

#teos-dots span {
	display: inline-block;
	opacity: 0.35;
	transform: scale(0.8);
	transition:
		opacity 0.3s ease,
		transform 0.3s ease;
}


#teos-dots span.active {
	opacity: 1;
	transform: scale(1);
}


/* Pisteiden ja sulkimen väliin jäävä alue */

#teos-description-area {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 10px 0;
}


/* Varsinainen kuvatekstilaatikko */

#teos-description {
	box-sizing: border-box;
	width: 100%;
	max-height: 25vh;
	overflow-y: auto;
	padding: 15px 20px;
	background: #222;
	border-radius: 15px;
	overflow-x: hidden;
	font-size: 13px;
	letter-spacing: 0.07em;
	line-height: calc(auto+5px);
	text-align: left;
}

#teos-description p {
	color: #777;
	font-weight: lighter;
	white-space: nowrap;
	margin: 0 0 -8px 0;
	pading: 0;
}


/* Suljin */

#teos-close {
	flex: 0 0 auto;
	align-self: flex-end;
	width: 35px;
	height: 35px;
	text-align: right;
	font-size: 30px;
	line-height: 35px;
	color: #999;
	cursor: pointer;
}


#teos-close:hover {
	color: #aaa;
}

/* Suurennus */

#teos-zoom {
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 32px;
	height: 32px;
	background: rgba(0,0,0,0.35);
	border-radius: 50%;
	cursor: pointer;
	z-index: 3;
	transition: background 0.25s ease;
}

#teos-zoom:hover {
	background: rgba(0,0,0,0.6);
}

#teos-zoom:before, #teos-zoom:after {
	content: "";
	position: absolute;
	width: 8px;
	height: 8px;
	border-color: rgba(255,255,255,0.7);
	border-style: solid;
	transition: border-color 0.25s ease;
}

#teos-zoom:before {
	left: 7px;
	top: 7px;
	border-width: 2px 0 0 2px;
}

#teos-zoom:after {
	right: 7px;
	bottom: 7px;
	border-width: 0 2px 2px 0;
}

#teos-zoom:hover:before, #teos-zoom:hover:after {
	border-color: #fff;
}

#zoom-overlay {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.95);
	z-index: 30000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.35s ease,
		visibility 0.35s;
}


#zoom-overlay.open {
	opacity: 1;
	visibility: visible;
}

#zoom-image {
	display: block;
	width: auto;
	height: auto;
	max-width: 95vw;
	max-height: 95vh;
	object-fit: contain;
	opacity: 0;
	transform: scale(0.98);
	transition:
		opacity 0.35s ease,
		transform 0.35s ease;
}


#zoom-overlay.open #zoom-image {
	opacity: 1;
	transform: scale(1);
}

#zoom-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	font-size: 30px;
	line-height: 40px;
	text-align: center;
	color: #777;
	cursor: pointer;
	transition: color 0.25s ease;
}


#zoom-close:hover {
	color: #aaa;
}