/* Island Craft PDF Library — frontend styles.
   Scoped under .ic-pdf-library so it won't bleed into the rest of the theme. */

.ic-pdf-library {
	--icpdf-border: #e2e5e9;
	--icpdf-head-bg: #f7f8fa;
	--icpdf-row-hover: #f4f9f6;
	--icpdf-accent: #2a7f5f;
	--icpdf-accent-hover: #1f6049;
	--icpdf-text: #1f2933;
	--icpdf-muted: #6b7785;
	font-size: 15px;
	color: var(--icpdf-text);
	margin: 0 0 1.5em;
}

.ic-pdf-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 1rem;
	align-items: flex-end;
}

.ic-pdf-control {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.ic-pdf-control-search {
	flex: 1 1 220px;
}

.ic-pdf-control label {
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--icpdf-muted);
}

.ic-pdf-control select,
.ic-pdf-control input[type="search"] {
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--icpdf-border);
	border-radius: 6px;
	background: #fff;
	font-size: 0.95rem;
	color: var(--icpdf-text);
	min-width: 180px;
	width: 100%;
	box-sizing: border-box;
}

.ic-pdf-control select:focus,
.ic-pdf-control input[type="search"]:focus {
	outline: none;
	border-color: var(--icpdf-accent);
	box-shadow: 0 0 0 2px rgba( 42, 127, 95, 0.15 );
}

.ic-pdf-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--icpdf-border);
	border-radius: 8px;
}

.ic-pdf-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	background: #fff;
}

.ic-pdf-table th,
.ic-pdf-table td {
	padding: 0.8rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--icpdf-border);
	vertical-align: middle;
}

.ic-pdf-table thead th {
	background: var(--icpdf-head-bg);
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--icpdf-muted);
	white-space: nowrap;
}

.ic-pdf-table tbody tr:last-child td {
	border-bottom: none;
}

.ic-pdf-table tbody tr:hover {
	background: var(--icpdf-row-hover);
}

/* Sortable headers */
.ic-pdf-sortable {
	cursor: pointer;
	user-select: none;
}

.ic-pdf-sortable span:first-child {
	margin-right: 0.35rem;
}

.ic-pdf-arrow {
	display: inline-block;
	width: 0;
	height: 0;
	opacity: 0.25;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	vertical-align: middle;
}

.ic-pdf-sortable.ic-pdf-asc .ic-pdf-arrow {
	opacity: 1;
	border-top: none;
	border-bottom: 5px solid currentColor;
}

.ic-pdf-sortable.ic-pdf-desc .ic-pdf-arrow {
	opacity: 1;
}

/* Title cell */
.ic-pdf-title {
	font-weight: 600;
	display: block;
}

.ic-pdf-fname {
	display: block;
	font-size: 0.8rem;
	color: var(--icpdf-muted);
	margin-top: 0.15rem;
	word-break: break-all;
}

.ic-pdf-cell-size,
.ic-pdf-cell-date {
	white-space: nowrap;
	color: var(--icpdf-muted);
}

/* Download button */
.ic-pdf-btn {
	display: inline-block;
	padding: 0.45rem 0.95rem;
	background: var(--icpdf-accent);
	color: #fff !important;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease;
}

.ic-pdf-btn:hover,
.ic-pdf-btn:focus {
	background: var(--icpdf-accent-hover);
	color: #fff !important;
}

.ic-pdf-na {
	color: var(--icpdf-muted);
	font-style: italic;
}

.ic-pdf-noresults,
.ic-pdf-empty {
	padding: 1.2rem;
	text-align: center;
	color: var(--icpdf-muted);
	margin: 0;
}

/* Responsive: stack into cards on narrow screens */
@media ( max-width: 640px ) {
	.ic-pdf-table thead {
		display: none;
	}

	.ic-pdf-table,
	.ic-pdf-table tbody,
	.ic-pdf-table tr,
	.ic-pdf-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.ic-pdf-table tr {
		border-bottom: 1px solid var(--icpdf-border);
		padding: 0.5rem 0;
	}

	.ic-pdf-table td {
		border-bottom: none;
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
		padding: 0.45rem 1rem;
	}

	.ic-pdf-table td::before {
		content: attr( data-label );
		font-size: 0.72rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--icpdf-muted);
		flex: 0 0 auto;
	}

	.ic-pdf-cell-title {
		flex-direction: column;
		align-items: flex-start;
	}

	.ic-pdf-cell-title::before {
		margin-bottom: 0.2rem;
	}
}
