/*
Theme Name: Lilla London
Theme URI: https://lillalondon.fi
Author: Lilla London
Author URI: https://lillalondon.fi
Description: A single-page WordPress block theme for Lilla London, a British-style café in Tampere. Black and gold, after the logo.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lillalondon
Tags: block-theme, full-site-editing, one-column, custom-colors, editor-style
*/

/*
 * Most styling lives in theme.json. This file carries what block settings cannot express:
 * the sticky header and its overlay menu, the gold ornaments, the menu's dotted price
 * leaders, the hours table and the form.
 *
 * THE SITE IS DARK. theme.json sets an `ink` background and `cream` text globally; gold is
 * for headings, rules, prices and buttons — never for running text, where it tires the eye.
 */

/* ------------------------------------------------------------------ tokens -- */

:root {
	/* Side inset for every section; theme.json's root padding points here. */
	--lilla-gutter: clamp(1.25rem, 4vw, 3rem);

	/* Header geometry. The overlay close button is positioned from these. */
	--lilla-header-pad-y: 0.85rem;
	--lilla-brand-h: 2.75rem;
	--lilla-header-top: 0px;

	--lilla-rule: color-mix(in srgb, var(--wp--preset--color--gold) 45%, transparent);
}

@media (min-width: 601px) {
	.admin-bar {
		--lilla-header-top: var(--wp-admin--admin-bar--height, 0px);
	}
}

/*
 * Anchor jumps land below the sticky header, not under it. Smooth scrolling only when the
 * visitor has not asked for reduced motion.
 */
html {
	scroll-padding-top: calc(var(--lilla-header-top) + var(--lilla-brand-h) + 2 * var(--lilla-header-pad-y) + 0.5rem);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

::selection {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}

:where(a, button, input, textarea, select):focus-visible {
	outline: 2px solid var(--wp--preset--color--gold-light);
	outline-offset: 3px;
}

/*
 * No gap between header, main and footer, nor between the full-width front-page sections:
 * each section owns its own spacing, and a blockGap strip between two bands shows as a
 * stray line of page background.
 */
.wp-site-blocks > * + *,
.wp-block-post-content > .alignfull {
	margin-block: 0;
}

/* ------------------------------------------------------------------ header -- */

/*
 * Sticky goes on the template-part <header>, NOT on .lilla-header: a sticky box only sticks
 * within its parent, and .lilla-header's parent is exactly as tall as it is.
 */
header.wp-block-template-part:has(> .lilla-header) {
	position: sticky;
	top: var(--lilla-header-top);
	z-index: 20;
}

/*
 * Solid background, NO backdrop-filter (or transform/filter): any of those makes the header
 * the containing block for `position: fixed` descendants, and the mobile overlay menu —
 * which lives inside the header — would be clipped to the header's height.
 */
.lilla-header {
	background-color: var(--wp--preset--color--ink);
	border-bottom: 1px solid var(--lilla-rule);
	color: var(--wp--preset--color--gold);
	padding: var(--lilla-header-pad-y) var(--lilla-gutter);
}

.lilla-brand {
	align-items: center;
	color: var(--wp--preset--color--gold);
	display: inline-flex;
	gap: 0.75rem;
	text-decoration: none;
}

.lilla-brand:hover {
	color: var(--wp--preset--color--gold-light);
}

.lilla-brand__mark {
	border-radius: 50%;
	display: block;
	height: var(--lilla-brand-h);
	width: var(--lilla-brand-h);
}

.lilla-brand__name {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.1rem, 0.9rem + 1vw, 1.45rem);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Keep the brand above the open overlay menu, exactly where it was. */
.has-modal-open .lilla-header .lilla-brand {
	position: relative;
	z-index: 100001;
}

/*
 * Core styles nav links at (0,3,0) with `color: inherit`; doubling the class outranks it.
 */
.lilla-header .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
	color: var(--wp--preset--color--gold);
	position: relative;
	transition: color 0.2s ease;
}

.lilla-header .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--cream);
}

.lilla-header .wp-block-navigation .wp-block-navigation-item__content::after {
	background-color: currentColor;
	bottom: -0.4em;
	content: "";
	height: 1px;
	inset-inline: 0;
	position: absolute;
	transform: scaleX(0);
	transition: transform 0.25s ease;
}

.lilla-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.lilla-header .wp-block-navigation .wp-block-navigation-item__content:focus-visible::after {
	transform: scaleX(1);
}

/*
 * Overlay breakpoint: 780px instead of core's 600px — three links plus the wordmark need
 * about 720px before they would wrap. Core's rules live in `@media (min-width: 600px)`,
 * so both have to be undone here; the `.lilla-header` prefix supplies the specificity.
 */
@media (max-width: 779px) {
	.lilla-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	.lilla-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
}

/* The overlay itself: centred, large Cinzel links. Colours come from the block attributes. */
.lilla-header .wp-block-navigation__responsive-container.is-menu-open {
	animation-name: lilla-overlay-fade;
	justify-content: center;
}

.lilla-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: center;
	justify-content: center;
	padding-top: 0;
}

.lilla-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	justify-content: center;
}

.lilla-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--x-large);
}

/* 48px tap targets; the close button sits exactly where the hamburger was. */
.lilla-header .wp-block-navigation__responsive-container-open,
.lilla-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	align-items: center;
	justify-content: center;
	min-height: 48px;
	min-width: 48px;
}

.lilla-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	display: flex;
	position: fixed;
	right: var(--lilla-gutter);
	top: calc(var(--lilla-header-top) + var(--lilla-header-pad-y) + (var(--lilla-brand-h) / 2));
	transform: translateY(-50%);
}

/* Opacity-only fade: core's translateY would make the overlay the containing block of the fixed close button. */
@keyframes lilla-overlay-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* --------------------------------------------------------------- sections -- */

.lilla-section {
	padding-block: var(--wp--preset--spacing--60);
}

.lilla-section--panel {
	background:
		radial-gradient(ellipse at top, color-mix(in srgb, var(--wp--preset--color--gold) 8%, transparent), transparent 60%),
		var(--wp--preset--color--coal);
	border-block: 1px solid var(--lilla-rule);
}

/*
 * Section heading ornament: a short gold rule with a diamond in the middle, echoing the
 * diamonds at the top and bottom of the logo. Drawn with gradients so no image is needed.
 */
.lilla-heading {
	margin-bottom: var(--wp--preset--spacing--40);
}

.lilla-heading::after {
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5z' fill='%23c9a14a'/%3E%3C/svg%3E") center / 9px 9px no-repeat,
		linear-gradient(90deg, transparent, var(--wp--preset--color--gold) 30%, transparent 44%, transparent 56%, var(--wp--preset--color--gold) 70%, transparent) center / 100% 1px no-repeat;
	content: "";
	display: block;
	height: 9px;
	margin: 0.9rem auto 0;
	width: min(11rem, 60%);
}

.lilla-heading--left::after {
	margin-inline-start: 0;
}

/* Gold metal headings, after the logo's lettering. Plain gold where clip is unsupported. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
	.lilla-heading,
	.lilla-menu__title {
		-webkit-background-clip: text;
		background-clip: text;
		background-image: var(--wp--preset--gradient--gold-metal);
		color: transparent;
	}
}

.lilla-photo img {
	aspect-ratio: 4 / 3;
	border: 1px solid var(--lilla-rule);
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

/* -------------------------------------------------------------------- hero -- */

.lilla-hero {
	padding-block: var(--wp--preset--spacing--50);
	text-align: center;
}

.lilla-hero__title {
	margin: 0 auto;
}

.lilla-hero__logo {
	display: block;
	height: auto;
	margin-inline: auto;
	width: min(30rem, 78vw);
}

.lilla-hero__tagline {
	color: var(--wp--preset--color--gold-light);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--x-large);
	letter-spacing: 0.06em;
	margin-top: 0;
}

.lilla-hero__lead {
	color: var(--wp--preset--color--cream);
	font-size: var(--wp--preset--font-size--large);
	margin-inline: auto;
	max-width: 38rem;
}

.lilla-hero .wp-block-buttons {
	margin-top: var(--wp--preset--spacing--40);
}

/* ----------------------------------------------------------------- buttons -- */

/*
 * Core's outline style sets its own 2px border and em padding; restate theme.json's so a
 * filled and an outline button side by side are the same size.
 */
.wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 1px;
	padding: 0.9rem 1.75rem;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	border-color: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--gold);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}

/* ------------------------------------------------------------------- about -- */

.lilla-about {
	gap: var(--wp--preset--spacing--50);
}

.lilla-about p {
	font-size: var(--wp--preset--font-size--large);
}

/* -------------------------------------------------------------------- menu -- */

.lilla-menu__intro {
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--display);
	letter-spacing: 0.12em;
	margin-top: calc(-1 * var(--wp--preset--spacing--30));
	text-transform: uppercase;
}

.lilla-menu__columns {
	column-gap: var(--wp--preset--spacing--60);
	margin-top: var(--wp--preset--spacing--50);
}

.lilla-menu__category + .lilla-menu__category {
	margin-top: var(--wp--preset--spacing--50);
}

.lilla-menu__title {
	border-bottom: 1px solid var(--lilla-rule);
	font-size: var(--wp--preset--font-size--x-large);
	margin-bottom: var(--wp--preset--spacing--30);
	padding-bottom: 0.5rem;
}

/*
 * One item: name · · · · price on the first row, description beneath. The three
 * paragraphs are siblings (so each stays a plain editable paragraph); the grid puts them
 * in place, and the dotted leader is the name's ::after filling the gap.
 */
.lilla-menu__item {
	align-items: baseline;
	column-gap: 0.75rem;
	display: grid;
	grid-template-columns: 1fr auto;
	padding-block: 0.4rem;
}

/* Items are flow-layout siblings; the padding above is all the spacing they need. */
.lilla-menu__category > .lilla-menu__item {
	margin-block: 0;
}

.lilla-menu__item > * {
	margin: 0;
}

.lilla-menu__name {
	align-items: baseline;
	color: var(--wp--preset--color--cream);
	display: flex;
	font-weight: 700;
	gap: 0.75rem;
	letter-spacing: 0.02em;
}

.lilla-menu__name::after {
	border-bottom: 1px dotted var(--wp--preset--color--gold-deep);
	content: "";
	flex: 1;
	min-width: 1.5rem;
	transform: translateY(-0.3em);
}

.lilla-menu__price {
	color: var(--wp--preset--color--gold);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	white-space: nowrap;
}

.lilla-menu__desc {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	grid-column: 1 / -1;
	margin-top: 0.2rem;
	max-width: 34rem;
}

/* ----------------------------------------------------------------- gallery -- */

.lilla-gallery {
	gap: 0;
	padding: 0;
}

.lilla-gallery .lilla-photo {
	margin: 0;
}

.lilla-gallery .lilla-photo img {
	border: 0;
	filter: saturate(0.85);
	transition: filter 0.4s ease;
}

.lilla-gallery .lilla-photo img:hover {
	filter: none;
}

@media (max-width: 781px) {
	.wp-block-group.lilla-gallery {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------- hours and address -- */

.lilla-visit {
	gap: var(--wp--preset--spacing--50);
}

.lilla-hours {
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--large);
	margin-inline: auto;
	width: min(100%, 20rem);
}

.lilla-hours th,
.lilla-hours td {
	border-bottom: 1px dotted var(--wp--preset--color--gold-deep);
	padding: 0.55rem 0;
}

.lilla-hours th {
	color: var(--wp--preset--color--gold);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	text-align: left;
}

.lilla-hours td {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.lilla-address {
	font-size: var(--wp--preset--font-size--large);
	font-style: normal;
	text-align: center;
}

.lilla-address span {
	display: block;
}

.lilla-address__street {
	color: var(--wp--preset--color--gold-light);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--x-large);
}

.lilla-address__links {
	line-height: 2;
	text-align: center;
}

/* -------------------------------------------------------------------- form -- */

.lilla-form__fields {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--40);
}

.lilla-form__row {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.lilla-form__field {
	color: var(--wp--preset--color--gold);
	display: grid;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	gap: 0.4rem;
	letter-spacing: 0.08em;
}

.lilla-form__field .wpcf7-form-control-wrap {
	display: block;
}

.lilla-contact input:not([type="checkbox"]):not([type="submit"]),
.lilla-contact textarea {
	background: var(--wp--preset--color--coal);
	border: 1px solid var(--lilla-rule);
	border-radius: 0;
	box-sizing: border-box;
	color: var(--wp--preset--color--cream);
	font: inherit;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	letter-spacing: normal;
	padding: 0.8rem 0.9rem;
	width: 100%;
}

.lilla-contact textarea {
	min-height: 9rem;
	resize: vertical;
}

.lilla-contact input:focus,
.lilla-contact textarea:focus {
	border-color: var(--wp--preset--color--gold);
}

.lilla-contact ::placeholder {
	color: var(--wp--preset--color--muted);
	opacity: 0.7;
}

.lilla-form__consent {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.lilla-form__consent input {
	accent-color: var(--wp--preset--color--gold);
	margin-right: 0.5rem;
}

.lilla-form__actions {
	text-align: center;
}

/* CF7's submit is a plain input; give it the theme's button. */
.lilla-contact .wpcf7-submit {
	background: var(--wp--preset--color--gold);
	border: 1px solid var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.12em;
	padding: 0.9rem 2.25rem;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.lilla-contact .wpcf7-submit:hover:not(:disabled) {
	background: transparent;
	color: var(--wp--preset--color--gold-light);
}

.lilla-contact .wpcf7-submit:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.lilla-contact .wpcf7-not-valid-tip {
	color: #f0a58a;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	letter-spacing: normal;
	margin-top: 0.3rem;
}

.lilla-contact .wpcf7 form .wpcf7-response-output {
	border-color: var(--wp--preset--color--gold);
	margin: var(--wp--preset--spacing--30) 0 0;
	padding: 0.8rem 1rem;
	text-align: center;
}

.lilla-contact .wpcf7 form.invalid .wpcf7-response-output,
.lilla-contact .wpcf7 form.failed .wpcf7-response-output {
	border-color: #f0a58a;
}

/* ------------------------------------------------------------------ footer -- */

.lilla-footer {
	border-top: 1px solid var(--lilla-rule);
	padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.lilla-footer__columns {
	gap: var(--wp--preset--spacing--50);
}

.lilla-footer__logo img {
	display: block;
	height: auto;
	margin-inline: auto;
	width: min(13rem, 60vw);
}

.lilla-footer__title {
	font-size: var(--wp--preset--font-size--large);
	text-align: center;
}

.lilla-footer .lilla-hours {
	font-size: var(--wp--preset--font-size--medium);
}

.lilla-footer .lilla-address,
.lilla-footer .lilla-address__street {
	font-size: var(--wp--preset--font-size--medium);
}

.lilla-footer__legal {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--gold) 20%, transparent);
	color: var(--wp--preset--color--muted);
	margin-top: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--30);
}

.lilla-footer__legal a {
	color: inherit;
}
