/*
Theme Name:  Astra Child — Imp Print 23
Theme URI:   https://impprint23.com/
Description: Child theme of Astra for the Imp Print 23 bookshop. Exists so that custom CSS and
             PHP survive Astra updates, and so the site's customisations can be kept in version
             control — everything else on this site lives only inside the WordPress admin.
Author:      fimdomeio
Author URI:  https://fimdomeio.com/
Template:    astra
Version:     1.0.4
Text Domain: astra-child-impprint23
*/

/* Custom styles go below. Keep the tracked copy in the impprint23.com project directory
   in step with what is live, or this file stops being a record of anything. */

/* ---------------------------------------------------------------------------
   Contrast correction — 2026-09-08
   --------------------------------------------------------------------------- */

/* The buy button is ours, and Astra's default gave it white text on #88ad35,
   which measures 2.60:1 — the most important element on the site was also the
   least legible (WCAG AA wants 4.5:1). Same green family, darkened until white
   text clears AA at ~4.9:1.

   !important is deliberate: Elementor's kit stylesheet targets this with
   `.elementor-kit-425 .elementor-widget-button .elementor-button`, which
   outranks any selector we can write here without hardcoding the kit ID. */
.elementor-widget-button .elementor-button,
.elementor-button.elementor-size-lg {
	background-color: #5f7a20 !important;
}

/* Deliberately NOT fixed here — these are the client's palette and design
   choices, reported for a decision instead of overridden:
     - Astra global colour 1 (#698927) as a link colour: 4.03:1 in the header
       menu and 2.60:1 in the footer, both on white.
     - Home page subtitle #2b5775 on the #7f98ac band: 2.57:1.
     - Home page intro line, white on the same band: 3.00:1.
   Changing those means changing how the site looks, which is not ours to do. */

/* ---------------------------------------------------------------------------
   Dark header and footer — 2026-09-08
   The header and below-footer bands were set to #536471 in the Customizer, a
   darker shade of the #7f98ac content band. Astra has no setting for the link
   colour inside the copyright block — it inherits the accent green, which is
   unreadable on the dark band (about 1.6:1). Forced light here instead of
   changing the global palette.
   --------------------------------------------------------------------------- */
.ast-footer-copyright,
.ast-footer-copyright p {
	color: #ffffff;
}

.ast-footer-copyright a,
.site-below-footer-wrap a {
	color: #ffffff !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ast-footer-copyright a:hover,
.site-below-footer-wrap a:hover {
	color: #dfe6ec !important;
}

/* ---------------------------------------------------------------------------
   Mobile pass — 2026-09-09
   First measurements taken on a genuine 390 × 844 viewport (iPhone 12, DPR 3)
   rather than inferred from a desktop window, which is all the tooling could do
   before. That matters here: nearly all the Libération traffic arrives on a
   phone, and the earlier notes in TASKS.md were guesses.

   Checked and NOT broken — recorded so nobody re-investigates it: the cart
   drawer computes 460px wide while it is closed and parked off-screen, which
   looks alarming in a 390px viewport. Astra already ships
   "@media (max-width: 544px) { .astra-cart-drawer.active { width: 100% } }",
   so it is exactly 390px the moment it opens. Measured open: left 0, right 390,
   nothing clipped.

   "!important" throughout, for the same reason as the button colour above:
   Astra prints its Elementor-compat rules and Elementor prints its per-widget
   rules as inline <style> blocks in the head, so source order is not reliably
   ours and the per-widget selectors outrank anything we can write.
   --------------------------------------------------------------------------- */

@media (max-width: 921px) {

	/* The buy button measured 243 × 39 on a phone — under the 44px minimum tap
	   target (WCAG 2.5.5, Apple HIG), on the single control the whole site
	   exists for. Astra steps its padding down to 14px at 921px and 12px at
	   544px, so both breakpoints land under 44px; one rule covers both.
	   16px/1.25 with 15px of vertical padding gives ~50px. Desktop keeps its
	   own rule and is untouched — it already measures 294 × 56. */
	.elementor-widget-button .elementor-button,
	.elementor-button.elementor-size-lg {
		font-size: 16px !important;
		line-height: 1.25 !important;
		padding-top: 15px !important;
		padding-bottom: 15px !important;
	}

	/* Body copy is 14.592px almost everywhere (Astra's responsive root size)
	   and a flat 14px in the home page's text widget, where Elementor sets it
	   per-widget. 16px is the usual floor for body text on a handset, and the
	   home page paragraph is the pitch that has to survive a cold reader
	   arriving from a newspaper link. Headings are rem-based off <html> and are
	   deliberately left alone, so the type scale does not move. */
	body,
	.entry-content p,
	.entry-content li,
	.elementor-widget-text-editor,
	.elementor-widget-text-editor p,
	.elementor-widget-text-editor li {
		font-size: 16px !important;
	}

	.entry-content p,
	.elementor-widget-text-editor p,
	.elementor-widget-text-editor li {
		line-height: 1.6 !important;
	}

	/* WooCommerce's own buttons are not Elementor's, so the rule above missed
	   them. #place_order — the button that actually takes the money — measured
	   39 × 14.592px on a phone, as did the cart's update button. min-height
	   rather than padding, so the checkout button that is already 67px tall
	   keeps its own proportions instead of growing again. */
	#place_order,
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button {
		font-size: 16px !important;
		line-height: 1.25 !important;
		min-height: 48px !important;
	}

	/* The five legal links share one paragraph in the footer and wrap onto
	   stacked lines 18px apart, so neighbouring targets very nearly touch.
	   Extra leading only — no restyle. */
	.ast-footer-copyright p:last-child a {
		display: inline-block;
		padding: 4px 0;
	}
}
