/* =========================================================
   Maison Noir Community: header widget (bell + account menu)
   and the notification list. Loaded on every page.
   Uses the theme's colours and fonts when it defines them.
   ========================================================= */

.mncm-hdr,
.mncm-pop,
.mncm-notes {
	--mh-ink: var(--color-text, #2c2823);
	--mh-muted: var(--color-text-muted, #6e6a63);
	--mh-line: rgba(44, 40, 35, 0.12);
	--mh-paper: var(--color-ivory, #fefdfb);
	--mh-wash: var(--color-surface-2, #f1ebe0);
	--mh-accent: var(--color-accent, #b8925a);
	--mh-accent-ink: var(--color-accent-strong, #8a6a36);
	--mh-alert: #b3361f;
}

.mncm-hdr,
.mncm-hdr *,
.mncm-pop,
.mncm-pop * {
	box-sizing: border-box;
}

.mncm-hdr [hidden],
.mncm-pop[hidden] {
	display: none !important;
}

/* ---------- The row in the header ---------- */

.mncm-hdr {
	position: relative;
	z-index: 1100;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 0.2rem;
	margin: 0 0 0 0.25rem;
	color: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.mncm-hdr__item {
	position: relative;
}

.mncm-hdr__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 0.6rem;
	font: inherit;
	font-size: 0.85rem;
	line-height: 1;
	color: inherit;
	text-decoration: none;
	background: transparent;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.2s ease;
}

.mncm-hdr__btn:hover,
.mncm-hdr__btn[aria-expanded="true"] {
	background: rgba(184, 146, 90, 0.16);
}

.mncm-hdr__btn:focus-visible,
.mncm-hdr__join:focus-visible,
.mncm-pop a:focus-visible,
.mncm-pop button:focus-visible {
	outline: 2px solid var(--mh-accent);
	outline-offset: 2px;
}

.mncm-hdr .mncm-avatar {
	display: block;
	flex: 0 0 auto;
	object-fit: cover;
	border-radius: 50%;
}

.mncm-hdr__me {
	padding: 0 0.35rem;
}

.mncm-hdr__name {
	display: none;
	max-width: 11ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mncm-hdr__label {
	display: none;
}

.mncm-hdr__badge {
	position: absolute;
	top: 3px;
	right: 1px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	color: #fff;
	text-align: center;
	background: var(--mh-alert);
	border: 2px solid var(--color-bg, #f8f5f0);
	box-sizing: content-box;
	border-radius: 11px;
	pointer-events: none;
}

.mncm-hdr__join {
	display: none;
	align-items: center;
	min-height: 38px;
	padding: 0 1.1rem;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: #fff;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	background: var(--mh-accent-ink);
	border-radius: 999px;
	transition: background 0.2s ease;
}

.mncm-hdr__join:hover {
	background: var(--color-black, #2c2823);
}

@media (min-width: 640px) {
	.mncm-hdr__label {
		display: inline;
	}

	.mncm-hdr__join {
		display: inline-flex;
	}
}

@media (min-width: 1200px) {
	.mncm-hdr__name {
		display: inline;
	}
}

/* Placement: desktop = logo, menu, search, this. Phones = logo, search, this, menu button. */
@media (min-width: 901px) {
	.site-header__inner > .mncm-hdr {
		order: 3;
	}
}

@media (max-width: 900px) {
	.site-header__inner > .mncm-hdr {
		order: 2;
		margin-left: auto;
	}

	.site-header__inner > .mn-search-trigger ~ .mncm-hdr {
		margin-left: 0;
	}
}

/* A theme without the header hook: the script floats the widget in the corner. */
.mncm-hdr--float {
	position: fixed;
	top: 10px;
	right: 10px;
	padding: 2px;
	color: var(--mh-ink);
	background: var(--mh-paper);
	border: 1px solid var(--mh-line);
	border-radius: 999px;
	box-shadow: 0 6px 20px rgba(44, 40, 35, 0.12);
}

/* ---------- Panels ---------- */

.mncm-pop {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 1200;
	width: min(380px, calc(100vw - 24px));
	overflow: hidden;
	font-family: var(--font-body, inherit);
	font-size: 0.92rem;
	line-height: 1.45;
	color: var(--mh-ink);
	text-align: left;
	letter-spacing: normal;
	text-transform: none;
	background: var(--mh-paper);
	border: 1px solid var(--mh-line);
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(44, 40, 35, 0.2);
}

.mncm-pop--me {
	width: min(300px, calc(100vw - 24px));
}

/* On a phone the panel spans the header width instead of hanging off a small button. */
@media (max-width: 700px) {
	.mncm-hdr,
	.mncm-hdr__item {
		position: static;
	}

	.mncm-pop,
	.mncm-pop--me {
		top: 100%;
		right: 0;
		left: 0;
		width: auto;
		margin: 6px 10px 0;
		max-height: calc(100vh - 90px);
		overflow-y: auto;
	}
}

.mncm-pop__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--mh-line);
}

.mncm-pop__link {
	padding: 0.25rem 0;
	font: inherit;
	font-size: 0.85rem;
	color: var(--mh-accent-ink);
	text-decoration: underline;
	background: none;
	border: 0;
	cursor: pointer;
}

.mncm-pop__foot {
	display: block;
	padding: 0.9rem 1rem;
	font-weight: 600;
	color: var(--mh-accent-ink);
	text-align: center;
	text-decoration: none;
	border-top: 1px solid var(--mh-line);
}

.mncm-pop__foot:hover {
	background: var(--mh-wash);
}

/* ---------- Account menu ---------- */

.mncm-me {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 1rem;
	border-bottom: 1px solid var(--mh-line);
}

.mncm-me .mncm-avatar {
	width: 44px;
	height: 44px;
}

.mncm-me strong {
	display: block;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.mncm-me a {
	font-size: 0.85rem;
	color: var(--mh-accent-ink);
}

.mncm-menu {
	margin: 0;
	padding: 0.35rem;
	list-style: none;
}

.mncm-menu li {
	margin: 0;
	padding: 0;
}

.mncm-menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	min-height: 46px;
	padding: 0.55rem 0.8rem;
	color: var(--mh-ink);
	text-decoration: none;
	border-radius: 8px;
}

.mncm-menu a:hover {
	background: var(--mh-wash);
}

.mncm-menu__out {
	margin-top: 0.35rem !important;
	padding-top: 0.35rem !important;
	border-top: 1px solid var(--mh-line);
}

.mncm-menu__count {
	min-width: 22px;
	padding: 0 6px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 22px;
	color: #fff;
	text-align: center;
	background: var(--mh-alert);
	border-radius: 11px;
}

/* ---------- Notification list (panel and page) ---------- */

.mncm-notes {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: min(60vh, 420px);
	overflow-y: auto;
	color: var(--mh-ink);
}

.mncm-notes li {
	margin: 0;
	padding: 0;
}

.mncm-notes__empty {
	padding: 1.4rem 1rem !important;
	color: var(--mh-muted);
}

.mncm-note a {
	display: flex;
	align-items: flex-start;
	gap: 0.8rem;
	padding: 0.85rem 1rem;
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid var(--mh-line);
}

.mncm-note a:hover {
	background: var(--mh-wash);
}

.mncm-note.is-unread a {
	background: rgba(184, 146, 90, 0.11);
}

.mncm-note.is-unread .mncm-note__text {
	font-weight: 600;
}

.mncm-note__icon {
	display: grid;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	place-items: center;
	color: var(--mh-accent-ink);
	background: var(--mh-wash);
	border-radius: 50%;
}

.mncm-note__icon--staff {
	color: #fff;
	background: var(--mh-alert);
}

.mncm-note__body {
	min-width: 0;
}

.mncm-note__text {
	display: block;
	overflow-wrap: anywhere;
}

.mncm-note__time {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.8rem;
	color: var(--mh-muted);
}

/* On its own page */
.mncm-notes--page {
	max-width: 640px;
	max-height: none;
	margin: 0 0 1.25rem;
	overflow: hidden;
	background: var(--mh-paper);
	border: 1px solid var(--mh-line);
	border-radius: 14px;
}

.mncm-notes--page .mncm-note:last-child a {
	border-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.mncm-hdr__btn,
	.mncm-hdr__join {
		transition: none;
	}
}

@media (max-width: 1279px) {
	.mncm-hdr__me > svg {
		display: none;
	}
}
