/* ===================================================================
   NightOwl Book CMS — dynamic blog post grid  ([nightowl_posts])
   Fully scoped under .nightowl-posts-catalog. Premium editorial
   NightOwl card: dark ground, discreet gold accents, warm text,
   restrained hover. Mirrors the .nightowl-books-catalog language
   using the NightOwl palette:
     #030303  #090909  #c8942f  #edc36b  #eee3cf  #a99c87
   3 / 2 / 1 columns. No JS. No slider / carousel / masonry.
   Every rule is prefixed with .nightowl-posts-catalog so it never
   collides with the book catalog / archive / single styles.
   =================================================================== */

.nightowl-posts-catalog {
	--nps-gold: var(--nightowl-gold);
	--nps-gold-light: var(--nightowl-gold-light);
	--nps-cream: var(--nightowl-cream);
	--nps-muted: var(--nightowl-muted);
	--nps-border: var(--nightowl-gold-border);
	--nps-border-soft: var(--nightowl-gold-border-soft);

	display: block;
	width: 100%;
}
.nightowl-posts-catalog *,
.nightowl-posts-catalog *::before,
.nightowl-posts-catalog *::after { box-sizing: border-box; }

/* --- Grid: 3 / 2 / 1 --- */
.nightowl-posts-catalog .nob-post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
}
@media (max-width: 1024px) {
	.nightowl-posts-catalog .nob-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 640px) {
	.nightowl-posts-catalog .nob-post-grid { grid-template-columns: 1fr; }
}

/* --- Card: equal structural height, CTA pinned to the bottom --- */
.nightowl-posts-catalog .nob-post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: linear-gradient(180deg, #111111, #0a0a0a);
	border: 1px solid var(--nps-border);
	border-radius: 6px;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.nightowl-posts-catalog .nob-post-card:hover,
.nightowl-posts-catalog .nob-post-card:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--nightowl-shadow-card);
	border-color: rgba(200, 148, 47, 0.6);
}

/* --- Cover (16:10, cover-crop) --- */
.nightowl-posts-catalog .nob-post-cover-link {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #0d0d0d;
}
.nightowl-posts-catalog .nob-post-cover {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.nightowl-posts-catalog .nob-post-card:hover .nob-post-cover { transform: scale(1.03); }
.nightowl-posts-catalog .nob-post-cover--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--nightowl-font-display);
	font-size: clamp(44px, 7vw, 64px);
	line-height: 1;
	color: var(--nps-gold-light);
	background:
		radial-gradient(80% 60% at 50% 30%, rgba(200, 148, 47, 0.14), rgba(3, 3, 3, 0) 70%),
		#0d0d0d;
}

/* --- Body --- */
.nightowl-posts-catalog .nob-post-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 18px 20px 22px;
}
.nightowl-posts-catalog .nob-post-cat {
	margin: 0 0 8px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: var(--nps-muted);
}
.nightowl-posts-catalog .nob-post-cat a {
	color: inherit;
	text-decoration: none;
}
.nightowl-posts-catalog .nob-post-cat a:hover,
.nightowl-posts-catalog .nob-post-cat a:focus-visible { color: var(--nps-gold-light); }

.nightowl-posts-catalog .nob-post-title {
	margin: 0 0 8px;
	font-family: var(--nightowl-font-display);
	font-size: 18px;
	font-weight: 400;
	letter-spacing: 0.3px;
	line-height: 1.3;
	color: var(--nps-gold);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.nightowl-posts-catalog .nob-post-title a {
	color: inherit;
	text-decoration: none;
}
.nightowl-posts-catalog .nob-post-title a:hover,
.nightowl-posts-catalog .nob-post-title a:focus-visible { color: var(--nps-gold-light); }

.nightowl-posts-catalog .nob-post-date {
	display: block;
	margin: 0 0 12px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	letter-spacing: 0.4px;
	color: var(--nps-muted);
}

.nightowl-posts-catalog .nob-post-excerpt {
	margin: 0 0 18px;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--nps-cream);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --- CTA (gold outline, bottom-aligned) --- */
.nightowl-posts-catalog .nob-post-btn {
	margin-top: auto;
	align-self: flex-start;
	padding: 10px 16px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-align: center;
	text-decoration: none;
	color: var(--nps-gold-light);
	border: 1px solid var(--nps-gold);
	border-radius: 4px;
	transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.nightowl-posts-catalog .nob-post-btn:hover,
.nightowl-posts-catalog .nob-post-btn:focus-visible {
	background-color: var(--nps-gold);
	color: #000;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(200, 148, 47, 0.22);
}

.nightowl-posts-catalog a:focus-visible {
	outline: 2px solid var(--nps-gold-light);
	outline-offset: 3px;
	border-radius: 2px;
}

/* --- Motion --- */
@media (prefers-reduced-motion: reduce) {
	.nightowl-posts-catalog .nob-post-card,
	.nightowl-posts-catalog .nob-post-cover,
	.nightowl-posts-catalog .nob-post-btn,
	.nightowl-posts-catalog .nob-post-title a,
	.nightowl-posts-catalog .nob-post-cat a {
		transition: none;
	}
	.nightowl-posts-catalog .nob-post-card:hover .nob-post-cover { transform: none; }
}

/* --- Intentional empty state (opt-in: [nightowl_posts empty_state="1"]) ---
   Rendered only on /blog/ when there are no published posts yet.
   Matches the category-archive empty-state language. --- */
.nightowl-posts-empty {
	max-width: 620px;
	margin: 8px auto 0;
	padding: 30px 24px 8px;
	text-align: center;
}
.nightowl-posts-empty-rule {
	display: block;
	width: 100px;
	height: 1px;
	margin: 0 auto 26px;
	background: linear-gradient(90deg, rgba(200, 148, 47, 0) 0%, rgba(200, 148, 47, 0.8) 50%, rgba(200, 148, 47, 0) 100%);
}
.nightowl-posts-empty-title {
	margin: 0 0 14px;
	font-family: var(--nightowl-font-display);
	font-weight: 400;
	font-size: clamp(22px, 3.4vw, 30px);
	line-height: 1.25;
	letter-spacing: 0.5px;
	color: var(--nightowl-gold);
}
.nightowl-posts-empty-text {
	margin: 0 auto;
	max-width: 520px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--nightowl-cream);
}
