/* ---------- Pulsanti "cartello" ----------
   Blocco scuro con una testa-freccia verde; al passaggio il verde riempie tutto il pulsante. */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: .8rem 4.3rem .8rem 1.4rem;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font: 700 1.12rem/1 var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .3s var(--ease), transform .2s var(--ease);
}
.btn::before {
  content: "";
  position: absolute; z-index: -1; top: 0; right: 0; bottom: 0;
  width: 3.2rem;
  background: var(--lime);
  transition: width .45s var(--ease);
}
.btn::after {
  content: "";
  position: absolute; right: 1.2rem; top: 50%;
  width: .62rem; height: .62rem;
  border-top: 3px solid var(--on-lime);
  border-right: 3px solid var(--on-lime);
  transform: translateY(-50%) rotate(45deg);
  transition: right .35s var(--ease);
}
.btn:hover { color: var(--on-lime); }
.btn:hover::before { width: 100%; }
.btn:hover::after { right: 1.5rem; }
.btn:active { transform: translateY(2px); }
.btn i { display: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover::before { width: 3.2rem; }
.btn:disabled:hover { color: var(--bg); }

.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--ghost:disabled:hover { color: var(--ink); }
.btn--light { background: #fff; color: #282d31; }
.btn--outline-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: var(--s-3); }

/* ---------- Foto "cartolina" ----------
   Bordo bianco e ombra; se la foto non carica resta il fondo tonale. */
.media {
  position: relative;
  overflow: hidden;
  border: 6px solid var(--surface);
  box-shadow: var(--shadow);
  background: linear-gradient(160deg, var(--tint), var(--lime));
  aspect-ratio: var(--ratio, 4 / 3);
  transition: transform .5s var(--ease);
}
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
a:hover > .media, .card:hover .media { transform: rotate(-.7deg) translateY(-5px); }
a:hover .media img { transform: scale(1.05); }

/* ---------- Card / tile ---------- */
.card { display: block; color: inherit; text-decoration: none; }
.card:hover { color: inherit; }
.card h3 { margin-top: var(--s-2); margin-bottom: .35rem; }
.card p { color: var(--muted); font-size: .98rem; margin-bottom: 0; }
.card__meta { font: 700 1rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--lime-deep); margin-bottom: .2rem; }

/* Tile: foto a tutta area con un cartello segnaletico appoggiato in basso */
.tile {
  position: relative;
  display: block;
  min-height: 340px;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  isolation: isolate;
  background: linear-gradient(160deg, var(--tint), var(--lime));
}
.tile:hover { color: var(--ink); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform 1.2s var(--ease); }
.tile:hover img { transform: scale(1.05); }
.tile__body {
  position: absolute; left: 0; bottom: 0;
  margin: 1.1rem;
  max-width: min(30rem, calc(100% - 2.2rem));
  padding: 1.1rem 1.4rem 1.2rem;
  background: var(--surface);
  border-left: 9px solid var(--lime);
  box-shadow: var(--shadow);
  transition: transform .45s var(--ease), border-color .25s;
}
.tile:hover .tile__body { transform: translateY(-6px); border-left-color: var(--b-orange); }
.tile h3 { margin-bottom: .3rem; font-size: clamp(1.6rem, 2.6vw, 2.5rem); }
.tile p { color: var(--muted); margin: 0; font-size: .98rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 700 1.1rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--ink);
  border-bottom: 3px solid var(--lime); padding-bottom: 2px;
  transition: border-color .25s, gap .3s var(--ease);
}
.link-arrow:hover { border-color: var(--b-orange); gap: .9rem; color: var(--ink); }

/* ---------- Breadcrumb e intestazione pagina interna ---------- */
.page-head { position: relative; padding-block: var(--s-5) var(--s-4); border-bottom: 1px solid var(--line); }
.page-head::before { content: ""; display: block; width: 64px; height: 14px; margin: 0 0 var(--s-2) max(1.25rem, calc((100% - 1280px) / 2));
  background: var(--bande-inclinate); }
.page-head--image {
  min-height: clamp(300px, 46vh, 500px);
  display: flex; align-items: flex-end;
  color: #fff;
  border: 0; border-bottom: 10px solid var(--lime);
  isolation: isolate;
  background: linear-gradient(160deg, #2b3a1a, var(--lime));
}
.page-head--image::before { display: none; }
.page-head--image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-head--image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgb(12 16 8 / .85), rgb(12 16 8 / .15) 70%); }
.page-head--image h1, .page-head--image p, .page-head--image .crumbs, .page-head--image .crumbs a { color: #fff; }
.page-head p { color: var(--muted); font-size: 1.2rem; margin: 0; }
.page-head--image p { color: rgb(255 255 255 / .94); }
.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 var(--s-2); padding: 0; font: 700 1rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.crumbs li + li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .5rem; border-top: 2px solid var(--b-orange); border-right: 2px solid var(--b-orange); transform: rotate(45deg); vertical-align: 1px; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-decoration-color: var(--b-orange); }

/* ---------- Prosa ---------- */
.prose { max-width: 70ch; }
.prose p { font-size: 1.13rem; }
.prose h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); margin-top: var(--s-4); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

/* ---------- Form ---------- */
.field { display: grid; gap: .4rem; }
.field label { font: 700 1.05rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.field__help { color: var(--muted); font-size: .9rem; }
.field__error { color: #b3261e; font-size: .95rem; font-weight: 700; }
[data-theme="dark"] .field__error { color: #ff8a80; }
.input, .select {
  width: 100%; min-height: 50px; padding: .6rem .9rem;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 0;
  font: 400 1.05rem var(--font-body);
}
.input::placeholder { color: var(--muted); }
.input:focus-visible, .select:focus-visible { outline: 3px solid var(--lime); outline-offset: 0; box-shadow: none; }
.input[aria-invalid="true"] { border-color: #b3261e; }

/* ---------- Tag ---------- */
.tag {
  display: inline-block; padding: .2rem .7rem;
  background: var(--tint); color: var(--ink);
  font: 700 1rem/1.25 var(--font-display); letter-spacing: .06em; text-transform: uppercase;
  border-left: 5px solid var(--vc, var(--lime));
}
.tag--valle { background: var(--vc, var(--lime)); color: var(--vc-ink, var(--on-lime)); border-left: 0; }
.tag--accent { background: var(--vc, var(--lime)); color: var(--vc-ink, var(--on-lime)); border-left: 0; }

/* ---------- Tab per valle ---------- */
.tabs { display: inline-flex; gap: 0; margin-bottom: var(--s-3); border-bottom: 4px solid var(--ink); }
.tabs button {
  min-height: 50px; padding: 0 1.6rem; border: 0; background: transparent; color: var(--ink);
  font: 700 1.2rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  transition: background-color .25s, color .25s;
}
.tabs button:hover { background: var(--tint); }
.tabs button[aria-selected="true"] { background: var(--vc, var(--lime)); color: var(--vc-ink, var(--on-lime)); }

/* ---------- Download ---------- */
.downloads { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: .6rem; }
.downloads a {
  display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem;
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700;
  border: 1px solid var(--line); border-left: 8px solid var(--lime);
  transition: transform .3s var(--ease), border-left-color .25s;
}
.downloads a:hover { transform: translateX(6px); border-left-color: var(--b-orange); color: var(--ink); }
.downloads i { font-size: 1.5rem; color: var(--lime-deep); }
.downloads small { margin-left: auto; color: var(--muted); font-weight: 700; }

/* ---------- Stato vuoto ---------- */
.empty { padding: var(--s-5) var(--s-3); text-align: center; border: 2px dashed var(--ink); background: var(--surface); }
.empty h3 { color: var(--ink); }
.empty p { margin-inline: auto; color: var(--muted); }

.grid-auto { display: grid; gap: var(--s-4) var(--s-3); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
