/**
 * Post Carousel styles
 * File location: /assets/css/post-carousel.css
 *
 * Written as plain CSS in a Tailwind-style utility naming convention
 * (pc- prefix avoids clashing with any theme/plugin classes).
 * If this theme already compiles Tailwind, these rules can instead be
 * moved into your Tailwind source file as @apply groups.
 */

:root {
	--pc-maroon: #6b1f2a;
	--pc-cream: #f4eedb;
	--pc-text: #2c2621;
	--pc-radius: 1.5rem;
}

.pc-carousel {
	--pc-gap: 2.5rem;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--pc-gap);
	width: 100%;
	max-width: 1400px;
	margin-inline: auto;
	padding-inline: 4rem; /* room for the arrows */
	box-sizing: border-box;
}

/* ---------- Card ---------- */

.pc-card {
	display: grid;
	grid-template-columns: minmax(280px, 45%) 1fr;
	align-items: stretch;
	gap: 3rem;
	width: 100%;
	background-color: var(--pc-cream);
	border-radius: var(--pc-radius);
	overflow: hidden;
	padding: 2.5rem 3rem;
	box-sizing: border-box;
	opacity: 1;
	transition: opacity 0.15s ease-in-out;
}

.pc-card.pc-fade-out {
	opacity: 0;
}

/* ---------- Media (image) ---------- */

.pc-media {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 450px; /* keeps the frame sensible if the excerpt is very short */
	border-radius: var(--pc-radius);
	overflow: hidden;
	background-color: #e4ddc6;
}

.pc-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* ---------- Content ---------- */

.pc-content {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	min-width: 0; /* prevents text overflow in the grid track */
}

.pc-title {
	margin: 0;
	font-family: Georgia, 'Times New Roman', serif;
	font-weight: 700;
	font-size: clamp(1.75rem, 2.5vw + 1rem, 3rem);
	line-height: 1.15;
	color: var(--pc-maroon);
}

.pc-title-link {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.pc-title-link:hover,
.pc-title-link:focus-visible {
	opacity: 0.8;
	text-decoration: underline;
}

.pc-excerpt {
	margin: 0;
	font-size: clamp(0.95rem, 0.5vw + 0.85rem, 1.15rem);
	line-height: 1.6;
	color: var(--pc-text);
}

.pc-readmore {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	width: fit-content;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pc-text);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.pc-readmore:hover,
.pc-readmore:focus-visible {
	color: var(--pc-maroon);
	border-color: var(--pc-maroon);
}

.pc-readmore span {
	transition: transform 0.15s ease;
}

.pc-readmore:hover span {
	transform: translateX(3px);
}

/* ---------- Arrows ---------- */

.pc-arrow {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 9999px;
	background: transparent;
	cursor: pointer;
	padding: 0;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.pc-arrow:hover,
.pc-arrow:focus-visible {
	background-color: rgba(107, 31, 42, 0.08);
	transform: scale(1.05);
}

.pc-arrow-icon {
	width: 100%;
	height: 100%;
	display: block;
}

.pc-empty {
	text-align: center;
	color: var(--pc-text);
	padding: 2rem;
}

/* ============================================================
   Responsive behaviour
   ============================================================ */

/* Tablets — tighten spacing, keep side-by-side layout */
@media (max-width: 1024px) {
	.pc-carousel {
		--pc-gap: 1.25rem;
		padding-inline: 2.5rem;
	}

	.pc-card {
		grid-template-columns: minmax(240px, 42%) 1fr;
		gap: 2rem;
		padding: 2rem;
	}

	.pc-arrow {
		width: 48px;
		height: 48px;
	}
}

/* Small tablets / large phones — stack image above content */
@media (max-width: 768px) {
	.pc-carousel {
		flex-wrap: wrap;
		padding-inline: 1.25rem;
	}

	.pc-card {
		grid-template-columns: 1fr;
		gap: 1.5rem;
		padding: 1.5rem;
		order: 2;
		width: calc(100% - 2 * 64px); /* leave room for the two arrows beside it */
	}

	.pc-media {
		aspect-ratio: 16 / 10;
	}

	.pc-arrow {
		order: 1;
		width: 48px;
		height: 48px;
	}

	.pc-arrow--prev {
		order: 1;
	}

	.pc-arrow--next {
		order: 3;
	}
}

/* Phones — full-width card, arrows move below the content */
@media (max-width: 480px) {
	.pc-carousel {
		flex-direction: column;
		padding-inline: 1rem;
		gap: 1rem;
	}

	.pc-card {
		width: 100%;
		order: 1;
		padding: 1.25rem;
	}

	.pc-media {
		aspect-ratio: 4 / 3;
	}

	.pc-title {
		font-size: 1.5rem;
	}

	.pc-content {
		gap: 1rem;
	}

	/* Arrows become a row centered under the card */
	.pc-arrow--prev,
	.pc-arrow--next {
		order: 2;
	}

	.pc-carousel::after {
		content: '';
		order: 3;
	}
}

@media (max-width: 480px) {
	.pc-carousel {
		flex-direction: column;
	}

	.pc-carousel {
		display: grid;
		grid-template-areas:
			'card'
			'nav';
		gap: 1rem;
	}

	.pc-card {
		grid-area: card;
	}

	.pc-arrow--prev,
	.pc-arrow--next {
		grid-area: nav;
		justify-self: center;
	}

	.pc-arrow--prev {
		justify-self: start;
		margin-left: 1rem;
	}

	.pc-arrow--next {
		justify-self: end;
		margin-right: 1rem;
	}
}
