/**
 * Bookmarks / reading list — toggle, header badge, and the bookmarks page.
 *
 * The theme styles every <button> globally (padding / shadow / radius + a mobile
 * width:100%); the toggle resets those on its own class so it stays a compact
 * icon control. Tokens only — no new palette.
 */

/* -------------------------------------------------------------------------- */
/* Save-for-later toggle                                                      */
/* -------------------------------------------------------------------------- */

.mp-bookmark-toggle {
	/* Reset the global button treatment. */
	width: auto;
	min-width: 0;
	margin: 0;
	padding: var(--space-2, 0.5rem);
	border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
	border-radius: var(--radius-md, 8px);
	box-shadow: none;
	background: var(--bg-primary, #fff);
	color: var(--text-secondary, #555);
	line-height: 0;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.mp-bookmark-toggle:hover,
.mp-bookmark-toggle:focus-visible {
	color: var(--brand-amber-dark, #b8860b);
	border-color: var(--brand-amber, #d4a017);
}

.mp-bookmark-toggle__icon {
	width: 1.25rem;
	height: 1.25rem;
	display: block;
	fill: none;
	stroke: currentColor;
}

/* Saved: filled bookmark in the brand amber. */
.mp-bookmark-toggle[aria-pressed="true"] {
	color: var(--brand-amber-dark, #b8860b);
	border-color: var(--brand-amber, #d4a017);
}

.mp-bookmark-toggle[aria-pressed="true"] .mp-bookmark-toggle__icon {
	fill: currentColor;
}

.mp-bookmark-toggle--error {
	color: var(--error, #c0392b);
	border-color: var(--error, #c0392b);
}

/* Card placement: float top-right over a card hero. */
.mp-bookmark-toggle--card {
	position: absolute;
	top: var(--space-3, 0.75rem);
	right: var(--space-3, 0.75rem);
	z-index: 3;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(2px);
}

/* Anchor the absolute toggle: the canonical product/brand/store card is the
   positioning context (the community card sets its own). Low-risk: position
   relative alone changes nothing visually. */
.mp-cm-card {
	position: relative;
}

/* -------------------------------------------------------------------------- */
/* Header badge                                                               */
/* -------------------------------------------------------------------------- */

.mp-bookmarks-link {
	position: relative;
}

.mp-bookmarks-badge {
	position: absolute;
	top: -0.35rem;
	right: -0.45rem;
	min-width: 1.1rem;
	height: 1.1rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: var(--brand-amber, #d4a017);
	color: var(--text-inverse, #fff);
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.1rem;
	text-align: center;
}

.mp-bookmarks-badge[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------- */
/* Bookmarks page                                                             */
/* -------------------------------------------------------------------------- */

.mp-bookmarks-page {
	/* Fill the shared page container (--content-max-width) like every other
	   page; no second, narrower cap. */
	padding-bottom: var(--space-12, 3rem);
}

.mp-bookmarks-group {
	margin-bottom: var(--space-12, 3rem);
}

.mp-bookmarks-group__title {
	margin: 0 0 var(--space-4, 1rem);
	font-family: var(--font-heading, "Playfair Display", serif);
	font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
	color: var(--text-primary, #1a1a1a);
}

/* Saved producers and stores use the immersive "featured" card, designed for a
   three-up grid like the Producers/Stores landings (the base .mp-cm-grid
   auto-fills to a narrower four-up). */
.mp-bookmarks-group--brand .mp-cm-grid,
.mp-bookmarks-group--sales_point .mp-cm-grid {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {

	.mp-bookmarks-group--brand .mp-cm-grid,
	.mp-bookmarks-group--sales_point .mp-cm-grid {
		grid-template-columns: 1fr;
	}
}

/* Each saved entity's renderer wraps its card in .mp-bookmark-item so the toggle
   can overlay and an unsave can drop just that card. */
.mp-bookmark-item {
	position: relative;
}

.mp-bookmark-item--removing {
	opacity: 0;
	transform: scale(0.97);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

/* Empty states. */
.mp-bookmarks-empty {
	max-width: 38rem;
	margin: var(--space-8, 2rem) auto;
	text-align: center;
	color: var(--text-secondary, #555);
}

.mp-bookmarks-empty__title {
	margin: 0 0 var(--space-3, 0.75rem);
	font-family: var(--font-heading, "Playfair Display", serif);
	font-size: 1.5rem;
	color: var(--text-primary, #1a1a1a);
}

.mp-bookmarks-empty__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3, 0.75rem);
	justify-content: center;
	margin-top: var(--space-6, 1.5rem);
}

/* Read-dim — stories this browser has already opened (set by bookmarks.js). */
.mp-bookmark-item--read {
	opacity: 0.55;
	transition: opacity 0.15s ease;
}

.mp-bookmark-item--read:hover,
.mp-bookmark-item--read:focus-within {
	opacity: 1;
}
