/*
 Theme Name: Astra Child
 Theme URI: https://wpastra.com/
 Description: Child theme for Astra
 Author: Heath Schweitzer
 Template: astra
 Version: 1.0.0
*/

/*
 * Contrast and accessibility fixes (WCAG: text 4.5:1, icons 3:1).
 * Palette: #2b2b2b dark, #6B5638 brown, #285335 green, #fbf7f2 cream, #b29b7d tan (footer).
 */

/* ---- Footer icons: one color, one size, one baseline ----
 * Cart, search and account are blocks in footer widgets. Each control is 37px
 * high like the social icons. Their SVGs have inner padding, so each is sized
 * to draw a glyph of about 32px, the same as the social glyphs.
 */
#colophon .site-footer-primary-section-3 {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	align-content: flex-start;
	justify-content: center;
	gap: 12px;
}

#colophon .site-footer-primary-section-3 .footer-widget-area {
	flex: 0 0 auto;
	width: auto;
	margin: 0;
}

#colophon .site-footer-primary-section-3 .widget {
	display: flex;
	align-items: center;
	height: 37px;
	margin: 0;
}

#colophon .wc-block-mini-cart,
#colophon .wp-block-woocommerce-customer-account {
	display: flex;
	margin: 0;
}

#colophon .wc-block-mini-cart,
#colophon .wc-block-mini-cart__button,
#colophon .wp-block-search,
#colophon .wc-block-customer-account__link {
	overflow: visible;
}

#colophon .wc-block-mini-cart__button,
#colophon .wp-block-search__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	min-width: 44px;
	height: 37px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: #2b2b2b;
}

#colophon .wc-block-mini-cart__quantity-badge,
#colophon .wc-block-customer-account__visual {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 37px;
	height: 37px;
}

#colophon .wc-block-mini-cart__icon,
#colophon .wp-block-search__button .search-icon,
#colophon .wc-block-customer-account__account-icon {
	flex: none;
	max-width: none;
	max-height: none;
	margin: -7px;
	fill: currentColor;
}

#colophon .wc-block-mini-cart__icon {
	width: 49px;
	height: 49px;
}

#colophon .wp-block-search__button .search-icon {
	width: 53px;
	height: 53px;
	margin: -8px;
}

#colophon .wc-block-customer-account__account-icon {
	width: 51px;
	height: 51px;
	transform: translate(-1px, -1px);
}

#colophon .wc-block-customer-account__link {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 37px;
	min-height: 0;
	padding: 0;
	color: #2b2b2b;
}

#colophon .wc-block-customer-account__link .label {
	margin: 0;
}

/* Cart count: dark badge, white number (14.2:1; badge on tan 5.3:1). Grows to the right. */
#colophon .wc-block-mini-cart__badge {
	top: 2px;
	background: #2b2b2b !important;
	color: #ffffff !important;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

/* Hover and focus: green icon (3.3:1 on tan) and a green focus ring. */
#colophon .wc-block-mini-cart__button:hover,
#colophon .wc-block-mini-cart__button:focus-visible,
#colophon .wp-block-search__button:hover,
#colophon .wp-block-search__button:focus-visible {
	background: transparent;
	color: #285335;
}

#colophon .footer-social-item:hover svg,
#colophon .footer-social-item:focus-visible svg,
#colophon .wc-block-customer-account__link:hover svg,
#colophon .wc-block-customer-account__link:focus-visible svg {
	fill: #285335;
	color: #285335;
}

/* Text stays dark: green on tan is below 4.5:1. */
#colophon .wc-block-customer-account__link:hover .label,
#colophon .footer-navigation .menu-link:hover {
	text-decoration: underline;
}

#colophon a:focus-visible,
#colophon button:focus-visible {
	outline: 2px solid #285335;
	outline-offset: 3px;
}

/* ---- Footer search, opened ---- */
#colophon .site-footer-primary-section-3 .footer-widget-area:has(.wp-block-search:not(.wp-block-search__searchfield-hidden)) {
	order: 1;
	display: flex;
	flex: 0 0 100%;
	justify-content: center;
}

#colophon .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper {
	align-items: center;
	gap: 6px;
	width: auto !important;
}

#colophon .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input {
	flex: 0 0 260px;
	width: 260px !important;
	max-width: calc(100vw - 80px);
	height: 40px;
	padding: 6px 10px;
	border: 1px solid #2b2b2b;
	background: #ffffff;
	color: #2b2b2b;
}

#colophon .wp-block-search__input::placeholder {
	color: #6B5638; /* 7:1 on white */
	opacity: 1;
}

#colophon .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input:focus {
	outline: 2px solid #285335;
	outline-offset: 2px;
}

/* ---- Header menu: current, hover and focus were tan on cream (2.5:1) ---- */
#masthead .main-header-menu .menu-item:hover > .menu-link,
#masthead .main-header-menu .menu-item:hover > .ast-menu-toggle,
#masthead .main-header-menu .menu-item.current-menu-item > .menu-link,
#masthead .main-header-menu .menu-item.current-menu-item > .ast-menu-toggle,
#masthead .main-header-menu .menu-item.current-menu-ancestor > .menu-link,
#masthead .main-header-menu .menu-item.current-menu-ancestor > .ast-menu-toggle,
#masthead .main-header-menu .ast-menu-toggle:hover,
#masthead .main-header-menu .menu-link:focus-visible {
	color: #6B5638;
}

#masthead .main-header-menu .menu-link:focus-visible,
#masthead .main-header-menu .dropdown-menu-toggle:focus-visible {
	outline-color: #6B5638;
}

/* ---- Home hero: cream text sat on a tan photo overlay ---- */
.home .wp-block-cover__background.has-ast-global-color-7-background-color {
	background-color: #2b2b2b !important; /* at the block's 70%: at least 5:1 behind cream text */
}

/* White on gold (2.5:1) button. */
.wp-block-button__link.has-ast-global-color-1-background-color {
	background-color: #6B5638 !important;
	color: #ffffff;
}

.wp-block-button__link.has-ast-global-color-1-background-color:hover,
.wp-block-button__link.has-ast-global-color-1-background-color:focus-visible {
	background-color: #51402A !important;
	color: #ffffff;
}

/* ---- Focus indicators that were cream, white or missing ---- */
body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]), textarea, select):focus-visible,
body :is(a.wp-block-button__link, a.button, button.button, input[type="submit"]):focus-visible {
	outline: 2px solid #285335;
	outline-offset: 2px;
}
