/* Photos of a recipe comment (Customizations\CommentPhotos): the field of
   the comment form (child style.css "Comment form" styles the card) and the
   photos under a comment. Colours from the brand tokens of the child theme. */

/* Form field */
.yt-comment-form .yt-cf-photos small {
	margin-left: .375rem;
	color: var(--yt-brand-muted, #6b7472);
	font-weight: 400;
}

.yt-comment-form .yt-cf-photos p {
	margin: 0;
	font-size: .875rem;
	line-height: 1.5;
	color: var(--yt-brand-muted, #6b7472);
}

.yt-comment-form .yt-cf-photos--guest a {
	color: var(--gt-theme-primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.yt-comment-form .yt-cf-photo-list {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
}

.yt-comment-form .yt-cf-photos--has .yt-cf-photo-list {
	margin-bottom: .75rem;
}

.yt-comment-form .yt-cf-photo {
	position: relative;
	width: 96px;
	height: 96px;
}

.yt-comment-form .yt-cf-photo img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 14px;
	object-fit: cover;
}

.yt-comment-form .yt-cf-photo-remove {
	position: absolute;
	top: -8px;
	right: -8px;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: #fff;
	border: 1px solid var(--gt-theme-tertiary);
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(22, 42, 40, .18);
	color: var(--yt-brand-green, #162a28);
	font-size: 1.125rem;
	line-height: 1;
	cursor: pointer;
}

.yt-comment-form .yt-cf-photo-remove:is(:hover, :focus-visible) {
	color: var(--gt-theme-primary);
	border-color: var(--gt-theme-primary);
}

/* A current photo of a comment being edited (PendingComments): its "remove"
   checkbox is the × badge; a ticked one is left out until the form is saved. */
.yt-comment-form .yt-cf-photo--current {
	margin: 0;
	cursor: pointer;
}

.yt-comment-form .yt-cf-photo--current input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.yt-comment-form .yt-cf-photo--current:has(input:checked) {
	display: none;
}

.yt-comment-form .yt-cf-photo--current:has(input:focus-visible) .yt-cf-photo-remove {
	outline: 2px solid var(--gt-theme-primary);
	outline-offset: 2px;
}

.yt-comment-form .yt-cf-photo-add {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	margin: 0 0 .5rem;
	padding: .75rem 1.125rem;
	background: var(--yt-surface-page, #fffbf8);
	border: 1px dashed var(--gt-theme-primary);
	border-radius: 14px;
	color: var(--gt-theme-primary);
	font-size: .9375rem;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none; /* Platea writes labels in capitals */
	cursor: pointer;
	transition: background-color .15s;
}

.yt-comment-form .yt-cf-photo-add:hover,
.yt-comment-form .yt-cf-photo-add:focus-within {
	background: var(--yt-surface, #fff2ea);
}

.yt-comment-form .yt-cf-photo-add[hidden] {
	display: none;
}

/* The input stays in the label (keyboard focus, posted without JavaScript),
   visually hidden once the script shows the previews. */
.yt-comment-form .yt-cf-photo-add input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.yt-comment-form .yt-cf-photo-add:has(input:focus-visible) {
	outline: 2px solid var(--gt-theme-primary);
	outline-offset: 2px;
}

.yt-comment-form .yt-cf-photos .yt-cf-photo-error {
	margin-top: .5rem;
	color: #c62828;
	font-weight: 600;
}

/* Under a comment */
.yt-comment-photos {
	display: flex;
	flex-wrap: wrap;
	gap: .625rem;
	margin-top: .875rem;
}

.yt-comment-photos a {
	display: block;
	border-radius: 14px;
	overflow: hidden;
}

.yt-comment-photos img {
	display: block;
	width: 120px;
	height: 120px;
	object-fit: cover;
	transition: transform .2s;
}

.yt-comment-photos a:is(:hover, :focus-visible) img {
	transform: scale(1.04);
}

/* Phones: up to three photos in one row of equal squares. */
@media (max-width: 575.98px) {
	.yt-comment-photos {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		max-width: 360px;
		gap: .5rem;
	}

	.yt-comment-photos img {
		width: 100%;
		height: auto;
		aspect-ratio: 1;
	}
}
