/*
Theme Name:   Astra Child - Paterakis Luxury Homes
Theme URI:    https://luxhomespaterakis.com/
Description:  Child theme for Paterakis Luxury Homes. Holds site-specific PHP and CSS so nothing is lost on Astra updates.
Author:       Paterakis Luxury Homes
Template:     astra
Version:      1.0.0
Text Domain:  astra-child
*/

/* Site CSS lives in Customizer > Additional CSS. Keep this file for rules that must survive a Customizer reset. */

/* ---------------------------------------------------------------------------
 * Dark sections
 *
 * Global body text is #332e28, which is correct on white but invisible on the
 * dark section backgrounds (1.27:1 on #001a43, 1.29:1 on #1c1a16).
 * These blocks set body-level text explicitly. Headings keep their own colour.
 *
 * Measured contrast:
 *   #eadac3 on #001a43 = 12.46:1
 *   #eadac3 on #1c1a16 = 12.67:1
 *   #ffffff on #856312 =  5.54:1
 * ------------------------------------------------------------------------- */

.uagb-block-494c42c4,
.uagb-block-a584d8cb,
.uagb-block-3ad17e27,
.uagb-block-78f9ff85,
.uagb-block-6b072705,
.uagb-block-48987cd2 {
	--plh-on-dark: #eadac3;
}

.uagb-block-494c42c4 p,
.uagb-block-494c42c4 li,
.uagb-block-494c42c4 .uagb-desc-text,
.uagb-block-494c42c4 .uagb-ifb-desc,
.uagb-block-494c42c4 .uagb-icon-list__label,
.uagb-block-a584d8cb p,
.uagb-block-a584d8cb li,
.uagb-block-a584d8cb .uagb-desc-text,
.uagb-block-a584d8cb .uagb-ifb-desc,
.uagb-block-a584d8cb .uagb-icon-list__label,
.uagb-block-3ad17e27 p,
.uagb-block-3ad17e27 li,
.uagb-block-3ad17e27 .uagb-desc-text,
.uagb-block-3ad17e27 .uagb-ifb-desc,
.uagb-block-3ad17e27 .uagb-icon-list__label,
.uagb-block-78f9ff85 p,
.uagb-block-78f9ff85 li,
.uagb-block-78f9ff85 .uagb-desc-text,
.uagb-block-78f9ff85 .uagb-ifb-desc,
.uagb-block-78f9ff85 .uagb-icon-list__label,
.uagb-block-6b072705 p,
.uagb-block-6b072705 li,
.uagb-block-6b072705 .uagb-desc-text,
.uagb-block-6b072705 .uagb-ifb-desc,
.uagb-block-6b072705 .uagb-icon-list__label,
.uagb-block-48987cd2 p,
.uagb-block-48987cd2 li,
.uagb-block-48987cd2 .uagb-desc-text,
.uagb-block-48987cd2 .uagb-ifb-desc,
.uagb-block-48987cd2 .uagb-icon-list__label {
	color: var(--plh-on-dark, #eadac3);
}

/* Gold backgrounds need white, not cream: #eadac3 on #8b6914 is only 3.71:1. */
.uagb-block-522dd1bc,
.uagb-block-f19340a1,
.uagb-block-e93b0095 p,
.uagb-block-e93b0095 .uagb-desc-text,
.uagb-block-169134ca p,
.uagb-block-169134ca .uagb-desc-text,
.uagb-block-795c3950 p,
.uagb-block-795c3950 .uagb-desc-text {
	color: #ffffff;
}

/* ---------------------------------------------------------------------------
 * text-transform: capitalize is wrong in both languages.
 * EN: "Guide To Golden Visa With ..." - prepositions should stay lowercase.
 * EL: "Κατασκευή ... Στα Χανιά", "Σχετικά Με Εμάς" - not Greek convention.
 * CSS cannot know grammar; casing belongs in the content.
 * ------------------------------------------------------------------------- */

.uagb-heading-text,
.uagb-ifb-title,
.uagb-desc-text {
	text-transform: none;
}

/* ---------------------------------------------------------------------------
 * Golden Visa FAQ (container daf0cedd, both languages)
 *
 * Reading column only. Colour and font size are global now.
 *
 * Spectra sets width/max-width: 100% at .wp-block-uagb-container
 * .uagb-is-root-container .uagb-block-daf0cedd (0,3,0), so the override has
 * to match that specificity.
 *
 * 0edb2905 is the section title and stays centred - only the individual
 * questions align left with their lists.
 * ------------------------------------------------------------------------- */

.wp-block-uagb-container.uagb-is-root-container .wp-block-uagb-container.uagb-block-daf0cedd {
	max-width: 46rem;
	margin-inline: auto;
}

.uagb-block-daf0cedd .wp-block-uagb-advanced-heading:not(.uagb-block-0edb2905) .uagb-heading-text {
	text-align: left;
}

/* ---------------------------------------------------------------------------
 * Bullet lists
 *
 * Two different list blocks are in use and both needed capping:
 *   wp:list          - Golden Visa, Our Services, Chania Beaches, Gorges
 *   uagb/icon-list   - the articles (Step-by-Step 74, Construction Tips 73,
 *                      Real Estate 22, Privacy 19)
 *
 * Before: wp:list 1132px (119 chars), icon-list 1095px (115 chars).
 * Paragraphs are deliberately left alone - only lists are inset.
 *
 * Spectra caps these at max-width: -webkit-fill-available with specificity
 * (0,4,1):  body .ast-container .wp-block-uagb-container >
 *           .uagb-container-inner-blocks-wrap > .wp-block-...
 * The selectors below mirror that chain and add one more class or element so
 * they win outright rather than depending on stylesheet order. The value
 * lives in plugin CSS, not in content, so matching specificity is the right
 * fix - !important would just hide the conflict.
 *
 * 46rem at the 19px root is 874px, about 92 characters - the same measure as
 * the FAQ block that was signed off.
 * ------------------------------------------------------------------------- */

body .ast-container .wp-block-uagb-container .uagb-container-inner-blocks-wrap ul.wp-block-list,
body .ast-container .wp-block-uagb-container .uagb-container-inner-blocks-wrap ol.wp-block-list,
body .ast-container .wp-block-uagb-container .uagb-container-inner-blocks-wrap .wp-block-uagb-icon-list.wp-block-uagb-icon-list,
.entry-content ul.wp-block-list,
.entry-content ol.wp-block-list,
.entry-content .wp-block-uagb-icon-list.wp-block-uagb-icon-list {
	max-width: 46rem;
	padding-left: 2rem;
	/* Spectra sets margin: 20px, which left-anchors the list while the intro
	   line centres. Both need the same treatment to share a left edge. */
	margin-inline: auto;
}

/* ---------------------------------------------------------------------------
 * List intro line
 *
 * A line that introduces a list belongs to the list and should share its
 * left edge. Two shapes exist in this site:
 *
 * 1. Bold run ending a text block that also holds a paragraph:
 *      <h5>Paragraph<br><br><strong>Intro:</strong></h5><ul>
 *    The block cannot be narrowed without narrowing the paragraph, so the
 *    inline <strong> is promoted to a block and given the list's measure.
 *
 * 2. A whole heading block that is only the intro sentence:
 *      <h4>Effective drainage includes:</h4><ul>
 *    Marked server-side with .plh-list-intro, because the discriminator is
 *    the trailing colon and CSS cannot test text content. Section headings
 *    that merely happen to precede a list ("Elafonisi Beach") are NOT marked.
 * ------------------------------------------------------------------------- */

.wp-block-uagb-advanced-heading:has(+ ul.wp-block-list) .uagb-heading-text > strong:last-child,
.wp-block-uagb-advanced-heading:has(+ ol.wp-block-list) .uagb-heading-text > strong:last-child,
.wp-block-uagb-advanced-heading:has(+ .wp-block-uagb-icon-list) .uagb-heading-text > strong:last-child,
.entry-content p:has(+ ul.wp-block-list) > strong:last-child,
.entry-content p:has(+ ol.wp-block-list) > strong:last-child,
.entry-content p:has(+ .wp-block-uagb-icon-list) > strong:last-child {
	display: block;
	max-width: 46rem;
	margin-inline: auto;
	padding-left: 2rem;
	margin-top: 1.2em;
}

/* Skip blocks whose intro is a trailing <strong>: those are handled above,
   and narrowing the whole block would drag the paragraph above it in too. */
body .ast-container .wp-block-uagb-container .uagb-container-inner-blocks-wrap .plh-list-intro:not(:has(.uagb-heading-text > strong:last-child)) .uagb-heading-text,
.plh-list-intro.plh-list-intro:not(:has(.uagb-heading-text > strong:last-child)) .uagb-heading-text {
	max-width: 46rem;
	margin-inline: auto;
	padding-left: 2rem;
}

/* ---------------------------------------------------------------------------
 * Section title spacing
 *
 * The gap between a section title and the text below it was 159px, made of:
 *   heading margin-bottom     15px
 *   separator + its margin     58px   (separatorSpace attribute)
 *   block padding-bottom       54px   (blockBottomPadding, 5% of container)
 *   container row-gap          20px
 *
 * separatorSpace and blockBottomPadding were halved in the content, taking it
 * to 105px. This trims the last piece that belongs to the title itself.
 * The container row-gap is deliberately left alone - it spaces every block in
 * the page, not just titles.
 * ------------------------------------------------------------------------- */

/* Spectra writes margin-bottom per block at
   .wp-block-uagb-advanced-heading.uagb-block-XXXX .uagb-heading-text (0,3,0),
   so this adds an element to the chain to win on equal class count. */
body .ast-container .wp-block-uagb-advanced-heading .uagb-heading-text,
body .ast-plain-container .wp-block-uagb-advanced-heading .uagb-heading-text {
	margin-bottom: 8px;
}

/* ---------------------------------------------------------------------------
 * Info-box card titles
 *
 * Two problems: words broke mid-word, and the title did not read as a title.
 *
 * 1. No word may break. If it does not fit it wraps whole, which rules out
 *    both word-break: break-word and hyphens: auto.
 *
 *    Measured with canvas, longest word per card in the real face:
 *      wide cards   350-418px box  -> 100-123px would fit
 *      medium       237px box      ->  42-72px
 *      5-card row   137px box      ->  26px ceiling
 *        binding words: collaboration 110px, construction 106px at 21px
 *    24px is the largest that clears the narrowest column with margin.
 *
 * 2. Title and description both came in at weight 500, and 46 of the 64 cards
 *    had a 0px gap between them, so the title did not separate. Fixed with
 *    weight and space, not colour.
 *
 * Spectra writes .uagb-block-XXXX .uagb-ifb-title at (0,2,0); the chain below
 * adds an element to win.
 * ------------------------------------------------------------------------- */

body .ast-container .uagb-ifb-title {
	font-size: 24px;
	line-height: 1.35;
	font-weight: 700;
	word-break: normal;
	overflow-wrap: normal;
	hyphens: none;
}

body .ast-container .uagb-ifb-title-wrap {
	margin-bottom: 12px;
}

/* ---------------------------------------------------------------------------
 * Contact call to action
 *
 * No prices are published, so contact is the only route forward. There was no
 * tel: link anywhere and no contact button in the header.
 *
 * Desktop: phone in the header, discreet button bottom right.
 * Mobile:  full-width bar, phone as a square beside the primary action.
 *
 * #856312 with white text is 5.54:1, the same gold used sitewide.
 * ------------------------------------------------------------------------- */

.plh-header-phone {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin-left: 1.5rem;
	font-size: 17px;
	font-weight: 700;
	color: #856312;
	white-space: nowrap;
}

.plh-header-phone:hover,
.plh-header-phone:focus {
	color: #332e28;
}

@media (max-width: 921px) {
	.plh-header-phone { display: none; }
}

/* Sticky bar */
.plh-sticky-cta {
	position: fixed;
	z-index: 999;
	right: 24px;
	bottom: 24px;
	display: flex;
	gap: 10px;
}

.plh-sticky-cta__primary,
.plh-sticky-cta__call {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #856312;
	color: #ffffff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	padding: 15px 26px;
	border-radius: 999px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
	text-decoration: none;
	transition: background 0.18s ease;
}

.plh-sticky-cta__call {
	padding: 15px 18px;
	font-size: 20px;
}

.plh-sticky-cta__primary:hover,
.plh-sticky-cta__primary:focus,
.plh-sticky-cta__call:hover,
.plh-sticky-cta__call:focus {
	background: #6f520f;
	color: #ffffff;
}

/* Phone is the header's job on desktop; the bar only needs the primary action. */
@media (min-width: 922px) {
	.plh-sticky-cta__call { display: none; }
}

@media (max-width: 921px) {
	.plh-sticky-cta {
		right: 12px;
		left: 12px;
		bottom: 12px;
		padding-bottom: env(safe-area-inset-bottom);
	}
	.plh-sticky-cta__primary { flex: 1; }
	body { padding-bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
	.plh-sticky-cta__primary,
	.plh-sticky-cta__call { transition: none; }
}

/* ---------------------------------------------------------------------------
 * Header menu alignment
 *
 * The menu links sat 26px above the logo's centre line.
 *
 * Cause: the menu <ul> inherited the default list margin
 * (ul { margin: 0 0 1.5em 3em }), giving it margin-bottom: 53.1px. Its nav
 * wrapper therefore measured 98px while the links themselves were 45px, and
 * centring the wrapper pushed the visible links to the top of it.
 *
 *   logo image centre  108px
 *   menu ul centre      82px
 *
 * Removing the inherited margin lets the existing centring work, rather than
 * nudging the menu down by a hard-coded offset.
 * ------------------------------------------------------------------------- */

.main-header-menu,
.ast-builder-menu-1 .main-header-menu {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
 * Estatik popups without Estatik CSS
 *
 * Estatik prints its authentication popup into the footer of every page, and
 * relies on the Magnific stylesheet to keep it hidden (.mfp-hide).
 *
 * Since Estatik assets are now limited to pages that actually render property
 * output, that stylesheet is absent elsewhere - so the popup markup showed as
 * plain text under the footer: "You're already logged in. Log out".
 *
 * Hiding it here rather than loading the whole Estatik stack back is the
 * cheaper fix: the popup is a login dialog that public visitors never need.
 * ------------------------------------------------------------------------- */

.mfp-hide,
#es-authentication-popup,
#es-request-info-popup,
#es-schedule-tour-popup {
	display: none;
}
