/*
Theme Name:        Kate Angelo Child
Theme URI:         https://kateangelo.com
Template:          astra
Version:           1.6.4
Requires at least: 6.0
Tested up to:      6.7
Requires PHP:      7.4
Author:            Kate Angelo
Author URI:        https://kateangelo.com
Text Domain:       kate-angelo-child
License:           All Rights Reserved
Description:       Astra child theme for Kate Angelo. Full per-version changelog in CHANGELOG.md.
*/

/*
 * ── DO NOT append the changelog back into the Description field above ──────
 * v1.2.3 fix note: this header comment block previously accumulated the full
 * per-version changelog inside the Description field. That pushed Template:
 * and Version: past byte offset 8192 — the limit WordPress's get_file_data()
 * reads when scanning a theme's opening comment block for header fields —
 * so WordPress could no longer see Template: and rejected the theme as an
 * invalid child theme ("Template is missing" install error).
 *
 * Fix: all WP header fields now live at the very top of this comment block,
 * Description is a single short line, and the full changelog history moved
 * to CHANGELOG.md (theme root). KEEP IT THAT WAY: log future per-version
 * notes in CHANGELOG.md, never back in this Description field.
 */

/* ── H3 contrast fix (dark-section-scoped, not a global recolor) ──────────
 * Root cause: Astra's Customizer "Headings Color" setting applies a single
 * fixed dark navy (#10253a) to every h1-h6 tag site-wide via a very-low-
 * specificity rule (`h1,h2,h3,h4,h5,h6{color:...}`). That default is CORRECT
 * wherever it's actually used — WP/Astra's own light-background content
 * areas (blog posts, default page templates) — so it must not be changed
 * globally.
 *
 * Elementor "Heading" widgets never hit this bug: every Heading widget on
 * this site already carries its own explicit, section-aware, higher-
 * specificity color rule (e.g. `.elementor-element-93e2f5c .elementor-
 * heading-title{color:#F5D000}`), confirmed on the About (Speak/Train/
 * Consult/Gather), Registry, and book-landing pages — those are fine as-is
 * and are deliberately left untouched here.
 *
 * The bug only hits a RAW <h3> typed directly into an Elementor "Text
 * Editor" widget (WYSIWYG content) — that widget's own container already
 * gets an explicit, section-aware text color (light on dark sections, dark
 * on light sections) from whoever built the page, but a bare <h3> inside it
 * ignores that inherited color because Astra's global rule targets the
 * element directly. Confirmed live case: the "Want to be one of the first
 * people to read Fatal Pattern?" H3 on /fp-launch-team/ — dark navy
 * (Astra default) on a #020F24 navy section, while the surrounding
 * paragraph text in the same widget correctly renders light (#EEF2F8)
 * because paragraphs don't have a competing global Astra rule.
 *
 * Fix: make raw H3s inside Text Editor widgets inherit the same
 * already-correct, section-aware color their sibling paragraph text uses,
 * instead of hard-coding one color everywhere. This is self-scoping — it
 * only ever changes rendering where the described bug pattern exists, and
 * is transparent to legitimate light-background Text Editor H3s (should
 * any exist) since it defers to whatever text color the page builder
 * already set for that widget.
 */
.elementor-widget-text-editor h3 {
    color: inherit;
}

/* ── GLOBAL GOLD BUTTON GLOW (Daria, staging batch round) ────────────────────
 * Kate specifically called out loving the soft gold glow that was already
 * sitting behind the home page's "Full Bio + Press Kit" / "Book Kate to
 * Speak" buttons (.sp-cta, in the Kate Book Manager plugin's own
 * inc/assets/home-landing.css) and asked for it EVERYWHERE, not just there.
 * Extracted here as two CSS custom properties (rest + hover box-shadow
 * values, copied verbatim from .sp-cta / .sp-cta:hover so the "reference"
 * button's own glow is visually unchanged) plus one small utility class,
 * `.ka-btn-glow`, that any button/link anywhere on the site can opt into.
 *
 * Lives in style.css (not site-header-footer.css) deliberately: style.css is
 * enqueued unconditionally on every single page type via
 * ka_child_enqueue_styles() in functions.php, so these two variables are
 * guaranteed to exist before ANY other stylesheet on the site — including
 * the Kate Book Manager PLUGIN's own home-landing.css, which is a separate
 * plugin-owned file this theme doesn't control the enqueue order of. Same
 * pattern already established for --ka-font-secondary (defined once,
 * consumed from multiple independent stylesheets via var()).
 */
:root {
	--ka-glow-gold:       0 4px 24px rgba(245, 208, 0, .35);
	--ka-glow-gold-hover: 0 8px 32px rgba(245, 208, 0, .5);
}
.ka-btn-glow {
	box-shadow: var(--ka-glow-gold);
	transition: box-shadow .2s ease, background-color .2s ease, transform .15s ease;
}
.ka-btn-glow:hover {
	box-shadow: var(--ka-glow-gold-hover);
}
@media (prefers-reduced-motion: reduce) {
	.ka-btn-glow { transition: box-shadow .2s ease, background-color .2s ease; }
}

/* ── Hide Astra's header & footer on the front/home page ──────────────────────
   The home page template has its own nav and footer built in.
   Astra's masthead and colophon are suppressed so they don't double-render. */
body.home #masthead,
body.home .ast-masthead-custom-menu-items,
body.home #ast-fixed-header,
body.home #colophon {
    display: none !important;
}

/* Remove Astra's default page padding/margin on home page */
body.home,
body.home .site,
body.home #page,
body.home #content,
body.home #primary,
body.home .site-main,
body.home .ast-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}

/* ── Book single pages: force true 100% full-bleed ── */
body.single-book #masthead,
body.single-book #ast-fixed-header,
body.single-book .ast-masthead-custom-menu-items,
body.single-book #colophon { display: none !important; }

body.single-book,
body.single-book .site,
body.single-book #page,
body.single-book #content,
body.single-book #primary,
body.single-book .site-main,
body.single-book .ast-container,
body.single-book .ast-container-wrapper,
body.single-book .entry-header,
body.single-book .entry-content,
body.single-book article,
body.single-book .post-content-wrap {
    margin:  0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Override Astra's content-width variable */
body.single-book { --content-width: 100%; }

/* Remove any Astra-added margins from the site wrapper */
body.single-book .ast-row {
    margin-left:  0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}

/* ── All pages: prevent Astra from adding top padding for admin bar offset on custom templates ── */
body.single-book .site,
body.home .site { margin-top: 0 !important; }

/* Admin bar: allow our nav to sit at the very top */
body.single-book.admin-bar #wpadminbar { position: fixed; }
body.home.admin-bar #wpadminbar { position: fixed; }

body.single-book #masthead { display: none !important; }
