/* Power Marine — base condivisa (reset, accessibilità, media, lightbox). I token visivi sono nei CSS di proposta. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--scroll-pad, 96px); }
body { margin: 0; min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; }
html.has-dialog { overflow: hidden; }

/* Accessibilità */
.pm-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pm-skip { position: absolute; left: 12px; top: -100px; z-index: 1000; padding: 12px 18px; background: var(--focus-bg, #000); color: var(--focus-fg, #fff); font-weight: 600; text-decoration: none; border-radius: 4px; }
.pm-skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus, #1a73e8); outline-offset: 3px; }
.on-dark :focus-visible, :is(.on-dark) :focus-visible { outline-color: var(--focus-on-dark, #ffd24a); }
[hidden] { display: none !important; }

/* Immagini: segnaposto colore dominante e stato di caricamento */
.pm-pic { display: block; position: relative; background: var(--ph, #ccc); overflow: hidden; }
.pm-pic > img { width: 100%; height: 100%; object-fit: cover; }
.pm-pic.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.18) 50%, transparent 80%); background-size: 200% 100%; animation: pm-shimmer 1.4s linear infinite; }
.pm-pic.is-loading > img { opacity: 0; }
.pm-pic > img { transition: opacity .35s ease; }
@keyframes pm-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* Dialog */
dialog { padding: 0; border: 0; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(0, 0, 0, .72); }

/* Lightbox (condivisa) */
.pm-lightbox { width: 100vw; height: 100dvh; margin: 0; background: #050607; color: #f3f3f3; display: grid; grid-template-rows: auto 1fr auto; }
.pm-lightbox:not([open]) { display: none; }
.pm-lb__bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 8px 20px; }
.pm-lb__counter { font-variant-numeric: tabular-nums; font-size: 15px; letter-spacing: .04em; }
.pm-lb__close, .pm-lb__nav { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.55); color: #fff; font-size: 20px; display: grid; place-items: center; }
.pm-lb__close:hover, .pm-lb__nav:hover { background: rgba(255,255,255,.16); }
.pm-lb__figure { display: grid; grid-template-rows: 1fr auto; min-height: 0; padding: 0 72px; }
.pm-lb__stage { position: relative; min-height: 0; display: grid; place-items: center; touch-action: pan-y; }
.pm-lb__stage picture, .pm-lb__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.pm-lb__stage img { max-height: calc(100dvh - 170px); }
.pm-lb__caption { text-align: center; padding: 12px 16px 4px; font-size: 16px; line-height: 1.5; color: #e6e6e6; max-width: 70ch; margin: 0 auto; }
.pm-lb__nav { position: fixed; top: 50%; transform: translateY(-50%); }
.pm-lb__prev { left: 12px; } .pm-lb__next { right: 12px; }
.pm-lb__hint { text-align: center; font-size: 13px; color: #bdbdbd; padding: 4px 16px 14px; }
.pm-lb__spinner { position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: pm-spin .9s linear infinite; display: none; }
.pm-lightbox.is-loading .pm-lb__spinner { display: block; }
@keyframes pm-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .pm-lb__figure { padding: 0 8px; }
  .pm-lb__nav { top: auto; bottom: 12px; transform: none; }
  .pm-lb__hint { padding-bottom: 72px; }
}

/* Form: elementi comuni */
.pm-form__summary-title:focus, .pm-form__success h3:focus { outline: none; }
.pm-field input[aria-invalid="true"], .pm-field textarea[aria-invalid="true"] { border-color: var(--error, #b3261e); }
.pm-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Riduzione del movimento: nessuna animazione o transizione non essenziale */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .pm-pic.is-loading::after { animation: none; }
}
