/*
Theme Name: Astra Child
Theme URI: https://alphahomeservicesky.com
Description: Astra child theme for Alpha Home Services site customizations. Created 2026-05-14 during Flatsome -> Astra changeover.
Author: Alpha Home Services
Author URI: https://alphahomeservicesky.com
Template: astra
Version: 1.0.0
Text Domain: astra-child
*/

/* Custom styles go here. Parent stylesheet is enqueued via functions.php. */


/* ============================================================
 * In-content link styling
 * Astra defaults are very subtle. Make body-content links
 * visible without overriding obvious styled buttons.
 * Added 2026-05-14 during Flatsome -> Astra changeover.
 * ============================================================ */

.entry-content a,
.ast-article-single .entry-content a,
.page-content a {
    color: #0097b2;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.entry-content a:hover,
.ast-article-single .entry-content a:hover,
.page-content a:hover {
    color: #004aad;
    text-decoration-thickness: 2px;
}

/* Anchors that already have an inline background (buttons, CTAs) get no underline */
.entry-content a[style*="background"],
.page-content a[style*="background"] {
    text-decoration: none;
}

/* Phone-number anchors (tel: links) — keep them clean, no underline by default */
.entry-content a[href^="tel:"],
.page-content a[href^="tel:"] {
    text-decoration: none;
}

/* Bare h2 elements in entry content (without inline color) */
.entry-content > h2:not([style]),
.page-content > h2:not([style]) {
    font-size: 1.75rem;
    color: #004aad;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}


/* ============================================================
 * tel: anchor button treatment (v2 — solid white secondary CTA)
 * Pair with the primary teal "Get a Free Estimate" button.
 * Reads as: primary action (teal filled) + alternate action (white filled).
 *
 * Uses !important to override the inline color/padding the content
 * carries from the original Flatsome-era authoring. Per SHARED_RULES
 * Rule 8 pattern — inline-style overrides for button-like elements.
 *
 * Targets only tel: anchors inside entry/page content. Outside content
 * (Astra header phone link if added later) is unaffected.
 * Added 2026-05-14 during Flatsome -> Astra changeover.
 * ============================================================ */

.entry-content a[href^="tel:"],
.page-content a[href^="tel:"] {
    display: inline-block !important;
    background-color: #ffffff !important;
    color: #004aad !important;
    padding: 14px 28px !important;
    border: 2px solid #ffffff !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
    line-height: 1.2 !important;
    vertical-align: middle;
}

.entry-content a[href^="tel:"]:hover,
.page-content a[href^="tel:"]:hover {
    background-color: transparent !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* ==============================================================
 * Bare tel: anchors inside plain <p> (the county + service pages
 * pattern) need a visible-on-white button treatment. The v2 rule
 * above gives them white-bg/navy-text, which disappears on the white
 * page background.
 *
 * Override to filled-teal for the bare case only. Inline-styled
 * containers (Home hero, Contact info, Service Area CTA boxes) keep
 * their existing treatment because their <p> ancestor has style="".
 *
 * Selector: <p> with NO style attr, containing a direct-child <a> to tel:.
 * Added 2026-05-16 during post-cutover visual sweep.
 * ============================================================= */

.entry-content p:not([style]) > a[href^="tel:"],
.page-content p:not([style]) > a[href^="tel:"] {
    background-color: #0097b2 !important;
    color: #ffffff !important;
    border-color: #0097b2 !important;
    padding: 12px 20px !important;
    font-size: 1rem !important;
}

.entry-content p:not([style]) > a[href^="tel:"]:hover,
.page-content p:not([style]) > a[href^="tel:"]:hover {
    background-color: #007c94 !important;
    color: #ffffff !important;
    border-color: #007c94 !important;
}

/* ==============================================================
 * Hide Astra's default page-title bar (.entry-header) on pages.
 * 
 * The h1 inside (Astra's `.entry-title`) stays in the DOM for SEO
 * crawlers and accessibility. Only the visual title bar is hidden.
 * 
 * Rationale: every page's visual hero block already contains its own
 * prominent headline (now an h2 per 2026-05-16 Decision). The duplicate
 * title bar above the hero is redundant and visually breaks the hero
 * treatment.
 * 
 * Uses clip-path hiding (not display: none) to ensure SEO/a11y crawlers
 * still parse the h1. Only applies to page type (.ast-page-builder-template
 * and .single-page contexts) not blog posts where the entry-header serves
 * its intended post-meta purpose.
 * 
 * Added 2026-05-16 after the h1->h2 conversion exposed the title bar.
 * ============================================================= */

.page .entry-header.ast-no-thumbnail {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==============================================================
 * Hide the "Alpha Home Services" text from Astra's site title area
 * (rendered under/beside the custom logo). The logo itself already
 * contains the brand name, so the text is redundant.
 * 
 * Using clip hiding (not display: none) to preserve the itemprop="name"
 * microdata for SEO.  Astra renders site-title twice (desktop + mobile
 * header), this catches both.
 * 
 * Added 2026-05-16.
 * ============================================================== */

.ast-site-title-wrap .site-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==============================================================
 * Tighten the inter-field gap on Forminator form 167.
 * Default per-field bottom margin is too generous.
 * Only changes the gap BETWEEN fields, not label-to-input spacing
 * or input height.
 * Added 2026-05-16.
 * ============================================================== */

.forminator-custom-form-167 .forminator-row {
    margin-bottom: 8px !important;
}

.forminator-custom-form-167 .forminator-field {
    margin-bottom: 0 !important;
}


/* ==============================================================
 * Phone field cleanup on Forminator form 167 (v2).
 * Real class names from devtools inspection 2026-05-16:
 *   .iti__country-container = flag area (NOT iti__flag-container)
 * Hides the country/flag container so the phone input takes full width.
 * Added 2026-05-16.
 * ============================================================== */

.forminator-custom-form-167 .iti__country-container {
    display: none !important;
}

.forminator-custom-form-167 .iti--inline-dropdown input.iti__tel-input {
    padding-left: 12px !important;
}

/* ==============================================================
 * Fix Forminator Select2 chevron glyph rendering on form 167.
 * The default icon uses U+2304 (DOWN ARROWHEAD) which requires the
 * forminator-icons-font ligature feature to render correctly.
 * On this site that ligature isn't firing in all browsers, leaving
 * raw garbled bytes in the dropdown arrow.
 * 
 * Override to use a basic Unicode triangle that renders in every
 * font without ligature dependency.
 * Added 2026-05-16.
 * ============================================================== */

.forminator-custom-form-167 .forminator-icon-chevron-down:before {
    content: "\25BE" !important;
    font-family: inherit !important;
    font-size: 0.85em !important;
}
