/*
 * AA Notifications UI — bell, badge, dropdown (U7).
 *
 * EVERY SELECTOR IS SCOPED UNDER .aa-notif, following the lesson in
 * docs/solutions/ui-bugs/comment-button-style-lives-in-elementor-custom-code.md:
 * this ships as an enqueued stylesheet with its own namespace rather than
 * Additional CSS or an Elementor Custom Code snippet, and rather than reusing
 * bare selectors that could collide with The7 or an Elementor global style.
 *
 * TOKENS ARE COPIED IN, NOT SHARED FROM aa-points.php. The design system's
 * tokens/colors.css and tokens/spacing.css values are pasted below with an
 * --aa-notif- prefix so this file has no load-order dependency on any other
 * mu-plugin's <style> block. --aa-notif-font-display/-accent/-body map onto
 * the site's existing Cartridge/Poppins stack per the design README's
 * instruction not to ship new webfonts for this feature.
 */

:root {
	--aa-notif-orange: #db680b;
	--aa-notif-orange-dark: #b8560a;
	--aa-notif-brown: #6a3306;
	--aa-notif-brown-light: #8a4a12;
	--aa-notif-yellow: #fae905;
	--aa-notif-yellow-dark: #e0c900;
	--aa-notif-yellow-light: #fdf28a;
	--aa-notif-cream: #fdf6e8;
	--aa-notif-white: #ffffff;
	--aa-notif-text-muted: #8a7a63;
	--aa-notif-border: #e8ddc4;

	--aa-notif-radius-sm: 4px;
	--aa-notif-radius-md: 8px;
	--aa-notif-radius-pill: 9999px;
	--aa-notif-shadow-card: 0 2px 8px rgba(74, 36, 4, 0.10);
	--aa-notif-shadow-card-hover: 0 6px 20px rgba(74, 36, 4, 0.18);

	--aa-notif-font-display: 'Cartridge', ui-sans-serif, system-ui, sans-serif;
	--aa-notif-font-accent: 'Poppins', ui-sans-serif, system-ui, sans-serif;
	--aa-notif-font-body: 'Poppins', ui-sans-serif, system-ui, sans-serif;
}

.aa-notif {
	position: relative;
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

/*
 * THE HEADER COLUMN THIS SITS IN, FORCED TO A ROW. Elementor's Login/Logout
 * column (56effe2 on the front-page header post 50845, 5759152 on the
 * all-other-pages header post 86585 — see wp/place-notification-bell.php)
 * previously held exactly one VISIBLE widget at a time: Login and Logout
 * carry opposite JetEngine Dynamic Visibility conditions, so only one of them
 * was ever actually in view, and the column's block layout never had to lay
 * two children out side by side. The bell widget is visible at the same time
 * as Logout (both condition on a signed-in visitor), so without this the
 * column stacks them block-fashion and the bell floats above the header row
 * instead of sitting to Logout's left. Scoped to the two known column IDs
 * rather than every Elementor column, so nothing else on the site is
 * affected.
 *
 * THE REAL FLEX CONTAINER IS THE INNER .elementor-widget-wrap, NOT THE
 * COLUMN DIV ITSELF. Measured over CDP on staging: the column div
 * (.elementor-element-56effe2) is already `display:flex` by Elementor's own
 * CSS, but its default `flex-direction` is `column` — that is what stacks a
 * column's widgets top-to-bottom, which is exactly why Login/Logout never
 * needed a row layout before (only one of them was ever visible at once).
 * Overriding `display` on the column div changed nothing observable; the
 * fix is `flex-direction: row` on the wrap one level in.
 */
.elementor-element-56effe2 > .elementor-widget-wrap,
.elementor-element-5759152 > .elementor-widget-wrap {
	flex-direction: row !important;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

/* Elementor's default 20px bottom margin on a stacked widget (meant for the
   column's old top-to-bottom layout) offsets the bell within the row above —
   zeroed only on the shortcode widget so Login/Logout's own spacing is
   untouched. */
.elementor-element-56effe2 > .elementor-widget-wrap > .elementor-widget-shortcode,
.elementor-element-5759152 > .elementor-widget-wrap > .elementor-widget-shortcode {
	margin: 0 !important;
}

/* ---- bell ------------------------------------------------------------- */

.aa-notif__bell {
	position: relative;
	width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--aa-notif-radius-pill);
	background: transparent;
	color: var(--aa-notif-brown);
	cursor: pointer;
	font-size: 18px;
	padding: 0;
	transition: background-color 0.15s ease;
}

.aa-notif__bell:hover,
.aa-notif__bell:focus-visible {
	background: rgba(106, 51, 6, 0.08);
}

.aa-notif__bell[aria-expanded="true"] {
	background: var(--aa-notif-yellow-dark);
}

.aa-notif__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 22px;
	height: 22px;
	padding: 0 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--aa-notif-radius-pill);
	background: var(--aa-notif-orange);
	color: var(--aa-notif-white);
	font-family: var(--aa-notif-font-body);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	border: 2px solid var(--aa-notif-yellow);
	box-sizing: border-box;
}

.aa-notif__badge[hidden] {
	display: none;
}

/* ---- backdrop click-catcher -------------------------------------------- */

.aa-notif__backdrop {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: transparent;
}

.aa-notif__backdrop[hidden] {
	display: none;
}

/* ---- panel -------------------------------------------------------------- */

.aa-notif__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 380px;
	max-width: calc(100vw - 24px);
	background: var(--aa-notif-white);
	border-radius: var(--aa-notif-radius-md);
	box-shadow: var(--aa-notif-shadow-card-hover);
	z-index: 9999;
	overflow: hidden;
	font-family: var(--aa-notif-font-body);
}

.aa-notif__panel[hidden] {
	display: none;
}

.aa-notif__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px 10px;
}

.aa-notif__title {
	font-family: var(--aa-notif-font-display);
	font-size: 18px;
	font-weight: 400;
	color: var(--aa-notif-brown);
	margin: 0;
}

.aa-notif__head-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.aa-notif__mark-all {
	font-size: 13px;
	font-weight: 600;
	color: var(--aa-notif-orange);
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}

.aa-notif__mark-all:hover {
	color: var(--aa-notif-brown);
}

.aa-notif__mark-all[hidden] {
	display: none;
}

.aa-notif__settings {
	color: var(--aa-notif-text-muted);
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	display: inline-flex;
}

.aa-notif__settings:hover {
	color: var(--aa-notif-brown);
}

.aa-notif__settings[hidden] {
	display: none;
}

/* ---- tabs ---------------------------------------------------------------- */

.aa-notif__tabs {
	display: flex;
	gap: 18px;
	padding: 0 16px;
	border-bottom: 1px solid var(--aa-notif-border);
}

.aa-notif__tab {
	background: none;
	border: 0;
	border-bottom: 3px solid transparent;
	padding: 8px 2px 9px;
	font-size: 13px;
	font-weight: 500;
	color: var(--aa-notif-text-muted);
	cursor: pointer;
}

.aa-notif__tab.is-active {
	color: var(--aa-notif-brown);
	border-bottom-color: var(--aa-notif-orange);
	font-weight: 600;
}

/* ---- rows ---------------------------------------------------------------- */

.aa-notif__body {
	max-height: 360px;
	overflow-y: auto;
}

.aa-notif__row {
	display: grid;
	grid-template-columns: 26px minmax(0, 1fr) auto;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: 10px 16px;
	background: var(--aa-notif-white);
	border: 0;
	border-bottom: 1px solid var(--aa-notif-border);
	text-align: left;
	cursor: pointer;
	font-family: inherit;
	text-decoration: none;
	color: inherit;
}

.aa-notif__row:last-child {
	border-bottom: 0;
}

.aa-notif__row.is-unread {
	background: var(--aa-notif-cream);
}

.aa-notif__row:hover {
	background: var(--aa-notif-yellow-light);
}

.aa-notif__row-icon {
	width: 26px;
	height: 26px;
	border-radius: var(--aa-notif-radius-pill);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--aa-notif-cream);
	color: var(--aa-notif-brown);
	font-size: 12px;
	flex: 0 0 auto;
}

.aa-notif__row.is-unread .aa-notif__row-icon {
	background: var(--aa-notif-yellow-light);
}

.aa-notif__row-message {
	font-size: 13px;
	line-height: 1.4;
	color: var(--aa-notif-brown);
	min-width: 0;
}

.aa-notif__row-message strong {
	font-weight: 700;
}

.aa-notif__row-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.aa-notif__row-time {
	font-size: 11px;
	color: var(--aa-notif-text-muted);
	white-space: nowrap;
}

.aa-notif__row-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--aa-notif-orange);
}

.aa-notif__row:not(.is-unread) .aa-notif__row-dot {
	visibility: hidden;
}

/* ---- empty states ---------------------------------------------------------- */

.aa-notif__empty {
	padding: 40px 24px;
	text-align: center;
}

.aa-notif__empty-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var(--aa-notif-cream);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--aa-notif-brown-light);
	font-size: 20px;
}

.aa-notif__empty-title {
	font-family: var(--aa-notif-font-display);
	font-size: 17px;
	font-weight: 400;
	color: var(--aa-notif-brown);
	margin: 0 0 6px;
}

.aa-notif__empty-body {
	font-size: 13px;
	color: var(--aa-notif-text-muted);
	margin: 0;
}

.aa-notif__empty-reset {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aa-notif-orange);
	text-decoration: none;
}

.aa-notif__empty-reset:hover {
	color: var(--aa-notif-brown);
}

/* ---- footer ------------------------------------------------------------- */

.aa-notif__footer {
	display: block;
	width: 100%;
	padding: 11px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--aa-notif-orange);
	text-decoration: none;
	border-top: 1px solid var(--aa-notif-border);
	background: var(--aa-notif-white);
}

.aa-notif__footer:hover {
	color: var(--aa-notif-brown);
	background: var(--aa-notif-cream);
}

.aa-notif__footer[hidden] {
	display: none;
}

/* ---- mobile: fits a 375px viewport, full-width under the header --------- */

@media (max-width: 480px) {
	.aa-notif__panel {
		position: fixed;
		top: 70px;
		left: 8px;
		right: 8px;
		width: auto;
		max-width: none;
	}
}

/* =========================================================================
 * U8 — the full 3B Sidebar notifications page ([aa_notifications]).
 * Scoped under .aa-notifp — a SEPARATE root class from the dropdown's
 * .aa-notif, because this ships on its own thin page (KTD10) rather than
 * inside the header, and the two never need to share a selector.
 * ========================================================================= */

.aa-notifp {
	font-family: var(--aa-notif-font-body);
	color: var(--aa-notif-brown);
}

.aa-notifp__grid {
	max-width: 1100px;
	margin: 0 auto;
	padding: 40px 32px 64px;
	display: grid;
	grid-template-columns: 230px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

/* ---- left rail ----------------------------------------------------------- */

.aa-notifp__heading {
	font-family: var(--aa-notif-font-display);
	font-size: 34px;
	font-weight: 400;
	color: var(--aa-notif-brown);
	margin: 0 0 4px;
}

.aa-notifp__unread {
	font-size: 14px;
	color: var(--aa-notif-text-muted);
	margin: 0 0 20px;
	min-height: 1em;
}

.aa-notifp__tabs,
.aa-notifp__categories {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.aa-notifp__tabs {
	margin-bottom: 16px;
}

.aa-notifp__tab-row,
.aa-notifp__cat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	text-align: left;
	color: var(--aa-notif-text-muted);
}

.aa-notifp__tab-row {
	padding: 8px 12px;
	border-radius: var(--aa-notif-radius-sm);
}

.aa-notifp__tab-row.is-active {
	background: var(--aa-notif-yellow-light);
	color: var(--aa-notif-brown);
	font-weight: 600;
}

.aa-notifp__rule {
	border-top: 1px solid var(--aa-notif-border);
	padding-top: 16px;
	margin-top: 8px;
}

.aa-notifp__type-heading {
	font-family: var(--aa-notif-font-accent);
	font-size: 15px;
	font-weight: 500;
	color: var(--aa-notif-brown-light);
	margin: 0 0 6px;
}

.aa-notifp__categories {
	margin-bottom: 20px;
}

.aa-notifp__cat-row {
	padding: 7px 12px;
	border-radius: var(--aa-notif-radius-sm);
}

.aa-notifp__cat-row.is-active {
	background: var(--aa-notif-cream);
	color: var(--aa-notif-orange);
}

.aa-notifp__settings-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	color: var(--aa-notif-text-muted);
	text-decoration: none;
}

.aa-notifp__settings-link:hover {
	color: var(--aa-notif-brown);
}

/* ---- right column: toolbar + card ---------------------------------------- */

.aa-notifp__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.aa-notifp__showing {
	font-size: 14px;
	color: var(--aa-notif-text-muted);
	margin: 0;
}

.aa-notifp__markall {
	border: 1px solid var(--aa-notif-border);
	background: var(--aa-notif-white);
	color: var(--aa-notif-brown);
	padding: 7px 16px;
	border-radius: var(--aa-notif-radius-pill);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.aa-notifp__markall:hover {
	background: var(--aa-notif-cream);
}

.aa-notifp__markall[hidden] {
	display: none;
}

.aa-notifp__card {
	background: var(--aa-notif-white);
	border-radius: var(--aa-notif-radius-md);
	box-shadow: var(--aa-notif-shadow-card);
	overflow: hidden;
}

/* ---- dense row grid -------------------------------------------------------- */

.aa-notifp__row {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr) 110px minmax(90px, max-content) 10px; /* the design's 90px time column fits "2 hours ago" but not "22 seconds ago", which ran into the unread dot */
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 11px 18px;
	background: var(--aa-notif-white);
	border: 0;
	border-bottom: 1px solid var(--aa-notif-border);
	text-align: left;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	font-family: inherit;
}

.aa-notifp__row:last-child {
	border-bottom: 0;
}

.aa-notifp__row.is-unread {
	background: var(--aa-notif-cream);
}

.aa-notifp__row:hover {
	background: var(--aa-notif-yellow-light);
}

.aa-notifp__row-icon {
	width: 28px;
	height: 28px;
	border-radius: var(--aa-notif-radius-pill);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--aa-notif-cream);
	color: var(--aa-notif-brown);
	font-size: 13px;
	flex: 0 0 auto;
}

.aa-notifp__row.is-unread .aa-notifp__row-icon {
	background: var(--aa-notif-yellow-light);
}

.aa-notifp__row-message {
	font-size: 14px;
	line-height: 1.4;
	min-width: 0;
	color: var(--aa-notif-brown);
}

.aa-notifp__row-message strong {
	font-weight: 700;
}

.aa-notifp__row-type {
	font-size: 12px;
	color: var(--aa-notif-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aa-notifp__row-time {
	font-size: 12px;
	color: var(--aa-notif-text-muted);
	text-align: right;
	white-space: nowrap;
}

.aa-notifp__row-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--aa-notif-orange);
}

.aa-notifp__row:not(.is-unread) .aa-notifp__row-dot {
	visibility: hidden;
}

/* ---- empty states ---------------------------------------------------------- */

.aa-notifp__empty {
	padding: 64px 40px;
	text-align: center;
}

.aa-notifp__empty--filtered {
	padding: 40px;
}

.aa-notifp__empty-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--aa-notif-cream);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--aa-notif-brown-light);
	font-size: 24px;
}

.aa-notifp__empty-title {
	font-family: var(--aa-notif-font-display);
	font-size: 24px;
	font-weight: 400;
	color: var(--aa-notif-brown);
	margin: 0 0 8px;
}

.aa-notifp__empty--filtered .aa-notifp__empty-title {
	font-family: var(--aa-notif-font-accent);
	font-size: 17px;
	font-weight: 600;
	margin: 0;
}

.aa-notifp__empty-body {
	font-size: 15px;
	color: var(--aa-notif-text-muted);
	margin: 0;
}

.aa-notifp__empty-reset {
	display: inline-block;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--aa-notif-orange);
	text-decoration: none;
}

.aa-notifp__empty-reset:hover {
	color: var(--aa-notif-brown);
}

/* ---- load more -------------------------------------------------------------- */

.aa-notifp__loadmore {
	display: block;
	margin: 16px auto 0;
	border: 1px solid var(--aa-notif-border);
	background: var(--aa-notif-white);
	padding: 10px 22px;
	border-radius: var(--aa-notif-radius-pill);
	font-size: 14px;
	font-weight: 600;
	color: var(--aa-notif-brown);
	cursor: pointer;
}

.aa-notifp__loadmore:hover {
	background: var(--aa-notif-cream);
}

.aa-notifp__loadmore[hidden] {
	display: none;
}

/* ---- sign-in prompt (both thin pages, logged out) -------------------------- */

.aa-notifp__login {
	box-sizing: border-box;
	max-width: 560px;
	margin: 48px auto 64px;
	padding: 40px 32px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(74, 36, 4, 0.10);
	text-align: center;
}

@media (max-width: 600px) {
	.aa-notifp__login {
		margin: 24px 16px 48px;
		padding: 32px 20px;
	}
}

/* The host pages draw their own heading, as the design does, so the theme-
   builder section that prints every default page's title is hidden on these
   two pages only (body class from AA_Notifications_UI::body_class()). */
body.aa-notif-host .elementor-element-20ecbf8 {
	display: none;
}

/* =========================================================================
 * U9 — the preferences screen ([aa_notification_preferences]).
 * ========================================================================= */

.aa-notifp--settings .aa-notifp__settings-wrap {
	max-width: 640px;
	margin: 0 auto;
	padding: 40px 24px 64px;
}

.aa-notifp__prefs-list {
	margin-top: 8px;
}

.aa-notifp__pref-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 20px 0;
	border-bottom: 1px solid var(--aa-notif-border);
}

.aa-notifp__pref-text h3 {
	font-family: var(--aa-notif-font-display);
	font-weight: 400;
	font-size: 18px;
	margin: 0 0 6px;
	color: var(--aa-notif-brown);
}

.aa-notifp__pref-text p {
	font-size: 14px;
	line-height: 1.5;
	color: var(--aa-notif-text-muted);
	margin: 0;
}

/* A checkbox-driven pill switch: input is visually hidden but focusable, the
   track and thumb are its general siblings so :checked can style both with
   no JS beyond toggling the underlying input. */
.aa-notifp__switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: 0 0 auto;
	margin-top: 2px;
}

.aa-notifp__switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.aa-notifp__switch-track {
	position: absolute;
	inset: 0;
	background: var(--aa-notif-border);
	border-radius: var(--aa-notif-radius-pill);
	transition: background-color 0.15s ease;
}

.aa-notifp__switch-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--aa-notif-white);
	box-shadow: 0 1px 3px rgba(74, 36, 4, 0.3);
	transition: transform 0.15s ease;
}

.aa-notifp__switch input:checked ~ .aa-notifp__switch-track {
	background: var(--aa-notif-orange);
}

.aa-notifp__switch input:checked ~ .aa-notifp__switch-thumb {
	transform: translateX(20px);
}

.aa-notifp__switch input:focus-visible ~ .aa-notifp__switch-track {
	outline: 2px solid var(--aa-notif-brown);
	outline-offset: 2px;
}

.aa-notifp__confirm {
	min-height: 18px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aa-notif-orange);
	margin: 10px 0 0;
}

.aa-notifp__legal {
	margin-top: 28px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--aa-notif-text-muted);
}

.aa-notifp__legal p {
	margin: 0 0 10px;
}

.aa-notifp__legal a {
	color: var(--aa-notif-orange);
}

.aa-notifp__back {
	display: inline-block;
	margin-top: 24px;
}

/* =========================================================================
 * Mobile — the rail collapses above the list, and the dense row grid drops
 * its 110px type-label column so nothing overflows a 375px viewport. The
 * time and unread dot stay: they are the two facts a member scanning on a
 * phone still needs, and the icon bubble + message already carry the type.
 * ========================================================================= */

@media (max-width: 760px) {
	.aa-notifp__grid {
		grid-template-columns: 1fr;
		gap: 24px;
		padding: 24px 16px 48px;
	}

	.aa-notifp__rail {
		order: 1;
	}

	.aa-notifp__main {
		order: 2;
	}
}

@media (max-width: 480px) {
	.aa-notifp__row {
		/* 'auto' for the time column, not a fixed px width — "2 minutes ago" at
		   12px does not fit in the 60px a fixed column allowed, and it overlapped
		   the unread dot rather than wrapping (grid columns don't clip text).
		   auto sizes the column to its content instead. */
		grid-template-columns: 24px minmax(0, 1fr) auto 8px;
		gap: 8px;
		padding: 10px 12px;
	}

	.aa-notifp__row-type {
		display: none;
	}

	.aa-notifp__row-time {
		font-size: 11px;
	}

	.aa-notifp__toolbar {
		flex-wrap: wrap;
	}
}
