/**
 * DataStream front-end styles.
 *
 * Neutral, theme-friendly defaults: relative units, currentColor, no
 * hardcoded fonts. Everything can be overridden by the theme.
 */

.datastream-empty-state {
	padding: 1em;
	border: 1px dashed currentColor;
	border-radius: 4px;
	opacity: 0.75;
}

/* List template */

.datastream-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.datastream-list-item {
	padding: 0.75em 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.datastream-list-item:last-child {
	border-bottom: 0;
}

.datastream-item-title {
	display: block;
	font-weight: 600;
}

.datastream-item-field {
	display: inline-block;
	margin-right: 1em;
	font-size: 0.9em;
	opacity: 0.85;
}

.datastream-item-label {
	font-weight: 600;
	opacity: 0.7;
}

.datastream-item-label::after {
	content: ':';
}

/* Table template */

.datastream-table-wrap {
	overflow-x: auto;
}

.datastream-table {
	width: 100%;
	border-collapse: collapse;
}

.datastream-table th,
.datastream-table td {
	padding: 0.5em 0.75em;
	text-align: left;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.datastream-table th {
	font-weight: 600;
	border-bottom-width: 2px;
}

/* Cards template */

.datastream-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1em;
}

.datastream-card {
	padding: 1em;
	border: 1px solid rgba(128, 128, 128, 0.3);
	border-radius: 6px;
}

.datastream-card-title {
	margin: 0 0 0.5em;
	font-weight: 600;
}

.datastream-card-fields {
	margin: 0;
	font-size: 0.9em;
}

.datastream-card-fields dt {
	font-weight: 600;
	opacity: 0.7;
}

.datastream-card-fields dd {
	margin: 0 0 0.5em;
}

/* Grid template (image-led) */

.datastream-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.25em;
}

.datastream-grid-item {
	border: 1px solid rgba(128, 128, 128, 0.3);
	border-radius: 6px;
	overflow: hidden;
}

.datastream-grid-media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(128, 128, 128, 0.08);
}

.datastream-grid-media .datastream-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.datastream-grid-title {
	margin: 0.6em 0.8em 0.2em;
	font-weight: 600;
}

.datastream-grid-meta {
	margin: 0 0.8em 0.6em;
	font-size: 0.9em;
	opacity: 0.85;
}

/* Images in any template */

.datastream-img {
	max-width: 100%;
	height: auto;
}

.datastream-table .datastream-img {
	max-width: 80px;
}

/* Raw template */

.datastream-raw {
	overflow-x: auto;
	padding: 1em;
	font-size: 0.85em;
}

/* --- 2.1.0: search, pagination, presets --- */

.datastream-search {
	margin: 0 0 0.75em;
}

.datastream-search-input {
	width: 100%;
	max-width: 320px;
	padding: 0.45em 0.7em;
	border: 1px solid rgba(128, 128, 128, 0.4);
	border-radius: 4px;
	font: inherit;
	background: transparent;
	color: inherit;
}

.datastream-pagination {
	display: flex;
	gap: 0.35em;
	margin-top: 1em;
	flex-wrap: wrap;
}

.datastream-page {
	display: inline-block;
	min-width: 2em;
	text-align: center;
	padding: 0.3em 0.5em;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
}

.datastream-page.is-current {
	font-weight: 700;
	border-color: currentColor;
}

/* Style presets */

.datastream-style-clean .datastream-table th,
.datastream-style-clean .datastream-table td,
.datastream-style-clean .datastream-list-item {
	border: 0;
}

.datastream-style-bordered .datastream-card,
.datastream-style-bordered .datastream-grid-item {
	border-width: 2px;
}

.datastream-style-bordered .datastream-table,
.datastream-style-bordered .datastream-table th,
.datastream-style-bordered .datastream-table td {
	border: 1px solid rgba(128, 128, 128, 0.35);
}

.datastream-style-striped .datastream-table tbody tr:nth-child(odd) {
	background: rgba(128, 128, 128, 0.07);
}

.datastream-style-striped .datastream-list-item:nth-child(odd) {
	background: rgba(128, 128, 128, 0.07);
}

.datastream-style-compact .datastream-table th,
.datastream-style-compact .datastream-table td {
	padding: 0.25em 0.5em;
	font-size: 0.9em;
}

.datastream-style-compact .datastream-list-item {
	padding: 0.35em 0;
}

.datastream-style-compact .datastream-card,
.datastream-style-compact .datastream-grid-item .datastream-grid-title,
.datastream-style-compact .datastream-grid-item .datastream-grid-meta {
	padding: 0.5em;
	margin: 0.2em 0.5em;
}

/* Configurable image aspect for grid media */

.datastream-output {
	--ds-aspect: 4/3;
}

.datastream-grid-media {
	aspect-ratio: var(--ds-aspect, 4 / 3);
}

/* Long text stays tidy */

.datastream-card-fields dd,
.datastream-grid-meta {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
