/**
 * Newsletter Asset Library - frontend styles
 */

.nal-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
		Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1f2937;
	max-width: 1280px;
	margin: 0 auto;
}

.nal-wrap *,
.nal-wrap *::before,
.nal-wrap *::after {
	box-sizing: border-box;
}

.nal-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 20px;
	padding: 12px 16px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	position: sticky;
	top: 0;
	z-index: 5;
}

.nal-search {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 12px;
	font-size: 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	color: #111827;
	outline: none;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.nal-search:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.nal-count {
	font-size: 13px;
	color: #6b7280;
	white-space: nowrap;
}

.nal-group-heading {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #374151;
	margin: 28px 0 12px;
	padding-bottom: 6px;
	border-bottom: 1px solid #e5e7eb;
}

.nal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}

.nal-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	transition: box-shadow 150ms ease, transform 150ms ease,
		border-color 150ms ease;
}

.nal-card:hover {
	border-color: #d1d5db;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.nal-thumb {
	display: block;
	background: #f3f4f6;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.nal-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.nal-body {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
}

.nal-title {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nal-filename {
	font-size: 12px;
	color: #6b7280;
	margin: 0;
	word-break: break-all;
}

.nal-meta {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 11px;
	color: #4b5563;
}

.nal-meta li {
	background: #f3f4f6;
	border-radius: 4px;
	padding: 2px 6px;
	line-height: 1.5;
}

.nal-alt {
	font-size: 12px;
	color: #374151;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 6px;
	padding: 6px 8px;
	margin: 0;
	line-height: 1.4;
}

.nal-alt-label {
	font-weight: 600;
	margin-right: 4px;
	color: #92400e;
}

.nal-url-row {
	display: flex;
	gap: 6px;
	margin-top: auto;
}

.nal-url {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;
	padding: 7px 9px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #f9fafb;
	color: #111827;
}

.nal-url:focus {
	outline: none;
	background: #fff;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.nal-copy {
	flex: 0 0 auto;
	padding: 7px 12px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: #2563eb;
	border: 1px solid #2563eb;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease,
		transform 80ms ease;
	white-space: nowrap;
}

.nal-copy:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
}

.nal-copy:active {
	transform: translateY(1px);
}

.nal-copy.is-copied {
	background: #16a34a;
	border-color: #16a34a;
}

.nal-copy.is-error {
	background: #dc2626;
	border-color: #dc2626;
}

.nal-empty,
.nal-notice {
	padding: 24px;
	text-align: center;
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	color: #4b5563;
}

.nal-notice {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.nal-pagination {
	margin-top: 24px;
}

.nal-pagination ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.nal-pagination a,
.nal-pagination span {
	display: inline-block;
	padding: 6px 12px;
	font-size: 13px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	color: #1f2937;
	text-decoration: none;
	background: #fff;
}

.nal-pagination a:hover {
	border-color: #2563eb;
	color: #2563eb;
}

.nal-pagination .current {
	background: #2563eb;
	color: #fff;
	border-color: #2563eb;
}

@media (max-width: 600px) {
	.nal-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.nal-grid {
		grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	}
}

/* ---------- [newsletter_folder_browser] shortcode ---------- */

.nal-folder-browser {
	margin: 0 auto;
}

.nal-folder-grid {
	display: grid;
	grid-template-columns: repeat(var(--nal-folder-cols, 4), minmax(0, 1fr));
	gap: 16px;
}

.nal-folder-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 18px 18px 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	text-decoration: none;
	color: #1f2937;
	transition: border-color 150ms ease, box-shadow 150ms ease,
		transform 150ms ease, background-color 150ms ease;
}

.nal-folder-card:hover,
.nal-folder-card:focus-visible {
	border-color: #2563eb;
	box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
	transform: translateY(-1px);
	background: #fbfdff;
	color: #1f2937;
	text-decoration: none;
}

.nal-folder-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 10px;
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	color: #b45309;
}

.nal-folder-name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: #111827;
	word-break: break-word;
}

.nal-folder-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
	color: #6b7280;
}

.nal-folder-count,
.nal-folder-subfolders {
	display: inline-block;
	background: #f3f4f6;
	border-radius: 4px;
	padding: 2px 8px;
	line-height: 1.6;
}

.nal-folder-subfolders {
	background: #eef2ff;
	color: #4338ca;
}

/* Breadcrumb above drill-down grid */
.nal-breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
	padding: 10px 14px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 13px;
	color: #4b5563;
}

.nal-back-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
}

.nal-back-link:hover {
	text-decoration: underline;
}

.nal-breadcrumb-sep {
	color: #9ca3af;
}

.nal-breadcrumb-current {
	color: #111827;
	font-weight: 600;
}

@media (max-width: 900px) {
	.nal-folder-grid {
		grid-template-columns: repeat(min(var(--nal-folder-cols, 4), 3), minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.nal-folder-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- [newsletter_campaigns] shortcode ---------- */

.nal-campaigns .nal-campaign-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
}

.nal-campaigns thead th {
	text-align: left;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	padding: 10px 12px;
	font-weight: 600;
	color: #374151;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.nal-campaigns tbody td {
	padding: 12px;
	border-bottom: 1px solid #f3f4f6;
	vertical-align: top;
}

.nal-campaigns tbody tr:last-child td {
	border-bottom: 0;
}

.nal-campaigns tbody tr:hover {
	background: #f9fafb;
}

.nal-folder-tag {
	display: inline-block;
	background: #eef2ff;
	color: #4338ca;
	border-radius: 4px;
	padding: 2px 6px;
	font-size: 11px;
	margin-left: 6px;
}

.nal-muted {
	color: #9ca3af;
	font-style: italic;
}

.nal-handoff-cell {
	white-space: nowrap;
}

.nal-btn {
	display: inline-block;
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 6px;
	border: 1px solid #d1d5db;
	background: #fff;
	color: #1f2937;
	text-decoration: none;
	margin-right: 4px;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.nal-btn:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.nal-btn-primary {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
}

.nal-btn-primary:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #fff;
}
