/*
Theme Name: Accounts Confidant
Theme URI: https://accountsconfidant.com/
Author: Accounts Confidant
Author URI: https://accountsconfidant.com/
Description: Block theme for accountsconfidant.com. Design tokens live in theme.json; custom blocks and site logic live in the Accounts Confidant Blocks plugin.
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.1.37
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: accountsconfidant-theme
*/

/* Global rules theme.json can't express. Keep this file small;
 * block CSS belongs with the block (assets/css/). */

/* Metric-matched fallback for Inter (served by Google Fonts with
 * display=swap): local Arial scaled to Inter's proportions, so text
 * keeps its size and line breaks when Inter arrives and long pages
 * don't jump (CLS 0.12 on posts before). Used only until Inter loads. */
@font-face {
	font-family: "Inter Fallback";
	src: local("Arial");
	size-adjust: 107.12%;
	ascent-override: 90.44%;
	descent-override: 22.52%;
	line-gap-override: 0%;
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
}

/* Page regions (top bar, header, main, footer) sit flush, as in the
 * design; each section sets its own padding. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

:where(a, button, summary, input, textarea, select):focus-visible {
	outline: 3px solid var(--wp--custom--focus-ring);
	outline-offset: 4px;
}

/* The size rules below and the hover rules after them style the same buttons
 * with different properties; their order doesn't matter, so the specificity
 * ordering check is off for this file (as in assets/css/pages.css). */
/* stylelint-disable no-descending-specificity */

/* Button size and arrow (tests/visual/button-size-compare.mjs).
 * Inner pages, design site.css .button: 48px high, 0 22px padding; the arrow is
 * typed into the label after a space, at the label size.
 * Homepage, index.html .button: 51px, 0 23px; the arrow is span.arrow (17px,
 * weight 450) 22px from the label; on phones (<=600px) the hero buttons are
 * 46px, 0 15px, 11.5px text, arrow 8px away.
 * Header "Talk to us" (.header-cta / .site-header .button): 43px, 0 18px,
 * 11.5px text (radius 9px on the homepage).
 * The footer pill and the homepage "Talk to us" link have their own sizes.
 * Text sizes are raised from the design for US legibility (user decision
 * 2026-11-10, docs/build/tokens.md): the design's 11.5px button text is 14px;
 * other sizes follow the theme.json scale (13px buttons are now 15px). */
.wp-block-button:not(.is-style-pill-light) > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 48px;
	padding: 0 22px;
}

.ac-btn-arrow .wp-block-button__link::after,
.ac-btn-arrow-up .wp-block-button__link::after,
.ac-header .ac-header__cta .wp-block-button__link::after {
	margin-left: 0.28em;
}

.home .wp-block-button:not(.is-style-pill-light) > .wp-block-button__link {
	min-height: 51px;
	padding: 0 23px;
}

.home .ac-btn-arrow .wp-block-button__link::after,
.home .ac-btn-arrow-up .wp-block-button__link::after,
.home .ac-header .ac-header__cta .wp-block-button__link::after {
	margin-left: 22px;
	font-size: 17px;
	font-weight: 450;
	line-height: 1;
}

/* Homepage "Talk to us" in How it works (design .process-footer-link). */
.home .ac-home-process__footer .wp-block-button > .wp-block-button__link {
	min-height: 0;
	padding: 11px 17px;
	border-radius: 12px;
	font-weight: 770;
}

.ac-header .ac-header__cta .wp-block-button > .wp-block-button__link {
	min-height: 43px;
	padding: 0 18px;
	font-size: 16px;
}

.home .ac-header .ac-header__cta .wp-block-button > .wp-block-button__link {
	border-radius: 9px;
}

@media (max-width: 600px) {

	.home .ac-home-hero__actions .wp-block-button > .wp-block-button__link {
		min-height: 46px;
		padding: 0 15px;
		font-size: 16px;
	}

	.home .ac-home-hero__actions .wp-block-button__link::after {
		margin-left: 8px;
	}
}

/* Buttons lift on hover. Inner pages follow the design's site.css .button
 * (transition .2s, translateY(-2px)); the homepage follows index.html .button
 * (.25s, plus saturate(1.08) and its own hover shadow). The hover shadow itself
 * is set in theme.json from --wp--custom--button-shadow-hover. Outline buttons
 * get the design's .button-ghost hover shadow. */
.wp-block-button__link,
.wp-element-button,
.ac-form .wpcf7-submit {
	transition: transform 0.2s, box-shadow 0.2s;
}

.wp-block-button__link:hover,
.wp-element-button:hover,
.ac-form .wpcf7-submit:hover {
	transform: translateY(-2px);
}

.home {
	--wp--custom--button-shadow-hover: var(--wp--custom--button-shadow-hover-home);
}

.home .wp-block-button__link,
.home .wp-element-button,
.home .ac-form .wpcf7-submit {
	transition: transform 0.25s, box-shadow 0.25s, filter 0.25s;
}

.home .wp-block-button__link:hover,
.home .wp-element-button:hover,
.home .ac-form .wpcf7-submit:hover {
	filter: saturate(1.08);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	box-shadow: var(--wp--custom--hover--ghost-shadow);
}

/* Button and link polish (user request 2026-11-08, beyond the design's motion,
 * which stays as above): the arrow points the way on hover, the footer pill's
 * round arrow turns forward, a press settles the button, keyboard focus lifts
 * like hover, and a gentle ease-out curve throughout. */
.wp-block-button__link,
.wp-element-button,
.ac-form .wpcf7-submit,
.home .wp-block-button__link,
.home .wp-element-button,
.home .ac-form .wpcf7-submit {
	transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wp-block-button__link:focus-visible,
.ac-form .wpcf7-submit:focus-visible {
	transform: translateY(-2px);
}

.wp-block-button__link:active,
.wp-element-button:active,
.ac-form .wpcf7-submit:active {
	box-shadow: var(--wp--preset--shadow--button);
	transform: translateY(0) scale(0.985);
	transition-duration: 0.08s;
}

.wp-block-button.is-style-outline > .wp-block-button__link:active {
	box-shadow: none;
}

.ac-btn-arrow .wp-block-button__link::after,
.ac-btn-arrow-up .wp-block-button__link::after,
.ac-header .ac-header__cta .wp-block-button__link::after,
.wp-block-button.is-style-pill-light .wp-block-button__link::after,
.ac-arrow-link::after {
	transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ac-btn-arrow .wp-block-button__link:is(:hover, :focus-visible)::after,
.ac-header .ac-header__cta .wp-block-button__link:is(:hover, :focus-visible)::after {
	transform: translateX(4px);
}

/* Text-link arrows are inline (glued to the last word, sections.css), so they
 * slide with `left` rather than a transform. */
.ac-arrow-link:not(.ac-arrow-link--up):has(> a:is(:hover, :focus-visible))::after,
.wp-block-read-more.ac-arrow-link:is(:hover, :focus-visible)::after {
	left: 4px;
}

/* Diagonal arrows turn straight (↗ to →) and slide forward. */
.ac-btn-arrow-up .wp-block-button__link:is(:hover, :focus-visible)::after,
.ac-arrow-link--up:has(> a:is(:hover, :focus-visible))::after {
	transform: translateX(3px) rotate(45deg);
}

.wp-block-button.is-style-pill-light .wp-block-button__link:is(:hover, :focus-visible)::after {
	transform: rotate(45deg) scale(1.06);
}

/* Contact form submit: its arrow is a background image. */
.ac-form .wpcf7-submit,
.home .ac-form .wpcf7-submit {
	transition-property: transform, box-shadow, filter, background-position;
}

.ac-form .wpcf7-submit:is(:hover, :focus-visible) {
	background-position: calc(50% + 119px) 50%, 0 0;
}

/* In-article buttons from the classic theme ("Get Form", "Instructions",
 * "Get Help" on IRS-form posts; tools/legacy-buttons.py): links styled like
 * the header button (design .header-cta: 43px, 0 18px, 11.5px), with the
 * site's button hover and press. */
a.ac-btn-sm {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 43px;
	margin: 4px;
	padding: 0 18px;
	border-radius: var(--wp--preset--border-radius--sm);
	background: var(--wp--preset--gradient--brand);
	box-shadow: var(--wp--preset--shadow--button);
	color: var(--wp--preset--color--white);
	font-size: 16px;
	font-weight: var(--wp--custom--font-weight--label);
	text-decoration: none;
	transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

a.ac-btn-sm:is(:hover, :focus-visible) {
	box-shadow: var(--wp--custom--button-shadow-hover);
	color: var(--wp--preset--color--white);
	transform: translateY(-2px);
}

a.ac-btn-sm:active {
	box-shadow: var(--wp--preset--shadow--button);
	transform: translateY(0) scale(0.985);
	transition-duration: 0.08s;
}

/* Tap targets at least 24x24px (WCAG 2.2 2.5.8) for small standalone
 * links, without moving anything: inline links get vertical padding (it
 * doesn't change the line box); block links get padding cancelled by an
 * equal negative margin. */
.ac-top-bar a {
	padding-block: 6px;
}

.ac-footer .ac-footer__mail a,
.ac-footer .ac-footer__email a,
.ac-footer .ac-footer-legal a,
.ac-arrow-link a {
	padding-block: 5px;
}

.ac-resource-card__title a {
	padding-block: 2px;
}

/* Category labels on posts and the blog grid. */
.wp-block-post-terms a {
	padding: 5px 2px;
}

.ac-footer .ac-footer__menu .wp-block-navigation-item__content {
	margin-block: -4px;
	padding-block: 4px;
}

.wp-block-read-more.ac-arrow-link {
	margin-block: -1px;
	padding-block: 1px;
}

/* Footer legal bar (design: .footer-bottom). */
.ac-footer-legal {
	border-top: 1px solid var(--wp--custom--line-on-navy);
}

.ac-footer-legal > p {
	margin: 0;
}

.ac-footer-legal__disclaimer {
	flex: 1 1 360px;
	max-width: 620px;
}

@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}

	.wp-block-button__link,
	.wp-element-button,
	.ac-form .wpcf7-submit,
	.home .wp-block-button__link,
	.home .wp-element-button,
	.home .ac-form .wpcf7-submit,
	.ac-btn-arrow .wp-block-button__link::after,
	.ac-btn-arrow-up .wp-block-button__link::after,
	.ac-header .ac-header__cta .wp-block-button__link::after,
	.wp-block-button.is-style-pill-light .wp-block-button__link::after,
	.ac-arrow-link::after,
	a.ac-btn-sm {
		transition: none;
	}
}
