/*
Theme Name: Atelier 3D
Theme URI: https://atelier3d.pratique-et-vous.fr
Author: Atelier 3D
Description: Tema a blocchi per un laboratorio di lampade e oggetti stampati in 3D su ordinazione. Catalogo con ordine su WhatsApp, tre lingue (italiano, francese, inglese).
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Version: 2.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: atelier3d
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-stretch: 100%; }
:where(section[id]) { scroll-margin-top: 84px; }
.wp-site-blocks > * + *, .wp-block-post-content > * + * { margin-block-start: 0; }
h1, h2 { font-variation-settings: "opsz" 96; text-wrap: balance; letter-spacing: -0.022em !important; }
p { text-wrap: pretty; }

a:focus-visible, button:focus-visible, summary:focus-visible, .wp-element-button:focus-visible {
	outline: 3px solid var(--wp--preset--color--amber);
	outline-offset: 3px;
}

/* ---------- Header ---------- */
.a3d-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--night) 94%, transparent);
	backdrop-filter: saturate(1.3) blur(14px);
	-webkit-backdrop-filter: saturate(1.3) blur(14px);
	color: var(--wp--preset--color--paper);
	border-bottom: 1px solid rgba(255,255,255,.07);
}
.a3d-header a { color: inherit; text-decoration: none; }
.a3d-header .wp-block-navigation a:hover { color: var(--wp--preset--color--amber-soft); }
.a3d-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--night); color: var(--wp--preset--color--paper); }
.a3d-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.a3d-brand-mark { display: block; width: 28px; height: 28px; flex: none; }
.a3d-brand-name { font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.03em; }
.a3d-lang { display: inline-flex; width: fit-content; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); }
.a3d-lang a { font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; text-decoration: none; color: rgba(255,255,255,.65); }
.a3d-lang a:hover { color: #fff; }
.a3d-lang a[aria-current="true"] { background: var(--wp--preset--color--paper); color: var(--wp--preset--color--night); }
.a3d-wa-small { font-size: .875rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--wp--preset--color--amber); color: var(--wp--preset--color--night) !important; white-space: nowrap; }
.a3d-wa-small:hover { background: var(--wp--preset--color--amber-soft); }

/* ---------- Sezioni scure ---------- */
.a3d-dark { color: var(--wp--preset--color--paper); }
.a3d-dark p { color: rgba(248,247,245,.74); }
.a3d-dark h1, .a3d-dark h2, .a3d-dark h3 { color: var(--wp--preset--color--paper); }

/* ---------- Hero: la lampada si accende ---------- */
.a3d-hero { position: relative; overflow: hidden; }
.a3d-hero h1 { max-width: 11ch; }
.a3d-hero .a3d-lede { max-width: 30ch; font-size: var(--wp--preset--font-size--large); line-height: 1.5; }
.a3d-hero-img { margin: 0; position: relative; }
.a3d-hero-img img {
	display: block; width: 100%; height: auto;
	-webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
	mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
	animation: a3d-switch-on 2.2s cubic-bezier(.3,.6,.2,1) .25s both;
}
@keyframes a3d-switch-on {
	0% { filter: brightness(.12) saturate(.4); }
	35% { filter: brightness(.5) saturate(.8); }
	42% { filter: brightness(.3) saturate(.6); }
	100% { filter: brightness(1) saturate(1); }
}
@media (prefers-reduced-motion: reduce) { .a3d-hero-img img { animation: none; } }
.a3d-dark .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--paper); border: 1.5px solid rgba(255,255,255,.4); background: transparent; padding: calc(.9rem - 1.5px) calc(1.55rem - 1.5px); }
.a3d-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: var(--wp--preset--color--paper); background: rgba(255,255,255,.06); }
.a3d-proof { display: flex; flex-wrap: wrap; gap: 6px 26px; list-style: none; padding: 0; margin: 2rem 0 0; font-size: .9rem; color: rgba(248,247,245,.62); }
.a3d-proof li { padding-left: 16px; position: relative; }
.a3d-proof li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--wp--preset--color--amber); box-shadow: 0 0 10px var(--wp--preset--color--amber); }

/* ---------- Intestazioni di sezione ---------- */
.a3d-head { margin-bottom: clamp(1.75rem, 3.5vw, 3rem) !important; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 3rem; }
.a3d-head h2 { margin: 0; }
.a3d-head p { margin: 0; max-width: 42ch; }

/* ---------- Schede prodotto ---------- */
.a3d-grid { gap: clamp(14px, 2vw, 24px) !important; }
.a3d-card { height: 100%; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; }
.a3d-card > * { margin-block: 0; }
.a3d-card .a3d-card-img { margin: 0; overflow: hidden; }
.a3d-card .a3d-card-img img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.a3d-card:hover .a3d-card-img img { transform: scale(1.035); }
@media (prefers-reduced-motion: reduce) { .a3d-card .a3d-card-img img { transition: none; } }
.a3d-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.a3d-card-body > * { margin: 0; }
.a3d-card-body h3 { font-size: 1.55rem; }
.a3d-card-body .a3d-desc { font-size: .98rem; line-height: 1.55; }
.a3d-card-body .wp-block-buttons { margin-top: auto; padding-top: 8px; }
.a3d-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .85rem; }
.a3d-dots { display: inline-flex; gap: 6px; }
.a3d-dots i { width: 14px; height: 14px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.a3d-tag { font-weight: 600; letter-spacing: .01em; }

.a3d-card.is-night { background: var(--wp--preset--color--night-2); border: 1px solid rgba(255,255,255,.06); }
.a3d-card.is-night .a3d-tag { color: var(--wp--preset--color--amber-soft); }
.a3d-card.is-day { background: var(--wp--preset--color--paper); border: 1px solid var(--wp--preset--color--line); }
.a3d-card.is-day p { color: var(--wp--preset--color--muted); }
.a3d-card.is-day .a3d-tag { color: var(--wp--preset--color--ink); }

.a3d-btn-line > .wp-block-button__link { background: transparent; border: 1.5px solid currentColor; padding: calc(.7rem - 1.5px) calc(1.2rem - 1.5px); font-size: .92rem; }
.a3d-card.is-night .a3d-btn-line > .wp-block-button__link { color: var(--wp--preset--color--amber); }
.a3d-card.is-night .a3d-btn-line > .wp-block-button__link:hover { background: var(--wp--preset--color--amber); color: var(--wp--preset--color--night); border-color: var(--wp--preset--color--amber); }
.a3d-card.is-day .a3d-btn-line > .wp-block-button__link { color: var(--wp--preset--color--ink); }
.a3d-card.is-day .a3d-btn-line > .wp-block-button__link:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); border-color: var(--wp--preset--color--ink); }

.a3d-note { font-size: .85rem; opacity: .7; }

/* ---------- Su misura ---------- */
.a3d-steps { counter-reset: step; }
.a3d-step { counter-increment: step; border-top: 1.5px solid var(--wp--preset--color--ink); padding-top: 18px; }
.a3d-step::before { content: counter(step); display: block; font-family: var(--wp--preset--font-family--display); font-size: 1rem; font-weight: 600; margin-bottom: 26px; }
.a3d-step h3 { margin: 0 0 8px; }
.a3d-step p { margin: 0; color: var(--wp--preset--color--muted); }
.a3d-custom-lead { max-width: 18ch; }

/* ---------- Colori ---------- */
.a3d-swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; max-width: 900px; list-style: none; padding: 0; margin: 0; }
.a3d-swatches li { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.a3d-swatches span { display: block; aspect-ratio: 1; width: min(100%, 112px); border-radius: 50%; margin-bottom: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
	background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.10) 0 2px, rgba(0,0,0,.05) 2px 4px); }
.a3d-swatches small { display: block; font-weight: 400; color: var(--wp--preset--color--muted); }

/* ---------- FAQ ---------- */
.a3d-faq details { border-bottom: 1px solid var(--wp--preset--color--line); padding-block: 20px; }
.a3d-faq details:first-child { border-top: 1px solid var(--wp--preset--color--line); }
.a3d-faq summary { cursor: pointer; font-weight: 600; font-size: 1.12rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.a3d-faq summary::-webkit-details-marker { display: none; }
.a3d-faq summary::after { content: ""; flex: none; width: 12px; height: 12px; margin-top: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.a3d-faq details[open] summary::after { transform: rotate(-135deg); margin-top: 10px; }
.a3d-faq details p { margin: 12px 0 0; color: var(--wp--preset--color--muted); max-width: 62ch; }

/* ---------- Contatti ---------- */
.a3d-cta { position: relative; overflow: hidden; }
.a3d-cta .a3d-cta-img { margin: 0; }
.a3d-cta .a3d-cta-img img { display: block; width: 100%; height: auto; -webkit-mask-image: radial-gradient(closest-side, #000 65%, transparent 100%); mask-image: radial-gradient(closest-side, #000 65%, transparent 100%); }
.a3d-phone { font-family: var(--wp--preset--font-family--display); font-size: 1.1rem; letter-spacing: -0.01em; }

/* ---------- Footer ---------- */
.a3d-footer a { color: inherit; }
.a3d-footer p { color: rgba(248,247,245,.62); }

/* ---------- Mobile ---------- */
@media (max-width: 1000px) {
	.a3d-swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
	.a3d-hide-mobile { display: none !important; }
	.a3d-hero .wp-block-columns { flex-direction: column-reverse; }
	.a3d-hero-img { max-width: 360px; margin-inline: auto; }
	.a3d-step::before { margin-bottom: 12px; }
}
