/*
 * Langferry Site: styles theme.json can't express.
 * Colours come from theme.json presets. Dark mode swaps the same presets,
 * using the dashboard's own dark tokens (cloud/app/static/app.css).
 */

:root {
	color-scheme: light dark;
	--lf-warning-soft: #fffbeb;
	--lf-warning-line: #e9b949;
	--lf-plan-free-bg: #e8ebf4;    --lf-plan-free-fg: #475569;
	--lf-plan-custom-bg: #e0f7f4;  --lf-plan-custom-fg: #0f766e;
	--lf-plan-startup-bg: #e0ecff; --lf-plan-startup-fg: #1d4ed8;
	--lf-plan-business-bg: #efe4ff; --lf-plan-business-fg: #6d28d9;
	--lf-plan-enterprise-bg: #fff1d6; --lf-plan-enterprise-fg: #9a5b00;
	--lf-radius: 10px;
	--lf-radius-lg: 16px;
	--lf-night-line: rgba(255, 255, 255, .12);
	--lf-night-accent: #a5b4fc;
}

@media (prefers-color-scheme: dark) {
	/* :root:root outranks the :root block WordPress prints for theme.json presets. */
	:root:root {
		--wp--preset--color--base: #0b0f1a;
		--wp--preset--color--surface: #121827;
		--wp--preset--color--surface-2: #1a2133;
		--wp--preset--color--border: #252e44;
		--wp--preset--color--contrast: #e8ecf5;
		--wp--preset--color--secondary: #aab4c8;
		--wp--preset--color--muted: #9aa3b8;
		--wp--preset--color--brand: #818cf8;
		--wp--preset--color--brand-strong: #a5b4fc;
		--wp--preset--color--brand-soft: #1e1f4b;
		--wp--preset--color--brand-text: #c7d2fe;
		--wp--preset--color--on-brand: #0b0f1a;
		--wp--preset--color--night: #10122e;
		--lf-warning-soft: #2b2108;
		--lf-warning-line: #8a6410;
		--lf-plan-free-bg: #232c42;    --lf-plan-free-fg: #aab4c8;
		--lf-plan-custom-bg: #0d2f2c;  --lf-plan-custom-fg: #5eead4;
		--lf-plan-startup-bg: #11234a; --lf-plan-startup-fg: #93c5fd;
		--lf-plan-business-bg: #2a1748; --lf-plan-business-fg: #c4b5fd;
		--lf-plan-enterprise-bg: #3a2a0a; --lf-plan-enterprise-fg: #fcd34d;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* ---------- Focus ---------- */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--brand);
	outline-offset: 3px;
	border-radius: 4px;
}
.has-night-background-color :where(a, button, summary):focus-visible {
	outline-color: var(--lf-night-accent);
}

/* ---------- Template rhythm ---------- */
.wp-site-blocks > header.wp-block-template-part,
.wp-site-blocks > footer.wp-block-template-part,
.wp-site-blocks > .lf-main { margin-block-start: 0; }

/* Full-width bands on landing pages sit edge to edge. */
:root .lf-band { margin-block: 0; }
.lf-landing .wp-block-post-content { margin-block: 0; }

/* ---------- Header ---------- */
.lf-header { border-bottom: 1px solid var(--wp--preset--color--border); }

.lf-brand { margin: 0; line-height: 1; }
.lf-brand a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.lf-brand a::before {
	content: "";
	width: 32px;
	height: 32px;
	flex: none;
	background: url("../logo-mark.svg") center / contain no-repeat;
}

.lf-header-end { min-width: 0; }
.lf-nav .lf-nav-cta > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--on-brand);
	padding: .5rem .95rem;
	border-radius: 8px;
	font-weight: 600;
}
.lf-nav .lf-nav-cta > .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--brand-strong);
	color: var(--wp--preset--color--on-brand);
}
.lf-nav .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--wp--preset--color--contrast);
}
/* The mobile menu button and overlay */
.lf-nav .wp-block-navigation__responsive-container-open,
.lf-nav .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--contrast);
	padding: 6px;
}
.lf-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50);
}
.lf-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--40);
	font-size: 1.25rem;
}

/* The Langferry plugin's switcher, when placed in the header or footer */
.lf-header-end .lf-switcher,
.lf-footer-base .lf-switcher { font-size: .9rem; }

/* ---------- Footer ---------- */
.lf-footer { border-top: 1px solid var(--wp--preset--color--border); }
.lf-footer .lf-brand { margin-bottom: var(--wp--preset--spacing--40); }
.lf-footer-heading {
	font-size: .9375rem;
	letter-spacing: 0;
	margin-bottom: var(--wp--preset--spacing--30);
}
ul.lf-footer-links {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: .5rem;
	font-size: .9375rem;
}
.lf-footer-links a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	overflow-wrap: anywhere;
}
.lf-footer-links a:hover { color: var(--wp--preset--color--contrast); text-decoration: underline; }
.lf-footer-base { border-top: 1px solid var(--wp--preset--color--border); }
.lf-footer-base p { margin: 0; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--brand);
	border: 1px solid currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--brand-soft);
	color: var(--wp--preset--color--brand-text);
	border-color: var(--wp--preset--color--brand-text);
}
.has-night-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	color: #fff;
	border-color: rgba(255, 255, 255, .45);
}
.has-night-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(255, 255, 255, .08);
	border-color: #fff;
}
/* On the dark bands, keep the light-mode brand so the button reads clearly. */
.has-night-background-color .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	background: #4f46e5;
	border-color: #6366f1;
	color: #fff;
}
.has-night-background-color .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
	background: #4338ca;
	border-color: #818cf8;
}

/* ---------- Text helpers ---------- */
.lf-lead { max-width: 40em; line-height: 1.45; }
.has-night-background-color a:not(.wp-element-button) { color: var(--lf-night-accent); }
.lf-small-print { max-width: 40em; }

/* ---------- Hero ---------- */
.lf-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: var(--wp--preset--spacing--70) calc(var(--wp--preset--spacing--80) + 12px);
	/* A wavy lower edge, drawn from the wave in the Langferry mark. */
	-webkit-mask:
		linear-gradient(#000 0 0) top / 100% calc(100% - 27px) no-repeat,
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0H120V14C100 4 80 4 60 14S20 24 0 14Z'/%3E%3C/svg%3E") left bottom / 120px 28px repeat-x;
	mask:
		linear-gradient(#000 0 0) top / 100% calc(100% - 27px) no-repeat,
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0H120V14C100 4 80 4 60 14S20 24 0 14Z'/%3E%3C/svg%3E") left bottom / 120px 28px repeat-x;
}
.lf-hero::before,
.lf-hero::after {
	content: "";
	position: absolute;
	z-index: -1;
	pointer-events: none;
	border-radius: 50%;
}
.lf-hero::before {
	top: -35%;
	right: -15%;
	width: min(720px, 120vw);
	aspect-ratio: 1;
	background: radial-gradient(closest-side, rgba(139, 92, 246, .5), transparent);
}
.lf-hero::after {
	bottom: -45%;
	left: -20%;
	width: min(680px, 120vw);
	aspect-ratio: 1;
	background: radial-gradient(closest-side, rgba(236, 72, 153, .28), transparent);
}
.lf-hero h1 {
	font-size: var(--wp--preset--font-size--display);
	letter-spacing: -0.035em;
	line-height: 1.04;
	max-width: 13em;
}
.lf-hero .lf-lead { color: var(--wp--preset--color--night-text); }
.lf-hero .lf-small-print { color: #a9aed6; }

/* The demo panel: one sentence at each language's address. */
.lf-ferry {
	margin: 0;
	padding: 6px;
	border: 1px solid var(--lf-night-line);
	border-radius: var(--lf-radius-lg);
	background: rgba(255, 255, 255, .035);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.lf-ferry ol {
	list-style: none;
	margin: 0;
	padding: 0;
}
.lf-ferry li {
	display: grid;
	grid-template-columns: 7.25rem minmax(0, 1fr);
	gap: .25rem 1rem;
	align-items: baseline;
	padding: .8rem 1rem;
}
.lf-ferry li + li { border-top: 1px solid rgba(255, 255, 255, .07); }
.lf-ferry li:first-child {
	background: rgba(255, 255, 255, .07);
	border-radius: var(--lf-radius);
}
.lf-ferry code {
	font-family: var(--wp--preset--font-family--mono);
	font-size: .8rem;
	color: var(--lf-night-accent);
	white-space: nowrap;
}
.lf-ferry .lf-ferry-text {
	color: #fff;
	font-size: 1.0625rem;
	line-height: 1.45;
}
.lf-ferry figcaption {
	margin: 0;
	padding: .6rem 1rem .5rem;
	font-size: .875rem;
	color: #a9aed6;
}
@media (prefers-reduced-motion: no-preference) {
	.lf-ferry li { animation: lf-cross .5s cubic-bezier(.2, .7, .2, 1) both; }
	.lf-ferry li:nth-child(2) { animation-delay: .25s; }
	.lf-ferry li:nth-child(3) { animation-delay: .4s; }
	.lf-ferry li:nth-child(4) { animation-delay: .55s; }
	.lf-ferry li:nth-child(5) { animation-delay: .7s; }
	.lf-ferry li:nth-child(6) { animation-delay: .85s; }
}
@keyframes lf-cross {
	from { opacity: 0; transform: translateX(-10px); }
	to { opacity: 1; transform: none; }
}
.lf-ferry li[dir="rtl"] { animation-name: lf-cross-rtl; }
@keyframes lf-cross-rtl {
	from { opacity: 0; transform: translateX(10px); }
	to { opacity: 1; transform: none; }
}

/* ---------- Section intros ---------- */
/* The measure goes on the children: WordPress centres constrained-layout children with
   margin:auto, so a max-width on the group itself would pull it off the left edge. */
.lf-section-intro > * { margin-block: 0; max-width: 40em; }
.lf-section-intro > * + * { margin-block-start: var(--wp--preset--spacing--30); }

/* ---------- Steps (a real sequence, so numbered) ---------- */
ol.lf-steps {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--60);
	counter-reset: lf-step;
}
ol.lf-steps > li {
	counter-increment: lf-step;
	position: relative;
	padding-top: 3.5rem;
	color: var(--wp--preset--color--secondary);
}
ol.lf-steps > li::before {
	content: counter(lf-step);
	position: absolute;
	top: 0;
	inset-inline-start: 0;
	width: 2.5rem;
	height: 2.5rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--on-brand);
	font-weight: 700;
	font-size: 1.0625rem;
}
ol.lf-steps > li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 1.25rem;
	inset-inline-start: 3.5rem;
	inset-inline-end: calc(-1 * var(--wp--preset--spacing--60) + 1rem);
	border-top: 2px dashed var(--wp--preset--color--border);
}
ol.lf-steps strong {
	display: block;
	margin-bottom: .35rem;
	color: var(--wp--preset--color--contrast);
	font-size: 1.1875rem;
	line-height: 1.3;
}

/* ---------- Spec rows (features, agencies) ---------- */
.lf-spec > .lf-spec-row {
	margin-block: 0;
	padding-block: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--wp--preset--color--border);
}
.lf-spec > .lf-spec-row:last-child { padding-bottom: 0; }
.lf-spec-row h3 { margin-top: 0; }
.lf-spec-row .lf-spec-sub {
	color: var(--wp--preset--color--secondary);
	margin-top: .5rem;
}
.lf-spec-row .wp-block-column > :first-child { margin-top: 0; }

ul.lf-ticks {
	list-style: none;
	padding: 0;
	margin-block: 0;
	display: grid;
	gap: .65rem;
}
ul.lf-ticks > li {
	position: relative;
	padding-inline-start: 1.75rem;
}
ul.lf-ticks > li::before {
	content: "";
	position: absolute;
	inset-inline-start: .2rem;
	top: .45em;
	width: .7rem;
	height: .38rem;
	border-left: 2px solid var(--wp--preset--color--brand);
	border-bottom: 2px solid var(--wp--preset--color--brand);
	transform: rotate(-45deg);
}

.wp-block-code {
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--border);
}
.wp-block-code code { white-space: pre; }

/* ---------- Example dashboard (agencies) ---------- */
.lf-sites {
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--lf-radius-lg);
	background: var(--wp--preset--color--surface);
	box-shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 12px 32px rgba(15, 23, 42, .08);
}
.lf-sites table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9375rem;
}
.lf-sites th {
	text-align: start;
	font-size: .8125rem;
	font-weight: 650;
	color: var(--wp--preset--color--muted);
	padding: .7rem 1rem;
	background: var(--wp--preset--color--surface-2);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.lf-sites td {
	padding: .85rem 1rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
	vertical-align: middle;
}
.lf-sites td:first-child { font-weight: 600; overflow-wrap: anywhere; }
.lf-sites td:nth-child(2) { color: var(--wp--preset--color--secondary); font-size: .875rem; }
.lf-sites figcaption {
	margin: 0;
	padding: .8rem 1rem;
	font-size: .875rem;
	color: var(--wp--preset--color--secondary);
	display: flex;
	justify-content: space-between;
	gap: .5rem 1rem;
	flex-wrap: wrap;
}
.lf-plan {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: .8125rem;
	font-weight: 650;
	white-space: nowrap;
}
.lf-plan--free { background: var(--lf-plan-free-bg); color: var(--lf-plan-free-fg); }
.lf-plan--custom { background: var(--lf-plan-custom-bg); color: var(--lf-plan-custom-fg); }
.lf-plan--startup { background: var(--lf-plan-startup-bg); color: var(--lf-plan-startup-fg); }
.lf-plan--business { background: var(--lf-plan-business-bg); color: var(--lf-plan-business-fg); }
.lf-plan--enterprise { background: var(--lf-plan-enterprise-bg); color: var(--lf-plan-enterprise-fg); }

/* ---------- FAQ ---------- */
.lf-faq > .wp-block-details { margin-block: 0; }
.lf-faq > .wp-block-details:first-of-type { border-top: 1px solid var(--wp--preset--color--border); }
.wp-block-details summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	font-weight: 650;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--contrast);
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "";
	flex: none;
	width: .55rem;
	height: .55rem;
	margin-inline-end: .25rem;
	border-right: 2px solid var(--wp--preset--color--muted);
	border-bottom: 2px solid var(--wp--preset--color--muted);
	transform: translateY(-2px) rotate(45deg);
	transition: transform .15s ease;
}
.wp-block-details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.wp-block-details > :not(summary) {
	color: var(--wp--preset--color--secondary);
	max-width: 42em;
}
.wp-block-details > summary + * { margin-top: .75rem; }

/* ---------- Contact ---------- */
.lf-contact-list > .wp-block-group {
	margin-block: 0;
	padding-block: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--border);
}
.lf-contact-list h2 { font-size: var(--wp--preset--font-size--large); margin-bottom: .25rem; }
.lf-contact-list .lf-email { font-size: 1.25rem; font-weight: 600; margin-block: .25rem .5rem; overflow-wrap: anywhere; }
.lf-contact-list p:last-child { color: var(--wp--preset--color--secondary); margin-bottom: 0; }

/* ---------- Legal pages ---------- */
.lf-draft-notice {
	background: var(--lf-warning-soft);
	border: 1px solid var(--lf-warning-line);
	border-inline-start-width: 5px;
	border-radius: var(--lf-radius);
	margin-bottom: var(--wp--preset--spacing--60);
}
.lf-draft-notice p { margin: 0; }
.lf-legal .wp-block-post-content h2 {
	font-size: 1.5rem;
	margin-top: var(--wp--preset--spacing--60);
	scroll-margin-top: 1.5rem;
}
.lf-legal .wp-block-post-content h3 {
	font-size: 1.125rem;
	margin-top: var(--wp--preset--spacing--50);
}
.lf-legal .lf-effective { color: var(--wp--preset--color--muted); font-size: .9375rem; }
.wp-block-table { overflow-x: auto; }
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table th,
.wp-block-table td {
	border: 1px solid var(--wp--preset--color--border);
	padding: .6rem .75rem;
	text-align: start;
	vertical-align: top;
}
.wp-block-table thead { border-bottom: 0; }
.wp-block-table th { background: var(--wp--preset--color--surface-2); font-weight: 650; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
	ol.lf-steps { grid-template-columns: minmax(0, 1fr); gap: var(--wp--preset--spacing--50); }
	ol.lf-steps > li { padding-top: 0; padding-inline-start: 3.5rem; min-height: 2.5rem; }
	ol.lf-steps > li:not(:last-child)::after {
		top: 3rem;
		bottom: calc(-1 * var(--wp--preset--spacing--50) + .5rem);
		inset-inline-start: 1.25rem;
		inset-inline-end: auto;
		border-top: 0;
		border-inline-start: 2px dashed var(--wp--preset--color--border);
	}
}
@media (max-width: 600px) {
	/* Wide tables scroll sideways inside their own box instead of squeezing every cell. */
	.wp-block-table table { min-width: 34rem; font-size: .875rem; }
	.wp-block-table { -webkit-overflow-scrolling: touch; }
	.lf-ferry li { grid-template-columns: minmax(0, 1fr); padding: .7rem .85rem; }
	.lf-ferry .lf-ferry-text { font-size: 1rem; }
	.lf-nav-cta { display: block; }
	.lf-spec > .lf-spec-row { padding-block: var(--wp--preset--spacing--50); }
}
