/*
Theme Name: Advally
Theme URI: https://advally.com
Author: Advally
Author URI: https://advally.com
Description: Brand block theme for the public advally.com site (marketing + blog + knowledge base + product/adtech). Editable in the WordPress Site Editor. Palette and typography mirror the Adligature brand kit (config/email_brand.php in advally-reporting) so the public site and outbound email stay visually consistent. Ships the brand foundation plus the full Phase 1 template set: homepage + static pages and per-CPT archive/single/taxonomy templates for blog, knowledge base, products, adtech, and plugins.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.0
Version: 0.1.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: advally
Tags: block-theme, full-site-editing, blog, custom-colors, editor-style, wide-blocks
*/

/*
 * Block themes drive nearly all styling from theme.json. This file carries the
 * required theme header above plus only the handful of rules theme.json can't
 * express (sticky header offset, footer link reset). Prefer theme.json for
 * anything a designer should be able to tune in the Site Editor.
 */

/*
 * Canvas background — the live advally.com design (Laravel render) paints the
 * page body the soft grey canvas (#f3f4f7) so white sections and the white
 * trust-badge card pop off the background. theme.json sets this on `body`, but
 * the all-bootstrap-blocks plugin's bootstrap.min.css enqueues AFTER the inline
 * theme styles and resets `body { background-color: #fff }` at equal
 * specificity, winning the cascade and flattening the page to all-white.
 * Re-assert the canvas grey with a higher-specificity selector so it wins
 * regardless of stylesheet load order. Mirrors the original exactly.
 */
html body.wp-site-blocks,
html body {
	background-color: var(--wp--preset--color--canvas, #f3f4f7);
}

/* Sticky header — mirrors `header-sticky` on the Laravel layout. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--wp--preset--color--surface);
	box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Footer links read white on the black footer (Bootstrap `bg-black text-white`). */
footer.wp-block-template-part a {
	color: inherit;
	text-decoration: none;
}

footer.wp-block-template-part a:hover {
	text-decoration: underline;
}

/*
 * Bootstrap button accent — the homepage and several CPT pages were built with
 * the all-bootstrap-blocks plugin, whose `.btn-primary` ships Bootstrap's
 * default blue (#0d6efd). The live advally.com design recolours that primary
 * to the Advally purple, so mirror it here. Targets the same class the imported
 * areoi blocks render. theme.json can't reach plugin Bootstrap classes.
 */
.wp-site-blocks .btn-primary {
	--bs-btn-bg: var(--wp--preset--color--accent, #5856d6);
	--bs-btn-border-color: var(--wp--preset--color--accent, #5856d6);
	--bs-btn-hover-bg: #4b49b6;
	--bs-btn-hover-border-color: #4b49b6;
	--bs-btn-active-bg: #4b49b6;
	--bs-btn-active-border-color: #4b49b6;
	background-color: var(--wp--preset--color--accent, #5856d6);
	border-color: var(--wp--preset--color--accent, #5856d6);
}

.wp-site-blocks .btn-primary:hover,
.wp-site-blocks .btn-primary:focus,
.wp-site-blocks .btn-primary:active {
	background-color: #4b49b6;
	border-color: #4b49b6;
}

/*
 * Stray marketing-page image captions — the imported static pages (homepage,
 * About Us, etc.) carry core/image blocks whose caption was auto-filled with
 * the media-library title ("Homepage 15", "About Us 5", …). The live design
 * shows no such captions. Scope the hide to the `page` post type (which covers
 * the front page + every static page) so legitimate captions on blog/KB/AdTech
 * CPT singles — body class `single` — stay visible.
 */
body.page figure.wp-block-image > figcaption {
	display: none;
}
