/*
Theme Name: Julien Kilchenmann
Description: A WordPress block theme built with Shader and VX Framework, with block templates and theme.json.
Author: Shader
Author URI: https://vxframework.com
Text Domain: julien-kilchenmann
Version: 0.1.0
Requires at least: 7.1
Requires PHP: 8.1
Update URI: false
*/

/*
 * Plumbing only. The look lives in theme.json; this file holds what theme.json
 * can't express. It loads on the site and in the editor, so its rules must hold
 * in both.
 */

/* Room for a scrollbar on every page, so a short page and a long one line up
   where scrollbars take space, as on Windows, instead of the layout jumping
   sideways between them. */
html {
	scrollbar-gutter: stable;
}

/* WordPress puts a block gap between the template's top-level blocks: the
   header part, main and the footer part. Sections own their spacing instead.
   The editor's canvas root is .wp-site-blocks too while it shows a template,
   but there WordPress prints that gap after this file, so :root makes this win. */
:root .wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main keeps its distance from the header and footer. A
   template whose main starts or ends with a full-bleed section adds the
   is-flush class to main. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--50);
}

.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* Keyboard focus stays visible on every control, and only there: in the
   editor, the text being typed in has focus too. */
:where(a, button, input, select, textarea, summary, [tabindex]:not([contenteditable])):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Links and selection. */
a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

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

/* The sticky header stays above the page's own stacking (the strings hero, sleeves, prints). */
.site-header-wrap {
	z-index: 50;
}

.site-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.site-header .wp-block-navigation .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--wp--preset--color--amber);
}

/* The phone menu: big serif links on ink. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: var(--wp--preset--spacing--70);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.1;
	text-transform: none;
}

/* Captions and the hero's name on dark bands. */
.has-ink-background-color .wp-element-caption {
	color: var(--wp--preset--color--ash);
}

.is-style-strings h1 {
	line-height: 0.9;
	letter-spacing: -0.02em;
}

/* Video embeds fill their column at 16:9, also when VX builds them from a field (the recording's Video). */
.wp-block-embed__wrapper:has(> iframe[src*="youtube"], > iframe[src*="vimeo"]) {
	aspect-ratio: 16 / 9;
}

.wp-block-embed__wrapper > iframe[src*="youtube"],
.wp-block-embed__wrapper > iframe[src*="vimeo"] {
	width: 100%;
	height: 100%;
}

/* A drop cap in the display serif and varnish. */
.has-drop-cap:not(:focus)::first-letter {
	color: var(--wp--preset--color--varnish);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
}

/* Archive and singular heads. */
.page-head__intro {
	max-width: 42rem;
}

/* Search field: a pill on any ground. */
.site-search .wp-block-search__input {
	padding: 0.85em 1.3em;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
}

.site-search .wp-block-search__inside-wrapper {
	gap: var(--wp--preset--spacing--30);
	max-width: 36rem;
}

.has-ink-background-color .site-search .wp-element-button {
	border-color: var(--wp--preset--color--amber);
	background-color: var(--wp--preset--color--amber);
	color: var(--wp--preset--color--ink);
}

/* WhatsApp: its glyph before every WhatsApp link (a theme image, painted in the link's colour). */
.wp-element-button[href^="https://wa.me/"]::before {
	content: "";
	flex: 0 0 auto;
	width: 1.15em;
	height: 1.15em;
	background: currentColor;
	-webkit-mask: url(assets/images/whatsapp.svg) center / contain no-repeat;
	mask: url(assets/images/whatsapp.svg) center / contain no-repeat;
}

.wp-block-button.is-style-big-link .wp-element-button[href^="https://wa.me/"]::before {
	width: 0.8em;
	height: 0.8em;
}

.wp-block-button:not(.is-style-arrow-link) .wp-element-button[href^="https://wa.me/"] {
	display: inline-flex;
	gap: 0.6em;
	align-items: center;
}

/* The floating WhatsApp button, bottom right on every page (in the footer part). On the site only: in the editor it
   stays in the footer, where it is edited. */
body:not(.editor-styles-wrapper) .quick-contact {
	position: fixed;
	right: clamp(1rem, 2.5vw, 1.75rem);
	bottom: clamp(1rem, 2.5vw, 1.75rem);
	z-index: 60;
	margin: 0;
}

.quick-contact .wp-element-button {
	box-shadow: 0 0.75rem 2rem -0.75rem color-mix(in srgb, var(--wp--preset--color--ink) 75%, transparent);
}

/* theme.js tucks it away on the first screen and while the footer, with its own WhatsApp link, is in view. */
body:not(.editor-styles-wrapper) .quick-contact {
	transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

body:not(.editor-styles-wrapper) .quick-contact.is-tucked {
	opacity: 0;
	visibility: hidden;
	transform: translateY(1rem);
}

/* On phones, a round button with the glyph only; the word stays its name for screen readers. */
@media (max-width: 600px) {
	.quick-contact .wp-element-button {
		width: 3.25rem;
		height: 3.25rem;
		padding: 0;
		justify-content: center;
		font-size: 0;
	}

	.quick-contact .wp-element-button::before {
		width: 1.5rem;
		height: 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	body:not(.editor-styles-wrapper) .quick-contact {
		transition: none;
	}
}

/* The contact form: WordPress's comment form on the Contact page (inc/contact-form.php). */
.contact-form .comment-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	margin: 0;
}

.contact-form .comment-form > p {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	margin: 0;
}

.contact-form .comment-notes,
.contact-form .logged-in-as,
.contact-form .comment-form-comment,
.contact-form .form-submit {
	grid-column: 1 / -1;
}

.contact-form .comment-notes,
.contact-form .logged-in-as {
	color: var(--wp--preset--color--smoke);
	font-size: var(--wp--preset--font-size--small);
}

.contact-form label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.contact-form .required {
	color: var(--wp--preset--color--varnish);
}

.contact-form .optional {
	letter-spacing: 0.06em;
	text-transform: none;
	opacity: 0.75;
}

.contact-form input:not([type="submit"]),
.contact-form select,
.contact-form textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 0.85em 1em;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 28%, transparent);
	border-radius: 0.5rem;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	transition: border-color 0.2s ease;
}

.contact-form input:not([type="submit"]):focus,
.contact-form select:focus,
.contact-form textarea:focus {
	border-color: var(--wp--preset--color--varnish);
	outline: 2px solid color-mix(in srgb, var(--wp--preset--color--varnish) 35%, transparent);
	outline-offset: 1px;
}

.contact-form textarea {
	min-height: 10rem;
	resize: vertical;
}

.contact-form .form-submit {
	margin: var(--wp--preset--spacing--20) 0 0;
}

/* The honeypot: out of sight and out of the tab order; people never fill it in, bots do. */
.contact-form .comment-form-website,
.contact-form .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.contact-form__sent {
	margin: 0 0 var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border-left: 3px solid var(--wp--preset--color--varnish);
	background: var(--wp--preset--color--paper);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
}

@media (max-width: 600px) {
	.contact-form .comment-form {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Footer. */
.site-footer__columns {
	border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.site-footer__base a {
	text-decoration: none;
}

.site-footer__base a:hover {
	text-decoration: underline;
}

/* An article's body: concert and recording texts, blog posts. */
.article-body {
	max-width: 40rem;
	line-height: 1.7;
}

.article-body > * + * {
	margin-block-start: 1.1em;
}

.article-body a {
	color: var(--wp--preset--color--varnish);
}

/* Reveal on scroll: assets/js/theme.js adds the start state to sections below the first screen only, so nothing is
   hidden without the script, in the editor, or under reduced motion. */
.jk-reveal {
	opacity: 0;
	transform: translateY(1.75rem);
}

.jk-reveal.is-revealed {
	opacity: 1;
	transform: none;
	transition: opacity 0.9s ease, transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
	.jk-reveal {
		opacity: 1;
		transform: none;
	}
}
