/* ===== FONT ===== */
/* Se carichi Exo 2 da HTML, puoi rimuovere questa riga */
@import url("https://fonts.googleapis.com/css2?family=Exo+2:wght@400;600;700&display=swap");

/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

input,
select,
button,
textarea {
  font-family: inherit;
}

:root {
  --bg-top: #ffffff;
  --bg-mid: #f8fafc;
  --bg-bottom: #eef2f7;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #c7d2fe;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: rgba(99, 102, 241, 0.12);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.16);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --container: 1380px;
  --page-container: 1100px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  background: radial-gradient(circle at 18% 10%, rgba(99, 102, 241, 0.10), transparent 32%), radial-gradient(circle at 85% 18%, rgba(59, 130, 246, 0.08), transparent 28%), linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bottom) 100%);
}

img {
  max-width: 100%;
  display: block;
}

svg {
  flex-shrink: 0;
}

/* ===== LINK BASE ===== */
a {
  color: inherit;
  text-decoration: none;
}

/* Link visibili nei contenuti testuali */
.content-card a,
.wiki-content a,
.project-card a,
.news-excerpt a,
.news-card-body a,
.page-header a,
.team-modal-content a,
.error-page a,
.observer-card a,
.left-column a,
.right-column a,
.upload-page a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.content-card a:hover,
.wiki-content a:hover,
.project-card a:hover,
.news-excerpt a:hover,
.news-card-body a:hover,
.page-header a:hover,
.team-modal-content a:hover,
.error-page a:hover,
.observer-card a:hover,
.left-column a:hover,
.right-column a:hover,
.upload-page a:hover {
  color: var(--primary-dark);
  background-color: var(--primary-soft);
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--border-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Mantiene puliti menu, bottoni e link grafici */
.nav-links a,
.dropdown-menu a,
.btn-custom,
.upload-button,
.upload-logout a,
.footer-inner a,
.card,
.card-main,
.card-secondary,
.project-card,
.news-links a,
.team-photo-card {
  text-decoration: none;
}

/* ===== LAYOUT SAFETY ===== */
.card,
.card-main,
.card-secondary,
.project-card,
.content-card,
.page-shell,
.project-logo-wrap,
.wiki-content,
.wiki-sidebar,
.wiki-nav {
  min-width: 0;
}

/* ===== HOME PAGE ===== */
.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: clamp(180px, 28vh, 340px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: center center / cover no-repeat url("https://images.unsplash.com/photo-1464802686167-b939a6910659?auto=format&fit=crop&w=1800&q=80");
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.42);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.30), rgba(2, 6, 23, 0.62));
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(var(--container), 92vw);
  text-align: center;
  color: #ffffff;
  padding: 28px 16px;
}

.hero-kicker {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}

.hero-content h1 {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow:
  0 2px 10px rgba(0, 0, 0, 0.80),
  0 0 22px rgba(129, 140, 248, 0.35);
}

.hero-subtitle {
  max-width: 760px;
  margin: 16px auto 0;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.90);
}

/* ===== MAIN ===== */
main {
  flex: 1;
  width: min(var(--container), 92vw);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) 0;
}

.section-block + .section-block {
  margin-top: 16px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0 0 8px;
  font-family: "Exo 2", sans-serif;
  font-size: clamp(1.5rem, 2vw, 2rem);
  color: #111827;
}

.section-heading p {
  margin: 0;
  font-size: clamp(1rem, 1.1vw, 1.08rem);
  color: var(--text-soft);
}

/* ===== GRID HOME ===== */
.grid-main,
.grid-secondary {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}

.grid-main {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-secondary {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.container-fluid {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: auto;
}

.center-button {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

/* ===== CARDS ===== */
.card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: #c5ccff;
}

/* ===== MAIN PROJECT CARDS ===== */
.card-main {
  min-height: clamp(220px, 28vw, 280px);
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
}

.card-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.14), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card-main:hover::before {
  opacity: 1;
}

.card-badge {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin: 0 auto 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-main h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: #111827;
}

.card-main p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.7;
  color: var(--text-soft);
}

.card-arrow {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 12px auto 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 700;
  color: var(--primary);
  transition: transform 0.25s ease;
}

.card-main:hover .card-arrow {
  transform: translateX(6px);
}

/* ===== PROJECTS TWO COLUMNS ===== */
.projects-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.projects-left {
  display: flex;
}

.projects-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.featured-card {
  width: 100%;
  min-height: 210px;
  padding: 20px;
}

.side-card {
  min-height: 96px;
  padding: 14px 18px;
}

.featured-card h3,
.side-card h3 {
  margin-bottom: 8px;
  line-height: 1.05;
}

.featured-card h3 {
  font-size: clamp(1.8rem, 2.8vw, 2.3rem);
}

.side-card h3 {
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
}

.featured-card p,
.side-card p {
  margin: 0;
  line-height: 1.45;
}

.featured-card p {
  font-size: 1rem;
}

.side-card p {
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .projects-layout {
  grid-template-columns: 1fr;
  }
}

/* ===== SMALLER SECONDARY CARDS ===== */
.card-secondary {
  text-align: center;
  min-height: 140px;
  padding: 16px 14px;
}

.card-secondary h3 {
  margin: 6px 0 0;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.2;
}

.icon {
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
}

.icon svg {
  width: 26px;
  height: 26px;
}

.card-collab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.icon-collab-img {
  display: block;
  height: 78px;
  margin: 0 auto;
  object-fit: contain;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.footer-inner {
  width: min(var(--container), 92vw);
  margin: 0 auto;
  text-align: center;
  font-size: clamp(0.82rem, 1vw, 0.92rem);
  line-height: 1.7;
  color: var(--text-muted);
}

.footer-inner a {
  color: var(--primary-dark);
  font-weight: 600;
}

.footer-inner a:hover {
  color: var(--primary);
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.navbar-inner {
  width: min(var(--page-container), 94vw);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-title {
  font-family: "Exo 2", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-links a,
.dropdown-trigger {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  padding: 6px 8px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-links a:hover,
.dropdown-trigger:hover {
  color: var(--primary-dark);
  background: rgba(99, 102, 241, 0.08);
}

.active-nav {
  color: #4338ca !important;
  background: rgba(99, 102, 241, 0.08);
}

/* ===== DROPDOWN ===== */
.dropdown {
  position: relative;
}

/* menu nascosto */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  display: none;
  z-index: 200;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* 🔥 IMPORTANTISSIMO: solo figli diretti */
.dropdown.open > .dropdown-menu {
  display: block;
}

/* link */
.dropdown-menu a {
  display: block;
  padding: 8px 10px;
  font-size: 14px;
  color: #334155;
  border-radius: 6px;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: #f1f5f9;
  color: var(--primary-dark);
}

/* ========================= */
/* SUBMENU */
/* ========================= */

.sub-dropdown {
  position: relative;
}

/* posizionamento laterale */
.sub-dropdown > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 6px;
  right: auto; /* 🔥 evita conflitto con right:0 */
}

/* stile bottone submenu */
.sub-dropdown > .dropdown-trigger {
  font-family: inherit;  /* 🔥 prende font navbar */
  font-size: 14px;  /* uguale ai link */
  font-weight: 500;  /* opzionale, allinealo ai link */
  color: #334155;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* ===== PAGINE GENERICHE ===== */
.generic-page main {
  width: min(var(--page-container), 94vw);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) clamp(12px, 2vw, 20px) clamp(28px, 4vw, 48px);
}

.page-shell {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 28px);
  background: rgba(255, 255, 255, 0.82);
  border-radius: clamp(16px, 2vw, 22px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overflow-x: hidden;
}

.page-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.page-header h1,
.home-page .hero-content h1 {
  font-family: "Exo 2", sans-serif;
}

.page-header h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3vw, 2.4rem);
  color: #111827;
}

.page-header p {
  max-width: 760px;
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
  text-align: justify;
}

/* ===== LAYOUT AGGIUNTIVI ===== */
.grid,
.grid-small,
.content-grid,
.wiki-layout,
.project-grid,
.placeholder-list {
  display: grid;
}

.grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.grid-small {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.content-grid {
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}

.content-card,
.project-card,
.wiki-nav,
.project-logo-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.content-card {
  border-color: #e2e8f0;
  border-radius: 16px;
  padding: 22px;
}

.content-card h2 {
  margin-bottom: 12px;
  font-size: 20px;
  color: #111827;
}

.content-card p {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
}

.placeholder-list {
  gap: 12px;
  margin-top: 8px;
}

.placeholder-item {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
}

.grid .card {
  border: 1.5px solid #c7d2fe;
}

.grid .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
  border-color: #6366f1;
}

.grid-small .card {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.grid-small .card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.18);
  background: #fbfdff;
}

.card h3,
.project-card h2,
.wiki-content h2 {
  color: #111827;
}

.card h3 {
  margin-bottom: 8px;
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
}

.grid-small .card h3 {
  width: 100%;
  margin: 4px 0 0;
  text-align: center;
  line-height: 1.25;
}

.card p,
.project-card p,
.wiki-content p,
.wiki-content li {
  color: #475569;
}

.card p,
.project-card p {
  font-size: clamp(0.98rem, 1vw, 1.05rem);
  line-height: 1.55;
}

/* Pulsante di base */
.btn-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #eef2ff, #dfe7ff);
  color: #374151;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.btn-go:hover {
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-color: #4f46e5;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.24);
}
a.btn-go:hover {
  color: #ffffff !important;
}

.btn-go:active {
  transform: translateY(0);
}

.btn-go:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

/* ===== WIKI ===== */
.wiki-layout {
  grid-template-columns: 3fr 1fr;
  gap: 28px;
}

.wiki-content section {
  scroll-margin-top: 90px;
  margin-bottom: 28px;
}

.wiki-content h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.wiki-content p,
.wiki-content li {
  font-size: 15px;
  line-height: 1.7;
}

.wiki-content ul {
  margin-top: 8px;
  padding-left: 18px;
}

.wiki-content img {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.wiki-content .container {
  text-align: center;
}

.wiki-sidebar {
  position: relative;
}

.wiki-nav {
  position: sticky;
  top: 78px;
  border-radius: 14px;
  padding: 16px;
}

.wiki-nav h3 {
  margin-bottom: 10px;
  font-size: 14px;
  color: #64748b;
}

.wiki-nav a {
  display: block;
  padding: 7px 10px;
  font-size: 14px;
  color: #334155;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.wiki-nav a:hover {
  background: #f8fafc;
  color: #4338ca;
}

.wiki-nav a.active {
  font-weight: 600;
  color: #4338ca;
  background: rgba(99, 102, 241, 0.1);
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  z-index: 300;
  border: 0;
  border-radius: 999px;
  font-size: 18px;
  color: #fff;
  background: #4f46e5;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== PROJECT ===== */
.project-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(240px, 30vw, 360px);
  margin-bottom: 24px;
  padding: clamp(20px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 18px;
}

.project-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: clamp(200px, 24vw, 300px);
  object-fit: contain;
}

.project-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
  padding: 18px;
  border: 1px solid #dbe4ff;
  border-radius: 16px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.project-card h2 {
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  line-height: 1.1;
  text-align: center;
}

.project-card p {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.5;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: #6366f1;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12);
}

.project-card.has-text {
  justify-content: flex-start;
}

.project-card.has-text h2 {
  text-align: left;
}

/* ===== HOME PAGE TUNING ===== */
.home-page main {
  width: min(var(--page-container), 94vw);
  margin: 0 auto;
  padding: 18px 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-page .hero {
  height: clamp(130px, 18vw, 150px);
  min-height: clamp(130px, 18vw, 150px);
  flex-shrink: 0;
}

.home-page .hero-content {
  position: relative;
  z-index: 2;
  padding: 20px;
}

.home-page .hero-content h1 {
  font-size: clamp(2rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow:
  0 2px 6px rgba(0, 0, 0, 0.8),
  0 0 12px rgba(99, 102, 241, 0.35);
  animation: glow 2.8s ease-in-out infinite alternate;
}

.home-page footer {
  text-align: center;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  overflow-x: auto;
}

@keyframes glow {
  from {
  text-shadow:
  0 2px 6px rgba(0, 0, 0, 0.8),
  0 0 10px rgba(99, 102, 241, 0.25);
  }
  to {
  text-shadow:
  0 2px 10px rgba(0, 0, 0, 0.9),
  0 0 18px rgba(129, 140, 248, 0.45);
  }
}

/* ===== 404 PAGE ===== */
.error-page {
  max-width: 760px;
  margin: 12px auto 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.error-title {
  margin-bottom: 24px;
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 1;
  color: var(--primary);
}

.error-image {
  display: block;
  width: min(100%, 520px);
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.error-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

/* ===== ABOUT PAGE ===== */
.about-page {
  margin-top: 12px;
}

.team-card {
  padding-top: 28px;
}

.team-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 999px;
  margin: 0 auto 14px;
  border: 3px solid rgba(99, 102, 241, 0.14);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

/* ===== TEAM MODAL ===== */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.team-photo-card {
  width: 140px;
  height: 140px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.team-photo-card .team-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  border: 3px solid rgba(99, 102, 241, 0.14);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.team-photo-card:hover .team-image {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-md);
}

.team-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.team-modal.open {
  display: flex;
}

.team-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.team-modal-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 460px);
  padding: 28px;
  text-align: center;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.team-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.team-modal-image {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 999px;
  margin: 0 auto 18px;
}

.team-modal-content h3 {
  margin: 0 0 10px;
  color: #111827;
}

.team-modal-content p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
  text-align: justify;
}

/* ===== OBSERVER PAGE ===== */
.observer-page {
  margin-top: 12px;
}

.observer-card {
  overflow-x: auto;
  padding: 18px;
}

.observer-card .bk-root {
  width: 100% !important;
}

/* ===== NEWS PAGE ===== */
.news-page {
  margin-top: 12px;
}

.news-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.news-input,
.news-select {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
}

.news-input {
  min-width: 240px;
}

.news-filter-group {
  display: flex;
  gap: 8px;
}

.news-filter-btn,
.news-reset-btn {
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s ease;
}

.news-filter-btn:hover,
.news-reset-btn:hover {
  border-color: var(--primary);
}

.news-filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.news-card {
  height: 100%;
  overflow: hidden;
}

.news-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-date {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.news-title {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 1.7vw, 1.7rem);
  line-height: 1.2;
  color: #111827;
}

.news-excerpt {
  flex-grow: 1;
  margin: 0;
  line-height: 1.7;
  color: var(--text-soft);
  text-align: justify;
}

.news-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.news-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.news-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

[data-has-video="true"] .news-card {
  border-top: 4px solid #2563eb;
}

@media (max-width: 900px) {
  .news-grid {
  grid-template-columns: 1fr;
  }
}

/* ===== LOGIN PAGE STYLES ===== */
.login-card {
  max-width: 400px;
  margin: 50px auto;
  padding: 30px;
  background: #f8f8f8;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-card h2 {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-label {
  font-size: 1rem;
  color: #444;
}

.form-control {
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.btn-submit {
  background-color: #d57e43;
  border-color: #b16d2f;
  font-size: 1.1rem;
  padding: 12px;
  border-radius: 8px;
  color: white;
  transition: background-color 0.3s ease;
}

.btn-submit:hover {
  background-color: #b16d2f;
}

.alert {
  text-align: center;
  font-size: 1rem;
  margin-top: 20px;
}

.mb-3 {
  margin-bottom: 1.5rem !important;
}

.w-50 {
  width: 50% !important;
}

/* ===== TABELLE ===== */
.container-fluid-tab {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 15px;
  align-items: flex-start;
}

.left-column {
  flex: 1;
  min-width: 300px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.right-column {
  flex: 1.5;
  min-width: 300px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.table {
  width: 100%;
  margin-bottom: 20px;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px;
  border: 1px solid #ddd;
}

.table th {
  background-color: var(--primary);
  color: #ffffff;
  text-align: left;
}

.table td {
  color: var(--text);
}

.table td:focus {
  background-color: var(--primary-dark);
  color: #ffffff;
}

.table-striped tbody tr:nth-child(odd) {
  background-color: var(--bg-mid);
}

.table-striped tbody tr:nth-child(even) {
  background-color: var(--bg-bottom);
}

.table-striped tbody tr:hover {
  background-color: var(--primary-soft);
}

table.table-striped-first tr:nth-child(1) {
  background-color: #f7c1c1;  /* Colore di sfondo rosso chiaro */
  font-weight: bold;  /* Testo in grassetto */
  color: #000;  /* Colore del testo */
}

.allineamento {
  text-align: right;
}

.tab-padd {
  padding-bottom: 10px;
}

/* ===== ELENCO GAD ===== */
.d-flex {
  display: flex;
  align-items: center;
}

.mr-3 {
  margin-right: 1rem;
}

.selectpicker {
  display: block;
  width: 100%;
  max-width: 300px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.bold-option {
  font-weight: bold;
}

.btn-custom {
  width: 220px;
  background-color: var(--primary);
  color: white;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 30px;
  border: 1px solid var(--primary);
  display: inline-block;
  text-align: center;
  transition: background-color 0.3s, border-color 0.3s;
}

.btn-custom:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.alert-danger {
  color: red;
  background-color: #f8d7da;
  border-color: #f5c6cb;
  border-radius: 5px;
  padding: 10px;
}

/* ===== UPLOAD FORM ===== */

.upload-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-top: 28px;
}

.upload-input-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.upload-input {
  width: min(100%, 420px);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.upload-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}

.upload-button,
.upload-logout-btn {
  min-width: 220px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  font-size: 0.96rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* Upload button */
.upload-button {
  background: linear-gradient(135deg, var(--primary),
  #6366f1
  );
  color: white;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.upload-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.28);
}

/* Logout button */
.upload-logout-btn {
  display: inline-block;
  background: #fff;
  color: var(--text-soft);
  border: 1px solid var(--border);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.upload-logout-btn:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.upload-count {
  margin-bottom: 28px;
  color: var(--text-muted);
  text-align: center;
  font-size: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .navbar-inner {
  flex-direction: column;
  align-items: flex-start;
  }
  .nav-links {
  justify-content: flex-start;
  }
  .grid,
  .grid-small,
  .project-grid,
  .grid-main,
  .grid-secondary {
  grid-template-columns: repeat(2, 1fr);
  }
  .content-grid,
  .wiki-layout {
  grid-template-columns: 1fr;
  }
  .home-page {
  min-height: auto;
  }
  .home-page main {
  justify-content: flex-start;
  padding-top: 24px;
  padding-bottom: 24px;
  }
  .wiki-nav {
  position: relative;
  top: 0;
  }
  .project-logo-wrap {
  min-height: 220px;
  }
  .project-logo {
  max-height: 190px;
  }
}

@media (max-width: 600px) {
  .hero {
  min-height: 140px;
  }
  .hero-content {
  padding: 20px 12px;
  }
  .hero-kicker {
  font-size: 0.8rem;
  }
  .hero-content h1 {
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  }
  .hero-subtitle {
  font-size: 0.98rem;
  }
  main {
  width: min(94vw, var(--container));
  padding-top: 22px;
  padding-bottom: 24px;
  }
  .generic-page main {
  width: 94vw;
  padding: 20px 0 28px;
  }
  .section-block + .section-block {
  margin-top: 24px;
  }
  .section-heading h2 {
  font-size: 1.45rem;
  }
  .section-heading p {
  font-size: 0.96rem;
  }
  .grid,
  .grid-small,
  .project-grid,
  .grid-main,
  .grid-secondary {
  grid-template-columns: 1fr;
  }
  .card-main,
  .card-secondary {
  min-height: unset;
  }
  .card-main {
  padding: 22px 16px;
  }
  .card-secondary {
  padding: 20px 16px;
  }
  .card-main h3 {
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  }
  .card-main p {
  font-size: clamp(1rem, 4vw, 1.1rem);
  }
  .card-secondary h3 {
  font-size: clamp(1.15rem, 5vw, 1.35rem);
  }
  .card-secondary p {
  font-size: 1rem;
  }
  .icon-collab-img {
  height: 90px;
  }
  .footer-inner {
  font-size: 0.8rem;
  }
  .site-title {
  font-size: 17px;
  }
  .page-shell {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  }
  .page-header h1 {
  font-size: 28px;
  }
  .project-logo-wrap {
  min-height: 180px;
  padding: 16px;
  margin-bottom: 16px;
  }
  .project-logo {
  max-height: 150px;
  }
  .project-card {
  min-height: 96px;
  }
  .home-page .hero {
  height: 130px;
  min-height: 130px;
  }
  .home-page .hero-content h1 {
  font-size: 28px;
  }
}

.highlight-marker {
  display: inline;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: linear-gradient(transparent 35%, rgba(250, 204, 21, 0.45) 35%
  );
  font-weight: 700;
}

/* ===== OBSERVER FORM IMPROVED ===== */

.observer-form {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* SELECT WRAPPER */
.observer-input-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* SELECT INPUT */
.observer-select,
.gad-select {
  width: 100%;
  max-width: 680px;
  height: 64px;
  padding: 0 22px;
  border-radius: 18px;
  border: 1.5px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96) );
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.observer-select:hover,
.gad-select:hover {
  border-color: #a5b4fc;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.10);
}

.observer-select:focus,
.gad-select:focus {
  outline: none;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.12), 0 16px 34px rgba(79, 70, 229, 0.14);
}

/* BUTTON WRAPPER */
.observer-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* BUTTON */
.observer-btn,
.gad-btn {
  min-width: 260px;
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #6366f1 );
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.24);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.observer-btn:hover,
.gad-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) );
  box-shadow: 0 18px 38px rgba(79, 70, 229, 0.32);
}

.observer-btn:active,
.gad-btn:active {
  transform: translateY(-1px);
}

.observer-hero {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.observer-hero-img {
  width: 100%;
  height: clamp(140px, 22vh, 220px);
  object-fit: cover;
  object-position: center;
  display: block;
}

.observer-select-page {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.observer-select-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* MOBILE */
@media (max-width: 600px) {
  .observer-form {
  gap: 22px;
  }
  .observer-select {
  height: 58px;
  font-size: 1rem;
  border-radius: 16px;
  }
  .observer-btn {
  width: 100%;
  min-width: unset;
  }
}

/* ===== GAD SELECT PAGE ===== */

.gad-select-page {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gad-hero {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.gad-hero-img {
  width: 100%;
  height: clamp(120px, 18vh, 190px);
  object-fit: cover;
  object-position: center;
  display: block;
}

.gad-form {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.gad-input-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gad-label {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-weight: 700;
  text-align: center;
}

.gad-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

.gad-message-wrapper {
  width: 100%;
  max-width: 520px;
  margin: 24px auto 0;
}

@media (max-width: 600px) {
  .gad-hero-img {
  height: 180px;
  }
  .gad-select {
  height: 58px;
  font-size: 1rem;
  border-radius: 16px;
  }
  .gad-btn {
  width: 100%;
  min-width: unset;
  }
}

/* =========================================================
  PROJECT HOME COMPACT - OVERRIDE FINALE
  Usa queste classi per CARMELO, RAMBO e altre home progetto.
  Hero solo immagine + card compatte solo titolo.
  ========================================================= */

.project-home-page {
  max-width: 1040px;
}

.project-home-hero-image {
  width: 100%;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-home-hero-img {
  width: 100%;
  height: clamp(220px, 34vh, 420px);
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96) );
}

.project-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-home-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 86px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #dbe4ff;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.project-home-card::before,
.project-home-card::after {
  display: none;
  content: none;
}

.project-home-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.14);
}

.project-home-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1;
}

.project-home-card h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #111827;
  text-align: left;
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.2;
}

.project-home-card p {
  display: none;
}

.project-home-card:hover h2 {
  color: var(--primary-dark);
}

@media (max-width: 900px) {
  .project-home-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .project-home-page {
  padding: 14px;
  }
  .project-home-hero-image {
  margin-bottom: 16px;
  border-radius: 18px;
  }
  .project-home-hero-img {
  height: 190px;
  }
  .project-home-grid {
  grid-template-columns: 1fr;
  gap: 12px;
  }
  .project-home-card {
  min-height: 78px;
  padding: 14px 16px;
  border-radius: 16px;
  }
}

/* RAMBO + CURVEGAD: mostra il testo nelle card */
.rambo-page .project-home-card p,
.curvegad-page .project-home-card p {
  display: block;
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.curvegad-page .project-home-hero-image {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 24px;
  margin-bottom: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96) );
  box-shadow: var(--shadow-md);
}

.curvegad-page .project-home-hero-img {
  width: 100%;
  height: clamp(240px, 34vh, 420px);
  object-fit: cover;
  object-position: center;
  display: block;
  padding: 18px;
}