/*
 * POS-BOOKING site presentation (#558). SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Divi base typography, buttons, CF7 forms, start section, footer and image
 * slots, all from the --pb-* tokens. Brand, fonts and radius therefore follow
 * the Customizer; neutral colours and type scale belong to the design system.
 * Rules stay scoped to Divi/WordPress content so the native LatePoint UI keeps
 * its own layout.
 */

/* 1. Typography ------------------------------------------------------------ */
html body,
html body :is(input, textarea, select, button) {
	font-family: var(--pb-font-body);
}

html body {
	color: var(--pb-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

:is(.et_pb_text, .entry-content) > :is(p, ul, ol),
.et_pb_text :is(p, li) {
	font-size: 16px;
	line-height: 1.7;
}

:is(.et_pb_text, .entry-content) :is(h1, h2, h3, h4, h5, h6),
.entry-content > :is(h1, h2, h3, h4, h5, h6),
.entry-title {
	color: var(--pb-ink);
	font-family: var(--pb-font-head);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.entry-content .latepoint-w :is(h1, h2, h3, h4, h5, h6) {
	letter-spacing: normal;
}

/* LatePoint follows the font tokens (its own sizes, colours and layout stay native). */
:where(body:not(.wp-admin)) :is(.latepoint-w, .latepoint-lightbox-w, .latepoint-w :is(button, input, select, textarea), .latepoint-lightbox-w :is(button, input, select, textarea), .ss-title, .id-amount, .invoice-make-payment-btn, .topi-heading, .topit-amount, .topi-amount, .order-summary-items-heading, .sbc-big-item, .lp_iti--detached-country-selector) {
	font-family: var(--pb-font-body) !important;
}

:where(body:not(.wp-admin)) :is(.latepoint-w, .latepoint-lightbox-w) :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--pb-font-head) !important;
}

/* Page background: the soft brand gradient of the start section on every page (#560). */
html body #main-content {
	background: linear-gradient(180deg, var(--pb-brand-soft) 0, var(--pb-surface) 560px) no-repeat, var(--pb-surface);
}

html body #main-content .et_pb_section:not(.et_pb_with_background) {
	background-color: transparent;
}

/* 2. Header ------------------------------------------------------------------ */
html body #main-header {
	box-shadow: 0 1px 0 var(--pb-line);
}

html body #top-menu > li > a {
	color: var(--pb-ink);
	font-weight: 600;
}

html body #top-menu > li > a:hover {
	color: var(--pb-brand);
	opacity: 1;
}

/* 3. Buttons: Divi modules, block buttons and plain links with .pb-btn ------- */
html body :is(.et_pb_button, .wp-block-button__link, a.pb-btn) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid var(--pb-brand);
	border-radius: var(--pb-radius-sm);
	background: var(--pb-brand);
	box-shadow: var(--pb-shadow-xs);
	color: var(--pb-on-brand);
	font-family: var(--pb-font-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

html body :is(.et_pb_button, .wp-block-button__link, a.pb-btn):hover {
	padding: 12px 24px;
	border-color: var(--pb-brand-strong);
	background: var(--pb-brand-strong);
	color: var(--pb-on-brand);
	transform: translateY(-1px);
}

html body .et_pb_button::after {
	display: none;
}

html body :is(.et_pb_button, .wp-block-button__link, a.pb-btn):focus-visible,
.pb-hero a:focus-visible,
#main-footer a:focus-visible {
	outline: 2px solid var(--pb-brand);
	outline-offset: 3px;
}

/* 4. Start section (Divi section .pb-hero) ----------------------------------- */
html body .et_pb_section.pb-hero {
	padding: 56px 0 48px;
	background: transparent;
}

.pb-hero .et_pb_row {
	padding: 0;
}

.pb-hero .et_pb_row.et_pb_equal_columns > .et_pb_column {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.pb-hero .et_pb_text {
	margin-bottom: 0;
}

.pb-eyebrow {
	display: inline-block;
	margin: 0 0 18px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--pb-brand-tint);
	color: var(--pb-brand-strong);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	line-height: 1.3;
	text-transform: uppercase;
}

html body .pb-hero h1 {
	margin: 0 0 16px;
	padding: 0;
	color: var(--pb-ink);
	font-family: var(--pb-font-head);
	font-size: clamp(34px, 4.4vw, 52px);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.025em;
	overflow-wrap: anywhere;
}

html body .pb-lead {
	max-width: 34em;
	margin: 0;
	padding: 0;
	color: var(--pb-text);
	font-size: 18px;
	line-height: 1.6;
}

ul.pb-chips {
	display: grid;
	gap: 10px;
	margin: 26px 0 0;
	padding: 0;
	list-style: none;
}

html body ul.pb-chips li {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	color: var(--pb-ink);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
}

ul.pb-chips li::before {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--pb-brand-tint);
	content: "";
}

ul.pb-chips li::after {
	position: absolute;
	top: 50%;
	left: 5px;
	width: 12px;
	height: 12px;
	margin-top: -6px;
	background: var(--pb-brand);
	content: "";
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

html body .pb-hero-actions p {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 22px;
	margin: 30px 0 0;
	padding: 0;
}

.pb-hero-actions .pb-hero-call {
	color: var(--pb-text);
	font-size: 15px;
}

.pb-hero-actions .pb-phone {
	color: var(--pb-ink);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.pb-hero-actions .pb-phone:hover {
	color: var(--pb-brand);
}

.pb-hero .pb-hero-media {
	margin: 0;
}

.pb-hero .pb-hero-media .et_pb_image_wrap,
.pb-hero .pb-hero-media img {
	display: block;
	width: 100%;
	border-radius: var(--pb-radius-lg);
}

.pb-hero .pb-hero-media .et_pb_image_wrap {
	overflow: hidden;
	box-shadow: var(--pb-shadow-md), var(--pb-shadow-xs);
}

/* Booking section anchor (#buchen) */
html body .et_pb_section.pb-book {
	padding: 24px 0 64px;
	scroll-margin-top: 96px;
}

.pb-book .et_pb_row {
	padding: 0;
}

/* 5. Image slots: fixed ratios with automatic crop ----------------------------- */
:is(.pb-ratio-16x9, .pb-ratio-4x3, .pb-ratio-1x1) img {
	width: 100%;
	height: auto;
	object-fit: cover;
	object-position: center;
}

.pb-ratio-16x9 img {
	aspect-ratio: 16 / 9;
}

.pb-ratio-4x3 img {
	aspect-ratio: 4 / 3;
}

.pb-ratio-1x1 img {
	aspect-ratio: 1 / 1;
}

/* Style guide page ([posbooking_styleguide], private page) */
.pb-styleguide {
	margin: 0 0 32px;
}

.pb-sg-swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin: 0 0 20px;
}

.pb-sg-swatch {
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--pb-line);
	border-radius: var(--pb-radius-md);
	background: var(--pb-surface);
}

.pb-sg-swatch > span {
	display: block;
	height: 56px;
	border-bottom: 1px solid var(--pb-line);
}

.pb-sg-swatch figcaption {
	display: grid;
	gap: 2px;
	padding: 8px 10px;
	color: var(--pb-ink);
	font-size: 13px;
	line-height: 1.4;
}

.pb-sg-swatch small {
	color: var(--pb-muted);
}

html body .pb-styleguide :is(.pb-sg-contrast, .pb-sg-setting) {
	margin: 0 0 8px;
	padding: 10px 14px;
	border: 1px solid var(--pb-line);
	border-radius: var(--pb-radius-sm);
	background: var(--pb-surface);
	color: var(--pb-ink);
	font-size: 15px;
}

.pb-styleguide .pb-sg-contrast.is-ok {
	border-left: 4px solid var(--pb-success);
}

.pb-styleguide .pb-sg-contrast.is-low {
	border-left: 4px solid var(--pb-danger);
	background: var(--pb-danger-soft);
}

/* 6. Footer ------------------------------------------------------------------ */
html body #main-footer {
	background: var(--pb-footer-bg);
}

html body #main-footer #footer-widgets {
	padding: 56px 0 16px;
}

html body #footer-widgets .footer-widget :is(h4.title, .wp-block-heading) {
	margin: 0 0 14px;
	padding: 0;
	color: var(--pb-on-footer);
	font-family: var(--pb-font-head);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.4;
}

html body #footer-widgets .footer-widget,
html body #footer-widgets .footer-widget :is(p, li, address, span, dt, dd) {
	color: var(--pb-on-footer-muted);
	font-size: 15px;
	font-style: normal;
	line-height: 1.7;
}

html body #footer-widgets .footer-widget a,
html body #footer-widgets .footer-widget li a {
	color: var(--pb-on-footer);
	text-decoration: none;
}

html body #footer-widgets .footer-widget a:hover {
	color: var(--pb-on-footer);
	text-decoration: underline;
	text-underline-offset: 3px;
}

html body #footer-widgets .footer-widget li {
	margin: 0 0 6px;
	padding-left: 0;
}

html body #footer-widgets .footer-widget li::before {
	display: none;
}

#footer-widgets .pb-contact address {
	display: flex;
	flex-direction: column;
	margin: 0 0 10px;
}

#footer-widgets .pb-contact address strong {
	color: var(--pb-on-footer);
	font-weight: 600;
}

#footer-widgets .pb-contact .pb-contact-list {
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

html body #footer-widgets .pb-contact a.pb-route {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
}

#footer-widgets .pb-contact a.pb-route::after {
	content: "\2192";
}

#footer-widgets .pb-hours {
	display: grid;
	gap: 4px;
	margin: 0;
}

#footer-widgets .pb-hours > div {
	display: grid;
	grid-template-columns: 4.5em minmax(0, 1fr);
	gap: 12px;
}

html body #footer-widgets .pb-hours dt {
	color: var(--pb-on-footer);
	font-weight: 600;
}

#footer-widgets .pb-hours dd {
	margin: 0;
	font-variant-numeric: tabular-nums;
}

html body #main-footer #footer-bottom {
	padding: 18px 0;
	background: var(--pb-footer-bar);
}

html body #main-footer #footer-info {
	padding: 0;
	color: var(--pb-on-footer-muted);
	font-size: 13px;
	line-height: 1.6;
}

html body #main-footer .et-social-icon a {
	color: var(--pb-on-footer);
}

/* 7. Forms: Contact Form 7 on every page, matching the LatePoint login fields - */
.wpcf7-form > p {
	margin: 0 0 18px;
	padding: 0;
}

.wpcf7-form > p:last-of-type {
	margin-bottom: 0;
}

html body .wpcf7-form label {
	display: block;
	color: var(--pb-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
}

.wpcf7-form-control-wrap {
	display: block;
}

html body .wpcf7 :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], select, textarea) {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin-top: 6px;
	padding: 10px 12px;
	border: 1px solid var(--pb-line-strong);
	border-radius: var(--pb-radius-sm);
	background: var(--pb-surface);
	box-shadow: none;
	color: var(--pb-ink);
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
	transition: border-color .15s ease, box-shadow .15s ease;
}

html body .wpcf7 :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], select) {
	min-height: 44px;
}

html body .wpcf7 textarea {
	height: 160px;
	min-height: 120px;
	resize: vertical;
}

html body .wpcf7 ::placeholder {
	color: var(--pb-muted);
	opacity: 1;
}

html body .wpcf7 :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], select, textarea):focus {
	border-color: var(--pb-brand);
	outline: none;
	box-shadow: 0 0 0 3px var(--pb-focus-ring);
}

html body .wpcf7 .wpcf7-form-control.wpcf7-not-valid,
html body .wpcf7 .wpcf7-form-control.wpcf7-not-valid:focus {
	border-color: var(--pb-danger);
}

html body .wpcf7 .wpcf7-not-valid-tip {
	margin-top: 6px;
	color: var(--pb-danger);
	font-size: 13px;
	line-height: 1.4;
}

html body .wpcf7-form a {
	color: var(--pb-brand);
}

html body .wpcf7-form a:focus-visible {
	outline: 2px solid var(--pb-brand);
	outline-offset: 2px;
}

.wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}

html body .wpcf7-form .wpcf7-acceptance label {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
	color: var(--pb-text);
	font-size: 14px;
	font-weight: 400;
}

html body .wpcf7-acceptance input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--pb-brand);
}

/* Submit follows the site buttons (section 3) at full form width. */
.wpcf7-form p:has(> .wpcf7-submit) {
	position: relative;
}

html body .wpcf7 .wpcf7-submit {
	box-sizing: border-box;
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid var(--pb-brand);
	border-radius: var(--pb-radius-sm);
	background: var(--pb-brand);
	box-shadow: var(--pb-shadow-xs);
	color: var(--pb-on-brand);
	font-family: var(--pb-font-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

html body .wpcf7 .wpcf7-submit:not(:disabled):hover {
	border-color: var(--pb-brand-strong);
	background: var(--pb-brand-strong);
	transform: translateY(-1px);
}

html body .wpcf7 .wpcf7-submit:disabled {
	box-shadow: none;
	opacity: .55;
	cursor: not-allowed;
}

html body .wpcf7 .wpcf7-submit:focus-visible {
	outline: 2px solid var(--pb-brand);
	outline-offset: 2px;
}

html body .wpcf7 .wpcf7-submit + .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: 14px;
	margin: -12px 0 0;
}

html body .wpcf7 form .wpcf7-response-output {
	margin: 18px 0 0;
	padding: 12px 14px;
	border-width: 1px;
	border-radius: var(--pb-radius-sm);
	font-size: 14px;
	line-height: 1.5;
}

html body .wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--pb-success);
	background: var(--pb-success-soft);
	color: var(--pb-success);
}

html body .wpcf7 form:is(.failed, .aborted, .spam, .invalid, .unaccepted, .payment-required) .wpcf7-response-output {
	border-color: var(--pb-danger-line);
	background: var(--pb-danger-soft);
	color: var(--pb-danger);
}

.posbooking-recaptcha-notice,
.posbooking-recaptcha-footer {
	display: none;
}

/* 8. Responsive -------------------------------------------------------------- */
@media (max-width: 980px) {
	html body .et_pb_section.pb-hero {
		padding: 32px 0 28px;
	}

	.pb-hero .et_pb_row.et_pb_equal_columns > .et_pb_column:first-child {
		margin-bottom: 28px;
	}

	.pb-hero .pb-hero-media img {
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 600px) {
	body:has(.posbooking-recaptcha-notice) .grecaptcha-badge[data-style="bottomright"] {
		visibility: hidden !important;
	}

	.posbooking-recaptcha-footer {
		display: block;
		padding: 12px 16px;
		background: var(--pb-footer-bar);
		color: var(--pb-on-footer-muted);
		text-align: center;
	}

	body:has(.wpcf7-form .posbooking-recaptcha-notice) .posbooking-recaptcha-footer {
		display: none;
	}

	.posbooking-recaptcha-notice {
		display: block;
		padding: 0;
		font-size: 13px;
		line-height: 1.5;
		overflow-wrap: anywhere;
	}

	.wpcf7-form > .posbooking-recaptcha-notice {
		margin: 10px 0 0;
		color: var(--pb-muted);
	}

	.posbooking-recaptcha-notice a {
		text-decoration: underline;
	}

	.posbooking-recaptcha-footer a {
		color: var(--pb-on-footer);
	}

	.posbooking-recaptcha-footer a:focus-visible {
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}

	html body .pb-lead {
		font-size: 17px;
	}

	html body .pb-hero-actions a.pb-btn {
		width: 100%;
	}

	html body #main-footer #footer-widgets {
		padding-top: 40px;
	}
}
