/**
 * Mobile menu (patterns/navigation-overlay.php) and site footer (patterns/footer.php): only what their blocks' own
 * settings can't do. Loaded in the Site Editor too.
 */

/* ── Both ────────────────────────────────────────────────────────────────── */

.nav-overlay-cjb :is(a, button):focus-visible,
.footer-cjb a:focus-visible,
:is(.menu-card-cjb, .footer-card-cjb) a:focus-visible::after {
	outline: 2px solid currentcolor;
	outline-offset: 3px;
}

/* The Site Editor shrinks an inline-block link, and the SVG in it, to nothing. */
:is(.nav-overlay-cjb, .footer-brand-cjb) .wp-block-site-logo .custom-logo-link {
	display: block;
}

/* Outlined 44px circles around the social icons. */
:is(.menu-social-cjb, .footer-social-cjb).wp-block-social-links {
	font-size: 20px;
}

:is(.menu-social-cjb, .footer-social-cjb) .wp-social-link {
	border: 1px solid rgb(255 255 255 / 32%);
}

:is(.menu-social-cjb, .footer-social-cjb) .wp-social-link:hover {
	border-color: #fff;
}

:is(.menu-social-cjb, .footer-social-cjb) .wp-social-link.wp-social-link .wp-block-social-link-anchor {
	padding: 11px;
}

/* The whole Database card is its link. */
:is(.menu-card-cjb, .footer-card-cjb) {
	position: relative;
}

:is(.menu-card-cjb, .footer-card-cjb) a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 8px;
}

:is(.nav-overlay-cjb, .footer-cjb) :is(.menu-card-cjb, .footer-card-cjb) a:focus-visible {
	outline: none;
}

:is(.menu-card-cjb, .footer-card-cjb):is(:hover, :has(:focus-visible)) {
	border-color: rgb(255 255 255 / 60%) !important;
	background: rgb(255 255 255 / 6%);
}

/* Both sites have a snippet that gives a menu's links a background on small screens. */
:is(.menu-list-cjb, .footer-menu-cjb) .wp-block-navigation-item__content.wp-block-navigation-item__content {
	background: none !important;
}

/* ── Mobile menu ─────────────────────────────────────────────────────────── */

/* iPhones color the areas behind the status bar and Safari's toolbar to match the menu: the bottom from the background of
   the box it scrolls in, and the top from what's there as it opens, so it can't fade in. */
.wp-block-navigation__responsive-container.is-menu-open:has(.nav-overlay-cjb) {
	background-color: var(--wp--custom--color--role--footer);
	animation: none;
}

/* Logged in, the menu starts below the admin bar. */
.admin-bar .nav-overlay-cjb.nav-overlay-cjb {
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)) !important;
}

/* One field with the icon in front. !important: the site squares off and fills every field, and dark mode
   (inc/dark-mode.php) sets every field's border. */
.menu-search-cjb .wp-block-search__inside-wrapper {
	flex-direction: row-reverse;
	padding: 0;
	background: rgb(255 255 255 / 8%);
}

.menu-search-cjb .wp-block-search__inside-wrapper:has(input:focus) {
	outline: 2px solid #fff;
	outline-offset: 1px;
}

.menu-search-cjb .wp-block-search__input.wp-block-search__input {
	height: 46px;
	padding: 0 16px 0 0;
	border: 0 !important;
	background: none !important;
	color: #fff;
	color-scheme: dark;
	outline: none;
}

.menu-search-cjb .wp-block-search__input::placeholder {
	color: rgb(255 255 255 / 78%);
	opacity: 1;
}

.menu-search-cjb .wp-block-search__button.wp-block-search__button {
	width: 46px;
	margin: 0;
	padding: 0;
	border: 0;
}

/* A row for each section, with a line under it and a chevron at its end. The width is for the Site Editor. */
.menu-list-cjb :is(.wp-block-navigation__container, .wp-block-navigation-item, .wp-block-navigation-item__content) {
	width: 100%;
}

.nav-overlay-cjb .menu-list-cjb .wp-block-navigation__container.wp-block-navigation.menu-list-cjb {
	gap: 0 !important;
}

.nav-overlay-cjb .menu-list-cjb.menu-list-cjb .wp-block-navigation-item__content.wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	min-height: 53px;
	padding: 8px 5px 8px 0;
	border-bottom: 1px solid rgb(255 255 255 / 14%);
	border-radius: 0;
	font-size: inherit;
}

.menu-list-cjb .wp-block-navigation-item__content::after {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border: solid rgb(255 255 255 / 70%);
	border-width: 2px 2px 0 0;
	rotate: 45deg;
}

.menu-list-cjb .wp-block-navigation-item__content:hover::after {
	border-color: #fff;
}

/* The menu has its own social icons; here they're at the bottom. Their list item goes too, so it isn't read out empty. */
.nav-overlay-cjb .menu-list-cjb :is(.social-menu-cjb, .wp-block-navigation-item:has(> .social-menu-cjb)) {
	display: none;
}

/* The Database card's posters, behind its text and fading in from its end. */
.menu-card-cjb {
	isolation: isolate;
}

.menu-card-cjb p {
	max-width: 74%;
	text-wrap: balance;
}

.nav-overlay-cjb .menu-card-cjb .db-wall-cjb {
	position: absolute;
	z-index: -1;
	inset: 0 0 0 auto;
	grid-template-columns: repeat(4, 76px);
	width: 188px;
	border-radius: 0 7px 7px 0;
	-webkit-mask-image: linear-gradient(90deg, transparent 21%, #000 73%);
	mask-image: linear-gradient(90deg, transparent 21%, #000 73%);
}

/* Shorter rows where the social icons would be cut off, such as an iPhone with Safari's toolbar showing. */
@media (max-height: 750px) {
	.nav-overlay-cjb .menu-list-cjb.menu-list-cjb .wp-block-navigation-item__content.wp-block-navigation-item__content {
		min-height: 48px;
	}

	.nav-overlay-cjb .menu-card-cjb {
		min-height: 88px !important;
	}
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

/* Section links, two to a row. */
.footer-menu-cjb .wp-block-navigation__container {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	width: 100%;
}

/* Links with room to tap. */
.footer-menu-cjb .wp-block-navigation-item__content.wp-block-navigation-item__content,
.footer-links-cjb a {
	display: block;
	width: fit-content;
	padding: 10px 0;
}

.footer-archive-link-cjb a {
	display: inline-block;
	margin-block: -5px;
	padding-block: 5px;
}

.footer-cjb .superhero-news-network img {
	box-sizing: content-box;
	padding: 12px 0 11px;
}

.footer-links-cjb {
	list-style: none;
}
