/**
 * Theme Name:        Astra Child
 * Theme URI:         https://seotoolchecker.net/
 * Description:       Child theme of Astra for SEO Tool Checker. Put all custom styles, templates and functions here so Astra updates never overwrite them.
 * Author:            SEO Tool Checker
 * Author URI:        https://seotoolchecker.net/
 * Template:          astra
 * Version:           1.2.1
 * Requires at least: 6.5
 * Tested up to:      7.1
 * Requires PHP:      7.4
 * License:           GNU General Public License v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       astra-child
 * Domain Path:       /languages
 */

/*
 * Astra loads its own stylesheet (astra-theme-css); this file is enqueued
 * after it from functions.php. Colors, fonts and buttons come from Astra's
 * Customizer (global palette variables), so only layout additions live here.
 */

/* ---------- Accessibility ---------- */

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--ast-global-color-0);
	outline-offset: 2px;
}

/* ---------- Cards (homepage query loops) ---------- */

.stc-card-grid .wp-block-post {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	padding: 1.5em;
	background: var(--ast-global-color-4);
	border: 1px solid var(--ast-border-color);
	border-radius: 8px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stc-card-grid .wp-block-post:hover,
.stc-card-grid .wp-block-post:focus-within {
	border-color: var(--ast-global-color-0);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.stc-card-grid .wp-block-post-title {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.35;
}

.stc-card-grid .wp-block-post-title a {
	color: var(--ast-global-color-2);
	text-decoration: none;
}

.stc-card-grid .wp-block-post-title a:hover {
	color: var(--ast-global-color-0);
}

.stc-card-grid .wp-block-post-excerpt {
	margin: 0;
	color: var(--ast-global-color-3);
}

.stc-card-grid .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.stc-card-grid .wp-block-post-featured-image {
	margin: -1.5em -1.5em 0.5em;
	overflow: hidden;
	border-radius: 8px 8px 0 0;
}

.stc-card-grid .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.stc-card-grid .wp-block-post-date,
.stc-card-grid .wp-block-post-terms {
	font-size: 0.875rem;
	color: var(--ast-global-color-3);
}

.stc-card-grid .wp-block-read-more {
	margin-top: auto;
	font-weight: 600;
}

/* ---------- Topics list ---------- */

.stc-topic-list.wp-block-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stc-topic-list.wp-block-categories li a {
	display: inline-block;
	padding: 0.4em 1em;
	border: 1px solid var(--ast-border-color);
	border-radius: 999px;
	background: var(--ast-global-color-4);
	text-decoration: none;
}

.stc-topic-list.wp-block-categories li a:hover {
	border-color: var(--ast-global-color-0);
}

/* ---------- Single post: author box ---------- */

.stc-author-box {
	display: flex;
	gap: 1.25em;
	align-items: flex-start;
	margin-top: 2.5em;
	padding: 1.5em;
	background: var(--ast-global-color-5);
	border-radius: 8px;
}

.stc-author-box__avatar {
	flex: 0 0 auto;
	border-radius: 50%;
}

.stc-author-box__title {
	margin: 0 0 0.35em;
	font-size: 1.15rem;
}

.stc-author-box__bio p {
	margin-bottom: 0.5em;
}

.stc-author-box__link {
	font-weight: 600;
}

@media (max-width: 544px) {
	.stc-author-box {
		flex-direction: column;
	}
}

/* ---------- Blog page header ---------- */

/* Astra prints its archive header rules for body.archive only; the posts page
   (body.blog) reuses the same markup, so mirror the layout here. */
body.blog .ast-archive-description {
	width: 100%;
	max-width: var(--ast-normal-container-width, 1200px);
	padding: 3em;
	text-align: left;
}

body.blog .ast-archive-description .ast-archive-title {
	font-weight: 600;
	font-size: 2rem;
}

body.blog .ast-archive-description > *:not(:last-child) {
	margin-bottom: 10px;
}

@media (max-width: 544px) {
	body.blog .ast-archive-description {
		padding: 1.5em 1em;
	}
}

/* ---------- Footer ---------- */

/* Dark footer built from Astra's global palette, so palette changes in the
   Customizer still flow through. Astra's footer rows, menu and copyright keep
   their markup; only their presentation is adjusted here. */
.site-footer {
	--stc-footer-bg: var(--ast-global-color-2);
	--stc-footer-bg-deep: color-mix(in srgb, var(--ast-global-color-2) 70%, #000);
	--stc-footer-text: color-mix(in srgb, var(--ast-global-color-5) 82%, var(--ast-global-color-2));
	--stc-footer-muted: color-mix(in srgb, var(--ast-global-color-5) 64%, var(--ast-global-color-2));
	--stc-footer-heading: var(--ast-global-color-4);
	--stc-footer-accent: color-mix(in srgb, var(--ast-global-color-0) 55%, #fff);
	--stc-footer-line: color-mix(in srgb, var(--ast-global-color-5) 14%, transparent);
	--stc-footer-gutter: 20px;

	position: relative;
	color: var(--stc-footer-text);
	background-color: var(--stc-footer-bg);
	background-image:
		radial-gradient(60rem 22rem at 12% 0%, color-mix(in srgb, var(--ast-global-color-0) 16%, transparent), transparent 70%),
		linear-gradient(180deg, var(--stc-footer-bg) 0%, var(--stc-footer-bg-deep) 100%);
}

/* Hairline accent along the top edge. */
.site-footer::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--stc-footer-accent), transparent);
	opacity: 0.6;
}

.site-footer a {
	color: var(--stc-footer-text);
}

.site-footer a:hover,
.site-footer a:focus {
	color: var(--stc-footer-heading);
}

.site-footer :where(a, button):focus-visible {
	outline-color: var(--stc-footer-accent);
}

/* Brand panel (inc/footer.php). */
.stc-footer-brand__inner {
	display: grid;
	gap: 2rem;
	align-items: end;
	max-width: var(--ast-normal-container-width, 1200px);
	margin: 0 auto;
	padding: clamp(3rem, 7vw, 4.5rem) var(--stc-footer-gutter) clamp(2rem, 4vw, 3rem);
}

@media (min-width: 922px) {
	.stc-footer-brand__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 3rem;
	}
}

.stc-footer-brand__identity {
	max-width: 36rem;
}

.site-footer .stc-footer-brand__name {
	display: inline-block;
	color: var(--stc-footer-heading);
	font-size: clamp(1.5rem, 2.6vw, 1.875rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-decoration: none;
}

.stc-footer-brand__logo {
	display: block;
	width: auto;
	max-height: 48px;
}

.stc-footer-brand__description {
	margin-top: 0.75rem;
	color: var(--stc-footer-muted);
	font-size: 1rem;
	line-height: 1.65;
}

.stc-footer-brand__description p {
	margin: 0;
}

.stc-footer-brand__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.site-footer .stc-footer-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.65rem 1.25rem;
	border: 1px solid var(--stc-footer-line);
	border-radius: 999px;
	color: var(--stc-footer-heading);
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-footer .stc-footer-cta:hover,
.site-footer .stc-footer-cta:focus-visible {
	border-color: var(--stc-footer-accent);
	background-color: color-mix(in srgb, var(--ast-global-color-5) 8%, transparent);
	color: var(--stc-footer-heading);
}

.site-footer .stc-footer-cta--primary {
	border-color: var(--ast-global-color-0);
	background-color: var(--ast-global-color-0);
	color: var(--ast-global-color-4);
}

.site-footer .stc-footer-cta--primary:hover,
.site-footer .stc-footer-cta--primary:focus-visible {
	border-color: var(--ast-global-color-1);
	background-color: var(--ast-global-color-1);
	color: var(--ast-global-color-4);
}

.stc-footer-cta__icon {
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.stc-footer-cta:hover .stc-footer-cta__icon,
.stc-footer-cta:focus-visible .stc-footer-cta__icon {
	transform: translateX(3px);
}

/* Astra builder rows: blend into the dark footer. */
.site-footer :is(.site-above-footer-wrap, .site-primary-footer-wrap, .site-below-footer-wrap)[data-section] {
	background: transparent;
	border-top-color: var(--stc-footer-line);
}

.site-footer .site-below-footer-wrap[data-section] {
	padding-top: 1.25rem;
	padding-bottom: 1.25rem;
}

.site-footer .site-below-footer-wrap[data-section] .ast-builder-grid-row {
	padding-inline: var(--stc-footer-gutter);
}

.site-footer .ast-footer-copyright.site-footer-focus-item {
	color: var(--stc-footer-muted);
	font-size: 0.875rem;
}

.site-footer .ast-footer-copyright p {
	margin: 0;
}

.site-footer :is(.widget-title, .widget h2, .widget h3) {
	color: var(--stc-footer-heading);
}

/* Footer menu links: animated underline on hover/focus. */
.site-footer #astra-footer-menu {
	gap: 0.25rem 1.5rem;
}

.site-footer #astra-footer-menu .menu-item > .menu-link {
	padding: 0.25rem 0;
	color: var(--stc-footer-text);
	font-size: 0.9375rem;
	text-decoration: none;
	background-image: linear-gradient(var(--stc-footer-accent), var(--stc-footer-accent));
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0% 1px;
	transition: background-size 0.25s ease, color 0.2s ease;
}

.site-footer #astra-footer-menu .menu-item > .menu-link:hover,
.site-footer #astra-footer-menu .menu-item > .menu-link:focus-visible,
.site-footer #astra-footer-menu .current-menu-item > .menu-link {
	color: var(--stc-footer-heading);
	background-size: 100% 1px;
}

@media (min-width: 922px) {
	.site-footer .site-below-footer-wrap[data-section] .site-footer-section-1 .ast-footer-copyright {
		justify-content: flex-start;
		text-align: left;
	}

	.site-footer .site-below-footer-wrap[data-section] .site-footer-section-2 .footer-widget-area {
		width: 100%;
	}
}

@media (min-width: 922px) and (max-width: 1199px) {
	/* Not enough room for both on one line: menu row above copyright, left aligned. */
	.site-footer .site-below-footer-wrap[data-section] .ast-builder-grid-row {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 0.75rem;
	}

	.site-footer .site-below-footer-wrap[data-section] .site-footer-section-1 {
		order: 2;
	}

	.site-footer .footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {
		justify-content: flex-start;
	}
}

@media (min-width: 1200px) {
	/* Copyright left (content width), menu right on one line. */
	.site-footer .site-below-footer-wrap[data-section] .ast-builder-grid-row {
		grid-template-columns: auto minmax(0, 1fr);
		column-gap: 2rem;
	}

	.site-footer #astra-footer-menu {
		gap: 0.25rem 1.25rem;
	}

	.site-footer .footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {
		justify-content: flex-end;
	}
}

@media (max-width: 921px) {
	/* Stack the bottom bar: menu first, copyright below. */
	.site-footer .site-below-footer-wrap[data-section] .ast-builder-grid-row {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Leave room for Astra's fixed "scroll to top" button at the page end. */
	.site-footer .site-below-footer-wrap[data-section] {
		padding-bottom: 5rem;
	}

	/* Two-column link grid with comfortable tap targets on tablet and mobile. */
	.site-footer .footer-nav-wrap :is(.astra-footer-tablet-vertical-menu, .astra-footer-mobile-vertical-menu) {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		justify-content: stretch;
		gap: 0 1.5rem;
		width: 100%;
		max-width: 28rem;
		margin-inline: auto;
	}

	.site-footer #astra-footer-menu .menu-item {
		align-items: flex-start;
	}

	.site-footer #astra-footer-menu .menu-item > .menu-link {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		padding: 0;
	}

	.site-footer .site-below-footer-wrap[data-section] .site-footer-section-1 {
		order: 2;
		margin-top: 1rem;
		padding-top: 1rem;
		border-top: 1px solid var(--stc-footer-line);
	}

	.stc-footer-brand__actions .stc-footer-cta {
		flex: 1 1 12rem;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-footer .stc-footer-cta,
	.stc-footer-cta__icon,
	.site-footer #astra-footer-menu .menu-item > .menu-link {
		transition: none;
	}

	.stc-footer-cta:hover .stc-footer-cta__icon,
	.stc-footer-cta:focus-visible .stc-footer-cta__icon {
		transform: none;
	}
}

/* ---------- Core fixes ---------- */

/* Core's `.wp-block-search__label { width: 100% }` overrides the 1px width of
   visually hidden labels, which pushes the page wider than the viewport. */
.wp-block-search__label.screen-reader-text {
	width: 1px;
}
