/* Gatti Bonsai 2026 — remake responsive del sito 2001. Testi originali, layout nuovo. */
:root {
  --bg: #ffffff;  /* bianco: sfondo.jpg ha il fondo bianco */
  --surface: #fdfbfd;
  --ink: #1d1a1f;
  --muted: #5d5662;
  --line: #e7e0e8;
  --mag: #ff00ff;
  --mag-ink: #b0009f;          /* magenta leggibile su chiaro */
  --bar: #000000;
  --bar-ink: #ff00ff;
  --red: #d40000;
  --cat-1: #e3f7e3;            /* #ccffcc del 2001, addolcito */
  --cat-2: #fdf8d8;            /* #ffffcc */
  --cat-3: #fbe3e3;            /* #ffcccc */
  --banner-bg: #ffffcc;
  --banner-ink: #000;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 24px rgb(40 0 40 / .07);
  --mono: "Lucida Console", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121014;
    --surface: #1c1920;
    --ink: #ece6ee;
    --muted: #a69dab;
    --line: #2e2934;
    --mag-ink: #ff6bff;
    --red: #ff5a5a;
    --cat-1: #16261a;
    --cat-2: #28260f;
    --cat-3: #2c1616;
    --banner-bg: #2b2a12;
    --banner-ink: #f3efc0;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 24px rgb(0 0 0 / .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4rem; }
body {
  margin: 0;
  background: var(--bg) url(../sfondo.jpg) no-repeat right bottom fixed;
  background-size: auto min(70vh, 640px);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
@media (prefers-color-scheme: dark) { body { background-image: none; } }
img { max-width: 100%; height: auto; }
a { color: var(--mag-ink); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--mag); outline-offset: 2px; border-radius: 4px; }

/* ---------- masthead ---------- */
.masthead {
  background: var(--bar);
  color: var(--bar-ink);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 16px .9rem;
  text-align: center;
}
.masthead .kitten { width: 144px; justify-self: center; border-radius: 8px; opacity: .95; }
.masthead .brand { display: grid; justify-items: center; gap: .55rem; }
.masthead .brand img { width: 179px; image-rendering: auto; }
.masthead .tagline { margin: 0; font: italic 1.05rem/1.3 var(--serif); color: var(--bar-ink); letter-spacing: .01em; }
@media (max-width: 720px) {
  .masthead { grid-template-columns: 1fr; padding: 1.1rem 16px 1rem; }
  .masthead .kitten { display: none; }
}

/* ---------- sticky nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: rgb(0 0 0 / .92);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid #ff00ff55;
}
.topnav .inner {
  max-width: 72rem; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: center; min-height: 3.25rem;
}
.topnav .mini { display: none; }
.topnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; justify-content: center; }
.topnav a {
  display: block; padding: .45rem .85rem; border-radius: 999px;
  font: 700 .98rem/1.2 var(--mono); color: var(--mag); text-decoration: none;
}
.topnav a:hover { background: #ff00ff22; }
.topnav a[aria-current="page"] { background: var(--mag); color: #000; }
.burger { display: none; }
.topnav .lang { margin-left: .5rem; }
.topnav .lang a { border: 1px solid var(--mag); font-weight: 400; }
@media (max-width: 640px) { .topnav .lang { margin-left: 0; } .topnav .lang a { border-style: dashed; } }

@media (max-width: 640px) {
  .topnav .inner { justify-content: space-between; flex-wrap: wrap; min-height: 3rem; }
  .topnav .mini { display: block; line-height: 0; }
  .topnav .mini img { height: 26px; width: auto; }
  .burger {
    display: inline-grid; place-content: center; gap: 5px;
    width: 44px; height: 44px; margin-right: -8px;
    background: none; border: 0; border-radius: 10px; cursor: pointer;
  }
  .burger span { display: block; width: 22px; height: 2px; background: var(--mag); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .js .topnav ul { display: none; }
  .topnav ul { flex-direction: column; width: 100%; padding: .25rem 0 .75rem; gap: .15rem; }
  .js .topnav.open ul { display: flex; }
  .topnav a { padding: .7rem .9rem; border-radius: 10px; font-size: 1.05rem; }
}

/* ---------- content ---------- */
main { flex: 1; width: 100%; max-width: 46rem; margin: 0 auto; padding: 2.25rem 16px 1rem; }
main.wide { max-width: 72rem; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: .2em 0 .4em; text-align: center; }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin: 1.8em 0 .6em; }
main > h2:first-child, .card > h2:first-child { margin-top: 0; }
p { margin: 0 0 1.1em; }
.lead { font-size: 1.15rem; }
.center { text-align: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  margin: 0 0 1.75rem;
}

/* home: sezione con bonsai a lato */
.split { display: grid; gap: 1.25rem; align-items: start; }
.split .deco {
  width: 140px; justify-self: center;
  background: #fff; border-radius: 12px; padding: .5rem;
}
@media (min-width: 760px) {
  .split { grid-template-columns: 1fr 150px; gap: 2rem; }
  .split .deco { order: 2; position: sticky; top: 5rem; }
}

/* metodo: lista dei tre requisiti */
ol.req { list-style: none; counter-reset: req; padding: 0; margin: 1.25rem 0 1.5rem; display: grid; gap: 1rem; }
ol.req li {
  counter-increment: req; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.1rem 4rem; box-shadow: var(--shadow);
}
ol.req li::before {
  content: counter(req); position: absolute; left: 1.1rem; top: 1rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-content: center;
  background: var(--bar); color: var(--mag); font: 700 1rem var(--mono);
}

/* news */
.news { overflow: hidden; padding: 0; }
.news header {
  background: var(--bar); color: var(--mag);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem;
  padding: .8rem 1.25rem; font-family: var(--mono);
}
.news header p { margin: 0; }
.news header .title { font-weight: 700; }
.news .body { padding: 1.25rem 1.25rem .25rem; }
.news footer { background: var(--bar); padding: .7rem 1.25rem; text-align: center; font-family: var(--mono); }
.news footer p { margin: 0; }
.news footer a { color: var(--mag); }

/* galleria */
figure { margin: 1.5rem 0; }
figure img { display: block; margin: 0 auto; border-radius: 10px; box-shadow: var(--shadow); }
figcaption { text-align: center; color: var(--muted); font-style: italic; margin-top: .75rem; }

/* store */
.cols { display: grid; gap: 1rem; margin: 1.5rem 0; }
@media (min-width: 640px) { .cols { grid-template-columns: 1fr 1fr; } }
.cols .card { margin: 0; }
.cols h3 { margin: 0 0 .5rem; font-size: 1.3rem; }
.cols ul { margin: 0; padding-left: 1.2rem; }
.blink { text-align: center; color: var(--mag-ink); animation: blink 1.1s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .blink { animation: none; } }
.supply { list-style: none; padding: 0; display: grid; gap: .6rem; }
.supply a {
  display: block; padding: .9rem 1.1rem; border-radius: 12px; text-decoration: none; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.supply a::after { content: " \2192"; }

/* catalogo (cont/acc) */
.catalog { margin: 2.25rem 0; padding: clamp(1rem, 3vw, 1.75rem); border-radius: calc(var(--radius) + 6px); }
.catalog.c1 { background: var(--cat-1); }
.catalog.c2 { background: var(--cat-2); }
.catalog.c3 { background: var(--cat-3); }
.catalog .head {
  display: grid; grid-template-areas: "t t" "c h"; grid-template-columns: auto 1fr;
  align-items: baseline; gap: .1rem 1rem; margin-bottom: 1rem;
}
.catalog .head h2 { grid-area: t; margin: 0; }
.catalog .head .codlabel { grid-area: c; font: 700 .8rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.catalog .head .hint { grid-area: h; justify-self: end; font-style: italic; color: var(--muted); font-size: .95rem; text-align: right; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.item {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.item .pics { display: flex; gap: 2px; background: #fff; }
.item .pics a { flex: 1; display: grid; place-items: center; height: 190px; padding: .75rem; cursor: zoom-in; }
.item .pics img { max-height: 166px; width: auto; object-fit: contain; transition: transform .25s; }
.item .pics a:hover img { transform: scale(1.04); }
.item .txt { padding: .9rem 1.1rem 1.1rem; }
.item .code { margin: 0 0 .35rem; font: 700 .85rem var(--mono); color: var(--muted); }
.item .code .flag { color: var(--red); margin-left: .35rem; }
.item .code .flag:first-child { margin-left: 0; }
.item .desc { margin: 0; line-height: 1.5; }
.back { text-align: center; margin: 2rem 0 1rem; }

/* storia */
.storia main { display: grid; place-content: center; text-align: center; min-height: 50vh; }
.storia .big { font: 700 clamp(1.5rem, 5vw, 2.4rem)/1.25 var(--serif); margin: 0 0 1rem; text-wrap: balance; }
.storia .url { font: 700 clamp(1.4rem, 6vw, 3rem)/1.2 var(--serif); margin: 0; word-break: break-word; }
.storia .alert { color: var(--red); font-weight: 700; }
.storia .alert .t { font-size: 1.5rem; display: block; }
.storia .stamp {
  display: inline-block; border: 4px double var(--red); color: var(--red);
  padding: 1.25rem 1.75rem; border-radius: 10px; transform: rotate(-2deg);
}

/* ---------- footer ---------- */
.disclaimer { max-width: 46rem; margin: 1rem auto 0; padding: 0 16px 1.25rem; text-align: center; font-size: .78rem; font-style: italic; color: var(--muted); }
.bufala {
  background: var(--banner-bg); color: var(--banner-ink);
  border-top: 1px solid #9995;
  padding: .7rem 16px; text-align: center; font: .78rem/1.6 var(--sans);
}
.bufala a { color: inherit; }

/* ---------- lightbox ---------- */
dialog.lb {
  border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible;
}
dialog.lb::backdrop { background: rgb(0 0 0 / .82); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.lb img {
  display: block; width: min(90vw, 576px); max-height: 86vh; object-fit: contain;
  background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgb(0 0 0 / .5);
}
dialog.lb button {
  position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #000; background: var(--mag); cursor: pointer;
}
dialog.lb button::before, dialog.lb button::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 17px; height: 3px; background: #000; border-radius: 2px;
}
dialog.lb button::before { transform: rotate(45deg); }
dialog.lb button::after { transform: rotate(-45deg); }

/* ---------- keep browsing (fine pagina) ---------- */
.more {
  display: grid; gap: .75rem; width: 100%; max-width: 46rem; margin: 3rem auto 1.5rem;
  padding-top: 1.5rem; border-top: 1px dashed var(--line); text-align: left;
}
.more a { text-decoration: none; -webkit-tap-highlight-color: transparent; }
.more .next {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .1rem 1rem;
  min-height: 4.5rem; padding: 1rem 1.25rem; border-radius: var(--radius);
  background: var(--bar); color: var(--mag); border: 1px solid var(--mag);
  box-shadow: var(--shadow); font: 700 1.25rem/1.25 var(--mono);
}
.more .next .k { grid-column: 1; font: 400 .8rem/1.2 var(--mono); color: #c9c9c9; text-transform: uppercase; letter-spacing: .08em; }
.more .next .t { grid-column: 1; }
.more .next .arrow { grid-column: 2; grid-row: 1 / span 2; font-size: 1.8rem; transition: transform .2s; }
.more .next:hover .arrow, .more .next:focus-visible .arrow { transform: translateX(4px); }
.more .prev {
  justify-self: start; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
  padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font: 700 .95rem/1.2 var(--mono);
}
.more .sections {
  list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
}
.more .sections a {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: .5rem .75rem;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  font: 700 .95rem/1.2 var(--mono); text-align: center;
}
.more .sections a:hover, .more .prev:hover { border-color: var(--mag-ink); }
.storia .more { text-align: left; }
