/* =========================================================
   COMPASS Brand Portal – white-label front-end
   Surfaces come from theme variables (light/dark);
   brand accent colors stay constant across themes.
   ========================================================= */

html.bp-standalone,
html.bp-standalone body.bp-standalone-body {
	margin: 0;
	padding: 0;
	min-height: 100%;
}

.bp-portal {
	--bp-radius: 14px;
	font-family: var(--bp-body-font, sans-serif);
	font-weight: var(--bp-body-weight, 400);
	color: var(--bp-text, #111);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	transition: background .2s ease, color .2s ease;
}

.bp-portal *,
.bp-portal *::before,
.bp-portal *::after { box-sizing: border-box; }

.bp-portal h1,
.bp-portal h2,
.bp-portal h3 { font-family: var(--bp-heading-font, sans-serif); font-weight: var(--bp-heading-weight, 700); margin: 0; }

/* ---------------- Header ---------------- */
.bp-header {
	background: var(--bp-header-bg, #111);
	color: var(--bp-header-text, #fff);
	padding: 16px 28px;
	position: sticky;
	top: 0;
	z-index: 30;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px rgba(0, 0, 0, .18);
}
.bp-header-inner {
	max-width: 1240px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}
.bp-brandmark { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bp-logo { max-height: 44px; width: auto; display: block; }
.bp-logo-text { font-family: var(--bp-heading-font); font-weight: 700; font-size: 22px; color: var(--bp-header-text); }
.bp-tagline { color: rgba(255, 255, 255, .7); font-size: 14px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .25); }

.bp-header-tools { display: flex; align-items: center; gap: 12px; }
.bp-search-wrap { flex: 0 1 300px; }
.bp-search {
	width: 100%;
	padding: 10px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .2);
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 14px;
	outline: none;
}
.bp-search::placeholder { color: rgba(255, 255, 255, .6); }
.bp-search:focus { border-color: var(--bp-accent); background: rgba(255, 255, 255, .18); }

/* Day/night switch button */
.bp-theme-toggle {
	flex: 0 0 auto;
	border: 0; padding: 0; background: transparent; cursor: pointer;
	line-height: 0;
}
.bp-toggle-track {
	position: relative; display: inline-flex; align-items: center;
	width: 64px; height: 32px; border-radius: 999px;
	background: rgba(0, 0, 0, .35);
	border: 1px solid rgba(255, 255, 255, .25);
	transition: background .25s ease;
}
.bp-portal[data-theme="light"] .bp-toggle-track { background: #f5c451; border-color: rgba(0, 0, 0, .1); }
.bp-toggle-ico {
	position: absolute; top: 50%; transform: translateY(-50%);
	font-size: 16px; width: 16px; height: 16px; z-index: 1;
}
.bp-toggle-sun { left: 8px; color: #fff3d6; }
.bp-toggle-moon { right: 8px; color: #cfd6ff; }
.bp-portal[data-theme="light"] .bp-toggle-moon { color: rgba(0, 0, 0, .35); }
.bp-portal[data-theme="dark"] .bp-toggle-sun { color: rgba(255, 255, 255, .4); }
.bp-toggle-knob {
	position: absolute; top: 3px; left: 3px; z-index: 2;
	width: 24px; height: 24px; border-radius: 50%;
	background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
	transition: transform .25s cubic-bezier(.4, .1, .3, 1.3);
}
.bp-portal[data-theme="dark"] .bp-toggle-knob { transform: translateX(32px); }

/* ---------------- Body layout ---------------- */
.bp-body {
	flex: 1;
	max-width: 1240px;
	width: 100%;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 28px;
	padding: 28px;
}

/* ---------------- Nav ---------------- */
.bp-nav {
	position: sticky;
	top: 92px;
	align-self: start;
	background: var(--bp-surface);
	border: 1px solid var(--bp-border);
	border-radius: var(--bp-radius);
	padding: 16px 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
}
.bp-nav-title {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--bp-muted);
	padding: 4px 12px 10px;
}
.bp-nav-select { display: none; width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--bp-border); background: var(--bp-surface-2); color: var(--bp-text); font-size: 15px; }
.bp-nav ul { list-style: none; margin: 0; padding: 0; }
.bp-tab {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	color: var(--bp-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: background .15s, color .15s;
}
.bp-tab .dashicons { color: var(--bp-primary); font-size: 18px; width: 18px; height: 18px; }
.bp-tab:hover { background: color-mix(in srgb, var(--bp-primary) 10%, transparent); }
.bp-tab.is-active { background: var(--bp-primary); color: #fff; }
.bp-tab.is-active .dashicons { color: #fff; }
.bp-count {
	margin-left: auto;
	background: var(--bp-surface-2);
	color: var(--bp-muted);
	font-size: 12px;
	border-radius: 999px;
	padding: 1px 8px;
	min-width: 22px;
	text-align: center;
}
.bp-tab.is-active .bp-count { background: rgba(255, 255, 255, .25); color: #fff; }

/* ---------------- Main ---------------- */
.bp-main { min-width: 0; }
.bp-welcome { margin-bottom: 26px; }
.bp-welcome h1 { font-size: 30px; margin-bottom: 6px; }
.bp-welcome p { color: var(--bp-muted); font-size: 15px; }

.bp-section { margin-bottom: 40px; scroll-margin-top: 100px; }
.bp-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 20px;
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--bp-border);
}
.bp-section-title > .dashicons { color: var(--bp-primary); }
.bp-empty { color: var(--bp-muted); font-style: italic; }

/* Select-all per group */
.bp-selectall {
	margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
	font-size: 13px; font-weight: 500; color: var(--bp-muted); cursor: pointer;
}
.bp-selectall input { width: 16px; height: 16px; accent-color: var(--bp-primary); cursor: pointer; }
.bp-selectall:hover { color: var(--bp-text); }

/* ---------------- Grid + cards ---------------- */
.bp-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bp-grid-color { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.bp-grid-url { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.bp-card {
	position: relative;
	background: var(--bp-surface);
	border: 1px solid var(--bp-border);
	border-radius: var(--bp-radius);
	overflow: hidden;
	transition: transform .15s, box-shadow .15s;
	display: flex;
	flex-direction: column;
	cursor: pointer;
}
.bp-card .bp-detail { display: none; }
.bp-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, .14); }
.bp-card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.bp-card-body strong { font-size: 14px; font-weight: 600; word-break: break-word; }
.bp-meta { font-size: 12px; color: var(--bp-muted); }

.bp-btn {
	display: inline-block;
	align-self: flex-start;
	background: var(--bp-primary);
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	transition: filter .15s;
}
.bp-btn:hover { filter: brightness(1.08); }

/* Selection checkbox */
.bp-check {
	position: absolute; top: 10px; left: 10px; z-index: 4;
	width: 26px; height: 26px; cursor: pointer;
}
.bp-check-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bp-check-box {
	position: absolute; inset: 0; border-radius: 7px;
	background: rgba(255, 255, 255, .9);
	border: 1px solid rgba(0, 0, 0, .2);
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.bp-check-box .dashicons { font-size: 18px; width: 18px; height: 18px; color: #fff; opacity: 0; transition: opacity .1s; }
.bp-check-input:checked + .bp-check-box { background: var(--bp-primary); border-color: var(--bp-primary); }
.bp-check-input:checked + .bp-check-box .dashicons { opacity: 1; }
.bp-card.is-selected { outline: 2px solid var(--bp-primary); outline-offset: -2px; }

/* Square media thumbnails */
.bp-thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	background: repeating-conic-gradient(rgba(0,0,0,.04) 0% 25%, transparent 0% 50%) 50% / 22px 22px, var(--bp-surface-2);
	display: flex; align-items: center; justify-content: center;
	overflow: hidden;
}
.bp-thumb-img { padding: 0; }
.bp-thumb .bp-cover, .bp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-thumb-file { flex-direction: column; gap: 8px; }
.bp-thumb-file .dashicons { font-size: 46px; width: 46px; height: 46px; color: var(--bp-muted); }
.bp-file-ext { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--bp-muted); }
.bp-thumb-link { text-decoration: none; }
.bp-thumb-link .dashicons { font-size: 40px; width: 40px; height: 40px; color: var(--bp-primary); }

/* Colors */
.bp-card-color .bp-swatch {
	width: 100%; aspect-ratio: 3 / 2; border: none; cursor: pointer; padding: 0; display: block;
}
.bp-card-color .bp-card-body { gap: 6px; }
.bp-copyrow { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bp-copyrow-label { width: 42px; color: var(--bp-muted); font-weight: 600; letter-spacing: .03em; flex: 0 0 auto; }
.bp-copyrow-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--bp-text); flex: 1; }
.bp-copy-icon {
	border: none; background: transparent; cursor: pointer; color: var(--bp-muted);
	padding: 2px; border-radius: 6px; display: inline-flex;
}
.bp-copy-icon:hover { color: var(--bp-primary); background: var(--bp-surface-2); }
.bp-copy-icon .dashicons { font-size: 16px; width: 16px; height: 16px; }
.bp-copyrow.is-copied .bp-copy-icon { color: var(--bp-primary); }
.bp-copyrow.is-copied .bp-copyrow-value::after { content: " ✓"; color: var(--bp-primary); }

/* Fonts */
.bp-font-preview {
	aspect-ratio: 16 / 10;
	padding: 22px 16px; display: flex; align-items: baseline; gap: 14px;
	background: var(--bp-surface-2); border-bottom: 1px solid var(--bp-border);
	overflow: hidden;
}
.bp-font-aa { font-size: 46px; line-height: 1; color: var(--bp-text); }
.bp-font-sample { font-size: 18px; color: var(--bp-muted); }

/* Links */
.bp-link-url { font-size: 12px; color: var(--bp-muted); word-break: break-all; }

/* Videos */
.bp-video { aspect-ratio: 16 / 9; background: #000; }
.bp-video video, .bp-video iframe, .bp-video embed { width: 100%; height: 100%; display: block; border: 0; }

/* Notes – square preview cards */
.bp-thumb-note {
	flex-direction: column; gap: 10px; padding: 16px;
	background: linear-gradient(160deg, var(--bp-surface-2), var(--bp-surface));
	text-align: left; align-items: stretch; justify-content: flex-start;
}
.bp-note-ico { font-size: 26px; width: 26px; height: 26px; color: var(--bp-primary); flex: 0 0 auto; }
.bp-note-excerpt {
	margin: 0; font-size: 13px; line-height: 1.55; color: var(--bp-muted);
	overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
}
.bp-doc {
	display: flex; align-items: center; gap: 8px; margin-top: 12px;
	padding: 10px 12px; border: 1px solid var(--bp-border); border-radius: 10px;
	background: var(--bp-surface-2); text-decoration: none; color: var(--bp-text);
}
.bp-doc:hover { border-color: var(--bp-primary); }
.bp-doc .dashicons { color: var(--bp-primary); }
.bp-doc-name { font-size: 13px; flex: 1; word-break: break-all; }
.bp-doc-size { font-size: 12px; color: var(--bp-muted); }

/* ---------------- Footer ---------------- */
.bp-footer {
	text-align: center;
	padding: 22px;
	color: var(--bp-muted);
	font-size: 13px;
	border-top: 1px solid var(--bp-border);
}
.bp-footer-brand {
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-weight: 700;
	color: var(--bp-text);
	letter-spacing: .01em;
}

/* ---------------- Selection bar ---------------- */
.bp-selbar {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
	z-index: 50;
	display: flex; align-items: center; gap: 16px;
	background: var(--bp-header-bg, #111); color: #fff;
	padding: 12px 18px; border-radius: 999px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.bp-selbar[hidden] { display: none; }
.bp-sel-count { font-size: 14px; }
.bp-sel-download {
	display: inline-flex; align-items: center; gap: 6px;
	background: var(--bp-primary); color: #fff; border: none; cursor: pointer;
	padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.bp-sel-download:hover { filter: brightness(1.08); }
.bp-sel-download .dashicons { font-size: 16px; width: 16px; height: 16px; }
.bp-sel-download.is-busy { opacity: .7; pointer-events: none; }
.bp-sel-clear { background: transparent; border: none; color: rgba(255, 255, 255, .8); cursor: pointer; font-size: 13px; text-decoration: underline; }

/* ---------------- Lightbox / detail modal ---------------- */
.bp-modal {
	position: fixed; inset: 0; z-index: 100;
	display: flex; align-items: center; justify-content: center;
	padding: 24px;
}
.bp-modal[hidden] { display: none; }
.bp-modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.bp-modal-dialog {
	position: relative; z-index: 1;
	width: min(920px, 100%); max-height: 90vh; overflow: auto;
	background: var(--bp-surface); color: var(--bp-text);
	border: 1px solid var(--bp-border); border-radius: 18px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
	animation: bp-modal-in .18s ease;
}
@keyframes bp-modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.bp-modal-close {
	position: absolute; top: 12px; right: 12px; z-index: 3;
	width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
	border: none; background: rgba(0, 0, 0, .45); color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
}
.bp-modal-close:hover { background: rgba(0, 0, 0, .7); }

.bp-detail-inner { display: grid; grid-template-columns: 1.15fr 1fr; }
.bp-detail-media {
	background: var(--bp-surface-2);
	display: flex; align-items: center; justify-content: center;
	min-height: 320px; padding: 20px; overflow: hidden;
}
.bp-detail-media img { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; border-radius: 8px; }
.bp-detail-media video, .bp-detail-media iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; }
.bp-detail-swatch { width: 100%; height: 100%; min-height: 320px; border-radius: 8px; }
.bp-detail-font { font-size: 40px; line-height: 1.3; text-align: center; color: var(--bp-text); }
.bp-detail-font span { font-size: 22px; color: var(--bp-muted); }
.bp-detail-note-ico .dashicons { font-size: 90px; width: 90px; height: 90px; color: var(--bp-primary); opacity: .5; }

.bp-detail-info { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.bp-detail-title { font-size: 22px; }
.bp-detail-meta { font-size: 13px; color: var(--bp-muted); margin: 0; word-break: break-word; }
.bp-detail-meta a { color: var(--bp-primary); }
.bp-detail-note { font-size: 14px; line-height: 1.6; color: var(--bp-text); }
.bp-detail-note p { margin: 0 0 10px; }
.bp-detail-info .bp-btn { align-self: flex-start; }

/* Filtering */
.bp-portal.is-filtered .bp-section { display: none; }
.bp-portal.is-filtered .bp-section.is-visible { display: block; }
.bp-portal.is-filtered .bp-welcome { display: none; }
.bp-card.is-hidden { display: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
	.bp-body { grid-template-columns: 1fr; }
	.bp-nav { position: static; }
	.bp-nav-title { display: none; }
	.bp-nav ul { display: none; }         /* hide the vertical list on mobile */
	.bp-nav-select { display: block; }    /* show dropdown instead */
	.bp-nav { padding: 10px; }
	.bp-header-inner { flex-wrap: wrap; }
	.bp-search-wrap { flex: 1; }
	.bp-detail-inner { grid-template-columns: 1fr; }
	.bp-detail-media { min-height: 220px; }
	.bp-detail-swatch { min-height: 200px; }
}
