/* Card grids */
.reviews,
.games,
.authors {
	display: grid;
	gap: var(--s-4);
	margin-top: var(--s-4);
}
.reviews {
	grid-template-columns: 1fr;
} /* full-width review cards */
.games {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.authors {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Card surface */
.review-card,
.game-card,
.author-card,
.review {
	position: relative;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--s-4) var(--s-5);
	box-shadow: var(--shadow-sm);
	transition:
		box-shadow 0.15s ease,
		border-color 0.15s ease,
		transform 0.15s ease;
}
.review-card:hover,
.game-card:hover,
.author-card:hover {
	box-shadow: var(--shadow);
	border-color: var(--border-strong);
}

/* Review card ) */
.review-card {
	display: grid;
	grid-template-columns: 1fr auto auto;
	grid-template-areas:
		"title  edit   delete"
		"byline byline byline"
		"stars  stars  stars"
		"desc   desc   desc";
	column-gap: var(--s-3);
	row-gap: var(--s-2);
	align-items: center;
}
.review-card .review-title {
	grid-area: title;
}
.review-card .edit-button {
	grid-area: edit;
}
.review-card .delete-button {
	grid-area: delete;
}
.review-card sub {
	grid-area: byline;
}
.review-card > div {
	grid-area: stars;
} /* the inline-style stars div */
.review-card .review-description {
	grid-area: desc;
}

.review-title {
	font-size: 1.375rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.25;
	margin: 0;
}
.review-title a {
	color: var(--text);
	text-decoration: none;
}
.review-title a:hover {
	color: var(--accent);
}

.review-description {
	color: var(--text-muted);
	margin: 0;
}

/* Full review  */
.review {
	padding: var(--s-5) var(--s-6);
}
.review .review-title {
	font-size: 1.875rem;
	margin-bottom: var(--s-2);
}
.review .review-description {
	color: var(--text);
	font-size: 1.0625rem;
	line-height: 1.65;
	margin-top: var(--s-4);
}

/* Byline  */
.review-card sub,
.review > sub {
	display: block;
	font-size: 0.875rem;
	color: var(--text-muted);
	margin-top: var(--s-1);
}
.review-card sub a,
.review > sub a {
	color: var(--text);
	text-decoration: none;
	border-bottom: 1px solid var(--border-strong);
}
.review-card sub a:hover,
.review > sub a:hover {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

/* Edit / Delete inline buttons */
.edit-button,
.delete-button {
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	padding: 4px 10px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text);
	line-height: 1.4;
	white-space: nowrap;
}
.edit-button:hover {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent);
}
.delete-button {
	color: var(--danger);
	border-color: color-mix(in oklab, var(--danger), white 60%);
}
.delete-button:hover {
	background: var(--danger-soft);
	border-color: var(--danger);
	color: var(--danger);
}

/* Game card */
.game-card {
	padding: 0; /* figure goes edge-to-edge at the top */
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.game-card figure {
	margin: 0;
	background: var(--surface-alt);
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-bottom: 1px solid var(--border);
}
.game-card figure img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.game-card figure figcaption {
	display: none;
} /* alt text is enough on cards */

.game-card .game-name {
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0;
	padding: var(--s-3) var(--s-4) 0;
	line-height: 1.3;
}
.game-card .game-name a {
	color: var(--text);
	text-decoration: none;
}
.game-card .game-name a:hover {
	color: var(--accent);
}
.game-card .game-rating {
	font-size: 0.875rem;
	color: var(--text-muted);
	padding: var(--s-3) var(--s-4) 0;
}
.game-card > p {
	margin: 0;
	padding: var(--s-2) var(--s-4) var(--s-4);
	font-size: 0.875rem;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: var(--s-2);
}

/* Author card */
.author-card {
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
}
.author-card .author-name {
	font-size: 1.125rem;
	margin: 0;
}
.author-card .author-name a {
	color: var(--text);
	text-decoration: none;
}
.author-card .author-name a:hover {
	color: var(--accent);
}
.author-card > p {
	margin: 0;
	color: var(--text-muted);
	font-size: 0.9375rem;
}

/* Figures inside a full review */
.review figure {
	margin: var(--s-5) 0;
	background: var(--surface-alt);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	overflow: hidden;
}
.review figure img {
	width: 100%;
	height: auto;
	max-height: 520px;
	object-fit: contain;
	background: var(--surface-alt);
}
.review figure figcaption {
	padding: var(--s-2) var(--s-4);
	font-size: 0.875rem;
	color: var(--text-muted);
	text-align: center;
	border-top: 1px solid var(--border);
	background: var(--surface);
}

/* Stars */
/* The PHP renders `<div class="stars">` and inlines SVGs;
   colour the SVGs themselves so they match the warm palette. */
.stars {
	width: 10rem;
	display: flex;
}
.review-card > div svg,
.review > div svg,
.game-card svg {
	width: 20%;
	height: auto;
	color: var(--star); /* SVGs use currentColor for fills */
	fill: currentColor;
}
.game-card > p > div {
	/* stars sit inline beside "Average Rating:" */
	width: 6rem !important;
}
.game-card > p > div svg {
	width: 20%;
}

/* Single review's stars row */
.review > div {
	/* the bare stars wrapper */
	margin-bottom: var(--s-3);
}
