/*
Theme Name: AI Product Factory Peluche
Theme URI: https://robertodilodovico.it/
Author: Roberto Di Lodovico
Author URI: https://robertodilodovico.it/
Description: Tema WordPress leggero per il laboratorio AI Product Factory. Homepage dinamica, integrazione WooCommerce e nessuna dipendenza da page builder.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ai-product-factory-peluche
Tags: e-commerce, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --aipf-ink: #171714;
  --aipf-muted: #66665f;
  --aipf-paper: #f7f5ee;
  --aipf-surface: #fff;
  --aipf-line: #dedbd0;
  --aipf-lime: #c8ff3d;
  --aipf-violet: #7457ff;
  --aipf-soft: #ece9df;
  --aipf-success: #15834d;
  --aipf-width: 1180px;
  --aipf-radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--aipf-ink);
  background: var(--aipf-paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--aipf-violet); outline-offset: 3px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  clip: auto !important; width: auto; height: auto; padding: 12px 16px; margin: 12px;
  overflow: visible; background: var(--aipf-surface); color: var(--aipf-ink); z-index: 100000;
}
.aipf-shell { width: min(calc(100% - 64px), var(--aipf-width)); margin-inline: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--aipf-line); }
.site-header__inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.custom-logo-link { display: inline-flex; }
.custom-logo { max-height: 42px; width: auto; }
.site-branding__mark {
  display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
  border-radius: 10px; background: var(--aipf-ink); color: var(--aipf-paper);
  font-size: .78rem; font-weight: 800;
}
.site-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 800; letter-spacing: -.03em; }
.site-title a { text-decoration: none; }
.site-navigation { display: flex; align-items: center; gap: 22px; }
.site-navigation ul { display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; list-style: none; }
.site-navigation a { color: var(--aipf-muted); font-size: .875rem; font-weight: 600; text-decoration: none; }
.site-navigation a:hover { color: var(--aipf-ink); }
.aipf-lab-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px;
  border: 1px solid var(--aipf-line); border-radius: 999px; background: var(--aipf-surface);
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; white-space: nowrap;
}
.aipf-lab-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #20be6b; box-shadow: 0 0 0 4px rgba(32,190,107,.16); }

/* Hero */
.aipf-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 58px; align-items: center; padding-block: 88px 78px; }
.aipf-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--aipf-violet); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.aipf-eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.aipf-hero h1 { max-width: 700px; margin: 20px 0 22px; font-size: clamp(3rem, 6.1vw, 4.9rem); font-weight: 800; letter-spacing: -.065em; line-height: .98; }
.aipf-hero h1 em { color: var(--aipf-violet); font-style: normal; }
.aipf-lead { max-width: 620px; margin: 0; color: var(--aipf-muted); font-size: 1.125rem; line-height: 1.65; }
.aipf-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.aipf-button, .wp-block-button__link, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 20px;
  border: 1px solid var(--aipf-ink); border-radius: 12px; background: var(--aipf-ink); color: var(--aipf-paper);
  font-size: .875rem; font-weight: 750; text-decoration: none; transition: transform .18s ease, opacity .18s ease;
}
.aipf-button:hover, .wp-block-button__link:hover, .woocommerce a.button:hover, .woocommerce button.button:hover { transform: translateY(-2px); opacity: .9; }
.aipf-button--secondary { border-color: var(--aipf-line); background: var(--aipf-surface); color: var(--aipf-ink); }
.aipf-hero-art {
  position: relative; min-height: 480px; overflow: hidden; border-radius: 32px;
  background: radial-gradient(circle at 28% 23%, #efe4ff 0 18%, transparent 43%), linear-gradient(145deg, #d8ff70, #b8e73f 54%, #91c524);
  box-shadow: 0 24px 70px rgba(23,23,20,.16);
}
.aipf-hero-grid { position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(#19200d 1px, transparent 1px), linear-gradient(90deg, #19200d 1px, transparent 1px); background-size: 34px 34px; }
.aipf-photo-tag { position: absolute; top: 22px; left: 22px; z-index: 2; padding: 10px 13px; border-radius: 12px; background: rgba(255,255,255,.86); color: #1b1d13; font-size: .75rem; font-weight: 750; backdrop-filter: blur(9px); }
.aipf-bear { position: absolute; inset: 68px 30px 70px; display: grid; place-items: center; font-size: clamp(9rem, 21vw, 15rem); filter: drop-shadow(0 28px 20px rgba(39,53,14,.22)); transform: rotate(-4deg); }
.aipf-generated-card { position: absolute; right: 18px; bottom: 18px; z-index: 2; width: min(270px, 72%); padding: 17px; border-radius: 18px; background: rgba(20,21,15,.93); color: #f7f5ee; box-shadow: 0 16px 36px rgba(0,0,0,.22); backdrop-filter: blur(10px); }
.aipf-generated-card small { color: #bbbcae; }
.aipf-generated-card strong { display: block; margin: 6px 0 13px; font-size: 1.05rem; line-height: 1.35; }
.aipf-generated-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .78rem; }
.aipf-status { color: var(--aipf-lime); font-weight: 750; }

/* Workflow */
.aipf-flow-wrap { padding-block: 26px 76px; }
.aipf-section-label { margin-bottom: 18px; color: var(--aipf-muted); font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.aipf-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.aipf-flow-step { padding: 23px; border: 1px solid var(--aipf-line); border-radius: 18px; background: var(--aipf-surface); }
.aipf-step-top { display: flex; align-items: center; justify-content: space-between; }
.aipf-step-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--aipf-soft); font-size: 1rem; font-weight: 800; }
.aipf-step-number { color: var(--aipf-muted); font-size: .72rem; font-weight: 800; }
.aipf-flow-step h2 { margin: 20px 0 8px; font-size: 1.25rem; letter-spacing: -.025em; }
.aipf-flow-step p { margin: 0; color: var(--aipf-muted); font-size: .875rem; line-height: 1.55; }

/* Products */
.aipf-products { padding-block: 64px 78px; border-top: 1px solid var(--aipf-line); }
.aipf-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.aipf-section-head h2 { margin: 0; font-size: clamp(2rem, 5vw, 2.4rem); letter-spacing: -.045em; line-height: 1.1; }
.aipf-section-head p { max-width: 430px; margin: 0; color: var(--aipf-muted); line-height: 1.5; }
.aipf-product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.aipf-product { overflow: hidden; border: 1px solid var(--aipf-line); border-radius: var(--aipf-radius); background: var(--aipf-surface); }
.aipf-product a { text-decoration: none; }
.aipf-product__image { display: grid; place-items: center; min-height: 240px; overflow: hidden; background: var(--aipf-soft); }
.aipf-product__image img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s ease; }
.aipf-product:hover .aipf-product__image img { transform: scale(1.025); }
.aipf-product__placeholder { font-size: 6rem; line-height: 1; }
.aipf-product__copy { padding: 17px; }
.aipf-product__copy h3 { margin: 0; font-size: 1rem; line-height: 1.4; }
.aipf-product__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--aipf-muted); font-size: .8rem; }
.aipf-product__price { color: var(--aipf-ink); font-weight: 750; }
.aipf-empty { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--aipf-line); border-radius: var(--aipf-radius); color: var(--aipf-muted); text-align: center; }

/* Generic content and WooCommerce */
.site-main--content { padding-block: 64px 90px; }
.entry-header, .entry-content, .comments-area, .woocommerce { width: min(100%, 920px); margin-inline: auto; }
.entry-title { margin-top: 0; font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.05em; line-height: 1.05; }
.entry-content > * { max-width: 100%; }
.entry-content a { color: var(--aipf-violet); }
.post-card { padding: 24px 0; border-bottom: 1px solid var(--aipf-line); }
.post-card h2 { margin: 0 0 8px; }
.post-card h2 a { text-decoration: none; }
.woocommerce ul.products li.product { overflow: hidden; border: 1px solid var(--aipf-line); border-radius: 18px; background: var(--aipf-surface); padding-bottom: 18px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title, .woocommerce ul.products li.product .price, .woocommerce ul.products li.product .button { margin-left: 16px; margin-right: 16px; }
.woocommerce div.product div.images img { border-radius: 20px; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--aipf-violet); background: var(--aipf-surface); }

/* Footer */
.site-footer { border-top: 1px solid var(--aipf-line); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 26px 34px; color: var(--aipf-muted); font-size: .8rem; }

@media (max-width: 900px) {
  .aipf-hero { grid-template-columns: 1fr; padding-block: 62px; }
  .aipf-hero-art { min-height: 430px; }
  .aipf-flow, .aipf-product-grid { grid-template-columns: 1fr; }
  .aipf-section-head { align-items: start; flex-direction: column; }
}
@media (max-width: 680px) {
  .aipf-shell { width: min(calc(100% - 40px), var(--aipf-width)); }
  .site-header__inner { min-height: 68px; }
  .site-navigation ul { display: none; }
  .aipf-hero h1 { font-size: clamp(2.75rem, 15vw, 4.2rem); }
  .aipf-hero-art { min-height: 370px; }
  .aipf-bear { font-size: 9.5rem; }
  .site-footer__inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

