/*
Theme Name: Schemi Facili
Theme URI: https://example.it/
Author: Schemi Facili
Description: Tema a blocchi (Full Site Editing) per un blog di schemi all'uncinetto in italiano. Leggero, mobile first, pensato per Pinterest e pronto per gli spazi pubblicitari.
Version: 1.1.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: uncinetto-theme
Tags: block-theme, full-site-editing, blog, one-column, wide-blocks, food-and-drink
*/

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
.has-text-align-center { text-align: center; }
img { height: auto; }
:where(a, button, summary, input):focus-visible { outline: 3px solid var(--wp--preset--color--primary); outline-offset: 2px; border-radius: 4px; }
.wp-element-button, .wp-block-button__link, .wp-block-search__button { min-height: 44px; }
.skip-link:focus { z-index: 100; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--base); }
.site-brand { gap: .5rem !important; }
.site-brand svg { width: 38px; height: 38px; flex: none; }
.site-header .wp-block-navigation__responsive-container-open,
.site-header .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; justify-content: center; align-items: center; }
.header-search { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--wp--preset--color--contrast); }
.site-header .wp-block-navigation-item__content { padding: .5rem .25rem; }
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 1.25rem; }

/* ---------- Breadcrumb ---------- */
.schemi-breadcrumb { font-size: var(--wp--preset--font-size--small); color: #5E5650; }
.schemi-breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.schemi-breadcrumb li + li::before { content: "›"; margin-right: .25rem; color: #8C847D; }
.schemi-breadcrumb a { color: inherit; }

/* ---------- Badge / meta ---------- */
.schemi-badge { display: inline-block; font-size: .8125rem; font-weight: 700; line-height: 1; padding: .4rem .65rem; border-radius: 999px; background: #E6EEE7; color: #3F5A43; letter-spacing: .02em; }
.schemi-badge--intermedio { background: var(--wp--preset--color--secondary); color: #6B3A2A; }
.schemi-tempo { display: inline-flex; align-items: center; gap: .3rem; font-size: var(--wp--preset--font-size--small); color: #5E5650; }
.schemi-tempo svg { width: 16px; height: 16px; flex: none; }

/* ---------- Cards ---------- */
.schemi-grid { list-style: none; padding: 0; }
.schemi-card { background: var(--wp--preset--color--white); border-radius: 12px; box-shadow: var(--wp--preset--shadow--soft); overflow: hidden; height: 100%; display: flex; flex-direction: column; position: relative; }
.schemi-card .wp-block-post-featured-image, .schemi-card__img { margin: 0 !important; aspect-ratio: 2 / 3; border-radius: 0 !important; overflow: hidden; background: var(--wp--preset--color--secondary); }
.schemi-card .wp-block-post-featured-image img, .schemi-card__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; display: block; }
.schemi-card__body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.schemi-card__title { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 1.0625rem !important; line-height: 1.3; margin: 0 !important; }
.schemi-card__title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.schemi-card__title a::after { content: ""; position: absolute; inset: 0; }
.schemi-card .schemi-badge { align-self: flex-start; }
.schemi-card__body > * { margin: 0 !important; }
@media (max-width: 600px) {
	.wp-block-post-template.schemi-grid.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .9rem; }
	.schemi-card__body { padding: .65rem .7rem .8rem; }
}
.schemi-correlati { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }

/* ---------- Hero (React Bits: SplitText + ShinyText) ---------- */
.schemi-eyebrow { margin-bottom: .25rem !important; }
.shiny-badge { position: relative; display: inline-block; overflow: hidden; padding: .45rem 1rem; border-radius: 999px; background: var(--wp--preset--color--secondary); color: #6B3A2A; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.shiny-badge::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%); transform: translateX(-100%); animation: schemi-shine 3.2s ease-in-out infinite 1s; }
@keyframes schemi-shine { 60%, 100% { transform: translateX(100%); } }
.schemi-hero h1 { margin-top: .6rem; }
.schemi-hero__lead { color: #4A443F; font-size: 1.1875rem; }
.split-reveal .line, .split-reveal [class*="-mask"] { padding-bottom: .06em; }
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--contrast); border: 2px solid var(--wp--preset--color--contrast); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--white); }
.wp-block-button__link { will-change: transform; }

/* ---------- Marquee (21st.dev / React Bits ScrollVelocity) ---------- */
.schemi-marquee { overflow: hidden; border-block: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--white); padding-block: .9rem; margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50) !important; -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.schemi-marquee__track { display: flex; align-items: center; gap: 1.5rem; width: max-content; white-space: nowrap; padding-inline: 1.5rem; }
.schemi-marquee a { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: clamp(1.25rem, 3.5vw, 1.75rem); color: var(--wp--preset--color--contrast); text-decoration: none; }
.schemi-marquee a:hover { color: var(--wp--preset--color--primary-dark); }
.schemi-marquee__dot { color: var(--wp--preset--color--primary); font-size: 1.1rem; }
html:not(.motion-ready) .schemi-marquee { overflow-x: auto; scrollbar-width: none; }

/* ---------- Categorie bento (21st.dev) ---------- */
.schemi-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.schemi-bento > * { margin: 0 !important; }
.schemi-bento > .schemi-cat:first-child { grid-column: span 2; min-height: 200px !important; }
.schemi-bento > .schemi-cat:nth-child(6) { grid-column: 1 / -1; }
@media (min-width: 782px) {
	.schemi-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 170px; gap: 1rem; }
	.schemi-bento > .schemi-cat { min-height: 0 !important; height: 100%; }
	.schemi-bento > .schemi-cat:first-child { grid-column: span 2; grid-row: span 2; }
}
.schemi-cat { border-radius: 12px; overflow: hidden; position: relative; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.schemi-cat:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(46,42,39,.14); }
.schemi-cat.wp-block-cover { align-items: stretch; }
.schemi-cat .wp-block-cover__inner-container { position: relative; z-index: 2; width: 100% !important; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; gap: .15rem; }
.schemi-cat p, .schemi-cat .wp-block-cover__inner-container > * { margin: 0 !important; max-width: none; }
.schemi-cat__title { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }
.schemi-bento > .schemi-cat:first-child .schemi-cat__title { font-size: clamp(1.5rem, 4vw, 2.25rem); }
.schemi-cat__title a { text-decoration: none; color: inherit; }
.schemi-cat__title a::after { content: ""; position: absolute; inset: -3rem; z-index: 2; }
.schemi-cat__title a::before { content: "→"; position: absolute; right: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 1rem; line-height: 1; transition: transform .3s; }
.schemi-cat:hover .schemi-cat__title a::before { transform: rotate(-45deg); }
.schemi-cat__desc { font-size: var(--wp--preset--font-size--small); opacity: .85; }
.schemi-cat.has-background-dim, .schemi-cat .has-background-dim { color: var(--wp--preset--color--contrast); }

/* ---------- Barra di lettura ---------- */
.schemi-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--wp--preset--color--primary); transform-origin: 0 50%; transform: scaleX(0); z-index: 99; pointer-events: none; }

/* ---------- Card: tilt (React Bits TiltedCard) ---------- */
@media (hover: hover) and (pointer: fine) {
	.motion-ready .schemi-card { transform-style: preserve-3d; transition: box-shadow .3s; }
	.motion-ready .schemi-card:hover { box-shadow: 0 14px 34px rgba(46,42,39,.16); }
}

/* ---------- Lenis ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
	.shiny-badge::after { animation: none; display: none; }
	.schemi-cat, .schemi-cat:hover { transition: none; transform: none; }
}

/* ---------- Article ---------- */
.schemi-updated { font-size: var(--wp--preset--font-size--small); color: #5E5650; gap: .3rem !important; }
.schemi-updated p { margin: 0; }
.in-breve { border-radius: 12px; }
.in-breve__title { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 1.25rem; margin: 0; }
.in-breve ul { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .55rem; }
.in-breve li { display: flex; align-items: flex-start; gap: .6rem; }
.in-breve li::before { content: ""; flex: none; width: 22px; height: 22px; margin-top: .2rem; background: var(--wp--preset--color--primary-dark); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.in-breve li:nth-child(1) { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 20V14M10 20V9M16 20V4'/%3E%3C/svg%3E"); }
.in-breve li:nth-child(2) { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v4l3 2M9 2h6'/%3E%3C/svg%3E"); }
.in-breve li:nth-child(3) { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='2' y='8' width='20' height='8' rx='1'/%3E%3Cpath d='M6 8v3M10 8v4M14 8v3M18 8v4'/%3E%3C/svg%3E"); }
.in-breve li:nth-child(4) { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 21L17.5 6.5'/%3E%3Cpath d='M17.5 6.5c1.2-1.4 3.3-1.2 3.4.4.1 1.3-1.1 2.1-2.2 1.6'/%3E%3C/svg%3E"); }
.in-breve li:nth-child(5) { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M6 7c4 1 8 5 9 12M18 7c-4 1-8 5-9 12M4.5 12h15'/%3E%3C/svg%3E"); }
.schemi-indice { border-left: 3px solid var(--wp--preset--color--primary); padding: .25rem 0 .25rem 1rem; }
.schemi-indice__title { font-weight: 700; margin: 0 0 .35rem; }
.schemi-indice ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.schemi-indice a { text-decoration: none; }
.schemi-indice a:hover { text-decoration: underline; }
.wp-block-post-content h2[id], .wp-block-post-content h3[id] { scroll-margin-top: 1rem; }
.wp-block-post-content ol li { margin-bottom: .45rem; }
.pdf-box { border-radius: 12px; border: 2px dashed var(--wp--preset--color--primary); }
.pdf-box__title { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 1.25rem; margin: 0; }
.wp-block-details summary { font-weight: 700; cursor: pointer; min-height: 28px; }
.wp-block-details[open] summary { margin-bottom: .5rem; }
.wp-block-details + .wp-block-details { margin-top: .6rem; }

/* ---------- Pinterest ---------- */
.schemi-pinwrap { position: relative; }
.schemi-pin-save, .wp-block-post-featured-image a.schemi-pin-save { height: auto; width: auto; display: inline-flex; }
.schemi-pin-save { position: absolute; top: .6rem; left: .6rem; z-index: 3; display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .45rem .8rem; border-radius: 999px; background: #E60023; color: #fff !important; font-size: .875rem; font-weight: 700; line-height: 1; text-decoration: none !important; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.schemi-pin-save:hover { background: #AD081B; }
.schemi-pin-save svg { width: 16px; height: 16px; fill: currentColor; }
.schemi-pin { text-align: center; margin-block: var(--wp--preset--spacing--50); }
.schemi-pin figure { margin: 0 auto; max-width: 420px; position: relative; }
.schemi-pin img { border-radius: 12px; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.schemi-pin .schemi-pin-cta { position: static; margin-top: .9rem; min-height: 44px; padding: .7rem 1.2rem; font-size: 1rem; }

/* ---------- Ads (min-height: no layout shift) ---------- */
.ad-slot { display: flex; align-items: center; justify-content: center; min-height: 280px; margin-block: var(--wp--preset--spacing--50); overflow: hidden; }
.ad-slot--schema { min-height: 280px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--wp--preset--color--border); }
.site-footer .wp-block-navigation { font-weight: 400; font-size: var(--wp--preset--font-size--small); }
.site-footer .wp-block-navigation-item__content { padding-block: .35rem; }
.schemi-copyright { margin: 0; color: #5E5650; }

/* ---------- Search & 404 ---------- */
.wp-block-search__input { min-height: 44px; border-radius: 12px; border: 1px solid var(--wp--preset--color--border); padding: .5rem .9rem; font-size: 1rem; }

@media (min-width: 782px) {
	.schemi-card__title { font-size: 1.1875rem !important; }
}
