/* --------------------------------------------------------------------------
 * PadelMap — blog listing (home.php + archive.php).
 * Loaded conditionally by inc/assets.php on blog / category / tag / date
 * / author views.
 *
 * Shares its visual language with the courts card (16px radius, 1px hair-
 * line border, soft hover elevation, chip-style category tag) so a visitor
 * moving between /courts/ and /blog/ recognises the family. Diverges just
 * enough to read as editorial: 16:9 featured image (vs. courts' 3:2),
 * bolder title, no action row — the whole card is the affordance via a
 * stretched title link.
 * ----------------------------------------------------------------------- */

:root {
	/* Redeclared locally so this file can load standalone (courts.css
	   isn't enqueued on blog views). Values match courts.css so both
	   surfaces stay in sync when the design system evolves. */
	--padelmap-blog-radius: 16px;
	--padelmap-blog-border: 1px solid #E5E7EB;
	--padelmap-blog-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
	--padelmap-blog-shadow-lift: 0 4px 12px rgba(15, 23, 42, 0.06), 0 12px 24px rgba(15, 23, 42, 0.10);
}

/* ==== Page shell ======================================================= */

/* `.padelmap-blog` is our class on the outer #primary div. We intentionally
   leave IT un-styled (Kadence's own grid on the site wrapper cancels a
   `margin: 0 auto` set on this level — same reason courts.css centres via
   inner elements). Instead, each direct child section gets its own
   max-width + margin so the whole page reads as one centered column. */

.padelmap-blog > main.site-main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
}

/* ==== Header =========================================================== */

.padelmap-blog__header {
	max-width: 720px;
	margin: 0 0 2.5rem;
}
.padelmap-blog__eyebrow {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--wp--preset--color--padelmap-court, #1F8A3F);
}
.padelmap-blog__title {
	margin: 0 0 0.75rem;
	font-size: clamp(2rem, 3.5vw + 1rem, 2.75rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--padelmap-charcoal, #1A1F2E);
}
.padelmap-blog__lede {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.55;
	color: var(--wp--preset--color--padelmap-slate, #4A5163);
}
.padelmap-blog__lede p {
	/* Some archive descriptions come wrapped in <p>. */
	margin: 0;
}

/* ==== Grid ============================================================= */

.padelmap-blog__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
}
.padelmap-blog__item {
	list-style: none;
	margin: 0;
}

/* ==== Card ============================================================= */

.padelmap-blog__card {
	background: #fff;
	border: var(--padelmap-blog-border);
	border-radius: var(--padelmap-blog-radius);
	overflow: hidden;
	transition: transform 200ms ease, box-shadow 200ms ease;
	box-shadow: var(--padelmap-blog-shadow);
	height: 100%;
}
.padelmap-blog__card:hover,
.padelmap-blog__card:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--padelmap-blog-shadow-lift);
}

/* .card-inner is the positioned container that anchors the stretched
   title link's ::after overlay. Grid layout keeps card heights uniform
   across a row regardless of excerpt length. */
.padelmap-blog__card-inner {
	position: relative;
	display: grid;
	grid-template-rows: auto 1fr;
	height: 100%;
	color: inherit;
}

/* Media — editorial 16:9. Media + body deliberately NOT positioned, so
   the title link's ::after (below) has .card-inner as its containing
   block and stretches over the whole card. */
.padelmap-blog__card-media {
	aspect-ratio: 16 / 9;
	background: linear-gradient(135deg, rgba(31,138,63,0.08), rgba(27,79,138,0.08));
	overflow: hidden;
}
.padelmap-blog__card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 400ms ease;
}
.padelmap-blog__card:hover .padelmap-blog__card-img {
	transform: scale(1.03);
}
.padelmap-blog__card-noimg {
	width: 100%;
	height: 100%;
	background:
		radial-gradient(circle at 30% 30%, rgba(31,138,63,0.16), transparent 60%),
		radial-gradient(circle at 70% 70%, rgba(27,79,138,0.16), transparent 60%),
		#F5F5EF;
}

.padelmap-blog__card-body {
	padding: 1.125rem 1.25rem 1.375rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.padelmap-blog__card-title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
	letter-spacing: -0.005em;
	color: var(--wp--preset--color--padelmap-charcoal, #1A1F2E);
}
.padelmap-blog__card-title-link {
	color: inherit;
	text-decoration: none;
}
.padelmap-blog__card-title-link:hover,
.padelmap-blog__card-title-link:focus-visible {
	color: var(--wp--preset--color--padelmap-court, #1F8A3F);
}
/* Stretched-link overlay — makes the whole card clickable while keeping
   the semantic anchor on the title. Matches the .padelmap-archive__card
   pattern in courts.css exactly, so hover/focus behaviour is consistent. */
.padelmap-blog__card-title-link::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	border-radius: inherit;
}
.padelmap-blog__card-title-link:focus-visible::after {
	outline: 3px solid var(--wp--preset--color--padelmap-sun, #D4F33B);
	outline-offset: -3px;
}

.padelmap-blog__card-excerpt {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--wp--preset--color--padelmap-slate, #4A5163);
}

/* ==== Empty state ====================================================== */

.padelmap-blog__empty {
	padding: 3rem 1rem;
	text-align: center;
	color: var(--wp--preset--color--padelmap-slate, #4A5163);
	font-size: 1rem;
}

/* ==== Pagination ======================================================= */

/* Targets the markup emitted by `the_posts_pagination()`:
     <nav class="navigation pagination"…>
       <h2 class="screen-reader-text">…</h2>
       <div class="nav-links">
         <a class="prev page-numbers">…</a>
         <a class="page-numbers">1</a>
         <span class="page-numbers current">2</span>
         <a class="next page-numbers">…</a>
       </div>
     </nav>
*/
.padelmap-blog__pagination {
	margin-top: 3rem;
}
.padelmap-blog__pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.4rem;
}
.padelmap-blog__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 0.85rem;
	border: var(--padelmap-blog-border);
	border-radius: 999px;
	background: #fff;
	color: var(--wp--preset--color--padelmap-charcoal, #1A1F2E);
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.padelmap-blog__pagination a.page-numbers:hover,
.padelmap-blog__pagination a.page-numbers:focus-visible {
	background: #F5F5EF;
	border-color: rgba(0, 0, 0, 0.18);
	outline: none;
}
.padelmap-blog__pagination .page-numbers.current {
	background: var(--wp--preset--color--padelmap-court, #1F8A3F);
	border-color: var(--wp--preset--color--padelmap-court, #1F8A3F);
	color: #fff;
}
.padelmap-blog__pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	color: var(--wp--preset--color--padelmap-slate, #4A5163);
}
.padelmap-blog__pagination .prev,
.padelmap-blog__pagination .next {
	/* Keep the arrow pills a touch wider so labels breathe. */
	padding: 0 1.1rem;
}

/* ==== Motion / a11y ==================================================== */

@media (prefers-reduced-motion: reduce) {
	.padelmap-blog__card,
	.padelmap-blog__card-img,
	.padelmap-blog__pagination .page-numbers {
		transition: none;
	}
	.padelmap-blog__card:hover,
	.padelmap-blog__card:focus-within {
		transform: none;
	}
	.padelmap-blog__card:hover .padelmap-blog__card-img {
		transform: none;
	}
}

/* ==== Small screens ==================================================== */

@media (max-width: 600px) {
	.padelmap-blog > main.site-main {
		padding: 1.5rem 1rem 3rem;
	}
	.padelmap-blog__header {
		margin-bottom: 1.75rem;
	}
	.padelmap-blog__grid {
		gap: 1.25rem;
	}
}
