/*
Theme Name:   Hello Elementor Child – Smart Gadgets Reviews
Description:  Child theme for smartgadgetsreviews.com. Adds a centred header menu with native search, a four-column footer and brand layout CSS. All text, menus and branding are edited in WordPress.
Author:       Smart Gadgets Reviews
Template:     hello-elementor
Version:      1.3.0
Requires PHP: 7.4
Text Domain:  hello-elementor-child
*/

/* ==========================================================================
   HOW THIS FILE IS ORGANISED
   --------------------------------------------------------------------------
   Colours, logo typography, header/footer backgrounds and menu link colours
   are set in Elementor > Site Settings (Global Colors, Header, Footer) and
   are NOT repeated here, so they stay editable without code.

   This file only handles layout, spacing, hover/active states and the
   search box. Colours below read Elementor's global colour variables, with
   the brand hex value as a fallback:

     --sgr-primary  Primary blue   (Site Settings > Global Colors > Primary)
     --sgr-navy     Dark navy      (Global Colors > Secondary)
     --sgr-border   Border grey    (Global Colors > Border)
     --sgr-light    Light bg       (Global Colors > Light Background)

   Sections:
     1. Shared variables
     2. Logo (text) accent
     3. Header – desktop
     4. Header – search box
     5. Header – mobile / tablet dropdown (below 992px, Hello's breakpoint)
     6. Footer
     7. Footer – responsive
     8. Accessibility helpers
   ========================================================================== */

/* 1. Shared variables ----------------------------------------------------- */
.site-header,
.site-footer {
	--sgr-primary: var(--e-global-color-primary, #155EEF);
	--sgr-navy: var(--e-global-color-secondary, #101828);
	--sgr-border: var(--e-global-color-sgr_border, #EAECF0);
	--sgr-light: var(--e-global-color-sgr_light, #F5F7FA);
	/* Lighter tint of the primary blue, used for hovers on the dark footer
	   (#155EEF itself is too low-contrast on navy). */
	--sgr-primary-on-dark: #6E9BFF;
	/* Muted text on the dark footer. */
	--sgr-footer-muted: #D0D5DD;
}

/* 2. Logo (text) accent ----------------------------------------------------
   The site name comes from Settings / Site Identity. Its font size, weight,
   case and colour are set in Site Settings > Header/Footer > Site Logo.
   This adds a small blue "chip" before the name. If you upload an image
   logo instead, the chip is not shown. */
.site-header .site-title a,
.site-footer .site-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	text-decoration: none;
}

.site-header .site-title a::before,
.site-footer .site-title a::before {
	content: "";
	flex: none;
	width: 0.9em;
	height: 0.9em;
	border-radius: 0.2em;
	background: var(--sgr-primary);
	box-shadow: inset 0 0 0 0.22em var(--sgr-primary), inset 0 0 0 0.4em rgba(255, 255, 255, 0.85);
}

/* 3. Header – desktop ----------------------------------------------------- */
.site-header {
	border-block-end: 1px solid var(--sgr-border);
	padding-block: 0;
}

.site-header .header-inner {
	align-items: center;
	flex-wrap: nowrap;
	gap: 1rem 2rem;
	min-height: 72px;
}

.site-header .site-branding {
	flex: 0 1 auto;
	min-width: 0; /* lets a long site name wrap instead of overflowing */
}

.site-header .site-navigation-toggle-holder {
	flex: none;
}

/* Hello adds 10px inner padding below 576px on top of the Site Settings
   "Side Margins" (20px). Remove it so mobile edges are a single 20px. */
@media (max-width: 575px) {
	.site-header .header-inner,
	.site-footer .footer-inner {
		padding-inline: 0;
	}
}

/* Menu takes the remaining space; the list is centred, search sits right. */
.site-header .site-navigation {
	flex: 1 1 auto;
	gap: 1.5rem;
	justify-content: space-between;
}

.site-header .site-navigation ul.menu {
	flex: 1 1 auto;
	flex-wrap: nowrap;
	gap: 0.25rem;
	justify-content: center;
	margin: 0;
}

.site-header .site-navigation ul.menu > li > a {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.5;
	padding: 1.5rem 0.75rem;
	text-decoration: none;
	white-space: nowrap;
}

.site-header .site-navigation ul.menu > li > a:hover,
.site-header .site-navigation ul.menu > li > a:focus-visible {
	color: var(--sgr-primary);
}

/* Active item: current page, or the category of the post being viewed. */
.site-header .site-navigation ul.menu > li.current-menu-item > a,
.site-header .site-navigation ul.menu > li.current-menu-ancestor > a,
.site-header .site-navigation ul.menu > li.current-menu-parent > a,
.site-header .site-navigation ul.menu > li.current-post-ancestor > a {
	color: var(--sgr-primary);
	box-shadow: inset 0 -3px 0 var(--sgr-primary);
}

/* Slightly tighter spacing on small laptops, just above the 992px switch. */
@media (max-width: 1199px) {
	.site-header .header-inner {
		gap: 1rem;
	}

	.site-header .site-navigation ul.menu > li > a {
		padding-inline: 0.5rem;
	}
}

/* 4. Header – search box -------------------------------------------------
   Native WordPress search form (added by functions.php, section 4).
   The submit button keeps its "Search" text for screen readers; it is
   visually replaced by a magnifier icon. */
.sgr-header-search .search-form {
	display: flex;
	align-items: stretch;
	margin: 0;
}

.sgr-header-search .search-form label {
	display: block;
	flex: 1 1 auto;
	margin: 0;
}

.site-header .sgr-header-search .search-field {
	width: 11rem;
	height: 40px;
	padding: 0 0.75rem;
	border: 1px solid var(--sgr-border);
	border-inline-end: 0;
	border-radius: 6px 0 0 6px;
	background: #fff;
	color: var(--sgr-navy);
	font-size: 0.9375rem;
}

.site-header .sgr-header-search .search-field:focus {
	border-color: var(--sgr-primary);
	outline: 2px solid var(--sgr-primary);
	outline-offset: -2px;
}

.site-header .sgr-header-search .search-submit {
	flex: none;
	width: 44px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--sgr-primary);
	border-radius: 0 6px 6px 0;
	background-color: var(--sgr-primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 18px;
	color: transparent;
	font-size: 0;
	cursor: pointer;
}

.site-header .sgr-header-search .search-submit:hover,
.site-header .sgr-header-search .search-submit:focus-visible {
	background-color: var(--sgr-navy);
	border-color: var(--sgr-navy);
}

@media (max-width: 1199px) {
	.site-header .sgr-header-search .search-field {
		width: 8.5rem;
	}
}

/* 5. Header – mobile / tablet dropdown -----------------------------------
   Hello's own toggle button and script open/close the menu (no extra JS). */
.site-header .site-navigation-toggle-holder {
	padding: 0;
}

.site-header .site-navigation-toggle-holder .site-navigation-toggle {
	width: 44px;
	height: 44px;
	border-radius: 6px;
}

.site-header .site-navigation-dropdown {
	top: 100%;
	bottom: auto;
	margin-block-start: 0;
	background: #fff;
	border-block-end: 1px solid var(--sgr-border);
	box-shadow: 0 12px 24px -8px rgba(16, 24, 40, 0.12);
}

.site-header .site-navigation-dropdown ul.menu {
	position: static;
}

.site-header .site-navigation-dropdown ul.menu li a {
	padding: 14px 20px;
	color: var(--sgr-navy);
	font-weight: 600;
	text-decoration: none;
	box-shadow: inset 0 -1px 0 var(--sgr-border);
}

.site-header .site-navigation-dropdown ul.menu li a:hover,
.site-header .site-navigation-dropdown ul.menu li a:focus-visible {
	color: var(--sgr-primary);
}

.site-header .site-navigation-dropdown ul.menu li.current-menu-item > a,
.site-header .site-navigation-dropdown ul.menu li.current-menu-parent > a,
.site-header .site-navigation-dropdown ul.menu li.current-post-ancestor > a {
	background: var(--sgr-light);
	color: var(--sgr-primary);
	box-shadow: inset 3px 0 0 var(--sgr-primary), inset 0 -1px 0 var(--sgr-border);
}

.site-header .site-navigation-dropdown .sgr-header-search {
	padding: 16px 20px 20px;
}

.site-header .site-navigation-dropdown .sgr-header-search .search-field {
	width: 100%;
	height: 44px;
}

.site-header .site-navigation-dropdown .sgr-header-search .search-submit {
	height: 44px;
}

@media (prefers-reduced-motion: reduce) {
	.site-header .site-navigation-dropdown {
		transition: none;
	}
}

/* 6. Footer ----------------------------------------------------------------
   Background, title, tagline, link and copyright colours: Site Settings >
   Footer. Column layout: template-parts/dynamic-footer.php. */
.site-footer.sgr-footer {
	padding-block: 3.5rem 0;
}

.site-footer.sgr-footer .footer-inner {
	display: block;
}

.sgr-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
	gap: 2.5rem 2rem;
	padding-block-end: 2.5rem;
}

.site-footer.sgr-footer .footer-inner .sgr-footer__col {
	display: block;
	max-width: none;
	text-align: start;
	width: auto;
}

.site-footer.sgr-footer .site-branding {
	align-items: flex-start;
	gap: 0.875rem;
	justify-content: flex-start;
}

.sgr-footer__description,
.sgr-footer__description p {
	color: var(--sgr-footer-muted);
	font-size: 0.9375rem;
	line-height: 1.6;
	margin: 0;
	max-width: 22rem;
}

.site-footer .sgr-footer__heading {
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.4;
	margin: 0 0 1rem;
	text-transform: uppercase;
}

.site-footer.sgr-footer .footer-inner .site-navigation ul.menu {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
}

.site-footer.sgr-footer .footer-inner .site-navigation ul.menu li {
	display: block;
}

.site-footer.sgr-footer .footer-inner .site-navigation ul.menu li a {
	display: inline-block;
	font-size: 0.9375rem;
	line-height: 1.5;
	padding: 0.125rem 0;
	text-decoration: none;
}

.site-footer.sgr-footer .footer-inner .site-navigation ul.menu li a:hover,
.site-footer.sgr-footer .footer-inner .site-navigation ul.menu li a:focus-visible,
.site-footer.sgr-footer .site-title a:hover {
	color: var(--sgr-primary-on-dark);
}

.site-footer.sgr-footer .footer-inner .site-navigation ul.menu li a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Bottom bar: copyright. */
.site-footer.sgr-footer .footer-inner .sgr-footer__bottom {
	border-block-start: 1px solid rgba(255, 255, 255, 0.12);
	justify-content: flex-start;
	padding-block: 1.25rem;
	text-align: start;
}

.site-footer.sgr-footer .sgr-footer__bottom p {
	font-size: 0.875rem;
}

/* 7. Footer – responsive -------------------------------------------------- */
@media (max-width: 1024px) {
	.sgr-footer__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.sgr-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 600px) {
	.site-footer.sgr-footer {
		padding-block-start: 2.5rem;
	}

	.sgr-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2rem 1.25rem;
	}

	.site-footer.sgr-footer .footer-inner .sgr-footer__bottom {
		display: block;
	}

	/* Hello centres the footer branding below 576px; keep it left-aligned
	   to match the stacked columns. */
	.site-footer.sgr-footer:not(.footer-stacked) .footer-inner .site-branding {
		display: flex;
		text-align: start;
	}
}

/* 8. Accessibility helpers ------------------------------------------------ */
.site-header a:focus-visible {
	outline: 2px solid var(--sgr-primary);
	outline-offset: 2px;
}

.site-footer a:focus-visible {
	outline: 2px solid var(--sgr-primary-on-dark);
	outline-offset: 2px;
}
