/**
 * Pattern Styles
 *
 * Block pattern-specific styles (epigraph, etc.).
 * Uses theme.json CSS custom properties.
 *
 * @package Tufte_Blocks
 */

/* ========================================
   PATTERN: NEWSLETTER CTA
   ======================================== */

.tufte-newsletter-cta {
	text-align: center;
}

.tufte-newsletter-eyebrow {
	font-family: var(--wp--preset--font-family--monospace);
	font-size: 0.7rem !important;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.tufte-newsletter-desc {
	max-width: 440px;
	margin-left: auto;
	margin-right: auto;
}

/* ========================================
   Global: Eyebrow Label
   ======================================== */
.tufte-eyebrow {
	font-family: var(--wp--preset--font-family--monospace);
	font-size: 0.7rem !important;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1.4;
	margin-bottom: 0.5rem !important;
}

/* ========================================
   Pattern: Section Header
   ======================================== */
.tufte-section-header .tufte-section-desc {
	font-size: 0.95rem;
	line-height: 1.6;
	max-width: 600px;
}

/* ========================================
   Pattern: Testimonial / Epigraph
   ======================================== */
.tufte-epigraph {
	text-align: center;
}

.tufte-epigraph .tufte-epigraph-quote-mark {
	font-size: 3rem;
	line-height: 1;
	opacity: 0.5;
	margin-bottom: 0.5rem !important;
}

.tufte-epigraph .tufte-epigraph-quote {
	font-size: 1.4rem;
	font-style: italic;
	line-height: 1.6;
	margin-bottom: 1.25rem !important;
}

.tufte-epigraph .tufte-epigraph-attribution {
	font-size: 0.85rem;
	color: var(--wp--preset--color--secondary);
}

.tufte-epigraph .tufte-epigraph-attribution strong {
	color: var(--wp--preset--color--foreground);
	font-weight: 400;
}

/* ========================================
   Pattern: Stats Row
   ======================================== */
.tufte-stats-row {
	text-align: center;
}

.tufte-stat-item {
	padding: 1.5rem 1rem;
}

.tufte-stat-number {
	font-size: 2rem;
	font-weight: 400;
	line-height: 1.2;
	margin-bottom: 0.25rem !important;
}

.tufte-stat-label {
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-family: var(--wp--preset--font-family--monospace);
}

/* ========================================
   Pattern: Reading List / Bibliography
   ======================================== */
.tufte-reading-list {
	max-width: 700px;
}

.tufte-reading-item {
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border, #333333);
	align-items: start;
	gap: 1.5rem;
}

.tufte-reading-item:last-child {
	border-bottom: none;
}

.tufte-book-number {
	font-family: var(--wp--preset--font-family--monospace, Consolas, 'Liberation Mono', Menlo, Courier, monospace);
	font-size: 0.85rem !important;
	color: var(--wp--preset--color--primary) !important;
	padding-top: 0.2rem;
	margin: 0 !important;
	flex-shrink: 0;
}

.tufte-book-info {
	min-width: 0;
}

.tufte-book-title {
	font-size: 1.1rem !important;
	font-weight: 400;
	font-style: italic;
	margin-bottom: 0.2rem !important;
}

.tufte-book-title a {
	color: var(--wp--preset--color--foreground, #eeeeee);
	text-decoration: none;
}

.tufte-book-title a:hover {
	color: var(--wp--preset--color--primary);
}

.tufte-book-author {
	font-size: 0.95rem !important;
	color: var(--wp--preset--color--secondary, #a0a0a0) !important;
	margin-bottom: 0.35rem !important;
}

.tufte-book-note {
	font-size: 0.88rem !important;
	color: var(--wp--preset--color--secondary, #a0a0a0) !important;
	line-height: 1.5;
	font-style: italic;
	margin: 0 !important;
}

/* ========================================
   PATTERN: ABOUT CARD
   ======================================== */

.tufte-about-card {
	max-width: 700px;
}

.tufte-about-row {
	gap: 2.5rem !important;
	align-items: start;
}

/* Photo — static, no hover effect */
.tufte-about-photo {
	flex-shrink: 0;
	width: 200px !important;
	border-radius: 4px;
	border: 1px solid var(--wp--preset--color--border, #333333);
	overflow: hidden;
}

.tufte-about-photo img {
	aspect-ratio: 3/4;
	object-fit: cover;
	border-radius: 4px;
}

/* Info stack */
.tufte-about-info {
	min-width: 0;
}

/* Name */
.tufte-about-name {
	font-size: 1.4rem !important;
	font-weight: 400 !important;
	margin-bottom: 0.25rem !important;
}

/* Role — gold accent color */
.tufte-about-role {
	font-size: 0.9rem !important;
	color: var(--wp--preset--color--primary) !important;
	margin-bottom: 1rem !important;
}

/* Bio text */
.tufte-about-bio {
	font-size: 0.92rem !important;
	color: var(--wp--preset--color--secondary, #a0a0a0) !important;
	line-height: 1.7;
	margin-bottom: 1.25rem !important;
}

/* Links row */
.tufte-about-links {
	gap: 1.25rem !important;
}

.tufte-about-links p {
	font-family: var(--wp--preset--font-family--monospace) !important;
	font-size: 0.73rem !important;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin: 0 !important;
}

.tufte-about-links a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.tufte-about-links a:hover {
	color: var(--wp--preset--color--primary-hover);
}

@media (max-width: 768px) {
	.tufte-about-row {
		flex-wrap: wrap !important;
	}
	.tufte-about-photo {
		max-width: 200px !important;
	}
}

/* ========================================
   PATTERN: SYLLABUS / COURSE LISTING
   ======================================== */

.tufte-syllabus {
	max-width: 700px;
}

/* Each row: week num + content + status */
.tufte-syllabus-item {
	padding: 1rem 0 !important;
	border-bottom: 1px solid var(--wp--preset--color--border, #333333);
	gap: 1.25rem !important;
}

.tufte-syllabus-item:last-child {
	border-bottom: none;
}

/* Week number — gold monospace */
.tufte-syllabus-item .tufte-week-num {
	font-family: var(--wp--preset--font-family--monospace) !important;
	font-size: 0.75rem !important;
	color: var(--wp--preset--color--primary) !important;
	margin: 0 !important;
	flex-shrink: 0;
	min-width: 3rem;
}

/* Inner row: content + status stay together */
.tufte-syllabus-item .tufte-syllabus-content-row {
	flex: 1;
	min-width: 0;
	gap: 1.25rem !important;
	justify-content: space-between;
}

/* Content stack — grows to fill */
.tufte-syllabus-item .tufte-week-content {
	flex: 1;
	min-width: 0;
	gap: 0.15rem !important;
}

/* Week title */
.tufte-syllabus-item .tufte-week-title {
	font-size: 0.95rem !important;
	margin: 0 !important;
}

/* Reading/detail line */
.tufte-syllabus-item .tufte-week-detail {
	font-size: 0.82rem !important;
	color: var(--wp--preset--color--secondary, #a0a0a0) !important;
	margin: 0 !important;
}

/* Status label — monospace, secondary by default */
.tufte-syllabus-item .tufte-week-status {
	font-family: var(--wp--preset--font-family--monospace) !important;
	font-size: 0.7rem !important;
	color: var(--wp--preset--color--secondary, #a0a0a0) !important;
	letter-spacing: 0.03em;
	margin: 0 !important;
	flex-shrink: 0;
	white-space: nowrap;
}

/* Complete status — gold */
.tufte-syllabus-item .tufte-week-status.is-complete {
	color: var(--wp--preset--color--primary) !important;
}

/* ========================================
   HOMEPAGE: POST CARD HOVER
   ======================================== */
.tufte-post-card {
	position: relative;
	min-height: 100%;
	transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
	            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tufte-post-card:hover {
	border-color: var(--wp--preset--color--primary) !important;
	transform: translateY(-2px);
}

/* Stretched link: post title link covers the entire card */
.tufte-post-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
	.tufte-post-card {
		transition-duration: 0.01ms !important;
	}
}

/* ========================================
   HOMEPAGE: NOTE ROW
   ======================================== */
.tufte-note-row {
	position: relative;
}

.tufte-note-row .wp-block-post-date {
	flex-shrink: 0;
	min-width: 4.5rem;
	white-space: nowrap;
}

/* Stretched link: date link covers the entire row */
.tufte-note-row .wp-block-post-date a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* ========================================
   SINGLE POST: TUFTE HERO
   ======================================== */

/* Desktop: CSS Grid places the featured image in the right
   margin column alongside the title and metadata. */
@media (min-width: 1200px) {
	.tufte-hero {
		display: grid !important;
		grid-template-columns: var(--wp--style--global--content-size, 650px) 1fr;
		column-gap: var(--wp--preset--spacing--50, 1.5rem);
		align-items: start;
	}

	.tufte-hero > *:not(.is-style-tufte-hero) {
		grid-column: 1;
	}

	.tufte-hero .is-style-tufte-hero {
		grid-column: 2;
		grid-row: 1 / -1;
		max-width: none !important;
		margin: 0 !important;
	}

	.tufte-hero .is-style-tufte-hero img {
		width: 100%;
		height: auto;
	}
}

/* Below 1200px: image stacks below title */
@media (max-width: 1199px) {
	.tufte-hero .is-style-tufte-hero {
		margin-top: var(--wp--preset--spacing--50);
	}
}

/* ========================================
   PROJECTS
   Archive grid, card, single hero, buttons,
   details panel, patterns, project nav.
   Every value is a theme.json token.
   ======================================== */

/* --- Shared type helpers --- */
.tufte-project-mono,
.tufte-project-meta p,
.tufte-project-back,
.tufte-project-nav,
.tufte-project-dl,
.tufte-project-links .wp-block-button__link {
	font-family: var(--wp--preset--font-family--monospace);
}

/* --- Archive header --- */
.tufte-projects-archive .tufte-projects-title {
	max-width: 26ch;
}

.tufte-projects-archive .tufte-projects-intro {
	max-width: 62ch;
}

/* --- Card --- */
.tufte-project-card {
	position: relative;
	overflow: hidden;
	height: 100%;
	transition: border-color var(--wp--custom--transition),
	            transform var(--wp--custom--transition);
}

.tufte-project-card:hover,
.tufte-project-card:focus-within {
	border-color: var(--wp--preset--color--primary) !important;
	transform: translateY(-2px);
}

/* Banner: full bleed, fixed aspect, hairline below */
.tufte-project-card .tufte-project-banner {
	margin: 0;
	width: 100%;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.tufte-project-card .tufte-project-banner img {
	display: block;
	width: 100%;
	aspect-ratio: 1544 / 500;
	object-fit: cover;
	border-radius: 0;
}

/* Body fills the remaining height so the meta line sits at the bottom */
.tufte-project-card .tufte-project-body {
	flex: 1;
	width: 100%;
	min-width: 0;
}

.tufte-project-card .tufte-project-type,
.tufte-project-card .tufte-project-type a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	margin-bottom: 0 !important;
}

.tufte-project-card .tufte-project-title {
	margin: 0;
}

.tufte-project-card .tufte-project-title a {
	color: var(--wp--preset--color--foreground);
	transition: color var(--wp--custom--transition);
}

.tufte-project-card .tufte-project-title a:hover {
	color: var(--wp--preset--color--primary);
}

/* Stretched link: the title link covers the whole card */
.tufte-project-card .tufte-project-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.tufte-project-card .tufte-project-excerpt p {
	margin: 0;
}

/* Meta line: v1.0.2 · Sep 2026 */
.tufte-project-card .tufte-project-meta {
	margin-top: auto !important;
	padding-top: var(--wp--preset--spacing--20);
}

.tufte-project-meta p {
	margin: 0;
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

.tufte-project-meta .tufte-project-version::before {
	content: "v";
}

.tufte-project-meta .tufte-project-version + .tufte-project-date::before {
	content: "· ";
}

@media (prefers-reduced-motion: reduce) {
	.tufte-project-card,
	.tufte-project-card .tufte-project-title a {
		transition-duration: 0.01ms !important;
	}
}

/* --- Single: back link and project nav --- */
.tufte-project-back,
.tufte-project-nav {
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.tufte-project-back {
	font-size: 0.7rem;
	margin-top: 0 !important;
}

.tufte-project-nav {
	font-size: 0.8rem;
	letter-spacing: 0.05em;
}

.tufte-project-nav p,
.tufte-project-nav .wp-block-post-navigation-link {
	margin: 0;
}

/* --- Single: hero --- */
.tufte-project-hero .tufte-project-type,
.tufte-project-hero .tufte-project-type a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.tufte-project-hero .tufte-project-h1 {
	font-size: clamp(2.5rem, 6vw, 3rem);
	max-width: 30ch;
}

.tufte-project-hero .tufte-project-tagline {
	font-style: italic;
	line-height: 1.5;
	max-width: 44ch;
	margin-bottom: var(--wp--preset--spacing--60) !important;
}

/* Primary button: theme default plus the handoff's roomier padding */
.tufte-project-actions .wp-block-button__link {
	padding: 0.75rem 1.5rem;
}

/* Secondary button: hairline border, foreground text, gold on hover */
.tufte-project-actions .is-style-outline .wp-block-button__link {
	border-color: var(--wp--preset--color--border);
	color: var(--wp--preset--color--foreground);
}

.tufte-project-actions .is-style-outline .wp-block-button__link:hover,
.tufte-project-actions .is-style-outline .wp-block-button__link:focus {
	background: transparent;
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
	box-shadow: none;
}

/* Tertiary (link style) keeps default padding so it aligns with the buttons */
.tufte-project-actions .is-style-link .wp-block-button__link {
	padding: 0.75rem 0;
}

/* --- Single: featured figure --- */
.tufte-project-single .tufte-project-figure img {
	width: 100%;
	border-radius: 0;
}

/* --- Single: details panel --- */
.tufte-project-details {
	max-width: 480px;
}

.tufte-project-details .tufte-project-details-title {
	margin: 0;
}

.tufte-project-dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--50);
	font-size: 0.8rem;
}

.tufte-project-dl .tufte-project-detail {
	display: contents;
}

.tufte-project-dl p {
	margin: 0;
}

.tufte-project-dl .tufte-project-label {
	color: var(--wp--preset--color--secondary);
}

.tufte-project-dl .tufte-project-value {
	color: var(--wp--preset--color--foreground);
}

/* "Built with" is a post-terms block; drop its global eyebrow styling so it
   reads like the other values. */
.tufte-project-dl .tufte-project-tools {
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.tufte-project-dl .tufte-project-tools a {
	color: inherit;
}

.tufte-project-links .wp-block-button__link {
	font-size: 0.8rem;
	padding: 0;
}

/* --- Pattern: features grid --- */
.tufte-project-features .tufte-project-features-title {
	max-width: 34ch;
}

.tufte-project-feature {
	transition: border-color var(--wp--custom--transition),
	            transform var(--wp--custom--transition);
}

.tufte-project-feature:hover {
	border-color: var(--wp--preset--color--primary) !important;
	transform: translateY(-2px);
}

.tufte-project-feature h3 {
	margin-bottom: var(--wp--preset--spacing--20);
}

.tufte-project-feature p {
	margin: 0;
}

/* --- Pattern: install steps (01, 02, ...) --- */
.tufte-project-steps {
	list-style: none;
	padding-left: 0;
	margin: 0;
	max-width: 46ch;
	counter-reset: tufte-step;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.tufte-project-steps li {
	position: relative;
	padding-left: 2.5rem;
	counter-increment: tufte-step;
}

/* Positioned rather than flex so an inline <code> stays in the text run */
.tufte-project-steps li::before {
	content: counter(tufte-step, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 0.45rem;
	font-family: var(--wp--preset--font-family--monospace);
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--primary);
}

/* --- Pattern: FAQ (hairline rows instead of the theme's boxed details) --- */
.tufte-project-faq .wp-block-details {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	padding: 1.25rem 0;
	margin: 0;
}

.tufte-project-faq .wp-block-details:last-child {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.tufte-project-faq .wp-block-details summary {
	padding: 0;
	font-size: var(--wp--preset--font-size--medium);
}

.tufte-project-faq .wp-block-details > *:not(summary) {
	padding: 0;
	margin-top: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}

@media (prefers-reduced-motion: reduce) {
	.tufte-project-feature {
		transition-duration: 0.01ms !important;
	}
}
