:root {
  /* Palette: accent #07B0E5, titoli/logo #056397 / #335588, soft #C1E9F8 */
  --fs-ink: #212121;
  --fs-muted: #666666;
  --fs-paper: #f5f5f5;
  --fs-surface: #ffffff;
  --fs-accent: #07b0e5;
  --fs-accent-deep: #056397;
  --fs-accent-soft: #c1e9f8;
  --fs-accent-mid: #335588;
  --fs-line: #dddddd;
  --fs-header: var(--fs-accent-mid);
  --fs-header-deep: var(--fs-accent-mid);
  --fs-serif: "Source Serif 4", Georgia, serif;
  --fs-sans: "Source Sans 3", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fs-sans);
  color: var(--fs-ink);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(7, 176, 229, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(5, 99, 151, 0.08), transparent 50%),
    var(--fs-paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, .brand-mark, .hero-title {
  font-family: var(--fs-serif);
  letter-spacing: -0.02em;
  color: var(--fs-accent-deep);
}

a {
  color: var(--fs-accent-mid);
}

a:hover {
  color: var(--fs-accent-deep);
}

.site-header {
  background: var(--fs-header);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 8px rgba(51, 85, 136, 0.28);
}

.site-header .navbar {
  --bs-navbar-color: rgba(255, 255, 255, 0.92);
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
  --bs-navbar-brand-color: #fff;
  --bs-navbar-brand-hover-color: #fff;
  padding-block: 0.75rem;
}

.navbar-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  line-height: 1.1;
}

.brand-logo {
  height: 3.5rem;
  width: auto;
  display: block;
  flex-shrink: 0;
  border-radius: 0.35rem;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 2px 10px rgba(5, 99, 151, 0.25);
  background: #fff;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-mark {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.brand-sub {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  font-family: var(--fs-sans);
  color: #fff;
}

@media (max-width: 575.98px) {
  .brand-text {
    display: none;
  }

  .brand-logo {
    height: 3rem;
  }
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.45);
}

.navbar-toggler-icon {
  filter: invert(1);
}

.offcanvas {
  --bs-offcanvas-bg: var(--fs-header-deep);
  --bs-offcanvas-color: #fff;
}

.site-header .nav-link {
  position: relative;
  padding: 0.45rem 0.7rem;
  border-radius: 0.25rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-header .nav-link--search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  line-height: 1;
}

.site-header .nav-link--search svg {
  display: block;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.site-header .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none;
}

.site-header .nav-link.active:hover,
.site-header .nav-link.active:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

.hero-eyebrow {
  letter-spacing: 0.14em;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(5, 99, 151, 0.95) 0%, rgba(7, 176, 229, 0.88) 55%, rgba(51, 85, 136, 0.85) 100%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}

.hero .hero-title,
.hero .hero-subtitle,
.hero .hero-eyebrow {
  color: #fff;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  max-width: 18ch;
  margin-bottom: 0.75rem;
  animation: rise-in 0.7s ease-out both;
}

.hero-subtitle {
  font-size: 1.15rem;
  opacity: 0.95;
  max-width: 36ch;
  animation: rise-in 0.7s ease-out 0.12s both;
}

.hero-cta {
  animation: rise-in 0.7s ease-out 0.24s both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.35rem;
}

.section-lead {
  color: var(--fs-muted);
  max-width: 50ch;
  margin-bottom: 1.75rem;
}

.news-item-grid > [class*="col-"] {
  display: flex;
}

.news-item {
  border-bottom: 1px solid var(--fs-line);
  padding: 1rem 0;
  width: 100%;
  height: 100%;
  transition: transform 0.2s ease;
}

.news-item:hover {
  transform: translateX(4px);
}

.news-item time {
  color: var(--fs-muted);
  font-size: 0.875rem;
}

.news-item a {
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.news-item a:hover {
  color: var(--fs-accent-mid);
}

/* Archivio per anno (notizie / convegni) */
.news-archive {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.news-archive-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fs-muted);
  margin: 0;
}

.news-archive-select {
  width: auto;
  min-width: 8.5rem;
  max-width: 100%;
  font-weight: 600;
  color: var(--fs-accent-deep);
  border-color: var(--fs-line);
}

.news-listing {
  max-width: 42rem;
}

.news-listing-item {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--fs-line);
}

.news-listing-item:first-child {
  padding-top: 0.25rem;
}

.news-listing-date {
  display: block;
  font-size: 0.875rem;
  color: var(--fs-muted);
  text-transform: lowercase;
  margin-bottom: 0.35rem;
}

.news-listing-title {
  font-family: var(--fs-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.news-listing-title a {
  text-decoration: none;
  color: var(--fs-ink);
}

.news-listing-title a:hover {
  color: var(--fs-accent-deep);
}

.news-listing-excerpt {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--fs-muted);
}

/* Ricerca */
.search-summary {
  margin: 0 0 1.75rem;
  padding: 0.85rem 1rem;
  background: var(--fs-accent-soft);
  border-left: 4px solid var(--fs-accent);
  color: var(--fs-ink);
  font-size: 1rem;
}

.search-summary a {
  font-weight: 600;
  text-decoration: none;
}

.search-summary a:hover {
  text-decoration: underline;
}

.search-section {
  margin-bottom: 2.5rem;
}

.search-section-title {
  font-family: var(--fs-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fs-accent-deep);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--fs-accent);
}

.search-section-count {
  font-weight: 600;
  color: var(--fs-muted);
  font-size: 0.95rem;
}

.search-result-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--fs-line);
}

.search-result-title {
  font-family: var(--fs-sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  line-height: 1.35;
}

.search-result-title a {
  text-decoration: none;
  color: var(--fs-ink);
}

.search-result-title a:hover {
  color: var(--fs-accent-deep);
}

.search-result-meta {
  display: block;
  margin: 0;
  font-size: 0.85rem;
  color: var(--fs-muted);
}

.search-result-excerpt {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--fs-muted);
}

.search-doc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .search-doc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .search-doc-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.search-doc-card {
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  padding: 0.9rem 1rem;
  min-height: 100%;
}

.search-doc-card .search-result-title {
  font-size: 0.98rem;
}

.search-doc-link {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--fs-ink);
}

.search-doc-link:hover {
  color: var(--fs-accent-deep);
}

.search-doc-icon {
  flex: 0 0 auto;
  margin-top: -0.1rem;
  color: var(--fs-accent);
}

.search-doc-name {
  flex: 1 1 auto;
  min-width: 0;
}

.search-doc-card .search-result-meta {
  margin-top: 0.4rem;
}

.search-doc-card .search-result-meta a {
  color: var(--fs-muted);
  text-decoration: none;
}

.search-doc-card .search-result-meta a:hover {
  color: var(--fs-accent-deep);
  text-decoration: underline;
}

.search-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.search-pager a {
  font-weight: 600;
  text-decoration: none;
}

/* Griglia card (atti e convegni) */
.event-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .event-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .event-card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.event-card {
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  box-shadow: 0 1px 2px rgba(5, 99, 151, 0.06);
  height: 100%;
}

.event-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.event-card-link:hover .event-card-title {
  color: var(--fs-accent-deep);
}

.event-card-date {
  display: block;
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--fs-accent-mid);
  color: #fff;
  font-family: var(--fs-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
}

.event-card-date--empty {
  background: var(--fs-muted);
}

.event-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  padding: 1.1rem 1.15rem 1.25rem;
  background: var(--fs-surface);
}

.event-card-title {
  font-family: var(--fs-sans);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--fs-ink);
  overflow-wrap: anywhere;
}

.event-card-excerpt {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--fs-muted);
}

.project-link {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--fs-line);
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.project-link:hover {
  color: var(--fs-accent-mid);
}

.project-link .summary {
  display: block;
  font-weight: 400;
  color: var(--fs-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.calendar-table th,
.calendar-table td {
  width: 14.28%;
  vertical-align: top;
  height: 4.5rem;
  font-size: 0.85rem;
}

.calendar-table .has-event {
  background: var(--fs-accent-soft);
}

.calendar-table .day-num {
  font-weight: 700;
  color: var(--fs-accent-deep);
}

.event-chip {
  display: block;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--fs-accent-deep);
  text-decoration: none;
  margin-top: 0.2rem;
}

/* —— Calendario agenda (pagina /agenda/) —— */
.agenda-page-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0.5rem;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.cal-month-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--fs-accent-deep);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--fs-line);
  background: var(--fs-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cal-month-nav-btn:hover {
  border-color: var(--fs-accent);
  background: var(--fs-accent-soft);
  color: var(--fs-accent-deep);
}

.cal-month-nav-btn span[aria-hidden] {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
}

.cal-month-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 10rem;
}

.cal-month-name {
  font-family: var(--fs-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--fs-accent-deep);
  text-transform: capitalize;
  line-height: 1.1;
}

.cal-month-year {
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--fs-muted);
  font-weight: 600;
}

.cal {
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  overflow: hidden;
}

.cal-weekdays,
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-weekdays {
  background: linear-gradient(180deg, var(--fs-accent-deep) 0%, #045a87 100%);
  color: #fff;
}

.cal-weekdays > div {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.cal-week + .cal-week {
  border-top: 1px solid var(--fs-line);
}

.cal-day {
  min-height: 8.5rem;
  padding: 0.55rem 0.45rem 0.65rem;
  border-right: 1px solid var(--fs-line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cal-day:last-child {
  border-right: none;
}

.cal-day--empty {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 4px,
      rgba(0, 0, 0, 0.02) 4px,
      rgba(0, 0, 0, 0.02) 5px
    );
  min-height: 8.5rem;
}

.cal-day--has-events {
  background: linear-gradient(180deg, rgba(193, 233, 248, 0.35) 0%, #fff 55%);
}

.cal-day--today {
  box-shadow: inset 0 0 0 2px var(--fs-accent);
}

.cal-day--today .cal-day-num {
  background: var(--fs-accent);
  color: #fff;
}

.cal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--fs-accent-deep);
}

.cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-height: 0;
}

.cal-event {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--fs-ink);
  background: #fff;
  border: 1px solid var(--fs-line);
  border-left: 3px solid var(--fs-accent);
  padding: 0.4rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.3;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.cal-event:hover {
  border-color: var(--fs-accent);
  background: var(--fs-accent-soft);
  color: var(--fs-accent-deep);
  transform: translateY(-1px);
}

.cal-event-dot {
  flex: 0 0 auto;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.28rem;
  border-radius: 50%;
  background: var(--fs-accent);
}

.cal-event-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
}

.agenda-month-list {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.agenda-month-list-title {
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
}

.agenda-timeline-day {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.25rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--fs-line);
}

.agenda-timeline-day:first-child {
  padding-top: 0;
}

.agenda-timeline-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.15rem;
}

.agenda-timeline-weekday {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--fs-muted);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.agenda-timeline-daynum {
  font-family: var(--fs-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--fs-accent-deep);
  line-height: 1;
}

.agenda-timeline-month {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fs-muted);
  font-weight: 700;
  margin-top: 0.2rem;
}

.agenda-timeline-events {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.agenda-timeline-link {
  display: block;
  text-decoration: none;
  color: var(--fs-ink);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  padding: 0.75rem 1rem;
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  border-left: 4px solid var(--fs-accent);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.agenda-timeline-link:hover {
  color: var(--fs-accent-deep);
  border-color: var(--fs-accent);
  background: rgba(193, 233, 248, 0.35);
}

@media (max-width: 991.98px) {
  .cal-day {
    min-height: 6.5rem;
    padding: 0.4rem 0.3rem 0.5rem;
  }

  .cal-event-title {
    -webkit-line-clamp: 2;
    font-size: 0.65rem;
  }

  .cal-month-nav-label {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .cal-weekdays > div {
    font-size: 0.62rem;
    padding: 0.5rem 0.15rem;
  }

  .cal-day {
    min-height: 4.75rem;
  }

  .cal-event-title {
    -webkit-line-clamp: 1;
  }

  .agenda-timeline-day {
    grid-template-columns: 3.25rem 1fr;
    gap: 0.85rem;
  }
}

.page-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--fs-line);
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.prose {
  max-width: 68ch;
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.site-footer {
  background: var(--fs-header-deep);
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer-brand {
  font-family: var(--fs-serif);
  font-size: 1.15rem;
  color: #fff;
}

.footer-meta {
  font-size: 0.95rem;
}

.footer-note {
  opacity: 0.75;
  font-size: 0.9rem;
}

.btn-accent {
  --bs-btn-bg: var(--fs-accent-mid);
  --bs-btn-border-color: var(--fs-accent-mid);
  --bs-btn-hover-bg: var(--fs-accent-deep);
  --bs-btn-hover-border-color: var(--fs-accent-deep);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
}

.list-plain > li {
  margin-bottom: 0.5rem;
}

/* Sezioni istituzionali (Chi siamo, Documenti, …) */
.section-band {
  background: linear-gradient(180deg, rgba(7, 176, 229, 0.12) 0%, rgba(7, 176, 229, 0.04) 100%);
  border-bottom: 1px solid var(--fs-line);
  padding: 1.25rem 0 0;
}

.section-band--thin .page-header--band {
  padding-bottom: 1.25rem;
}

.page-header--band {
  border-bottom: none;
  margin-bottom: 0;
  padding-top: 0.5rem;
  padding-bottom: 1.75rem;
}

.breadcrumb-nav {
  margin-bottom: 0.5rem;
}

.breadcrumb-nav .breadcrumb {
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb-nav .breadcrumb-item a {
  color: var(--fs-accent-deep);
  text-decoration: none;
}

.breadcrumb-nav .breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-nav .breadcrumb-item.active {
  color: var(--fs-muted);
}

.section-index-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--fs-line);
  text-decoration: none;
  color: var(--fs-ink);
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.section-index-item:hover {
  color: var(--fs-accent-mid);
  padding-left: 0.35rem;
}

.section-index-arrow {
  color: var(--fs-accent-mid);
  font-weight: 400;
}

.aside-card,
.section-nav {
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  border-left: 4px solid var(--fs-accent-mid);
  padding: 1.25rem 1.35rem;
  position: sticky;
  top: 5.5rem;
}

.aside-card-label,
.section-nav-title {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fs-muted);
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.section-nav-title a {
  color: var(--fs-accent-deep);
  text-decoration: none;
}

.aside-card a,
.section-nav-link {
  display: block;
  padding: 0.4rem 0;
  color: var(--fs-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-size: 0.95rem;
}

.aside-card a:hover,
.section-nav-link:hover {
  color: var(--fs-accent-mid);
}

.section-nav-link.is-active {
  color: var(--fs-accent-mid);
  font-weight: 700;
}

.prose--page {
  max-width: none;
}

.prose--page h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--fs-accent-soft);
}

.prose--page p {
  margin-bottom: 1rem;
}

.prose--page ul {
  padding-left: 1.2rem;
  margin-bottom: 1.25rem;
}

.section--tight {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.section--alt {
  background: rgba(7, 176, 229, 0.06);
}

/* Carosello home */
.home-carousel {
  background: var(--fs-header-deep);
}

.home-carousel .carousel-item {
  min-height: clamp(220px, 42vw, 480px);
}

.carousel-slide-link {
  display: block;
  position: relative;
  color: inherit;
  text-decoration: none;
  min-height: inherit;
}

.carousel-img {
  width: 100%;
  height: clamp(220px, 42vw, 480px);
  object-fit: cover;
  display: block;
}

.carousel-img--placeholder {
  background: linear-gradient(
    120deg,
    var(--fs-accent-deep),
    var(--fs-accent) 55%,
    var(--fs-accent-mid)
  );
}

.carousel-caption {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1.5rem 2rem;
  text-align: left;
  background: linear-gradient(transparent, rgba(5, 99, 151, 0.88));
}

.carousel-title {
  font-family: var(--fs-serif);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 700;
  margin: 0 0 0.35rem;
  max-width: 28ch;
  color: #fff;
}

.carousel-text {
  margin: 0;
  max-width: 42ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
}

.home-carousel .carousel-control-prev,
.home-carousel .carousel-control-next {
  width: 3.5rem;
}

.agenda-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
}

.agenda-nav a {
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--fs-accent-deep);
  padding: 0.15rem 0.4rem;
}

.agenda-nav-label {
  text-transform: capitalize;
  font-weight: 600;
  color: var(--fs-accent-deep);
  min-width: 9rem;
  text-align: center;
}

.agenda-timeline--home {
  margin-top: 0.25rem;
}

.agenda-timeline--home .agenda-timeline-day {
  grid-template-columns: 3.5rem 1fr;
  gap: 0.85rem;
  padding: 0.85rem 0;
}

.agenda-timeline--home .agenda-timeline-daynum {
  font-size: 1.45rem;
}

.agenda-timeline--home .agenda-timeline-link {
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
}

.agenda-timeline--home .agenda-timeline-events {
  gap: 0.45rem;
}

.calendar-table td {
  height: 2.75rem;
  text-align: center;
}

.calendar-table .event-chip {
  display: inline;
  margin: 0;
  font-size: 0.85rem;
}

/* Progetti in evidenza (home) — lista icona + titolo */
.home-projects {
  max-width: 56rem;
}

.home-projects-title {
  font-family: var(--fs-serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--fs-ink);
  text-align: center;
  margin: 0 0 0.65rem;
}

.home-projects-all {
  text-align: center;
  margin: 0 0 2rem;
}

.home-projects-all a {
  font-family: var(--fs-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fs-accent-mid);
}

.home-projects-all a:hover {
  color: var(--fs-accent-deep);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.home-projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem 2.5rem;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .home-projects-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.home-project-link {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  text-decoration: none;
  color: var(--fs-accent-mid);
  min-height: 5rem;
}

.home-project-link:hover {
  color: var(--fs-accent-deep);
}

.home-project-icon {
  flex-shrink: 0;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--fs-accent);
  display: grid;
  place-items: center;
}

.home-project-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-project-label {
  font-family: var(--fs-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

.pub-card {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.pub-card:hover {
  color: inherit;
}

.pub-card-media {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--fs-line);
  background: var(--fs-surface);
  margin-bottom: 0.65rem;
}

.pub-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.pub-card:hover .pub-card-media img {
  transform: scale(1.03);
}

.pub-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  background: linear-gradient(160deg, #07b0e5, #056397);
  color: #fff;
  font-family: var(--fs-serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.pub-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  color: var(--fs-accent-deep);
}

.pub-card-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fs-muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.page-subtitle {
  font-size: 1.15rem;
  color: var(--fs-accent-deep);
  margin: 0.35rem 0 0.75rem;
  font-family: var(--fs-serif);
}

.doc-group {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--fs-line);
  border-left: 4px solid var(--fs-accent);
  background: var(--fs-surface);
}

.prose--page .doc-group-title,
.doc-group-title {
  font-family: var(--fs-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--fs-accent-deep);
}

.doc-group .doc-group-list {
  margin-bottom: 0;
}

.doc-group-list li {
  border-bottom: 1px solid var(--fs-line);
}

.doc-group-list li:last-child {
  border-bottom: none;
}

.doc-group-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0;
  text-decoration: none;
  color: var(--fs-ink);
  font-weight: 600;
}

.doc-group-icon {
  flex-shrink: 0;
  color: var(--fs-accent);
  display: inline-flex;
  line-height: 0;
}

.doc-group-name {
  flex: 1;
  min-width: 0;
}

.doc-group-link:hover {
  color: var(--fs-accent-mid);
}

.doc-group-link:hover .doc-group-icon {
  color: var(--fs-accent-deep);
}

.doc-group-size {
  color: var(--fs-muted);
  font-weight: 400;
  font-size: 0.85rem;
  white-space: nowrap;
}

.photo-gallery {
  margin: 1.75rem 0;
}

.photo-gallery-title {
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
  color: var(--fs-accent-deep);
}

.photo-gallery-item {
  overflow: hidden;
  border: 1px solid var(--fs-line);
  background: #fff;
}

.photo-gallery-link {
  display: block;
  cursor: zoom-in;
  text-decoration: none;
  color: inherit;
}

.photo-gallery-link:hover img {
  opacity: 0.92;
}

.photo-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.15s ease;
}

.photo-gallery-item figcaption {
  font-size: 0.8rem;
  color: var(--fs-muted);
  padding: 0.4rem 0.55rem;
}

/* Lightbox gallery */
.fs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10, 24, 40, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.fs-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.fs-lightbox-dialog {
  position: relative;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
}

.fs-lightbox-img {
  max-width: 100%;
  max-height: calc(92vh - 3rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.fs-lightbox-caption {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  text-align: center;
  max-width: 40rem;
}

.fs-lightbox-btn {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fs-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.fs-lightbox-close {
  top: 1rem;
  right: 1rem;
  position: fixed;
}

.fs-lightbox-prev,
.fs-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.fs-lightbox-prev {
  left: 0.75rem;
  position: fixed;
}

.fs-lightbox-next {
  right: 0.75rem;
  position: fixed;
}

.fs-lightbox-btn[hidden] {
  display: none;
}

@media (max-width: 575.98px) {
  .fs-lightbox-prev,
  .fs-lightbox-next {
    top: auto;
    bottom: 1rem;
    transform: none;
  }

  .fs-lightbox-prev {
    left: 1rem;
  }

  .fs-lightbox-next {
    right: 1rem;
  }
}

/* Schede agenda / notizie: full-width, senza menu laterale */
.entry-header-wrap {
  max-width: 42rem;
}

.entry-header h1 {
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.entry-date {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fs-accent-deep);
  font-weight: 600;
  margin: 0 0 0.65rem;
}

.entry-back {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.entry-back a {
  color: var(--fs-muted);
  text-decoration: none;
}

.entry-back a:hover {
  color: var(--fs-accent-mid);
}

.entry-body-wrap {
  max-width: 42rem;
}

.prose--entry {
  max-width: none;
}

.entry-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--fs-line);
}

.entry-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--fs-ink);
  padding: 0.85rem 1rem;
  border: 1px solid var(--fs-line);
  background: var(--fs-surface);
  transition: border-color 0.15s ease, color 0.15s ease;
  min-height: 100%;
}

.entry-pager-link:hover {
  border-color: var(--fs-accent);
  color: var(--fs-accent-deep);
}

.entry-pager-link--next {
  text-align: right;
  align-items: flex-end;
}

.entry-pager-dir {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fs-muted);
  font-weight: 600;
}

.entry-pager-meta {
  font-size: 0.85rem;
  color: var(--fs-accent-deep);
}

.entry-pager-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 575.98px) {
  .entry-pager {
    grid-template-columns: 1fr;
  }

  .entry-pager-link--next {
    text-align: left;
    align-items: flex-start;
  }
}
