/**
 * Element SSO link visibility.
 *
 * The [sso-show-login-link] shortcode renders a login button and, alongside it,
 * whatever content was enclosed for logged-in visitors. Which half is shown is
 * decided here, exactly as the yok0x-sso integration this replaces did.
 *
 * Note on selectors: `logged-out` is NOT a WordPress body class. Core's
 * body_class() adds `logged-in` and nothing else, so the logged-out state has to
 * be expressed as `body:not(.logged-in)`. yok0x-sso shipped `body.logged-out`
 * rules too, but they only ran behind its `y0x_omit_cache_busters` filter and
 * never matched anything.
 *
 * `xsso-logged-in` is honoured as well. Nothing in this plugin sets it, but it
 * is the class yok0x-sso's cache-busting JS added when it detected a session
 * from a cookie, so anything still doing that keeps working.
 *
 * Deliberately no `display` value is set on the visible state. The theme styles
 * `.logged-in-content` itself (see `.footer .sso-account-links
 * .logged-in-content` in the theme stylesheet), and forcing a value here would
 * win on specificity and break that layout.
 */

body:not(.logged-in):not(.xsso-logged-in) .xsso-container .logged-in-content {
	display: none;
}

/*
 * The login link is not rendered at all for a logged-in visitor, so this is
 * belt and braces: it also covers markup produced by another source that
 * renders both halves unconditionally.
 */
body.logged-in .xsso-container .login-link,
body.xsso-logged-in .xsso-container .login-link {
	display: none;
}

/* The login link is a button, so it needs to be inline-block to size itself. */
.login-link {
	display: inline-block;
}
