/*
 * X Batch Embed — front-end styles.
 *
 * Default layout: one large post per row, clean image, with a subtle
 * "via @handle on X" citation underneath.
 */

/* ---------- Grid wrapper ---------- */
.xbe-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2em;
	margin: 2em 0;
}

.xbe-grid--2 { grid-template-columns: repeat(2, 1fr); gap: 1.25em; }
.xbe-grid--3 { grid-template-columns: repeat(3, 1fr); gap: 1.25em; }
.xbe-grid--4 { grid-template-columns: repeat(4, 1fr); gap: 1.25em; }

/* Single column = large image per row. */
.xbe-grid--single {
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

@media (max-width: 600px) {
	.xbe-grid--2,
	.xbe-grid--3,
	.xbe-grid--4 {
		grid-template-columns: 1fr;
	}
}

/* ---------- Item ---------- */
.xbe-item {
	margin: 0;
	padding: 0;
}

.xbe-item__media {
	margin: 0;
	line-height: 0;
	background: #f4f4f5;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #ebeef0;
}

.xbe-item__link {
	display: block;
}

.xbe-item__link img {
	width: 100%;
	height: auto;
	display: block;
	line-height: 1;
	transition: opacity 0.2s ease;
}

.xbe-item__link:hover img {
	opacity: 0.92;
}

/* Text-only tweet (no image): a quoted card. */
.xbe-item__textcard {
	display: block;
	text-decoration: none;
	color: inherit;
}
.xbe-item__textcard blockquote {
	margin: 0;
	padding: 1.2em 1.4em;
	font-size: 1em;
	line-height: 1.5;
	color: #0f1419;
	background: #fff;
}

/* ---------- Footer: tweet text + citation ---------- */
.xbe-item__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em 0.75em;
	margin-top: 0.6em;
	font-size: 0.85em;
	color: #536471;
	line-height: 1.4;
}

.xbe-item__text {
	flex: 1 1 100%;
	color: #0f1419;
}

/* Collapsible tweet text toggle. */
.xbe-item__text-toggle {
	flex: 1 1 100%;
}
.xbe-item__text-toggle > summary {
	display: inline-block;
	list-style: none;
	cursor: pointer;
	color: #536471;
	user-select: none;
	border-bottom: 1px dashed transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.xbe-item__text-toggle > summary::-webkit-details-marker { display: none; }
.xbe-item__text-toggle > summary::before {
	content: "+ ";
	font-weight: 700;
	color: #b0b8bf;
}
.xbe-item__text-toggle[open] > summary::before { content: "− "; }
.xbe-item__text-toggle > summary:hover {
	color: #0f1419;
	border-bottom-color: #cfd9de;
}
.xbe-item__text-toggle .xbe-item__text {
	display: block;
	margin-top: 0.5em;
	padding: 0.6em 0.8em;
	background: #f7f9fa;
	border-left: 3px solid #cfd9de;
	border-radius: 0 4px 4px 0;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Citation line. */
.xbe-item__via {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.xbe-item__via a {
	color: #536471;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.xbe-item__via a:hover {
	color: #0f1419;
	border-bottom-color: #cfd9de;
}

/* Small X logo glyph before the citation — subtle brand cue. */
.xbe-item__via::before {
	content: "";
	display: inline-block;
	width: 13px;
	height: 13px;
	background-color: #536471;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/></svg>") center / contain no-repeat;
}
