/*
Theme Name: FBC Surrealist Expand Preview
Theme URI: https://themeshaper.com/surrealist/
Template: surrealist
Author: Chelsea Lawrence
Author URI: https://mutableobject.studio
Description: A child theme of Surrealist (by Automattic) that adds an expandable/collapsible link-list pattern and an always-on hamburger/fullscreen overlay site navigation, both inspired by the interaction style of Sankofa (also by Automattic). All Surrealist templates, patterns and styles are inherited unchanged from the parent theme.
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 5.7
Version: 1.10.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fbc-surrealist-expand-preview

Credits:
- Parent theme "Surrealist" by Automattic (https://automattic.com/), GPLv2+.
- Expand/collapse interaction and overlay navigation inspired by "Sankofa" by Automattic
  (https://automattic.com/), GPLv2+. This child theme does not reuse Sankofa's code directly;
  both features are built from scratch using WordPress core's native Details and Navigation
  blocks to achieve equivalent interactions.
*/

/* -----------------------------------------------------------------------
 * Site logo — larger on desktop than the 64px set on the Site Logo block
 * (parts/header.html), which is the mobile/base size.
 * --------------------------------------------------------------------- */

@media (min-width: 782px) {
	.custom-logo-link img {
		width: 240px !important;
		height: auto !important;
	}
}

/* -----------------------------------------------------------------------
 * "FBC Expand Nav" — big, full-width expandable blocks, Sankofa-style.
 * Scoped to .fbc-expand-nav so it only affects this specific pattern and
 * doesn't change the look of any other Details blocks used elsewhere.
 * --------------------------------------------------------------------- */

.fbc-expand-nav .wp-block-details {
	border-top: 2px solid var(--wp--preset--color--contrast);
	margin: 0;
}

.fbc-expand-nav .wp-block-details:last-of-type {
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}

.fbc-expand-nav .wp-block-details summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--kame-poster);
	font-weight: 900;
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.1;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hide the default disclosure triangle so we can draw our own marker. */
.fbc-expand-nav .wp-block-details summary::-webkit-details-marker {
	display: none;
}
.fbc-expand-nav .wp-block-details summary::marker {
	content: "";
}

.fbc-expand-nav .wp-block-details summary::after {
	content: "+";
	font-size: 0.7em;
	line-height: 1;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.fbc-expand-nav .wp-block-details[open] summary::after {
	transform: rotate(45deg);
}

/* Big, chunky hover/focus state — the whole block inverts, not just the text. */
.fbc-expand-nav .wp-block-details summary:hover,
.fbc-expand-nav .wp-block-details summary:focus-visible {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	outline: none;
}

/* Keep the open block visually "active" even after the pointer moves away. */
.fbc-expand-nav .wp-block-details[open] summary {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Revealed content sits inside the block, roomy and legible. */
.fbc-expand-nav .wp-block-details > :not(summary) {
	padding: 0 var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
	font-family: var(--wp--preset--font-family--pt-sans);
	font-size: var(--wp--preset--font-size--medium);
	max-width: 60ch;
}

.fbc-expand-nav .wp-block-details > :not(summary) a {
	text-decoration: underline;
}

/* -----------------------------------------------------------------------
 * "FBC Site Nav" — an always-on hamburger badge (header.html sets the
 * navigation block's overlayMenu to "always") that opens a fullscreen
 * overlay menu. Scoped to .fbc-site-nav so only this header badge is
 * affected. No hover/focus styling at all, by request — plain at rest.
 * --------------------------------------------------------------------- */

.fbc-site-nav {
	border: none !important;
}

/* Strip every default hover/focus effect WordPress core applies to
   individual nav links — plain white text, unstyled, at all times, no
   hover/focus effect of any kind. */
.wp-block-navigation-item.wp-block-navigation-link,
.wp-block-navigation-item.wp-block-navigation-link:hover,
.wp-block-navigation-item.wp-block-navigation-link:focus-within {
	background-color: transparent !important;
}

.wp-block-navigation-item.wp-block-navigation-link a,
.wp-block-navigation-item.wp-block-navigation-link a:hover,
.wp-block-navigation-item.wp-block-navigation-link a:focus,
.wp-block-navigation-item.wp-block-navigation-link a:visited {
	color: var(--wp--preset--color--base) !important;
	text-decoration: none !important;
	font-weight: normal !important;
	background-color: transparent !important;
}

/* -----------------------------------------------------------------------
 * "FBC Site Nav — mobile overlay" — once the overlay menu is actually
 * open (.is-menu-open, set by core when the hamburger is activated),
 * give each top-level item its own solid block of color, cycling
 * through the same 5 colors as the "pillar" palette. Hardcoded hex
 * values (not var(--wp--preset--color--pillar-*)) so this doesn't
 * depend on those theme.json palette entries being registered/synced
 * on the live site. Only overrides the plain/transparent rule above
 * while the overlay is open, so the desktop pill nav is untouched.
 * --------------------------------------------------------------------- */

/* Core sets align-items on the list to flex-start (not stretch), which is
   why items were shrink-wrapping to their text instead of spanning the
   overlay's width. Force full-width, edge-to-edge blocks with no gap
   between them, like the "FBC Expand Nav" pillar blocks. */
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__container {
	gap: 0 !important;
}

/* Make the overlay list span the full width whatever the block's
   Justification setting is (left/center makes it shrink to its text). */
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__responsive-container-content,
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__container {
	align-items: stretch !important;
	width: 100%;
}

/* Core also pads the overlay dialog itself (room for the close "X") and
   pads the content wrapper again on top of that — that's the leftover
   contrast-colored frame around/above the blocks. Zero both out so the
   color blocks reach the true edges of the screen. */
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 0 !important;
}
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__responsive-container-content {
	padding-top: 0 !important;
}
.fbc-site-nav .wp-block-navigation__responsive-close {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40) !important;
}

.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 1) {
	background-color: #ebe7c5 !important;
}
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 1) a {
	color: #412525 !important;
}

.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 2) {
	background-color: #ADBFDB !important;
}
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 2) a {
	color: #412525 !important;
}

.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 3) {
	background-color: ##ffc677 !important;
}
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 3) a {
	color: #ffffff !important;
}

.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 4) {
	background-color: #DC4E28 !important;
}
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 4) a {
	color: #ffffff !important;
}

.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 5) {
	background-color: #ebe7c5 !important;
}
.fbc-site-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item.wp-block-navigation-link:nth-child(5n + 5) a {
	color: #242121 !important;
}

/* -----------------------------------------------------------------------
 * Principles page — Leadership & Team text alignment.
 * Core's Media & Text block adds its own default left/right padding
 * (0 8%) around the text column. Nothing else on this page has that
 * padding, so the section's text was sitting ~40px further right than
 * the rest of the content even though the block itself was aligned
 * correctly. Only one Media & Text block exists on this page.
 * --------------------------------------------------------------------- */

body.page-id-13 .wp-block-media-text .wp-block-media-text__content {
	padding-left: 13px;
}

/* -----------------------------------------------------------------------
 * Principles page — bordered cards.
 * Scoped to the Principles page (body.page-id-13) only. The colored boxes
 * there aren't a custom card component — they're plain paragraph blocks
 * with a background color + border-radius set in the block editor,
 * wrapped in a page-builder plugin's ".ext-card"/".ext-card-content"
 * grid divs — so this rule targets that markup directly rather than
 * anything defined by this theme.
 * --------------------------------------------------------------------- */

body.page-id-13 .ext-card p.has-background {
	border: 2px solid var(--wp--preset--color--contrast);
	box-sizing: border-box;
}
