/* =========================================================
   BearStar Graphics — foglio di stile unico
   Palette: verde oliva, crema, salvia (dal sito originale)
   ========================================================= */

@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-italic.woff2") format("woff2");
  font-weight: 400 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap;
}

:root {
  --olive: #4f6132;
  --olive-dark: #3a4824;
  --olive-ink: #2a3419;
  --sage: #cdcfa8;
  --sage-soft: #dfe0c4;
  --cream: #e9e1d1;
  --paper: #f5f0e6;
  --white: #fffdf8;
  --ink: #23281b;
  --muted: #5d6450;
  --line: rgba(79, 97, 50, .22);

  --display: "Playfair Display", "Didot", "Bodoni MT", Georgia, serif;
  --text: "Source Serif 4", "Iowan Old Style", Georgia, serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 40, 27, .08), 0 12px 32px -12px rgba(35, 40, 27, .28);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 112px;   /* altezza header: il logo (200 px di larghezza = 98 px di altezza) ci sta dentro */
  --logo-w: 200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--olive); text-underline-offset: 3px; }
a:hover { color: var(--olive-dark); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; color: var(--olive-ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.4rem; }
h1 em, h2 em { color: var(--olive); font-style: italic; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font: 600 .78rem/1 var(--text); letter-spacing: .22em; text-transform: uppercase;
  color: var(--olive); margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head.center .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; }
.section-head.center .lead { margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--white); padding: 8px 14px; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.6em; border-radius: 999px; border: 1.5px solid var(--olive);
  font: 600 .82rem/1 var(--text); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, transform .2s;
  background: var(--olive); color: var(--white);
}
.btn:hover { background: var(--olive-dark); border-color: var(--olive-dark); color: var(--white); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--olive); }
.btn-ghost:hover { background: var(--olive); color: var(--white); }
.btn-light { background: var(--cream); border-color: var(--cream); color: var(--olive-ink); }
.btn-light:hover { background: var(--white); border-color: var(--white); color: var(--olive-ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 240, 230, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--header-h); }
.brand { display: block; line-height: 0; }
.brand img { width: var(--logo-w); height: auto; }
@media (max-width: 1020px) { :root { --header-h: 88px; --logo-w: 150px; } }
.nav { display: flex; align-items: center; gap: 28px; }
.nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.nav ul a { color: var(--ink); text-decoration: none; font-size: .98rem; position: relative; white-space: nowrap; }
.nav ul a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--olive); transform: scaleX(0); transition: transform .25s; }
.nav ul a:hover::after, .nav ul a[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn { padding: .7em 1.2em; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; font: 600 .74rem/1 var(--text); letter-spacing: .1em; }
.lang a { padding: 6px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang a[aria-current="true"] { background: var(--olive); color: var(--white); }

.menu-toggle { display: none; }
.menu-btn { display: none; }

@media (max-width: 1020px) {
  .menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; cursor: pointer; padding: 10px; border-radius: 10px;
  }
  .menu-btn span { height: 2px; background: var(--olive-ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 18px;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 20px var(--gutter) 28px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav ul { flex-direction: column; gap: 0; }
  .nav ul a { display: block; padding: 12px 0; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
  .nav ul a::after { display: none; }
  .menu-toggle:checked ~ .nav { opacity: 1; transform: none; visibility: visible; }
  .menu-toggle:checked ~ .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle:checked ~ .menu-btn span:nth-child(2) { opacity: 0; }
  .menu-toggle:checked ~ .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .lang { align-self: flex-start; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 110px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(24px, 5vw, 64px); }
.hero h1 { margin-bottom: .35em; }
.hero .lead { margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2.2rem; padding: 0; list-style: none; }
.hero-tags li { font-size: .85rem; padding: .35em .9em; border-radius: 999px; background: var(--sage-soft); color: var(--olive-ink); }
.hero-art { position: relative; }
.hero-art::before {
  content: ""; position: absolute; inset: 6% 2% 0 8%; border-radius: 48% 52% 44% 56% / 52% 44% 56% 48%;
  background: var(--cream); z-index: -1;
}
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; margin-inline: auto; order: -1; }
}

/* ---------- Portfolio ---------- */
.portfolio { background: var(--white); border-block: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: clamp(28px, 4vw, 44px); }
.filters input { position: absolute; opacity: 0; pointer-events: none; }
.filters label {
  display: inline-flex; align-items: center; gap: .6em; cursor: pointer;
  padding: .45em 1.1em .45em .5em; border-radius: 999px; border: 1px solid var(--line);
  font-size: .95rem; background: var(--paper); transition: background .2s, color .2s, border-color .2s;
  user-select: none;
}
.filters label.all { padding-left: 1.1em; }
.filters label img { width: 34px; height: 34px; border-radius: 50%; background: var(--sage); }
.filters label .count { font-size: .78rem; color: var(--muted); }
.filters label:hover { border-color: var(--olive); }
.filters input:focus-visible + label { outline: 2px solid var(--olive); outline-offset: 2px; }
.filters input:checked + label { background: var(--olive); border-color: var(--olive); color: var(--white); }
.filters input:checked + label .count { color: var(--sage); }

.covers { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.5vw, 32px); list-style: none; margin: 0; padding: 0; }
@media (max-width: 960px) { .covers { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .covers { grid-template-columns: repeat(2, 1fr); } }
/* le regole che nascondono le cover filtrate sono generate in ogni pagina da build.py */
.cover > a { display: block; text-decoration: none; color: inherit; }
.cover figure { margin: 0; }
.cover .frame { position: relative; aspect-ratio: 5 / 8; border-radius: 4px 8px 8px 4px; overflow: hidden; box-shadow: var(--shadow); background: var(--cream); transition: transform .35s, box-shadow .35s; }
.cover .frame::after { /* dorso del libro */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 7%;
  background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.12) 40%, transparent);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover:hover .frame { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 2px 4px rgba(35,40,27,.1), 0 22px 40px -14px rgba(35,40,27,.45); }
.cover figcaption { padding-top: 14px; }
.cover .title { font-family: var(--display); font-size: 1.1rem; line-height: 1.25; color: var(--olive-ink); }
.cover .meta { font-size: .85rem; color: var(--muted); }
.portfolio-note { text-align: center; margin-top: 40px; color: var(--muted); font-style: italic; }

/* ---------- Servizi ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 820px) { .services-grid { grid-template-columns: 1fr; } }
.service {
  background: var(--olive); color: var(--cream); border-radius: var(--radius); padding: 32px 28px 30px;
  position: relative; overflow: hidden;
}
.service img { width: 64px; margin-bottom: 18px; }
.service h3 { color: var(--white); }
.service p { margin: 0; color: var(--sage); }
.service .num { position: absolute; top: 18px; right: 22px; font: italic 500 2.6rem/1 var(--display); color: rgba(233,225,209,.18); }

/* ---------- Processo ---------- */
.process { background: var(--cream); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; list-style: none; padding: 0; margin: 0; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); row-gap: 36px; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { position: relative; padding: 0 24px 0 0; counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero); display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--olive); background: var(--paper);
  font: italic 500 1.2rem/1 var(--display); color: var(--olive); margin-bottom: 18px; position: relative; z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 27px; left: 54px; right: 0; height: 1px; background: var(--line); }
.steps li:last-child::after { display: none; }
@media (max-width: 900px) { .steps li::after { display: none; } }
.steps h3 { font-size: 1.2rem; }
.steps p { color: var(--muted); font-size: .98rem; margin: 0; }

/* ---------- Perché noi + teaser prezzi ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 820px) { .why-grid { grid-template-columns: 1fr; } }
.why .icon { font-size: 1.6rem; color: var(--olive); line-height: 1; margin-bottom: 14px; display: block; }
.why p { color: var(--muted); margin: 0; }

.teaser {
  margin-top: clamp(48px, 7vw, 80px); background: var(--olive-ink); color: var(--cream); border-radius: calc(var(--radius) * 1.5);
  padding: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center;
  position: relative; overflow: hidden;
}
.teaser::after { content: "✦"; position: absolute; right: -10px; bottom: -60px; font-size: 14rem; color: rgba(205,207,168,.07); line-height: 1; }
.teaser h2 { color: var(--white); margin-bottom: .3em; }
.teaser p { color: var(--sage); margin: 0; }
.teaser .price-from { text-align: right; position: relative; z-index: 1; }
.teaser .price-from small { display: block; letter-spacing: .2em; text-transform: uppercase; font-size: .75rem; color: var(--sage); }
.teaser .price-from strong { display: block; font: 500 3.6rem/1.1 var(--display); color: var(--white); margin-bottom: 16px; }
@media (max-width: 720px) { .teaser { grid-template-columns: 1fr; } .teaser .price-from { text-align: left; } }

/* ---------- Chi siamo ---------- */
.about { background: var(--white); border-top: 1px solid var(--line); }
.about .wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-photo { position: relative; }
.about-photo img { border-radius: 50% 50% var(--radius) var(--radius); box-shadow: var(--shadow); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.about-photo .badge {
  position: absolute; right: -14px; bottom: 28px; background: var(--olive); color: var(--cream);
  padding: 14px 18px; border-radius: 12px; font: italic 500 1.05rem/1.25 var(--display); box-shadow: var(--shadow);
}
.about .names { font-family: var(--display); font-size: 1.25rem; color: var(--olive); font-style: italic; }
@media (max-width: 820px) { .about .wrap { grid-template-columns: 1fr; } .about-photo { max-width: 420px; } .about-photo .badge { right: 8px; } }

/* ---------- Contatti ---------- */
.contact { background: var(--olive); color: var(--cream); }
.contact .wrap { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 6vw, 80px); }
.contact h2 { color: var(--white); }
.contact h2 em { color: var(--sage); }
.contact .eyebrow { color: var(--sage); }
.contact .lead { color: var(--sage); }
.contact-info { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 14px; }
.contact-info li { display: flex; gap: 12px; align-items: baseline; }
.contact-info span { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sage); min-width: 84px; }
.contact-info a { color: var(--white); }
.form { background: var(--paper); color: var(--ink); border-radius: calc(var(--radius) * 1.3); padding: clamp(24px, 4vw, 40px); display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } .contact .wrap { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .contact .wrap { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  padding: .75em .9em; width: 100%; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(79,97,50,.18); }
.form .privacy { font-size: .85rem; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.form .privacy input { margin-top: .35em; accent-color: var(--olive); }
.form .hp { position: absolute; left: -9999px; }
.form .btn { justify-self: start; }
.form-status { display: none; padding: 14px 16px; border-radius: 10px; font-size: .95rem; }
.form-status.ok { background: var(--sage-soft); color: var(--olive-ink); }
.form-status.err { background: #f3d9d6; color: #7a1f1f; }
.form-status.ok:target, .form-status.err:target { display: block; }
.form-status.show { display: block; }
.form .btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- Footer ---------- */
.site-footer { background: var(--olive-ink); color: var(--sage); padding-block: 48px 32px; font-size: .92rem; }
.site-footer .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; align-items: flex-start; }
.site-footer img { width: 160px; }
.site-footer .tagline { font: italic 1.1rem/1.4 var(--display); color: var(--cream); margin-top: 12px; max-width: 30ch; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer .bottom { border-top: 1px solid rgba(205,207,168,.2); margin-top: 36px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .82rem; }

/* ---------- Pagina prezzi ---------- */
.page-hero { padding-block: clamp(48px, 7vw, 96px) clamp(32px, 4vw, 48px); text-align: center; }
.page-hero .lead { margin-inline: auto; }
.page-hero .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; padding-bottom: clamp(56px, 8vw, 96px); }
@media (max-width: 940px) { .plans { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }
.plan {
  background: var(--white); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.3);
  padding: 34px 30px; display: flex; flex-direction: column; position: relative;
}
.plan h2 { font-size: 1rem; font-family: var(--text); font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--olive); margin-bottom: 16px; }
.plan .price { font: 500 3.6rem/1 var(--display); color: var(--olive-ink); display: flex; align-items: flex-start; gap: 4px; }
.plan .price sup { font-size: 1.4rem; margin-top: .4em; }
.plan .net { font-size: .85rem; color: var(--muted); margin: 8px 0 22px; }
.plan .desc { color: var(--muted); font-size: .98rem; min-height: 3.2em; }
.plan .inherits { font-style: italic; font-size: .95rem; color: var(--olive); margin: 6px 0 10px; }
.plan ul { list-style: none; margin: 0 0 28px; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 11px; flex: 1; align-content: start; }
.plan li { padding-left: 28px; position: relative; font-size: .98rem; line-height: 1.45; }
.plan li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 17px; height: 17px; border-radius: 50%;
  background: var(--sage-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%234f6132' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.plan li small { display: block; color: var(--muted); font-size: .82rem; }
.plan .btn { width: 100%; }
.plan.featured { background: var(--olive); border-color: var(--olive); color: var(--cream); box-shadow: var(--shadow); transform: translateY(-10px); }
@media (max-width: 940px) { .plan.featured { transform: none; } }
.plan.featured h2, .plan.featured .inherits { color: var(--sage); }
.plan.featured .price { color: var(--white); }
.plan.featured .net, .plan.featured .desc, .plan.featured li small { color: var(--sage); }
.plan.featured ul { border-color: rgba(205,207,168,.3); }
.plan.featured li::before { background-color: var(--sage); }
.plan .ribbon {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--cream); color: var(--olive-ink); font: 700 .7rem/1 var(--text); letter-spacing: .2em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow);
}

.extras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 820px) { .extras { grid-template-columns: 1fr; } }
.extra { background: var(--paper); border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); }
.extra h3 { font-size: 1.15rem; }
.extra p { margin: 0; color: var(--muted); }
.extra .big { font: 500 2rem/1 var(--display); color: var(--olive); display: block; margin-bottom: 10px; }

.terms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 48px; }
@media (max-width: 760px) { .terms { grid-template-columns: 1fr; } }
.terms h3 { font-size: 1.15rem; }
.terms p { color: var(--muted); }
.fiscal { margin-top: 40px; padding: 24px 28px; border-left: 3px solid var(--olive); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0; font-size: .95rem; color: var(--muted); }
.fiscal strong { display: block; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--olive); margin-bottom: 8px; }

.cta-band { text-align: center; }
.cta-band .wrap { display: block; }
.cta-band .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; }
.cta-band .lead { margin-inline: auto; margin-bottom: 1.8rem; }

/* ---------- Categorie: slider di riquadri affiancati ---------- */
.categories { background: var(--cream); }
.cat-tiles {
  display: flex; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px 4px 14px; scrollbar-width: none;
}
.cat-tiles::-webkit-scrollbar { display: none; }
/* centrati quando entrano tutti, scorrevoli da sinistra quando non entrano */
.cat-tile:first-child { margin-left: auto; }
.cat-tile:last-child { margin-right: auto; }
.cat-tile {
  flex: 0 0 190px; scroll-snap-align: start;
  display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  border-radius: 6px; background: #afc48b; box-shadow: 0 1px 2px rgba(35,40,27,.1), 0 8px 18px -12px rgba(35,40,27,.45);
  transition: transform .3s, box-shadow .3s;
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(35,40,27,.1), 0 16px 28px -14px rgba(35,40,27,.55); }
.cat-tile-img { display: block; aspect-ratio: 1; overflow: hidden; }
.cat-tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.cat-tile:hover .cat-tile-img img { transform: scale(1.06); }
.cat-tile-label {
  display: grid; gap: 1px; justify-items: center; text-align: center;
  background: var(--olive); color: var(--cream); padding: 9px 8px 10px;
}
.cat-tile-name { font: 500 .72rem/1.25 var(--text); letter-spacing: .2em; text-transform: uppercase; }
.cat-tile-count { font-size: .7rem; color: var(--sage); font-style: italic; }
.cat-tile:hover .cat-tile-label { background: var(--olive-dark); }
.slider-nav { display: none; justify-content: center; gap: 10px; margin-top: 10px; }
.slider.is-scrollable .slider-nav { display: flex; }
.slider-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--olive); background: transparent;
  color: var(--olive); font: 1rem/1 var(--text); cursor: pointer; transition: background .2s, color .2s, opacity .2s;
}
.slider-btn:hover:not(:disabled) { background: var(--olive); color: var(--white); }
.slider-btn:disabled { opacity: .3; cursor: default; }
@media (max-width: 600px) {
  .cat-tiles { gap: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .cat-tile { flex-basis: 150px; }
}

.cat-hero .cat-hero-icon { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: var(--sage); margin: 0 auto 22px; box-shadow: var(--shadow); }
.cat-count { margin-top: .8rem; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--olive); }
.cat-portfolio { padding-top: clamp(40px, 6vw, 72px); }

/* ---------- Passaggio tra pagine senza "lampo" (Chrome, Edge, Safari; altrove pagina normale) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
}

/* ---------- Pagina libro (servita da libro.php) ---------- */
.breadcrumb { border-bottom: 1px solid var(--line); background: var(--white); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding-block: 14px; margin-block: 0; font-size: .88rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--olive); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--olive); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--olive-ink); }

.book-hero { padding-block: clamp(36px, 6vw, 80px); }
.book-hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.book-front { margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
/* le immagini mantengono SEMPRE le proporzioni originali (width 100% + height auto, mai object-fit: fill) */
.book-front img { width: 100%; height: auto; border-radius: 4px 8px 8px 4px; box-shadow: var(--shadow); }
.book-info .eyebrow { text-decoration: none; }
.book-info h1 { margin-bottom: .6em; }
.book-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 2rem; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.book-facts div { background: var(--white); padding: 14px 16px; }
.book-facts dt { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--olive); font-weight: 600; }
.book-facts dd { margin: 4px 0 0; font-family: var(--display); font-size: 1.1rem; color: var(--olive-ink); }
.book-sub { font-size: 1.3rem; margin-top: .4em; }
.book-info p { color: var(--muted); }
.book-info .btn { margin-top: .8rem; }
@media (max-width: 820px) {
  .book-hero .wrap { grid-template-columns: 1fr; }
  .book-front { position: static; max-width: 360px; margin-inline: auto; }
}
@media (max-width: 520px) { .book-facts { grid-template-columns: 1fr; } }

.book-frontback { background: var(--white); border-block: 1px solid var(--line); }
.book-wide { margin: 0; }
.book-wide { display: flex; justify-content: center; }
.book-wide img { width: auto; max-width: 100%; height: auto; max-height: 80vh; border-radius: var(--radius); box-shadow: var(--shadow); }
/* mockup: riquadri tutti uguali in 3:2 (il formato dei mockup generati, 1536×1024); immagine intera dentro (contain), nessuna deformazione */
.mockup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(14px, 2vw, 24px); }
.mockup-grid figure {
  margin: 0; aspect-ratio: 3 / 2; position: relative; overflow: hidden;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
}
.mockup-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mockup-grid .zoom { position: absolute; inset: 0; cursor: zoom-in; }
.mockup-grid .zoom img { transition: transform .4s; }
.mockup-grid .zoom:hover img { transform: scale(1.03); }
.mockup-grid .zoom::after, .book-wide .zoom::after {   /* piccola lente che indica che l'immagine si ingrandisce */
  content: ""; position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,253,248,.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f6132' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center/18px no-repeat;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); opacity: .85; transition: opacity .2s;
}
.mockup-grid .zoom:hover::after, .book-wide .zoom:hover::after { opacity: 1; }
/* full cover cliccabile: stessa lente e stesso ingrandimento dei mockup */
.book-wide .zoom { position: relative; display: block; max-width: 100%; line-height: 0; cursor: zoom-in; border-radius: var(--radius); }
.book-wide .zoom img { transition: transform .4s, box-shadow .4s; }
.book-wide .zoom:hover img { transform: scale(1.01); }
.book-wide .zoom::after { right: 16px; bottom: 16px; }

/* ---------- Finestra modale (mockup ingranditi) ---------- */
.lightbox {
  padding: 0; border: 0; background: transparent; overflow: visible;
  max-width: 94vw; max-height: 94vh;
}
.lightbox::backdrop { background: rgba(26, 31, 18, .68); }   /* overlay scuro al 68% */
.lightbox img { display: block; max-width: 94vw; max-height: 88vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.lightbox-close {
  position: absolute; top: -18px; right: -18px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--white); color: var(--olive-ink); font: 400 1.8rem/1 var(--text); cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); transition: background .2s, color .2s;
}
.lightbox-close:hover { background: var(--olive); color: var(--white); }
@media (max-width: 600px) { .lightbox-close { top: -54px; right: 0; } }
html:has(.lightbox[open]) { overflow: hidden; }   /* la pagina sotto non scorre */
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lb-in .25s ease-out; }
  .lightbox[open]::backdrop { animation: lb-fade .25s ease-out; }
}
@keyframes lb-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.book-pager { border-block: 1px solid var(--line); background: var(--cream); }
.book-pager .wrap { display: grid; grid-template-columns: 1fr 1fr; }
.book-pager a { display: grid; gap: 4px; padding: 26px 0; text-decoration: none; color: var(--ink); }
.book-pager a span { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--olive); }
.book-pager a strong { font: 500 1.25rem/1.25 var(--display); color: var(--olive-ink); }
.book-pager a:hover strong { color: var(--olive); }
.book-pager .pager-next { text-align: right; border-left: 1px solid var(--line); padding-left: 20px; }

/* ---------- Pagina Chi siamo ---------- */
.about .hero-cta { margin-top: .4rem; }
.story { background: var(--white); border-block: 1px solid var(--line); }
.story-text { max-width: 68ch; columns: 2 320px; column-gap: 48px; color: var(--muted); }
.story-text p { break-inside: avoid; }
.team { background: var(--cream); }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 48px); max-width: 920px; margin-inline: auto; }
@media (max-width: 640px) { .team-grid { grid-template-columns: 1fr; } }
.person { background: var(--paper); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.3); padding: 30px 28px 32px; text-align: center; }
.person img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; }
.person h3 { margin-bottom: .2em; }
.person .role { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--olive); margin-bottom: .9em; }
.person p:last-child { color: var(--muted); margin: 0; }
