/* Front-end styles for the dp-berkas list (the [dp_berkas] shortcode).
 *
 * Uses the active theme's OWN colour and typography. Colour is inherited
 * (color: inherit) and everything drawn — panel border, table rules, tag border,
 * button, hover tint, pagination — is derived from the current text colour via
 * color-mix(). There is no font-family, no palette and no absolute type scale of
 * its own: sizes are relative (em) so they scale with the theme's base font
 * size, and the font family is simply inherited. Switch theme and this changes
 * with it.
 *
 * Only structure is declared: the panel, the table and its components. Enqueued
 * only on content that carries the shortcode (dp_enqueue_berkas_assets). Admin
 * screens use the WordPress admin chrome instead (assets/css/admin.css).
 */

.dp-berkas {
	color: inherit;
	font-family: inherit;

	/* Theme-derived line colours. Plain currentColor as the base; upgraded to a
	   translucent currentColor where color-mix() is supported. */
	--dp-berkas-line: currentColor;
	--dp-berkas-line-strong: currentColor;
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
	.dp-berkas {
		--dp-berkas-line: color-mix(in srgb, currentColor 20%, transparent);
		--dp-berkas-line-strong: color-mix(in srgb, currentColor 45%, transparent);
	}
}

/* --- Panel + table ------------------------------------------------------ */

.dp-berkas-panel {
	border: 1px solid var(--dp-berkas-line);
	padding: 1.5rem 1.5rem 0.75rem;
}

.dp-berkas-label {
	margin: 0 0 1.5rem;
	font-size: 0.7em;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.55;
}

.dp-berkas-label [aria-hidden] {
	opacity: 0.5;
}

.dp-berkas-table-wrap {
	overflow-x: auto;
}

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

.dp-berkas-table th {
	padding: 0 1rem 0.85rem 0;
	border-bottom: 1px solid var(--dp-berkas-line);
	font-weight: 400;
	font-size: 0.8em;
	letter-spacing: 0.04em;
	text-align: left;
	opacity: 0.55;
	white-space: nowrap;
}

.dp-berkas-table td {
	padding: 1.15rem 1rem 1.15rem 0;
	border-bottom: 1px solid var(--dp-berkas-line);
	vertical-align: middle;
}

.dp-berkas-table th:last-child,
.dp-berkas-table td:last-child {
	padding-right: 0;
}

.dp-berkas-table tbody tr:last-child td {
	border-bottom: 0;
}

.dp-berkas-cell-name,
.dp-berkas-cell-access,
.dp-berkas-cell-desc {
	font-size: 0.8em;
	overflow-wrap: anywhere;
}

.dp-berkas-cell-desc,
.dp-berkas-cell-access {
	opacity: 0.7;
}

/* File-type tag. */
.dp-berkas-type {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.2em 0.6em;
	border: 1px solid var(--dp-berkas-line-strong);
	border-radius: 4px;
	font-size: 0.72em;
	letter-spacing: 0.1em;
	line-height: 1.5;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0.9;
}

/* Row action button. */
.dp-berkas-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5em 1.1em;
	border: 1px solid var(--dp-berkas-line-strong);
	border-radius: 6px;
	color: inherit;
	font-size: 0.8em;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dp-berkas-button:hover,
.dp-berkas-button:focus-visible {
	border-color: currentColor;
	background-color: color-mix(in srgb, currentColor 7%, transparent);
}

.dp-berkas-empty {
	margin: 0 0 0.75rem;
	opacity: 0.6;
}

/* --- Pagination ---------------------------------------------------------- */

.dp-berkas-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 1.5rem 0 0.75rem;
}

.dp-berkas-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.625rem;
	border: 1px solid var(--dp-berkas-line);
	border-radius: 999px;
	color: inherit;
	font-size: 0.9em;
	line-height: 1;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

a.dp-berkas-page:hover,
a.dp-berkas-page:focus-visible {
	border-color: currentColor;
}

/* Current page: tinted from the theme's own text colour (no fixed fill). */
.dp-berkas-page[aria-current="page"] {
	border-color: currentColor;
	background-color: color-mix(in srgb, currentColor 12%, transparent);
}

/* --- Focus ring (follows the theme's text colour) ------------------------ */

.dp-berkas :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}
