/**
 * GGF Community Core: account links and the Save / Follow buttons.
 *
 * Needs ggfc-base.css. Small, because it loads on pages that have no other
 * community widget. Account items added to a theme menu are styled by the
 * theme like its own items; only their unread counter is styled here.
 */

/*
 * The account control ([ggfc_account], the GGF Account Links block, or a
 * Text/HTML element of the theme header). Compact outlined button with a
 * person icon: "Sign In" for visitors, "My GGF" with a drop-down for members.
 */
.ggfc:not(#ggfc-i).ggfc-account { position: relative; display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 8px; font-size: 14px; line-height: 1.2; vertical-align: middle; white-space: nowrap; }
.ggfc:not(#ggfc-i) .ggfc-account__link,
.ggfc:not(#ggfc-i) .ggfc-account__toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid var(--ggfc-border-strong);
	border-radius: var(--ggfc-radius-ctl);
	background: transparent;
	color: var(--ggfc-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color var(--ggfc-ease), background-color var(--ggfc-ease), color var(--ggfc-ease);
}
.ggfc:not(#ggfc-i) .ggfc-account__link:hover,
.ggfc:not(#ggfc-i) .ggfc-account__toggle:hover { border-color: var(--ggfc-text-2); background: var(--ggfc-hover); color: var(--ggfc-text); text-decoration: none; }
.ggfc:not(#ggfc-i) .ggfc-account__toggle[aria-expanded="true"] { border-color: var(--ggfc-text-2); background: var(--ggfc-hover); }
.ggfc:not(#ggfc-i) .ggfc-account__link--join { border-color: var(--ggfc-accent); background: var(--ggfc-accent); color: var(--ggfc-accent-fg); }
.ggfc:not(#ggfc-i) .ggfc-account__link--join:hover { border-color: color-mix(in srgb, var(--ggfc-accent) 85%, #000); background: color-mix(in srgb, var(--ggfc-accent) 85%, #000); color: var(--ggfc-accent-fg); }
.ggfc:not(#ggfc-i) .ggfc-account__icon { flex: 0 0 auto; display: block; width: 18px; height: 18px; }
.ggfc:not(#ggfc-i) .ggfc-account__label { overflow: hidden; text-overflow: ellipsis; max-width: 12em; }
.ggfc:not(#ggfc-i).ggfc-account--icon .ggfc-account__link,
.ggfc:not(#ggfc-i).ggfc-account--icon .ggfc-account__toggle { justify-content: center; min-width: 40px; min-height: 40px; padding: 0 10px; }
.ggfc:not(#ggfc-i) .ggfc-account__caret { width: 6px; height: 6px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: 0.75; transition: transform var(--ggfc-ease); }
.ggfc:not(#ggfc-i) .ggfc-account__toggle[aria-expanded="true"] .ggfc-account__caret { transform: translateY(1px) rotate(225deg); }

@media (max-width: 600px) {
	.ggfc:not(#ggfc-i).ggfc-account--mobile-icon .ggfc-account__label,
	.ggfc:not(#ggfc-i).ggfc-account--mobile-icon .ggfc-account__caret { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.ggfc:not(#ggfc-i).ggfc-account--mobile-icon .ggfc-account__link--join { display: none; }
	.ggfc:not(#ggfc-i).ggfc-account--mobile-icon .ggfc-account__link,
	.ggfc:not(#ggfc-i).ggfc-account--mobile-icon .ggfc-account__toggle { justify-content: center; min-width: 40px; padding: 0 10px; }
}

/* While the page is asking whether this is a member, show nothing in the control (no "Sign In" flash). */
.ggfc-m .ggfc:not(#ggfc-i).ggfc-account:not(.ggfc-account--member) > * { visibility: hidden; }

.ggfc:not(#ggfc-i) .ggfc-account__menu { position: absolute; z-index: 100000; top: calc(100% + 8px); right: 0; min-width: 220px; margin: 0; padding: 6px; border: 1px solid var(--ggfc-border); border-radius: var(--ggfc-radius); background: var(--ggfc-surface); color: var(--ggfc-text); box-shadow: var(--ggfc-shadow-lg); text-align: start; white-space: normal; }
.ggfc:not(#ggfc-i) .ggfc-account__menu li { margin: 0; padding: 0; }
.ggfc:not(#ggfc-i) .ggfc-account__menu a,
.ggfc:not(#ggfc-i) .ggfc-account__out { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border-radius: calc(var(--ggfc-radius) - 4px); color: var(--ggfc-text); font-size: 14px; font-weight: 500; text-align: start; text-decoration: none; cursor: pointer; }
.ggfc:not(#ggfc-i) .ggfc-account__menu a:hover,
.ggfc:not(#ggfc-i) .ggfc-account__out:hover { background: var(--ggfc-hover); color: var(--ggfc-text); text-decoration: none; }
.ggfc:not(#ggfc-i) .ggfc-account__menu .ggfc-account__sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--ggfc-border); }
.ggfc:not(#ggfc-i) .ggfc-account__count,
.ggfc-account-item .ggfc-account__count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }

/* The small toggle next to "My GGF" in a theme menu. It takes the menu's own colour and size. */
.ggfc:not(#ggfc-i).ggfc-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: 0 0 0 2px; padding: 0; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; line-height: 1; vertical-align: middle; cursor: pointer; }
.ggfc:not(#ggfc-i).ggfc-menu-toggle::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--ggfc-ease); }
.ggfc:not(#ggfc-i).ggfc-menu-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.ggfc:not(#ggfc-i).ggfc-menu-toggle:hover { background: rgba(128, 128, 128, 0.16); }
.ggfc:not(#ggfc-i).ggfc-menu-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.ggfc-account-item .ggfc-account-sub[hidden] { display: none; }

/* Save and Follow under an article */
.ggfc:not(#ggfc-i).ggfc-memberbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; margin-bottom: 24px; font-size: 15px; line-height: 1.3; }
.ggfc:not(#ggfc-i) .ggfc-memberbar__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 6px 14px; border: 1px solid var(--ggfc-border); border-radius: 999px; background: var(--ggfc-field); color: var(--ggfc-text); font-weight: 600; cursor: pointer; transition: background-color var(--ggfc-ease), border-color var(--ggfc-ease), color var(--ggfc-ease); }
.ggfc:not(#ggfc-i) .ggfc-memberbar__btn:hover { border-color: var(--ggfc-border-strong); background: var(--ggfc-hover); }
.ggfc:not(#ggfc-i) .ggfc-memberbar__btn[disabled] { opacity: 0.6; cursor: progress; }
.ggfc:not(#ggfc-i) .ggfc-memberbar__btn[aria-pressed="true"],
.ggfc:not(#ggfc-i) .ggfc-memberbar__btn[aria-pressed="true"]:hover { border-color: var(--ggfc-accent); background: var(--ggfc-tint); color: var(--ggfc-ink); }
.ggfc:not(#ggfc-i) .ggfc-memberbar__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ggfc:not(#ggfc-i) .ggfc-memberbar__icon { flex: 0 0 auto; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; }
.ggfc:not(#ggfc-i) .ggfc-memberbar__btn[aria-pressed="true"] .ggfc-memberbar__icon { border-color: var(--ggfc-accent); background: var(--ggfc-accent); }
.ggfc:not(#ggfc-i) .ggfc-memberbar__said { flex: 1 1 100%; min-height: 1.3em; color: var(--ggfc-text-2); font-size: var(--ggfc-size-sm); }
.ggfc:not(#ggfc-i) .ggfc-memberbar__said:empty { display: none; }

@media (max-width: 480px) {
	.ggfc:not(#ggfc-i) .ggfc-memberbar__btn { flex: 1 1 auto; justify-content: center; }
}

/* One account control per page: when it is placed by shortcode, block or a header element, the items added to a theme menu stand back. */
body:has(.ggfc-account[data-ggfc-account="inline"]) .ggfc-account-item { display: none; }
