:root { color-scheme: only light; }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  padding-bottom: 115px;
  background: #002a5e url("background.png") 100% 106% / auto no-repeat;
  color: #454546;
  font-family: Arial, sans-serif;
}
#logo { width: 450px; margin: 20px auto 0; }
#logo img { display: block; width: 450px; height: auto; max-height: 150px; }
.main-container, .results-container {
  width: 450px;
  margin: 17px auto 0;
  padding: 25px;
  background: #fff;
  border: 2px solid #0069a0;
  border-radius: 10px;
}
.results-container { width: 800px; }
h1 { margin: 0; padding-bottom: 25px; font-size: 21px; font-weight: 600; }
input, button {
  display: block;
  width: 100%;
  margin-bottom: 15px;
  padding: 13px;
  border: 1px solid #777;
  font: inherit;
  font-size: 20px;
}
button, .back { background: #009cff; color: #fff; letter-spacing: 3px; text-align: center; cursor: pointer; }
.back { display: inline-block; padding: 12px 18px; text-decoration: none; }
.result { padding: 12px 0; border-top: 1px solid #ccd9df; }
.result:first-of-type { border-top: 0; }
.result h2, .result p { margin: 5px 0; }
.result-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr auto; gap: 16px; align-items: center; margin: 12px 0; padding: 18px 18px; border: 1px solid #d9e3ea; border-left: 5px solid #0069a0; border-radius: 8px; background: #f8fbfd; font-size: 15px; box-shadow: 0 2px 7px rgba(21,42,92,.07); }
.result-name { color: #152a5c; font-size: 17px; }
.result-date { color: #59656d; line-height: 1.35; }
.detail-link, .action-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 17px; border-radius: 6px; background: #152a5c; color: #fff; text-align: center; text-decoration: none; text-transform: uppercase; font-size: 13px; font-weight: 700; letter-spacing: .5px; box-shadow: 0 3px 8px rgba(21,42,92,.18); }
.detail-link::after { content: '\2192'; margin-left: 9px; font-size: 18px; line-height: 1; }
.detail-link:hover, .detail-link:focus-visible, .action-link:hover, .action-link:focus-visible { background: #0069a0; }
.detail-container { width: 800px; }
.back-link { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid #bfd1df; border-radius: 999px; background: #fff; color: #152a5c; font-size: 15px; font-weight: 600; letter-spacing: 0; text-decoration: none; box-shadow: 0 2px 8px rgba(21,42,92,.08); transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.back-link:hover, .back-link:focus-visible { border-color: #0069a0; background: #f2f8fc; transform: translateX(-2px); }
.back-link span { font-size: 20px; line-height: 1; }
.memoteca { display: flex; gap: 30px; padding: 30px; border-radius: 8px; background: #f2f5f7; }
.photo-placeholder { flex: 0 0 215px; height: 245px; border: 1px solid #d6e0e6; border-radius: 6px; background: #fff url("segnaposto.png") center / cover no-repeat; }
.anagraphic-data { flex: 1; }
.anagraphic-data p { margin: 7px 0; line-height: 1.35; }
.person-name { color: #152a5c; font-size: 26px; padding-bottom: 12px; }
.location-data { margin-top: 28px; }
.action-link { width: 258px; margin-top: 18px; }
.print-button { border: 0; font-size: 13px; letter-spacing: 0; }
footer { position: fixed; bottom: 0; left: 0; width: 100%; border-top: 1px solid #7eaabf; text-align: center; color: #fff; background: rgba(0,42,94,.92); }
.privacy { max-width: 1200px; margin: 10px auto 0; font-size: 14px; }
.privacy a { color: #fff; }
.footer-text { margin: 8px 0; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
  #logo, .main-container, .results-container, .detail-container { width: calc(100% - 32px); }
  #logo img { width: 100%; }
  .result-row { grid-template-columns: 1fr; }
  .memoteca { display: block; }
  .photo-placeholder { margin-bottom: 20px; }
  footer { position: static; margin-top: 24px; }
  body { padding-bottom: 0; }
}
@media print {
  .no-print, footer { display: none !important; }
  body { background: #fff; padding: 0; }
  .detail-container { border: 0; }
}

/* Footer accordion per kiosk */
body { padding-bottom: 54px; }
.site-footer { position: fixed; z-index: 50; bottom: 0; left: 0; width: 100%; border-top: 1px solid #7eaabf; text-align: center; color: #fff; background: rgba(0,42,94,.97); }
.footer-accordion { width: 100%; }
.footer-toggle { min-height: 52px; padding: 10px 22px; display: flex; align-items: center; justify-content: center; gap: 14px; cursor: pointer; font-size: 17px; font-weight: 700; list-style: none; touch-action: manipulation; }
.footer-toggle::-webkit-details-marker { display: none; }
.footer-toggle:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.footer-symbol { position: relative; width: 26px; height: 26px; flex: 0 0 26px; border: 2px solid #fff; border-radius: 50%; }
.footer-symbol::before, .footer-symbol::after { content: ''; position: absolute; left: 5px; right: 5px; top: 11px; height: 2px; background: #fff; }
.footer-symbol::after { transform: rotate(90deg); transition: transform .2s ease; }
.footer-accordion[open] .footer-symbol::after { transform: rotate(0deg); }
.footer-content { max-height: min(42vh, 320px); overflow: auto; padding: 2px 24px 16px; border-top: 1px solid rgba(255,255,255,.25); }
.footer-content .privacy { max-width: 1200px; margin: 12px auto 0; font-size: 14px; }
.footer-content .footer-text { margin: 8px 0 0; font-size: 11px; }
@media (max-width: 520px) { body { padding-bottom: 54px; } .site-footer { position: fixed; margin-top: 0; } .footer-toggle { font-size: 15px; } }

/* Pagina mappa del Totem */
body.map-page { margin: 0; padding: 0; background: #f3f5f8; color: #171d3d; overflow: hidden; }
.map-shell { height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px; }
.map-header { width: min(1180px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.map-title { font-size: clamp(25px, 3vw, 42px); font-weight: 700; margin: 0; }
.map-person { font-size: clamp(18px, 2vw, 28px); margin: 4px 0 0; }
.map-image-wrap { flex: 1; min-height: 0; width: min(1180px, 100%); display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 18px; box-shadow: 0 10px 30px rgba(20,31,73,.16); padding: 18px; box-sizing: border-box; }
.map-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.map-back { display: inline-flex; align-items: center; justify-content: center; min-width: 300px; padding: 18px 30px; border-radius: 14px; background: #171d3d; color: #fff; text-decoration: none; font-size: 24px; font-weight: 700; }
.map-note { margin: 0; font-size: 16px; color: #596174; }
.map-error { font-size: 28px; text-align: center; }

/* Pulsanti azione sempre sopra il footer del kiosk */
.anagraphic-data .action-link { width: calc(50% - 7px); margin-top: 18px; vertical-align: top; }
.anagraphic-data .action-link + .action-link { margin-left: 10px; }
@media (max-width: 520px) { .anagraphic-data .action-link { width: 100%; } .anagraphic-data .action-link + .action-link { margin-left: 0; } }

/* Stampa temporaneamente nascosta */
.print-button { display: none !important; }
.anagraphic-data .action-link { width: 258px; }
