/* ============================================================================
   Clever Studio Art -- styles for the shared site header.
   Loaded by the standalone /tools/ pages, which cannot use index.html's
   inline CSS. Covers the design tokens, the topbar, the search band, the
   navbar/megamenu and the megamenu's >=992px rules.

   These rules are a copy of the header part of index.html's inline <style>
   block (index.html keeps its own copy because the page-content CSS lives in
   the same block). If the header's look changes, change both.
   ========================================================================= */

	:root {
		--paper: #FBF6EC;
		--ink: #2A241F;
		--ink-soft: #5b5248;
		--berry: #9C3B54;
		--berry-dark: #7C2C41;
		--sage: #5C7A5E;
		--gold: #B9862C;
		--cloud: #F1E7D3;
		--cloud-line: #e3d5b8;
		--radius: 14px;
	}

	/* ---------- Topbar / letterhead ---------- */
	.site-topbar {
		background: var(--cloud);
		border-bottom: 3px solid var(--gold);
		position: relative;
	}
	.site-topbar::after {
		content: "";
		position: absolute;
		left: 0; right: 0; bottom: -6px;
		height: 2px;
		background: var(--paper);
	}
	.site-eyebrow {
		font-family: 'Fraunces', Georgia, serif;
		font-size: 1.6rem !important;
		font-weight: 600;
		color: var(--ink);
	}
	.site-tagline {
		font-family: 'Work Sans', sans-serif;
		font-size: 0.85rem !important;
		letter-spacing: 0.14em;
		text-transform: uppercase;
		color: var(--berry) !important;
		font-weight: 600;
	}

	/* ---------- Search bar (under the category nav) ----------
	   One row: the breadcrumb on the left, the search box in the middle,
	   and a balancing flex item on the right so the search box stays
	   centred on the PAGE rather than on the space the breadcrumb leaves
	   over. ::after is that balancer -- a pseudo-element on a flex container
	   is a flex item, so no extra markup is needed for it. Both it and the
	   breadcrumb are flex: 1 1 0, so they always take equal shares of
	   whatever the search box does not use, and the box's centre is the
	   row's centre at every width. */
	.site-searchbar {
		background: var(--paper);
		border-bottom: 1px solid rgba(42,36,31,0.08);
	}
	.site-search-row {
		display: flex;
		align-items: center;
		gap: 20px;
	}
	.site-search-row::after {
		content: "";
		flex: 1 1 0;
		min-width: 0;
	}
	/* The crumb gets half the leftover width and wraps inside it -- min-width
	   is what lets it wrap instead of pushing the search box off centre. */
	.site-breadcrumb {
		flex: 1 1 0;
		min-width: 0;
		font-size: 0.9rem;
		font-weight: 600;
		line-height: 1.4;
		color: var(--ink);
		text-align: left;
	}
	.site-search-form {
		flex: 0 1 560px;
		min-width: 0;
		max-width: 560px;
	}
	/* Between the stacking breakpoint and xl there is no px-xl-5 gutter to
	   help, so the box hands ~100px back to the crumb rather than leaving it
	   three lines deep. Still centred: both sides stay flex: 1 1 0. */
	@media (min-width: 992px) and (max-width: 1199.98px) {
		.site-search-form { flex-basis: 460px; max-width: 460px; }
	}
	/* Below the crumb's breakpoint there is no room for three across: the
	   breadcrumb takes its own line above the box, which goes full width. */
	@media (max-width: 991.98px) {
		.site-search-row { flex-wrap: wrap; gap: 10px; }
		.site-search-row::after { display: none; }
		.site-breadcrumb { flex: 1 1 100%; }
		.site-search-form { flex: 1 1 100%; max-width: 640px; margin: 0 auto; }
	}
	.site-search-form .form-control {
		height: calc(1.5em + 1rem + 2px);
		border-color: rgba(42,36,31,0.18);
		font-size: 1rem;
	}
	.site-search-form .form-control:focus {
		border-color: var(--berry);
		box-shadow: 0 0 0 0.15rem rgba(156,59,84,0.15);
	}
	.site-search-form .btn {
		background: var(--berry);
		border-color: var(--berry);
		color: #fff;
		min-width: 52px;
	}
	.site-search-form .btn:hover,
	.site-search-form .btn:focus {
		background: var(--berry-dark);
		border-color: var(--berry-dark);
	}
	.site-search-hint {
		display: block;
		margin-top: 0.35rem;
		font-size: 0.8rem;
		color: var(--berry-dark);
		opacity: 0.85;
	}

	/* ---------- Navbar ---------- */
	.navbar.site-navbar {
		background: var(--paper) !important;
		box-shadow: 0 2px 10px rgba(42,36,31,0.06);
	}
	.site-navbar .nav-link {
		color: var(--ink) !important;
		font-weight: 500;
		letter-spacing: 0.02em;
		position: relative;
	}
	/* style.min.css (a Bootstrap 4 era build) forces .25rem !important vertical padding
	   via .navbar-expand-lg .navbar-nav .nav-link — specificity 0,3,0 — which silently
	   overrides plain padding declared on the rule above. Match it with a 0,4,0 selector
	   so the link box height, and the hover underline hung just below it, stay under this
	   file's control instead of depending on that legacy rule. */
	.navbar.site-navbar .navbar-nav .nav-link {
		padding-top: 0.25rem !important;
		padding-bottom: 0.25rem !important;
	}
	.site-navbar .nav-link::after {
		content: "";
		position: absolute;
		left: 1rem; right: 1rem;
		/* The link box ends only .25rem below the text, so nothing inside it is free.
		   Hang the bar just outside the box, in the navbar's own .5rem bottom
		   padding, to keep it clear of the text (and its descenders). */
		bottom: -0.25rem;
		height: 2px;
		background: var(--berry);
		transform: scaleX(0);
		transition: transform 0.2s ease;
		/* Reset Bootstrap's .dropdown-toggle::after caret (border-top: .3em solid plus
		   transparent side borders and margin-left). Left in place it stacked on top of
		   this bar, making it ~6px thick and pushing it up into the link text. */
		border: 0;
		margin: 0;
	}
	.site-navbar .nav-link:hover::after,
	.site-navbar .nav-link:focus::after {
		transform: scaleX(1);
	}
	.site-navbar .nav-link:hover { color: var(--berry) !important; }
	.dropdown-item:hover, .dropdown-item:focus {
		background-color: var(--cloud);
		color: var(--berry-dark);
	}
	.dropdown-header {
		font-family: 'Fraunces', Georgia, serif;
		font-weight: 600;
		color: var(--berry-dark);
		padding-left: 0.5rem;
		margin-bottom: 0.5rem;
	}
	.text-decoration-none.text-dark:hover {
		color: var(--berry) !important;
	}

	@media all and (min-width: 992px) {
		/* 1. Make the navbar position relative so the menu can span full width */
		.navbar { 
			position: relative; 
		}
		
		/* 2. Force the megamenu to the full width of the screen/container */
		.navbar .megamenu {
			padding: 20px;
			left: 0;
			right: 0;
			width: 100%;
			margin-top: 0;
			border-radius: 0;
			border: none;
			box-shadow: 0 8px 10px rgba(0,0,0,0.1);
		}
		
		/* 3. Ensure the dropdown trigger is static so the menu aligns to the navbar, not the LI */
		.navbar .has-megamenu { 
			position: static !important; 
		}
	}


/* The tools page sets its own body font (Inter); put the site's UI face back
   on the chrome itself rather than on <body>. */
.site-topbar, .site-navbar, .site-searchbar { font-family: 'Work Sans', -apple-system, sans-serif; }
