/* Migliorie conservative del sito statico MAR — settembre 2026 */
html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; }

.mar-skip-link {
  position: fixed;
  z-index: 100000;
  top: .5rem;
  left: .5rem;
  padding: .65rem .9rem;
  background: var(--wp--preset--color--primary, #f9f6de);
  color: var(--wp--preset--color--background, #59794f);
  border-radius: .25rem;
  transform: translateY(-180%);
  transition: transform .15s ease;
}
.mar-skip-link:focus { transform: translateY(0); }
.mar-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--wp--preset--color--primary, #f9f6de);
  outline-offset: 3px;
}
.wp-block-navigation-item__content[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: .08em;
  text-underline-offset: .35em;
}

.mar-home-content {
  width: min(100% - 2rem, 64rem);
  margin: 1.25rem auto 0;
}
.mar-home-intro {
  max-width: 48rem;
  margin: 0 auto 3rem;
  text-align: center;
}
.mar-home-intro h1 { margin-bottom: .75rem; }
.mar-home-lead { font-size: 1.12rem; line-height: 1.65; }
.mar-feature {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: .35rem;
}
.mar-feature-media img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: var(--wp--preset--shadow--natural, 6px 6px 9px rgba(0,0,0,.2));
}
.mar-kicker {
  margin: 0 0 .45rem;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.mar-feature h2 { margin-top: 0; margin-bottom: .65rem; }
.mar-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.mar-button {
  display: inline-block;
  padding: .65rem 1rem;
  border-radius: 2rem;
  background: var(--wp--preset--color--primary, #f9f6de);
  color: var(--wp--preset--color--background, #59794f) !important;
  font-weight: 700;
  text-decoration: none;
}
.mar-button:hover { background: var(--wp--preset--color--foreground, #fff); }
.mar-button-secondary {
  background: transparent;
  color: inherit !important;
  border: 1px solid currentColor;
}
.mar-quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 1rem;
}
.mar-quick-links a {
  display: block;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: .25rem;
  text-align: center;
  text-decoration: none;
}
.mar-quick-links a:hover { background: color-mix(in srgb, currentColor 8%, transparent); }

.mar-year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .9rem;
  margin: 1.25rem 0 2rem;
  padding: .8rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  font-size: .95rem;
}
.mar-year-nav a { white-space: nowrap; }

.mar-events { margin-top: 2rem; }
.mar-event {
  display: grid;
  grid-template-columns: minmax(220px, 394px) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: start;
  margin: 0 0 clamp(3rem, 7vw, 5rem);
  padding-left: 1rem;
  border-left: 1px solid currentColor;
}
.mar-event figure { margin: 0; }
.mar-event img {
  display: block;
  width: 100%;
  max-width: 394px;
  height: auto;
}
.mar-event h3 { margin-top: 0; }
.mar-event-year { margin-top: 0; font-weight: 700; }
.mar-event-description { line-height: 1.55; }
.mar-event-video {
  grid-column: 1 / -1;
  max-width: 720px;
  margin-top: .25rem;
}
.mar-event-video h4 { margin-bottom: .75rem; }
.mar-event-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}
.mar-event-video figcaption { margin-top: .5rem; line-height: 1.45; }
.mar-media-fallback { margin-top: .55rem; font-size: .95rem; }
.mar-news-feature {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin: 1.5rem 0 3rem;
  padding: 1rem 0 1rem 1rem;
  border-left: 1px solid currentColor;
}
.mar-news-feature img { display: block; width: 100%; height: auto; }

.mar-back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--wp--preset--color--primary, #f9f6de);
  color: var(--wp--preset--color--background, #59794f);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(.5rem);
  transition: opacity .15s ease, transform .15s ease;
}
.mar-back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mar-footer-links { margin-top: .6rem; font-size: .95rem; }
.mar-footer-links a { margin: 0 .35rem; }

@media (max-width: 760px) {
  .mar-feature, .mar-event, .mar-news-feature { grid-template-columns: 1fr; }
  .mar-feature-media { max-width: 32rem; margin: 0 auto; }
  .mar-quick-links { grid-template-columns: 1fr; }
  .mar-event { padding-left: .75rem; }
  .mar-event-video { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
