/* ABOUTME: Styles for the single resource detail card and prose content below. */
/* ABOUTME: Image-left / body-right layout with prominent single-download CTA. */

/* ---- Page-level spacing ---- */

.single-resource .entry-header {
	margin-block-end: 0;
	padding-block-end: 0;
}

.single-resource.wp-singular h1.entry-title {
	text-align: left;
}

/* Tighten the gap between the title and metabox */
.single-resource .entry-content {
	margin-block-start: 0;
}

/* ---- Detail card container ---- */

.ycv-resource-metabox {
	margin-block: var(--wp--preset--spacing--30) 0;
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	background: var(--yak-color-white);
	border: 1px solid rgb(0 0 0 / 0.08);
	border-radius: calc(var(--yak-radius) * 2);
	box-shadow:
		0 1px 2px rgb(0 0 0 / 0.04),
		0 4px 12px rgb(0 0 0 / 0.06);
}

.ycv-resource-metabox__inner {
	display: flex;
	gap: var(--wp--preset--spacing--50);
	align-items: flex-start;
}

/* ---- Image column (left) ---- */

.ycv-resource-metabox__image {
	flex: 0 0 auto;
	width: clamp(140px, 26%, 220px);
	align-self: flex-start;
}

.ycv-resource-metabox__image a {
	display: block;
	border-radius: var(--yak-radius);
	overflow: hidden;
	transition: box-shadow 0.3s ease;
	box-shadow:
		0 2px 8px rgb(0 0 0 / 0.12),
		0 1px 3px rgb(0 0 0 / 0.08);
}

.ycv-resource-metabox__image a:hover {
	box-shadow:
		0 8px 24px rgb(0 0 0 / 0.18),
		0 2px 6px rgb(0 0 0 / 0.1);
}

.ycv-resource-metabox__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
	transition: transform 0.3s ease;
}

.ycv-resource-metabox__image a:hover img {
	transform: scale(1.03);
}

/* ---- Body column (right) ---- */

.ycv-resource-metabox__body {
	flex: 1 1 0%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* ---- Meta lines (stacked) ---- */

.ycv-resource-meta {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.ycv-resource-meta__line {
	margin: 0;
	font-size: var(--yak-font-sm, 0.9rem);
	line-height: 1.5;
	color: var(--yak-color-black, #1a1a1a);
}

.ycv-resource-meta__label {
	font-weight: 600;
}

/* ---- Excerpt ---- */

.ycv-resource-metabox__excerpt {
	margin: 0.25rem 0 0;
	font-size: var(--yak-font-sm, 0.9rem);
	font-style: normal;
	line-height: 1.6;
	color: var(--yak-color-black, #1a1a1a);
}

/* ---- Single download CTA ---- */

.ycv-resource-cta {
	padding-block-start: 1rem;
}

.ycv-resource-cta__btn,
.entry-content .ycv-resource-cta__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 2rem;
	background: var(--yak-color-primary);
	color: #fff !important;
	font-size: var(--yak-font-md, 1.125rem);
	font-weight: 600;
	line-height: 1;
	border-radius: var(--yak-radius);
	text-decoration: none !important;
	transition:
		background 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.2s ease;
}

.ycv-resource-cta__btn:hover,
.entry-content .ycv-resource-cta__btn:hover {
	background: color-mix(in srgb, var(--yak-color-primary) 85%, black);
	box-shadow: 0 4px 16px rgb(35 99 224 / 0.3);
	transform: translateY(-2px);
	color: #fff !important;
}

.ycv-resource-cta__btn:focus-visible {
	outline: 2px solid var(--yak-color-primary);
	outline-offset: 3px;
}

.ycv-resource-cta__icon {
	display: flex;
	align-items: center;
}

.ycv-resource-cta__icon svg {
	display: block;
}

.ycv-resource-cta__badge {
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	background: rgb(255 255 255 / 0.2);
	padding: 0.2em 0.55em;
	border-radius: 4px;
	line-height: 1.4;
}

/* ---- Multiple downloads list ---- */

.ycv-resource-downloads {
	padding-block-start: 0.25rem;
}

.ycv-resource-downloads__heading {
	font-size: var(--yak-font-md, 1.125rem);
	font-weight: 700;
	letter-spacing: 0.01em;
	margin: 0 0 0.5rem;
	color: var(--yak-color-black, #1a1a1a);
}

.ycv-resource-attachments {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.ycv-resource-attachment {
	position: relative;
	border-radius: var(--yak-radius);
	background: var(--yak-color-white);
	border: 1px solid var(--yak-color-muted);
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.ycv-resource-attachment:hover {
	border-color: var(--yak-color-primary);
	box-shadow: 0 2px 8px rgb(35 99 224 / 0.10);
}

/* Override theme entry-content link underline */
.ycv-resource-attachment__link,
.entry-content .ycv-resource-attachment__link {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.5rem 0.875rem;
	text-decoration: none !important;
	color: inherit;
}

.ycv-resource-attachment__link:hover,
.ycv-resource-attachment__link:focus-visible,
.entry-content .ycv-resource-attachment__link:hover,
.entry-content .ycv-resource-attachment__link:focus-visible {
	color: inherit;
	text-decoration: none !important;
}

.ycv-resource-attachment__link:focus-visible {
	outline: 2px solid var(--yak-color-primary);
	outline-offset: 2px;
	border-radius: var(--yak-radius);
}

.ycv-resource-attachment__name {
	flex: 1 1 auto;
	font-size: var(--yak-font-sm);
	font-weight: 500;
	color: var(--yak-color-primary);
	transition: color 0.2s ease;
}

.ycv-resource-attachment:hover .ycv-resource-attachment__name {
	color: color-mix(in srgb, var(--yak-color-primary) 75%, black);
}

.ycv-resource-attachment__type {
	flex: 0 0 auto;
	font-size: 0.625rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--secondary, #666);
	background: var(--yak-color-muted);
	padding: 0.15em 0.45em;
	border-radius: 3px;
	line-height: 1.5;
}

.ycv-resource-attachment__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--yak-color-primary);
}

.ycv-resource-attachment__icon svg {
	display: block;
}

/* ---- Content below the card (the_content) ---- */

.single-resource .entry-content > :not(.ycv-resource-metabox):first-of-type {
	margin-block-start: var(--wp--preset--spacing--60);
}

.single-resource .entry-content:empty {
	display: none;
}

/* Generous prose rhythm for long-form content below the card */
.single-resource .entry-content > p,
.single-resource .entry-content > ul,
.single-resource .entry-content > ol,
.single-resource .entry-content > blockquote,
.single-resource .entry-content > .wp-block-group {
	max-width: 65ch;
}

.single-resource .entry-content > h2 {
	margin-block-start: var(--wp--preset--spacing--60);
}

.single-resource .entry-content > h3 {
	margin-block-start: var(--wp--preset--spacing--50);
}

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

@media (max-width: 640px) {
	.ycv-resource-metabox {
		padding: var(--wp--preset--spacing--30);
	}

	.ycv-resource-metabox__inner {
		flex-direction: column;
		gap: var(--wp--preset--spacing--30);
	}

	.ycv-resource-metabox__image {
		width: 50%;
		max-width: 180px;
	}

	.ycv-resource-attachment__link,
	.entry-content .ycv-resource-attachment__link {
		padding: 0.5rem 0.75rem;
	}

	.ycv-resource-attachment__name {
		font-size: var(--yak-font-xs);
	}

	.single-resource .entry-content > p,
	.single-resource .entry-content > ul,
	.single-resource .entry-content > ol,
	.single-resource .entry-content > blockquote {
		max-width: none;
	}
}
