/*
Theme Name:   Formcraft Design
Description:  Child theme of Lumina Personal for a design, renovation and accessible-homes business. Adds ready-made page sections (services, £250 assessment offer, process, projects, accessible homes, contact), a tap-to-call bar for phones, business details with search-engine markup, and a one-click setup that applies the colours, fonts and phone settings.
Template:     lumina-personal
Version: 2.4.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  formcraft-design
*/

/* ==========================================================================
   Homepage intro: a rectangular project photo instead of a round portrait
   ========================================================================== */
.hero { background: var(--lp-surface); }
.hero__media { justify-self: stretch; }
.hero__img {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: var(--lp-radius);
	box-shadow: var(--lp-shadow);
}
@media (min-width: 860px) {
	.hero--has-image .hero__inner { grid-template-columns: 1.15fr 1fr; }
	.hero__img { width: 100%; }
}
.hero__title { font-weight: 600; letter-spacing: -0.02em; }
.hero__eyebrow { letter-spacing: .08em; font-size: .85rem; }

/* Headings: a touch lighter and tighter for the serif look. */
.entry-content :is(h2, h3) { letter-spacing: -0.01em; }
.entry-content em { font-style: italic; }

/* ==========================================================================
   Section helpers used by the Formcraft patterns
   ========================================================================== */
.fc-eyebrow {
	margin: 0 0 .5em;
	color: var(--lp-primary);
	font-size: .8rem !important;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}
.entry-content .fc-section { margin-block: 0; padding-block: clamp(40px, 6vw, 80px); padding-inline: var(--lp-gutter); box-sizing: border-box; }
.entry-content .fc-section > * { max-width: 1140px; margin-inline: auto; }
.entry-content .fc-section.fc-band > * { max-width: 760px; }
/* Pages built from these sections: title lines up with the sections, first section sits
   close under the title, and the last one runs straight into the footer / contact form. */
.sidebar-none .entry:has(> .entry-content > .fc-section:first-child) > .entry-header { max-width: 1140px; }
.entry-header + .entry-content > .fc-section:first-child:not(.has-background) { padding-top: 8px; }
.site-content > .layout:has(.entry-content > .fc-section:last-child) { padding-bottom: 0; }
.site-main > .entry:has(.entry-content > .fc-section:last-child) { margin-bottom: 0; }
.fc-section .fc-eyebrow + .wp-block-heading { margin-top: 0; }
.fc-section .wp-block-heading + .fc-lead { margin-top: -.2em; }
/* Seven service cards: the odd one out spans the row on wide screens. */
@media (min-width: 1000px) {
	.entry-content .fc-cards > .fc-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; flex-direction: row; }
	.entry-content .fc-cards > .fc-card:last-child:nth-child(3n+1) > .wp-block-image { flex: 0 0 calc((100% - 48px) / 3); }
	.entry-content .fc-cards > .fc-card:last-child:nth-child(3n+1) > .wp-block-image img { height: 100%; }
	.entry-content .fc-cards > .fc-card:last-child:nth-child(3n+1) > .fc-card__body { justify-content: center; padding: 28px 32px; }
}
/* Site name next to the logo is hidden on computers & tablets (still read by screen readers)
   unless switched on. Phones follow Phone settings → Header & menu. */
@media (min-width: 640px) { .fc-hide-brandtext .site-branding__text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
} }
/* Grid of cards / steps (also works without the editor's grid layout styles). */
.entry-content .fc-cards,
.entry-content .fc-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: 24px; }
.entry-content .fc-steps { grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: 28px; }
.entry-content .fc-section + .fc-section { margin-top: 0; }
.fc-section > .wp-block-heading:first-child,
.fc-section > .fc-eyebrow:first-child { margin-top: 0; }
.fc-lead { font-size: 1.12em; color: var(--lp-muted); max-width: 40em; }

/* Four short highlights under the intro */
.fc-highlights { gap: 0 !important; }
.fc-highlights > .wp-block-column {
	padding: 20px 4px 20px 18px;
	border-left: 3px solid var(--lp-primary);
}
.fc-highlights h3 { margin: 0 0 .25em; font-size: 1.1rem; }
.fc-highlights p { margin: 0; color: var(--lp-muted); font-size: .95rem; }
@media (min-width: 782px) {
	.fc-highlights { gap: 24px !important; }
}
@media (max-width: 781px) {
	.fc-highlights { display: grid !important; grid-template-columns: 1fr 1fr; gap: 16px !important; }
	.fc-highlights > .wp-block-column { flex-basis: auto !important; }
}
@media (max-width: 420px) {
	.fc-highlights { grid-template-columns: 1fr; }
}

/* Cards (services, projects, contact details) */
.fc-cards { gap: 24px; }
.fc-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0 !important;
	background: var(--lp-bg);
	border: 1px solid var(--lp-border);
	border-radius: var(--lp-radius);
	overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease;
}
.fc-card:hover { box-shadow: var(--lp-shadow); }
.fc-card > .wp-block-image { margin: 0; }
.fc-card > .wp-block-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 0; }
.fc-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; gap: 0; }
.fc-card__body > * { margin-block: 0 .5em; }
.fc-card__body h3 { font-size: 1.2rem; }
.fc-card__body p { color: var(--lp-muted); font-size: .97rem; }
.fc-card__body .fc-more { margin-top: auto; padding-top: 6px; margin-bottom: 0; font-weight: 600; }
.fc-more a { text-decoration: none; }
.fc-more a::after { content: " →"; }
.fc-more a:hover { text-decoration: underline; }

/* Price / offer box */
.fc-offer {
	border: 2px solid var(--lp-primary);
	border-radius: var(--lp-radius);
	padding: 28px !important;
	background: var(--lp-bg);
}
.fc-price { font-family: var(--lp-font-head); font-size: clamp(2.6rem, 2rem + 2vw, 3.4rem) !important; line-height: 1; margin: 0 0 .15em !important; color: var(--lp-heading); font-weight: 600; }
.fc-offer .wp-block-buttons { flex-direction: column; align-items: stretch; gap: 10px; }
.fc-offer .wp-block-button, .fc-offer .wp-block-button__link { width: 100%; }

/* Tick lists */
.fc-ticks { list-style: none; padding-left: 0; }
.fc-ticks li { position: relative; padding-left: 30px; margin-bottom: .55em; }
.fc-ticks li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: .38em;
	width: 16px;
	height: 9px;
	border-left: 2.5px solid var(--lp-primary);
	border-bottom: 2.5px solid var(--lp-primary);
	transform: rotate(-45deg);
}

/* Numbered steps */
.fc-steps { gap: 24px; counter-reset: fc-step; }
.fc-step { counter-increment: fc-step; margin: 0 !important; }
.fc-step h3 { font-size: 1.15rem; margin: 0 0 .35em; }
.fc-step h3::before {
	content: counter(fc-step, decimal-leading-zero);
	display: block;
	margin-bottom: .4em;
	color: var(--lp-primary);
	font-family: var(--lp-font-head);
	font-size: 2rem;
	line-height: 1;
}
.fc-step p { color: var(--lp-muted); margin: 0; }

/* Dark call-to-action band */
.fc-band { background: var(--lp-footer-bg) !important; color: var(--lp-footer-tx); }
.fc-band :is(h2, h3, .fc-price) { color: #fff; }
.fc-band .fc-eyebrow { color: color-mix(in srgb, var(--lp-primary) 45%, #fff); }
.fc-band .wp-block-button__link { background: #fff; border-color: #fff; color: var(--lp-footer-bg); }
.fc-band .is-style-outline .wp-block-button__link { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }

/* Trust strip */
.fc-trust { gap: 10px 28px; color: var(--lp-muted); font-size: .95rem; }
.fc-trust p { margin: 0; }
.fc-trust p::before { content: "✓ "; color: var(--lp-primary); font-weight: 700; }

/* Quotes */
.fc-quote { border-left: 3px solid var(--lp-primary); padding-left: 20px; margin: 0; }
.fc-quote p { font-family: var(--lp-font-head); font-size: 1.2rem; }
.fc-quote cite { font-style: normal; color: var(--lp-muted); font-size: .9rem; }

/* Before / after labels */
.fc-ba figcaption { text-align: left; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--lp-primary); }

/* Contact details */
.fc-contact-list p { margin: 0 0 .4em; }
.fc-contact-list strong { display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--lp-muted); }
.fc-contact-list a { font-size: 1.15rem; font-weight: 600; text-decoration: none; }

/* ==========================================================================
   Tap-to-call bar (phones, optionally tablets)
   ========================================================================== */
.fc-callbar { display: none; }
@media (max-width: 639px) {
	.fc-callbar-on .fc-callbar { display: flex; }
	.fc-callbar-on { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
	.fc-callbar-on .back-to-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (min-width: 640px) and (max-width: 1024px) {
	.fc-callbar-tablet .fc-callbar { display: flex; }
	.fc-callbar-tablet { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
	.fc-callbar-tablet .back-to-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
.fc-callbar {
	position: fixed;
	z-index: 90;
	left: 0;
	right: 0;
	bottom: 0;
	gap: 8px;
	padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
	background: var(--lp-header-bg);
	border-top: 1px solid var(--lp-border);
	box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
}
.fc-callbar a {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 8px 10px;
	border-radius: var(--lp-radius);
	border: 2px solid var(--lp-primary);
	font-weight: 600;
	font-size: 16px;
	text-decoration: none;
	line-height: 1.15;
	text-align: center;
}
.fc-callbar__call { background: var(--lp-primary); color: var(--lp-on-primary) !important; }
.fc-callbar__alt { background: transparent; color: var(--lp-primary) !important; }
.fc-callbar svg { width: 18px; height: 18px; flex: none; }

/* ==========================================================================
   Phones: section spacing follows Phone settings → Page size & spacing
   ========================================================================== */
@media (max-width: 639px) {
	.entry-content .fc-section { padding-block: var(--lp-m-space, 40px); }
	.fc-offer { padding: 22px !important; }
	.fc-card__body { padding: var(--lp-m-card-pad, 18px); }
	.fc-band .wp-block-buttons, .fc-section .wp-block-buttons.fc-stack-phone { flex-direction: column; align-items: stretch; }
	.fc-band .wp-block-button, .fc-section .fc-stack-phone .wp-block-button { width: 100%; }
	.fc-band .wp-block-button__link, .fc-section .fc-stack-phone .wp-block-button__link { width: 100%; }
	.fc-trust { flex-direction: column; align-items: flex-start !important; }
}

/* Outlined buttons match the theme's ghost buttons. */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) { background: transparent; color: var(--lp-primary); border-color: var(--lp-primary); }
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color):hover { background: var(--lp-primary); color: var(--lp-on-primary); }
.fc-band .wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }

/* Phones: break headings between words, not mid-word. */
@media (max-width: 639px) {
	.entry-content :is(h2, h3), .hero__title { hyphens: manual; overflow-wrap: break-word; }
}

/* Wide (odd one out) card: photo fills its side. */
@media (min-width: 1000px) {
	.entry-content .fc-cards > .fc-card:last-child:nth-child(3n+1) > .wp-block-image { position: relative; align-self: stretch; min-height: 220px; }
	.entry-content .fc-cards > .fc-card:last-child:nth-child(3n+1) > .wp-block-image img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
}

/* ==========================================================================
   Homepage intro text (line breaks, **bold**, ==highlight==, extra text, small line)
   ========================================================================== */
.hero .fc-accent { color: var(--lp-primary); }
.hero__title strong, .hero__lead strong, .hero__extra strong { font-weight: 800; }
.hero__lead + .hero__extra { margin-top: -12px; }
.hero__extra { margin: 0 0 20px; color: var(--lp-muted); max-width: 40em; }
.hero__extra:last-of-type { margin-bottom: 28px; }
.hero__note { margin: 16px 0 0; font-size: .92rem; color: var(--lp-muted); }
.fc-hero-bg-light .hero .fc-accent { color: #f0d6b6; }
.fc-hero-bg-light .hero__extra { color: rgba(255, 255, 255, .9); text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.fc-hero-bg-light .hero__note { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
