/*
Theme Name: Zefiro
Theme URI: https://zefiroeyewear.com/
Author: Hatter
Author URI: https://hatter.it/
Description: Tema child di Twenty Twenty-Five per la vetrina di Zefiro Eyewear: header bianco con logo centrato e menu sottile, foto a tutta larghezza con margine di 16 px, pulsanti rettangolari, tipografia Bodoni Moda e Jost.
Template: twentytwentyfive
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.1.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zefiro
*/

/* Only what theme.json cannot express. Tokens come from theme.json presets. */

/* ---------------------------------------------------------------
 * Base
 * ------------------------------------------------------------ */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

::selection {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Visible focus ring: 2px outline, offset 2px. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------
 * Announcement bar
 * ------------------------------------------------------------ */

.wp-block-group.zefiro-announcement {
	margin-block: 0;
	font-family: var(--wp--preset--font-family--jost);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0.1em;
	text-align: center;
	text-transform: uppercase;
}

.zefiro-announcement p {
	margin: 0;
}

.zefiro-announcement a {
	color: inherit;
}

/* ---------------------------------------------------------------
 * Header (sticky, logo centred, thin uppercase menu below)
 * ------------------------------------------------------------ */

/*
 * A sticky element only sticks inside its parent box. The header template part
 * (<header class="wp-block-template-part">) is as tall as its content, so it is
 * flattened: .zefiro-header then sticks for the whole page while the announcement
 * bar scrolls away. Without :has() support the header simply scrolls.
 * Not in the site editor (block wrappers need a box for selection and toolbars).
 */
.wp-site-blocks > header.wp-block-template-part:not(.block-editor-block-list__block):has(> .zefiro-header) {
	display: contents;
}

.wp-block-group.zefiro-header {
	position: sticky;
	top: 0;
	z-index: 50;
	gap: 14px;
	margin-block: 0;
	padding: 26px 16px 18px;
	background-color: var(--wp--preset--color--base);
	border-bottom: 1px solid var(--wp--preset--color--accent-2);
}

.admin-bar .wp-block-group.zefiro-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

/* Logo: inline SVG wordmark, fill="currentColor". */
.zefiro-logo {
	display: block;
	width: 150px;
	max-width: 100%;
	color: var(--wp--preset--color--contrast);
	line-height: 0;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.zefiro-logo:hover {
	opacity: 0.7;
}

.zefiro-logo svg {
	display: block;
	width: 100%;
	height: auto;
}

.zefiro-logo__text {
	font-family: var(--wp--preset--font-family--bodoni-moda);
	font-size: 28px;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
}

/* Menu */
.zefiro-header .wp-block-navigation {
	gap: 8px 36px;
}

.wp-block-navigation .wp-block-navigation-item__content {
	text-decoration: none;
}

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation-item__content:focus-visible,
.wp-block-navigation .wp-block-navigation-item__content[aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.45em;
}

/* Mobile overlay (TT5 / core hamburger) */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
	gap: 26px;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
	font-size: 1.125rem;
	letter-spacing: 0.16em;
}

/* ---------------------------------------------------------------
 * Gallery gutter (Blackfin style)
 * ------------------------------------------------------------ */

/*
 * In the zefiro templates post-content is alignfull and carries the 16px root
 * padding (has-global-padding), so its .alignfull children would normally get
 * -16px margins and touch the viewport edges. Panels and the gallery wrapper keep
 * the 16px gutter instead (same in the editor canvas and in parent templates).
 */
.has-global-padding > .alignfull.is-style-zefiro-panel,
.has-global-padding > .alignfull.zefiro-gallery {
	margin-left: 0;
	margin-right: 0;
}

/* ---------------------------------------------------------------
 * Block style: core/cover "zefiro-panel"
 * ------------------------------------------------------------ */

.wp-block-cover.is-style-zefiro-panel {
	overflow: hidden;
	overflow: clip;
	padding: clamp(24px, 4vw, 56px) 16px clamp(32px, 5vw, 72px);
}

.wp-block-cover.is-style-zefiro-panel .wp-block-cover__inner-container,
.wp-block-cover.is-style-zefiro-panel.is-light .wp-block-cover__inner-container {
	color: #fff;
	text-align: center;
}

.wp-block-cover.is-style-zefiro-panel :where(h1, h2, h3, h4, h5, h6, p) {
	color: inherit;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 2px 24px rgba(0, 0, 0, 0.3);
}

.wp-block-cover.is-style-zefiro-panel .wp-block-buttons {
	justify-content: center;
}

/*
 * Slow zoom on hover (image only, never with parallax backgrounds).
 * Front end only (.wp-site-blocks, and not an editor block wrapper: the site
 * editor canvas also carries .wp-site-blocks), so the image does not move while editing.
 */
@media (prefers-reduced-motion: no-preference) {
	.wp-block-cover.is-style-zefiro-panel .wp-block-cover__image-background:not(.has-parallax),
	.wp-block-cover.is-style-zefiro-panel .wp-block-cover__video-background {
		transition: transform 1.2s ease;
	}

	.wp-site-blocks .wp-block-cover.is-style-zefiro-panel:not(.block-editor-block-list__block):hover .wp-block-cover__image-background:not(.has-parallax),
	.wp-site-blocks .wp-block-cover.is-style-zefiro-panel:not(.block-editor-block-list__block):focus-within .wp-block-cover__image-background:not(.has-parallax),
	.wp-site-blocks .wp-block-cover.is-style-zefiro-panel:not(.block-editor-block-list__block):hover .wp-block-cover__video-background,
	.wp-site-blocks .wp-block-cover.is-style-zefiro-panel:not(.block-editor-block-list__block):focus-within .wp-block-cover__video-background {
		transform: scale(1.04);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-cover.is-style-zefiro-panel .wp-block-cover__image-background,
	.wp-block-cover.is-style-zefiro-panel .wp-block-cover__video-background {
		transition: none !important;
		transform: none !important;
	}
}

/* ---------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------ */

.wp-block-button__link,
.wp-element-button {
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/*
 * Default style: white, square, 1px border. The border is the base colour on
 * covers (photos) and turns contrast elsewhere so the button stays visible on white.
 */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	border-color: var(--wp--preset--color--contrast);
}

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

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:focus-visible,
.wp-block-cover .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover,
.wp-block-cover .wp-block-button:not(.is-style-outline) > .wp-block-button__link:focus-visible {
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Buttons filled with the contrast preset (preset classes use !important) invert on hover. */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link.has-contrast-background-color:hover,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link.has-contrast-background-color:focus-visible {
	background-color: var(--wp--preset--color--base) !important;
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast) !important;
}

/* Outline style: transparent, 1px contrast border, contrast fill on hover. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background-color: transparent;
	border: 1px solid var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast);
	padding: 14px 30px;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Outline buttons on photos turn white. */
.wp-block-cover.is-style-zefiro-panel .wp-block-button.is-style-outline > .wp-block-button__link {
	border-color: #fff;
	color: #fff;
}

.wp-block-cover.is-style-zefiro-panel .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-cover.is-style-zefiro-panel .wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background-color: #fff;
	border-color: #fff;
	color: var(--wp--preset--color--contrast);
}

.wp-block-button__link:focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

.wp-block-cover.is-style-zefiro-panel .wp-block-button__link:focus-visible {
	outline-color: #fff;
}

/* ---------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------ */

.wp-block-group.zefiro-footer {
	border-top: 1px solid var(--wp--preset--color--accent-2);
	text-align: center;
}

.zefiro-footer p {
	margin: 0;
}

.zefiro-footer .zefiro-logo {
	width: 104px;
}

.zefiro-footer a {
	color: inherit;
	text-decoration: none;
}

.zefiro-footer a:hover,
.zefiro-footer a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.35em;
}

.zefiro-footer .zefiro-logo:hover {
	text-decoration: none;
}

.zefiro-footer-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 28px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.zefiro-footer-contact {
	font-size: 0.875rem;
}

.zefiro-footer .wp-block-social-links {
	gap: 20px;
}

.wp-block-group.zefiro-legal {
	gap: 4px 20px;
	font-size: 0.75rem;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--accent-3);
}

/* Credito dello sviluppatore: link dentro una frase, sottolineato per distinguerlo dal testo (WCAG 1.4.1). */
.zefiro-footer .zefiro-credit a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

.zefiro-footer .zefiro-credit a:hover {
	text-decoration: none;
}

/* ---------------------------------------------------------------
 * Contact Form 7
 * ------------------------------------------------------------ */

/* Honeypot (see mu-plugin zefiro-core). */
.zf-hp-wrap{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}

.wpcf7-form {
	font-family: var(--wp--preset--font-family--jost);
}

.wpcf7-form p {
	margin: 0 0 20px;
}

.wpcf7-form label {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.wpcf7-form label br {
	display: none;
}

.wpcf7-form .wpcf7-form-control-wrap {
	display: block;
	margin-top: 6px;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="number"],
.wpcf7-form select,
.wpcf7-form textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--wp--preset--color--accent-2);
	border-radius: 0;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--jost);
	font-size: 1rem;
	font-weight: 300;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.2s ease;
}

.wpcf7-form textarea {
	min-height: 180px;
	resize: vertical;
}

.wpcf7-form input:hover,
.wpcf7-form textarea:hover {
	border-color: var(--wp--preset--color--accent-6);
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
	border-color: var(--wp--preset--color--contrast);
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

/* Acceptance (privacy) */
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item {
	display: block;
	margin: 0;
}

.wpcf7-form .wpcf7-acceptance label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 0.875rem;
	font-weight: 300;
	letter-spacing: 0;
	line-height: 1.5;
	text-transform: none;
	cursor: pointer;
}

.wpcf7-form .wpcf7-acceptance input[type="checkbox"] {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--wp--preset--color--contrast);
}

.wpcf7-form .wpcf7-acceptance a {
	color: inherit;
}

/* Submit */
.wpcf7-form .wpcf7-submit {
	display: inline-block;
	padding: 14px 30px;
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 0;
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--jost);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.wpcf7-form .wpcf7-submit:hover,
.wpcf7-form .wpcf7-submit:focus-visible {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.wpcf7-form .wpcf7-submit:disabled {
	cursor: wait;
	opacity: 0.6;
}

/* Validation and response messages */
.wpcf7-form .wpcf7-not-valid {
	border-color: #a4262c;
}

.wpcf7-form .wpcf7-not-valid-tip {
	margin-top: 6px;
	color: #a4262c;
	font-size: 0.8125rem;
	letter-spacing: 0;
	text-transform: none;
}

.wpcf7 form .wpcf7-response-output {
	margin: 20px 0 0;
	padding: 12px 16px;
	border: 1px solid var(--wp--preset--color--accent-2);
	font-size: 0.875rem;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
	border-color: #a4262c;
}

.wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--wp--preset--color--contrast);
}

/* ---------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------ */

@media (max-width: 781px) {
	.wp-block-group.zefiro-announcement {
		font-size: 11px;
		letter-spacing: 0.08em;
	}

	.wp-block-group.zefiro-header {
		padding: 18px 16px;
	}

	.zefiro-logo {
		width: 120px;
	}

	/*
	 * The menu turns into the core/TT5 overlay (hamburger) for the whole mobile
	 * range. Core switches at 600px; these two rules extend it up to 781px.
	 * The open overlay (.is-menu-open) is untouched.
	 */
	.zefiro-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.zefiro-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	/* Hamburger on the left of the centred logo (no transform: the overlay is position:fixed). */
	.zefiro-header > .wp-block-navigation {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 16px;
		margin: 0;
	}

	/* Panels become 4:5 (they may still grow to fit their content). */
	.wp-block-cover.is-style-zefiro-panel {
		min-height: calc((100vw - 32px) * 1.25) !important;
		padding: 24px 16px 32px;
	}

	.zefiro-footer .zefiro-logo {
		width: 96px;
	}
}

@media (max-width: 599px) {
	.zefiro-footer-links {
		gap: 10px 20px;
	}
}

/* The admin bar is not fixed on small screens. */
@media (max-width: 600px) {
	.admin-bar .wp-block-group.zefiro-header {
		top: 0;
	}
}
