/*
 Theme Name:   Astra Child — Buyer's Guide
 Theme URI:    https://buyersguide.groomertogroomer.com/
 Description:  Child theme for the Groomer to Groomer Buyer's Guide. Put theme tweaks here (CSS below, PHP in functions.php) so Astra updates never overwrite them. Directory features live in the bg-directory plugin.
 Author:       Barkleigh Productions
 Template:     astra
 Version:      1.1.5
 Text Domain:  astra-child
*/

/* Your CSS tweaks go below. Colors: use Astra's palette variables
   (var(--ast-global-color-0) … -8) so they also work in dark mode. */

/* ---------- Dark mode switch (Astra Pro color switcher) ----------
 * Shown in the footer only, like Groomer to Groomer. It also sits in the header
 * builder, hidden, because Astra loads the switcher's script only when the
 * header has one. Drawn as the old sun/moon toggle: a yellow sun; in dark mode
 * a white-edged track with a crescent moon (Astra marks the 2nd icon .ast-current).
 */
.site-header .ast-header-color-switcher-element {
	display: none !important;
}

.bg-footer-switcher .ast-color-switcher-wrapper,
.bg-footer-switcher .ast-builder-color-switcher {
	display: inline-flex;
	vertical-align: middle;
}

.bg-footer-switcher {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	margin-left: .75em;
	vertical-align: middle;
}

.ast-builder-color-switcher .ast-switcher-button,
.ast-builder-color-switcher .ast-switcher-button:hover,
.ast-builder-color-switcher .ast-switcher-button:focus {
	position: relative;
	box-sizing: content-box;
	width: 2.5em;
	height: 1.5em;
	padding: 0;
	font-size: 18px;
	border: .125em solid #ffb200;
	border-radius: 1em;
	background: rgba(255, 255, 255, .15);
	cursor: pointer;
	transition: background .4s ease-in-out, border-color .4s ease-in-out;
}

.ast-builder-color-switcher .ast-switcher-button:focus-visible {
	outline: 3px solid var(--ast-global-color-0);
	outline-offset: 2px;
}

/* Astra's own icons; Astra's rule for them would otherwise win. */
.ast-builder-color-switcher .ast-switcher-button .ast-switcher-icon {
	display: none !important;
}

/* The sun; in dark mode its offset shadow becomes the moon. */
.ast-builder-color-switcher .ast-switcher-button::before {
	content: "";
	position: absolute;
	top: .25em;
	left: .25em;
	width: 1em;
	height: 1em;
	border-radius: 50%;
	background: #ffb200;
	box-shadow: 0 0 .625em #fff;
	transform: rotate(-45deg);
	transition: .4s ease-in-out;
}

.ast-builder-color-switcher .ast-switcher-button:has(.ast-switcher-icon:last-child.ast-current) {
	border-color: #fff;
	background: rgba(0, 0, 0, .15);
}

.ast-builder-color-switcher .ast-switcher-button:has(.ast-switcher-icon:last-child.ast-current)::before {
	left: .6em;
	background: transparent;
	box-shadow: .3125em .3125em 0 0 #eee;
}

/* ---------- Page background ----------
 * Astra paints "plain container" pages (home, A–Z, Get Listed, category pages)
 * with the content color (palette 4), the same as the header, so the header
 * blended into the page. Use the page color (palette 5) there too, like the
 * listing pages: header/footer/panels = palette 4, page = palette 5.
 */
body.ast-plain-container {
	background-color: var(--ast-global-color-5);
}

/* ---------- Dark mode links ----------
 * Body links are white (palette 2) with a red underline so they still read as
 * links; buttons and filled chips keep the primary red (palette 0).
 */
body.astra-dark-mode-enable .site-content a:not(.bg-btn):not(.bg-chip):not(.wp-block-button__link):not(.ast-button) {
	color: var(--ast-global-color-2);
	text-decoration: underline;
	text-decoration-color: var(--ast-global-color-0);
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}
body.astra-dark-mode-enable .site-content a:not(.bg-btn):not(.bg-chip):not(.wp-block-button__link):not(.ast-button):hover {
	text-decoration-color: var(--ast-global-color-2);
	text-decoration-thickness: 2px;
}
/* Pill-shaped links, card titles and the home page's Featured list don't need an underline.
   (Same :not() list as above so these out-rank it — each :not() adds weight.) */
body.astra-dark-mode-enable .site-content .bg-card__title a:not(.bg-btn):not(.bg-chip):not(.wp-block-button__link):not(.ast-button),
body.astra-dark-mode-enable .site-content .bg-feature__names a:not(.bg-btn):not(.bg-chip):not(.wp-block-button__link):not(.ast-button),
body.astra-dark-mode-enable .site-content .bg-az a:not(.bg-btn):not(.bg-chip):not(.wp-block-button__link):not(.ast-button),
body.astra-dark-mode-enable .site-content .bg-pager a:not(.bg-btn):not(.bg-chip):not(.wp-block-button__link):not(.ast-button) {
	text-decoration: none;
}

/* Home page Featured list: page-number links keep the gold of "Page …" in dark mode too. */
body.astra-dark-mode-enable .site-content .bg-feature__names a.bg-page-link:not(.bg-btn):not(.bg-chip):not(.wp-block-button__link):not(.ast-button) {
	color: inherit;
}
