:root {
  --bg: #000;
  --fg: #e32636;
  --line: #e32636;
  --line-width: 1px;
  --header-height: 19vh;
  --footer-height: 11vh;
  --menu-width: clamp(220px, 27vw, 360px);
  --gutter: 14px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Arial, Helvetica, sans-serif;
}

body { overflow: hidden; }
button, a { color: inherit; font: inherit; }

.site {
  position: relative;
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr) var(--footer-height);
  width: 100%;
  height: 100dvh;
  padding: var(--gutter);
  gap: var(--gutter);
  background: var(--bg);
}

.header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: var(--line-width) solid var(--line);
  padding: 12px 64px 12px 12px;
}

.signature {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Segnaposto da rimuovere quando inserisci il file SVG */
.signature-placeholder {
  font-family: Georgia, serif;
  font-size: clamp(2rem, 7vw, 5rem);
  font-style: italic;
  line-height: 1;
  text-align: center;
}

.menu-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 54px;
  height: 100%;
  border: 0;
  border-left: var(--line-width) solid var(--line);
  background: var(--bg);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.menu-toggle:hover,
.menu-toggle:focus-visible,
.menu-link:hover,
.menu-link:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.menu-icon {
  width: 20px;
  display: grid;
  gap: 5px;
}

.menu-icon span {
  display: block;
  height: 1px;
  background: currentColor;
  width: 100%;
}

.main {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: flex;
  border: var(--line-width) solid var(--line);
  overflow: hidden;
}

.carousel {
  position: relative;
  touch-action: pan-y pinch-zoom;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide.active { display: block; }

.empty-state {
  padding: 24px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.6;
}

.carousel-controls {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.carousel-controls button {
  pointer-events: auto;
  min-width: 48px;
  min-height: 42px;
  border: 0;
  border-top: var(--line-width) solid var(--line);
  background: var(--bg);
  cursor: pointer;
}

.carousel-controls button + button {
  border-left: var(--line-width) solid var(--line);
}

.carousel-controls button:hover,
.carousel-controls button:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.side-menu {
  flex: 0 0 0;
  width: 0;
  overflow: hidden;
  border-left: 0 solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: width 260ms ease, flex-basis 260ms ease, border-width 260ms ease;
}

.site.menu-open .side-menu {
  flex-basis: var(--menu-width);
  width: var(--menu-width);
  border-left-width: var(--line-width);
}

.side-menu-inner {
  width: var(--menu-width);
  min-width: 0;
  padding: 18px;
  overflow-y: auto;
}

.menu-heading {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: var(--line-width) solid var(--line);
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-list { display: grid; gap: 0; }

.menu-link {
  display: block;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: var(--line-width) solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu-link[aria-current="true"] {
  padding-left: 10px;
  background: var(--fg);
  color: var(--bg);
}

.footer,
.contact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 10px 14px;
  border: var(--line-width) solid var(--line);
  line-height: 1.4;
}

.footer-credits,
.footer-action { margin: 0; }

.footer a,
.contact-footer a {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 120ms linear, background-color 120ms linear;
}

.footer a:hover,
.footer a:focus-visible,
.contact-footer a:hover,
.contact-footer a:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

@media (max-width: 640px) {
  :root {
    --header-height: 17vh;
    --footer-height: 10vh;
    --menu-width: min(76vw, 320px);
    --gutter: 8px;
  }
  .site.menu-open .side-menu {
    flex-basis: var(--menu-width);
    width: var(--menu-width);
  }
  .side-menu-inner { padding: 12px; }
  .footer, .contact-footer { padding: 8px 10px; font-size: 0.62rem; gap: 8px; }
  .header { padding-right: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}




/* Contatore immagini 1/N */
.carousel-counter {
  position: absolute;
  right: 12px;
  bottom: 54px;
  z-index: 3;
  padding: 3px 5px;
  background: var(--bg);
  color: var(--fg);
  font-size: 0.65rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
