/*
 * RETRO archive. The player is a full-width grid item inserted after the last
 * card of the clicked row, so it lands below that row and later cards flow on.
 */

.retro-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 16px;
}

.retro-jump {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.retro-jump label {
	font-size: 14px;
	color: #555;
}

.retro-jump input {
	width: 90px;
	padding: 4px 6px;
	border: 1px solid #cfcfcf;
	border-radius: 4px;
	font-size: 14px;
}

.retro-jump button,
.retro-sort {
	padding: 5px 12px;
	border: 1px solid #cfcfcf;
	border-radius: 4px;
	background: #f6f6f6;
	color: #333;
	font-size: 14px;
	cursor: pointer;
}

.retro-jump button:hover,
.retro-sort:hover {
	background: #ececec;
}

.retro-sort::before {
	content: "\2195\00a0";
}

.retro-jump-message {
	margin: 0 0 12px;
	color: #be4c46;
	font-size: 14px;
}

.retro-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
	margin: 0 0 18px;
}

@media (max-width: 860px) {
	.retro-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
	.retro-grid { grid-template-columns: 1fr; }
}

.retro-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* A button, so it is keyboard-reachable; reset the theme's button styling. */
.retro-card-thumb {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 4px;
	overflow: hidden;
	background: #1c1c1c;
	line-height: 0;
	cursor: pointer;
	aspect-ratio: 16 / 9;
}

.retro-card-thumb-empty {
	cursor: default;
}

.retro-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .18s ease, opacity .18s ease;
}

.retro-card-thumb:hover img {
	transform: scale(1.03);
	opacity: .85;
}

.retro-card-noimage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #5a5a5a;
	font-size: 22px;
	font-weight: bold;
	letter-spacing: 3px;
	line-height: 1;
}

/* Play triangle, drawn with a border: no image request. */
.retro-card-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 54px;
	height: 54px;
	margin: -27px 0 0 -27px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	transition: background .18s ease;
}

.retro-card-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -10px 0 0 -6px;
	border-style: solid;
	border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent #fff;
}

.retro-card-thumb:hover .retro-card-play {
	background: rgba(190, 76, 70, .9);
}

/* Restricted shows: a padlock in place of the play triangle, drawn the same
   way so it needs no image either. */
.retro-card-lock::after {
	margin: -4px 0 0 -9px;
	width: 18px;
	height: 13px;
	border: 0;
	border-radius: 2px;
	background: #fff;
}

.retro-card-lock::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -12px 0 0 -6px;
	width: 12px;
	height: 10px;
	border: 3px solid #fff;
	border-bottom: 0;
	border-radius: 7px 7px 0 0;
	box-sizing: border-box;
}

/* Sits on the title's own line, so a restricted show is recognisable without
   costing the card a row of its own. */
.retro-card-state {
	font-size: 13px;
	line-height: 1;
	vertical-align: baseline;
}

/* Top left: the thumbnails carry their own title text lower down. */
.retro-card-duration {
	position: absolute;
	left: 6px;
	top: 6px;
	padding: 2px 6px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .75);
	color: #fff;
	font-size: 12px;
	line-height: 1.5;
}

#post-content .retro-card-date {
	margin: 6px 0 0;
	padding: 0;
	color: #8a8a8a;
	font-size: 12px;
	line-height: 1.2;
}

#post-content .retro-card-title {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-size: 15px;
	font-weight: bold;
	line-height: 1.25;
	color: #222;
	text-transform: none;
	letter-spacing: normal;
}

#post-content .retro-card-download {
	margin: 2px 0 0;
	padding: 0;
	font-size: 12px;
	line-height: 1.3;
}

.retro-card-size {
	color: #8a8a8a;
}

/* Spans every column, filling a row of its own above the clicked card. */
.retro-player-row {
	grid-column: 1 / -1;
	margin: 0 0 6px;
}

.retro-player-row video {
	width: 100%;
}

/* Same slot as the player, so a locked card answers a click in place. */
.retro-locked-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 16px;
	border: 1px solid #e3d3d2;
	border-radius: 6px;
	background: #faf3f3;
}

#post-content .retro-locked-text {
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.4;
}

#post-content .retro-locked-login,
#post-content .retro-locked-login:hover,
#post-content .retro-locked-login:visited {
	color: #fff;
}

.retro-locked-login {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 4px;
	background: #5865f2;
	color: #fff;
	font-size: 13px;
	font-weight: bold;
	text-decoration: none;
}

.retro-locked-login:hover {
	background: #4752c4;
	color: #fff;
}

#post-content .retro-notice {
	margin: 0 0 12px;
	padding: 16px;
	border: 1px solid #e3d3d2;
	border-radius: 6px;
	background: #faf3f3;
	font-size: 14px;
	line-height: 1.5;
}

.retro-player-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 6px;
}

#post-content .retro-player-title {
	margin: 0;
	font-size: 16px;
	font-weight: bold;
	color: #222;
}

#post-content .retro-player-resume {
	margin: 0 0 6px;
	font-size: 13px;
	color: #777;
}

.retro-player-restart {
	border: 0;
	background: none;
	color: #be4c46;
	font-size: 13px;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.retro-player-close {
	border: 0;
	background: none;
	color: #be4c46;
	font-size: 14px;
	cursor: pointer;
	padding: 0;
}

.retro-card.is-playing .retro-card-thumb {
	outline: 3px solid #be4c46;
	outline-offset: 2px;
}

.retro-card.is-target .retro-card-thumb {
	animation: retro-flash 1.6s ease-out 1;
}

@keyframes retro-flash {
	0%, 100% { box-shadow: 0 0 0 0 rgba(190, 76, 70, 0); }
	20%      { box-shadow: 0 0 0 6px rgba(190, 76, 70, .55); }
}

.retro-status,
.retro-empty {
	margin: 10px 0;
	color: #8a8a8a;
	font-size: 14px;
	text-align: center;
}
