/**
 * Post Grid (Section) widget.
 * Section header (title + explore link) over a divider, then a card grid:
 * rounded image, serif title, clamped excerpt, read-more link.
 */

.fpg-pg {
	width: 100%;
}

/* -- Section header ------------------------------------------------------- */
.fpg-pg__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	margin-bottom: 32px;
}

.fpg-pg__title {
	margin: 0;
	font-family: Georgia, "Times New Roman", "Playfair Display", serif;
	font-weight: 700;
	font-size: 34px;
	line-height: 1.1;
	color: #1a1a1a;
}

.fpg-pg__explore {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 15px;
	line-height: 1;
	color: #1a1a1a;
	text-decoration: none;
}

.fpg-pg__explore svg {
	width: 16px;
	height: 16px;
	flex: none;
}

/* -- Grid ----------------------------------------------------------------- */
.fpg-pg__grid {
	--fpg-pg-columns: 4;
	--fpg-pg-radius: 18px;
	display: grid;
	grid-template-columns: repeat(var(--fpg-pg-columns), minmax(0, 1fr));
	column-gap: 28px;
	row-gap: 40px;
}

.fpg-pg__card {
	display: flex;
	flex-direction: column;
}

/* Rounded thumbnail. The photo is a background layer (.fpg-pg__img), not an
   <img>, so the container's rounded corners stay crisp while it zooms on hover
   -- an <img> composites separately and clips with jagged / stair-stepped edges. */
.fpg-pg__thumb {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: var(--fpg-pg-radius, 18px);
	aspect-ratio: 1 / 1;
	margin-bottom: 18px;
	background-color: #e6e2d8;
	/* Promote to its own layer so the rounded clip is anti-aliased while the
	   inner layer zooms on hover (prevents jagged / stair-stepped corners). */
	transform: translateZ(0);
}

.fpg-pg__img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	border-radius: inherit; /* scaling layer follows the same corner shape */
	transition: transform 0.6s ease;
	will-change: transform;
}

.fpg-pg-zoom-yes .fpg-pg__card:hover .fpg-pg__img {
	transform: scale(1.05);
}

/* Alternating squared bottom corner by card position; all other corners keep
   the base radius:
     - odd cards  (1, 3, 5 ...): bottom-right squared
     - even cards (2, 4, 6 ...): bottom-left squared */
.fpg-pg-sqbottom-yes .fpg-pg__card:nth-child(odd) .fpg-pg__thumb {
	border-bottom-right-radius: 0;
}

.fpg-pg-sqbottom-yes .fpg-pg__card:nth-child(even) .fpg-pg__thumb {
	border-bottom-left-radius: 0;
}

/* Card title */
.fpg-pg__card-title {
	margin: 0 0 10px;
	font-family: Georgia, "Times New Roman", "Playfair Display", serif;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.28;
	color: #1a1a1a;
}

.fpg-pg__card-title a {
	color: inherit;
	text-decoration: none;
}

.fpg-pg__card-title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Excerpt (clamped to N lines) */
.fpg-pg__excerpt {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.6;
	color: #6f6f6f;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Read more */
.fpg-pg__readmore {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: auto;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #1a1a1a;
	text-decoration: none;
}

.fpg-pg__readmore svg {
	width: 13px;
	height: 13px;
	flex: none;
	color: #b07a3c;
	transition: transform 0.25s ease;
}

.fpg-pg__readmore:hover svg {
	transform: translate(2px, -2px);
}

.fpg-pg__empty {
	padding: 24px;
	text-align: center;
	color: #777;
	border: 1px dashed #ccc;
	border-radius: 8px;
}

/* -- Responsive ----------------------------------------------------------- */

/* Tablet */
@media (max-width: 1024px) {
	.fpg-pg__title {
		font-size: 28px;
	}
}

/* Mobile: stack the header */
@media (max-width: 767px) {
	.fpg-pg__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
}
