/* ============================================================
   Unified Feed — masonry activity wall
   Distinct `fd-` prefix so nothing collides with the theme.
   Tints use color-mix() over the theme vars, so light/dark adapt.
   ============================================================ */
:root {
	--fd-panel: color-mix(in srgb, var(--text) 5%, var(--bg));
	--fd-edge: color-mix(in srgb, var(--text) 13%, var(--bg));
	--fd-line: color-mix(in srgb, var(--text) 9%, var(--bg));
	--fd-scrub: color-mix(in srgb, #000 62%, transparent);
}
#feed-root,
#fd-panel,
#feed-root *,
#fd-panel * {
	box-sizing: border-box;
}
html {
	scrollbar-gutter: stable;
}

#feed-root {
	margin-top: 0.5em;
}

/* ---- filter bar ---- */
.fd-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 1.3em;
	margin-bottom: 1.6em;
	font-family: "Space Mono", monospace;
	font-size: 0.78rem;
}
.fd-filter {
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: var(--text-secondary);
	font: inherit;
	border-bottom: 1px solid transparent;
	padding-bottom: 3px;
	transition:
		color 0.15s,
		border-color 0.15s;
}
.fd-filter .fd-filter-count {
	opacity: 0.5;
	margin-left: 0.25em;
}
.fd-filter:hover {
	color: var(--text);
}
.fd-filter.on {
	color: var(--accent);
	border-bottom-color: var(--accent);
}
.fd-filter:focus-visible {
	outline: 1px solid var(--accent);
	outline-offset: 2px;
}

/* ---- masonry container ---- */
.fd-grid {
	position: relative;
}
.fd-t {
	position: absolute;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	background: var(--fd-panel);
	border: 1px solid var(--fd-line);
	animation: fd-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes fd-rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.fd-t:hover {
	box-shadow: 0 6px 22px -8px rgba(0, 0, 0, 0.22);
}
.fd-t.fd-open {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}
.fd-ts {
	font-family: "Space Mono", monospace;
	font-size: 0.6rem;
	color: var(--text-secondary);
	letter-spacing: 0.02em;
	white-space: nowrap;
}

/* ---- film tile (height from width via aspect-ratio) ---- */
.fd-film {
	aspect-ratio: 2 / 3;
}
.fd-poster {
	position: absolute;
	inset: 0;
	background: var(--fd-edge);
	overflow: hidden;
}
.fd-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}
.fd-t:hover .fd-poster img {
	transform: scale(1.04);
}
.fd-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0.7em 0.8em 0.65em;
	background: linear-gradient(to top, var(--fd-scrub) 32%, transparent);
	color: #fff;
}
.fd-cap .fd-ti {
	font-family: et-book, Palatino, Georgia, serif;
	font-weight: 600;
	font-size: 1.02rem;
	line-height: 1.15;
}
.fd-cap .fd-yr {
	font-family: "Space Mono", monospace;
	font-size: 0.62rem;
	opacity: 0.8;
	margin-left: 0.4em;
}
.fd-cap .fd-dots {
	color: var(--accent);
	letter-spacing: 1px;
	font-size: 0.6rem;
	margin-top: 0.2rem;
	display: block;
}
.fd-fts {
	position: absolute;
	top: 7px;
	right: 9px;
	z-index: 2;
	color: #fff;
	opacity: 0.92;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.fd-film.has-review::after {
	content: "✎";
	position: absolute;
	top: 7px;
	left: 9px;
	z-index: 2;
	color: #fff;
	opacity: 0.9;
	font-size: 0.72rem;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.44);
	font-family: "Space Mono", monospace;
}

/* ---- drop tile ---- */
.fd-drop {
	padding: 0.8em 0.9em 0.9em;
}
.fd-dh {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.45em;
}
.fd-body {
	font-size: 0.94rem;
	line-height: 1.5;
	white-space: pre-line;
}
.fd-body p {
	margin: 0.2em 0;
}
.fd-body p:first-child {
	margin-top: 0;
}
.fd-body a {
	word-break: break-word;
}
.fd-drop.fd-quote .fd-body {
	font-family: et-book, Palatino, Georgia, serif;
	font-style: italic;
	font-size: 1.12rem;
	line-height: 1.38;
	color: var(--text);
	border-left: 3px solid var(--accent);
	padding-left: 0.65em;
	white-space: normal;
}
.fd-drop.fd-wide .fd-body {
	font-size: 1.16rem;
	line-height: 1.34;
}
.fd-body blockquote {
	margin: 0.4em 0;
	padding: 0 0 0 0.65em;
	border-left: 2px solid var(--accent);
	font-style: italic;
	color: var(--text);
}
.fd-photo {
	display: block;
	max-width: 100%;
	border-radius: 4px;
	margin: 0.45em 0;
}
.fd-og {
	display: flex;
	gap: 0.6em;
	margin-top: 0.5em;
	padding: 0.5em;
	border: 1px solid var(--fd-edge);
	border-radius: 5px;
	align-items: center;
	text-decoration: none;
	color: inherit;
}
.fd-og:hover {
	border-color: var(--accent);
	text-decoration: none;
}
.fd-og img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 4px;
	flex: none;
	background: var(--fd-edge);
}
.fd-og .fd-ot {
	font-family: et-book, Palatino, Georgia, serif;
	font-weight: 600;
	font-size: 0.8rem;
	line-height: 1.2;
	display: block;
}
.fd-og .fd-od {
	font-family: "Space Mono", monospace;
	font-size: 0.58rem;
	color: var(--text-secondary);
	display: block;
	margin-top: 0.2rem;
}

/* ---- link tile ---- */
.fd-link {
	padding: 0.85em 0.9em;
	display: flex;
	gap: 0.6em;
	align-items: flex-start;
	min-height: 74px;
}
.fd-link.fd-fav-tile {
	box-shadow: inset 3px 0 0 var(--accent);
}
.fd-fav {
	width: 15px;
	height: 15px;
	border-radius: 3px;
	flex: none;
	margin-top: 3px;
	background: var(--fd-edge);
}
.fd-lx {
	min-width: 0;
	flex: 1;
}
.fd-lt {
	font-family: et-book, Palatino, Georgia, serif;
	font-weight: 600;
	font-size: 0.92rem;
	line-height: 1.2;
}
.fd-ld {
	font-family: "Space Mono", monospace;
	font-size: 0.58rem;
	color: var(--text-secondary);
	margin-top: 0.35rem;
}
.fd-star {
	color: var(--accent);
	font-size: 0.8rem;
	flex: none;
}

/* ---- footer ---- */
.fd-footer {
	display: flex;
	align-items: center;
	gap: 0.9em;
	margin-top: 2em;
}
.fd-count {
	font-family: "Space Mono", monospace;
	font-size: 0.72rem;
	color: var(--text-secondary);
}
.fd-refresh {
	background: none;
	border: none;
	font-family: "Space Mono", monospace;
	font-size: 0.7rem;
	color: var(--text-secondary);
	cursor: pointer;
	padding: 0;
}
.fd-refresh:hover {
	color: var(--accent);
}

/* ---- states ---- */
.fd-loading,
.fd-empty {
	font-family: "Space Mono", monospace;
	font-size: 0.8rem;
	color: var(--text-secondary);
	padding: 2em 0;
}
.fd-error {
	font-family: "Space Mono", monospace;
	font-size: 0.8rem;
	color: var(--text-secondary);
	padding: 2em 0;
}
.fd-retry {
	background: none;
	border: 1px solid var(--border);
	font-family: inherit;
	font-size: inherit;
	color: var(--text);
	cursor: pointer;
	padding: 0.2em 0.6em;
	border-radius: 2px;
	margin-left: 0.4em;
}
.fd-retry:hover {
	color: var(--accent);
	border-color: var(--accent);
}

/* ---- central detail panel (fixed, left of the sidebar) ---- */
#fd-panel {
	position: fixed;
	top: 50%;
	right: 235px;
	width: 380px;
	max-width: calc(100vw - 260px);
	max-height: 82vh;
	overflow-y: auto;
	transform: translateY(-50%) translateX(8px);
	z-index: 60;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1.3em 1.4em;
	box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.28);
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 0.18s ease,
		transform 0.18s ease;
}
#fd-panel.fd-show {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(-50%) translateX(0);
}
#fd-panel .fd-src {
	font-family: "Space Mono", monospace;
	font-size: 0.6rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-secondary);
}
#fd-panel .fd-x {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: 0;
	font-size: 1.15rem;
	color: var(--text-secondary);
	cursor: pointer;
	line-height: 1;
}
#fd-panel .fd-x:hover {
	color: var(--accent);
}
#fd-panel .fd-open-top {
	position: absolute;
	top: 11px;
	right: 36px;
	font-family: "Space Mono", monospace;
	font-size: 0.78rem;
	text-decoration: none;
}
#fd-panel .fd-open-top:hover {
	text-decoration: underline;
}
#fd-panel .fd-pt {
	font-family: et-book, Palatino, Georgia, serif;
	font-size: 1.5rem;
	margin: 0.15em 0 0;
	line-height: 1.1;
	font-weight: 600;
}
#fd-panel .fd-sub {
	font-family: "Space Mono", monospace;
	font-size: 0.72rem;
	color: var(--text-secondary);
	margin-top: 0.2em;
}
#fd-panel .fd-stars {
	color: var(--accent);
	letter-spacing: 2px;
	font-size: 1rem;
	margin: 0.5em 0;
}
#fd-panel .fd-pposter {
	display: block;
	width: 130px;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	border-radius: 5px;
	border: 1px solid var(--border);
	margin: 0.3em auto 0.7em;
}
#fd-panel .fd-review {
	font-style: italic;
	font-size: 1.02rem;
	line-height: 1.5;
	white-space: pre-line;
	margin: 0.7em 0;
	color: var(--text);
}
#fd-panel .fd-snip {
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--text-secondary);
	margin: 0.6em 0;
}
#fd-panel .fd-when {
	display: block;
	font-family: "Space Mono", monospace;
	font-size: 0.72rem;
	color: var(--text-secondary);
	margin-top: 0.8em;
}
#fd-panel .fd-out {
	font-family: "Space Mono", monospace;
	font-size: 0.78rem;
	display: inline-block;
	margin-top: 0.6em;
}
#fd-panel .fd-pog {
	display: flex;
	gap: 0.7em;
	margin-top: 0.8em;
	padding: 0.6em;
	border: 1px solid var(--border);
	border-radius: 6px;
	align-items: center;
	text-decoration: none;
	color: inherit;
}
#fd-panel .fd-pog:hover {
	border-color: var(--accent);
}
#fd-panel .fd-pog img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 5px;
	flex: none;
}
#fd-panel .fd-filmhead {
	display: block;
}
#fd-panel .fd-filmhead .fd-ph {
	flex: 1;
}
#fd-panel .fd-dropbody {
	font-size: 1rem;
	line-height: 1.55;
	white-space: pre-line;
}
#fd-panel .fd-dropbody p {
	margin: 0.3em 0;
}

@media (max-width: 900px) {
	#fd-panel {
		right: 50%;
		transform: translate(50%, -50%) translateX(8px);
	}
	#fd-panel.fd-show {
		transform: translate(50%, -50%);
	}
}
