/* =========================================================================
   Front Page — Combined Playful Feed
   A scrapbook-flavoured social stream mixing blog posts and micro posts.
   Blog posts read like little featured clippings; micro posts read like
   quick social notes, with extra treatment per post format.
   ========================================================================= */

.meitner-feed {
	max-width: var(--wp--custom--width--feed);
	margin: 0 auto;
	padding: 8px 24px 72px;
	position: relative;
}

/* -------------------------------------------------------------------------
   Section header
   ------------------------------------------------------------------------- */

.meitner-feed-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 40px 0 20px;
}

.meitner-feed-head__title {
	font-family: var(--f-display);
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.02em;
	margin: 0;
}

.meitner-feed-head__link {
	font-family: var(--f-mono);
	font-size: 13px;
	font-weight: 600;
	color: var(--c-text-tertiary);
	white-space: nowrap;
}

.meitner-feed-head__link:hover {
	color: var(--c-primary);
}

/* -------------------------------------------------------------------------
   Stream + cards
   ------------------------------------------------------------------------- */

.meitner-feed__stream {
	display: flex;
	flex-direction: column;
	gap: 28px;
	position: relative;
	z-index: 1;
	padding-left: 26px;
}

/* A dashed "thread" running down the stream, tying the cards together. */
.meitner-feed__stream::before {
	content: "";
	position: absolute;
	top: 14px;
	bottom: 14px;
	left: 7px;
	width: 2px;
	background-image: linear-gradient( var(--c-border) 55%, transparent 0 );
	background-size: 2px 11px;
	background-repeat: repeat-y;
	z-index: 0;
	pointer-events: none;
}

.feed-card {
	position: relative;
	background: var(--c-surface);
	border: 2px solid var(--c-border);
	border-radius: 16px;
	padding: 22px 24px 18px;
	box-shadow: 4px 4px 0 var(--c-border-light);
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		border-color 0.18s ease;
}

/* Scrapbook tilt — alternate the lean, straighten on hover/focus. */
@media (prefers-reduced-motion: no-preference) {
	.feed-card {
		transform: rotate(-0.5deg);
	}

	.feed-card:nth-child(even) {
		transform: rotate(0.6deg);
	}

	.feed-card:hover,
	.feed-card:focus-within {
		transform: rotate(0deg) translateY(-3px);
	}
}

.feed-card:hover,
.feed-card:focus-within {
	border-color: var(--c-primary);
	box-shadow: 6px 6px 0 var(--c-primary-light);
}

/* The "thread node" dot where each card meets the timeline. */
.feed-card::before {
	content: "";
	position: absolute;
	top: 24px;
	left: -25px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--c-surface);
	border: 2px solid var(--c-border);
	z-index: 2;
}

.feed-card:hover::before,
.feed-card:focus-within::before {
	background: var(--c-primary-brand);
	border-color: var(--c-primary-brand);
}

/* -------------------------------------------------------------------------
   Format sticker (micro cards) — quiet, mono, matches the meta type style
   ------------------------------------------------------------------------- */

.feed-sticker {
	display: inline-block;
	font-family: var(--f-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 2px 9px;
	border-radius: 999px;
	border: 1px solid var(--c-border);
	color: var(--c-text-tertiary);
	background: var(--c-surface);
	line-height: 1.5;
	margin-bottom: 12px;
}

/* -------------------------------------------------------------------------
   Blog post card — reads like a featured clipping
   ------------------------------------------------------------------------- */

.feed-card--post {
	background:
		linear-gradient(180deg, var(--c-primary-light) 0%, transparent 70px),
		var(--c-surface);
}

.feed-card--post .post-category {
	margin-bottom: 2px;
}

.feed-card__post-title {
	font-family: var(--f-display);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.22;
	letter-spacing: -0.02em;
	margin: 6px 0 10px;
}

.feed-card__post-title a { color: var(--c-text); }
.feed-card__post-title a:hover { color: var(--c-primary); }

.feed-card__banner {
	margin: 0 -24px 14px;
	border-top: 2px solid var(--c-border-light);
	border-bottom: 2px solid var(--c-border-light);
	overflow: hidden;
}

.feed-card__banner img {
	display: block;
	width: 100%;
	height: auto;
}

.feed-card__excerpt {
	font-size: 15px;
	color: var(--c-text-secondary);
	line-height: 1.6;
	margin: 0 0 14px;
}

.feed-card__readmore {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--c-primary);
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--c-primary-light);
	transition: background 0.15s, color 0.15s, transform 0.15s;
}

.feed-card__readmore:hover {
	background: var(--c-primary);
	color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
	.feed-card__readmore:hover { transform: translateX(2px); }
}

/* -------------------------------------------------------------------------
   Micro card — social note
   ------------------------------------------------------------------------- */

.feed-card__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.feed-card__avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	flex-shrink: 0;
	overflow: hidden;
	background: var(--c-primary-light);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--f-display);
	font-weight: 600;
	font-size: 17px;
	color: var(--c-primary);
	border: 2px solid var(--c-surface);
	box-shadow: 0 0 0 2px var(--c-border-light);
}

.feed-card__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.feed-card__id { min-width: 0; }

.feed-card__author {
	font-weight: 600;
	font-size: 15px;
	color: var(--c-text);
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.feed-card__handle {
	font-family: var(--f-mono);
	font-size: 13px;
	font-weight: 400;
	color: var(--c-text-tertiary);
}

.feed-card__time {
	font-family: var(--f-mono);
	font-size: 12px;
	color: var(--c-text-tertiary);
}

.feed-card__time:hover { color: var(--c-primary); }

.feed-card__micro-title {
	font-family: var(--f-display);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 8px;
}

.feed-card__micro-title a { color: var(--c-text); }
.feed-card__micro-title a:hover { color: var(--c-primary); }

.feed-card__body {
	font-size: 15.5px;
	color: var(--c-text-secondary);
	line-height: 1.6;
}

.feed-card__body p { margin: 0 0 8px; }
.feed-card__body p:last-child { margin-bottom: 0; }

.feed-card__body a {
	color: var(--c-primary);
	text-decoration: underline;
	text-decoration-color: var(--c-primary-light);
	text-underline-offset: 2px;
}

.feed-card__body a:hover { text-decoration-color: var(--c-primary); }

/* Media (image / video fallback) */
.feed-card__media {
	margin: 14px -24px 0;
	border-top: 2px solid var(--c-border-light);
	border-bottom: 2px solid var(--c-border-light);
	overflow: hidden;
}

.feed-card__media:last-child {
	margin-bottom: -18px;
	border-bottom: none;
}

.feed-card__media img {
	display: block;
	width: 100%;
	height: auto;
}

/* Format: quote */
.feed-card--quote { border-style: dashed; }

.feed-card__quote blockquote {
	margin: 0;
	padding: 4px 0 4px 18px;
	border: none;
	border-left: 4px solid var(--c-primary-brand);
	font-family: var(--f-display);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.45;
	letter-spacing: -0.01em;
	color: var(--c-text);
}

.feed-card__quote blockquote p { margin: 0 0 6px; }
.feed-card__quote blockquote p:last-child { margin-bottom: 0; }

.feed-card__quote cite,
.feed-card__quote blockquote footer {
	display: block;
	margin-top: 10px;
	font-family: var(--f-body);
	font-size: 14px;
	font-weight: 400;
	font-style: normal;
	color: var(--c-text-tertiary);
}

/* Format: link — chunky preview chip */
.feed-card__link {
	margin-top: 14px;
	display: block;
	padding: 14px 16px;
	background: var(--c-surface-raised);
	border: 2px dashed var(--c-border);
	border-radius: 12px;
	transition: border-color 0.15s, transform 0.15s;
}

.feed-card__link:hover {
	border-color: var(--c-primary);
}

@media (prefers-reduced-motion: no-preference) {
	.feed-card__link:hover { transform: translateY(-2px); }
}

.feed-card__link-domain {
	display: block;
	font-family: var(--f-mono);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--c-text-tertiary);
	margin-bottom: 4px;
}

.feed-card__link-url {
	font-size: 14px;
	font-weight: 600;
	color: var(--c-primary);
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Embeds bleed to the card edges. */
.feed-card__body .wp-block-embed,
.feed-card__body .wp-block-video {
	margin-left: -24px;
	margin-right: -24px;
	width: calc(100% + 48px);
	border-radius: 0;
}

/* Gallery: even tiles with a comfortable gap. The gap variable is what
   WordPress uses to size each tile, so set it alongside `gap`. */
.feed-card__body .wp-block-gallery {
	--wp--style--unstable-gallery-gap: 8px;
	gap: 8px;
	margin-top: 16px;
	margin-bottom: 16px;
}

/* Keep oEmbeds (videos etc.) inside the card. */
.feed-card__body iframe,
.feed-card__body video,
.feed-card__body .wp-block-embed iframe {
	max-width: 100%;
}

/* ActivityPub reactions in the card footer (blog + micro). */
.feed-card__reactions {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 2px dotted var(--c-border-light);
}

.feed-card__reactions .wp-block-activitypub-reactions {
	margin: 0;
	padding: 0;
}

.feed-card__reactions .wp-block-heading {
	font-family: var(--f-mono);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--c-text-tertiary);
	margin: 0 0 8px;
}

/* When reactions sit directly above the dotted foot, avoid a double rule. */
.feed-card__reactions + .feed-card__foot {
	border-top: none;
	padding-top: 4px;
}

/* Tag pills use the shared .feed-tag class (see meitner.css). */
.feed-card__tags {
	display: flex;
	gap: 7px;
	flex-wrap: wrap;
	margin-top: 14px;
}

/* Footer (micro): permalink + replies */
.feed-card__foot {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 16px;
	padding-top: 12px;
	border-top: 2px dotted var(--c-border-light);
}

.feed-card__permalink {
	font-family: var(--f-mono);
	font-size: 12px;
	color: var(--c-text-tertiary);
}

.feed-card__permalink:hover { color: var(--c-primary); }

.feed-card__replies {
	font-size: 13px;
	font-weight: 500;
	color: var(--c-text-tertiary);
}

.feed-card__replies:hover { color: var(--c-primary); }

/* -------------------------------------------------------------------------
   Empty + footer link
   ------------------------------------------------------------------------- */

.meitner-feed__empty {
	text-align: center;
	color: var(--c-text-tertiary);
	padding: 48px 0;
}

.meitner-feed__more {
	text-align: center;
	margin-top: 36px;
	position: relative;
	z-index: 1;
}

.meitner-feed__more a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--c-primary);
	background: var(--c-surface);
	border: 2px solid var(--c-border);
	border-radius: 999px;
	padding: 9px 22px;
	box-shadow: 3px 3px 0 var(--c-border-light);
	transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.meitner-feed__more a:hover {
	border-color: var(--c-primary);
	box-shadow: 4px 4px 0 var(--c-primary-light);
}

@media (prefers-reduced-motion: no-preference) {
	.meitner-feed__more a:hover { transform: translateY(-2px); }
}

/* -------------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------------- */

@media (max-width: 560px) {
	.meitner-feed { padding: 8px 16px 56px; }

	.feed-card { padding: 18px 18px 16px; box-shadow: 3px 3px 0 var(--c-border-light); }

	.feed-card__banner,
	.feed-card__media { margin-left: -18px; margin-right: -18px; }

	.feed-card__body .wp-block-embed,
	.feed-card__body .wp-block-video {
		margin-left: -18px;
		margin-right: -18px;
		width: calc(100% + 36px);
	}

	.feed-card__post-title { font-size: 21px; }

	.feed-card__handle { display: none; }
}

/* =========================================================================
   Archive context — the blog & micro archives reuse the feed look
   ========================================================================= */

.meitner-feed--archive {
	padding-top: 40px;
}

.meitner-feed--archive .micro-feed-header,
.meitner-feed--archive .blog-section-header-inner {
	max-width: none;
	margin: 0;
	padding: 0 0 4px;
}

.meitner-feed--archive .meitner-feed__stream {
	margin-top: 8px;
}

.meitner-feed--archive .pagination {
	margin-top: 36px;
}

/* =========================================================================
   Column context — two feeds side by side (front page)
   ========================================================================= */

.wp-block-column .meitner-feed {
	max-width: none;
	padding: 0 0 8px;
}

.wp-block-column .meitner-feed-head {
	padding: 6px 0 16px;
}
