/* =========================
   RESET E BASE
   ========================= */

/* Reset minimo */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.layout-v2 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


.layout-body {
  display: flex;
  min-height: calc(100vh - 120px - 56px - 40px);
}

/* =========================
   HEADER
   ========================= */

.header-wrapper {
  display: grid;
  grid-template-columns: 220px 1fr; /* sidebar | contenuto */
  grid-template-rows: 100px 45px;   /* banner | menu */
  width: 100%;
}

.header-wrapper {
  flex-shrink: 0;
}

/* --- POSIZIONAMENTO GRID (FONDAMENTALE) --- */

.header-logo {
  grid-column: 1;
  grid-row: 1;
}

.header-banner {
  grid-column: 2;
  grid-row: 1;
}

.header-spacer {
  grid-column: 1;
  grid-row: 2;
}

.header-menu {
  grid-column: 2;
  grid-row: 2;
}

/* --- COLONNA SINISTRA HEADER --- */

.header-left {
  background: #fafafa;
  border-bottom: 1px solid #ddd;
}

.header-logo {
  grid-column: 1;
  grid-row: 1 / span 2;   /* 🔑 OCCUPA BANNER + MENU */

  background-image: url('/frontend/v2/images/logo.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-color: #B1A891;

  display: flex;
  align-items: center;
  justify-content: center;

  border-bottom: 1px solid #ddd;
}



/* --- BANNER --- */

.header-banner {
  background-image: url('/frontend/v2/images/banner.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: top left;
  background-color: #B1A891;
}

/* --- MENU SOTTO IL BANNER --- */

.header-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #B1A891;
  border-bottom: 1px solid #ddd;
}

/* =========================
   MENU TOP (LINK)
   ========================= */

.topbar a {
  text-decoration: none;
  margin-right: 15px;
  color: #333;
}

.topbar-center a {
  padding: 6px 10px;
  text-decoration: none;
  color: #333;
  position: relative;
}

/* Voce attiva */
.topbar-center a.active {
  font-weight: 600;
}

/* Sottolineatura */
.topbar-center a.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background-color: #0056b3;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px; /* 🔑 spazio tra utente e logout */
}

.topbar-right a {
  color: #333;            /* stesso colore del testo */
  text-decoration: none;  /* niente sottolineatura */
}

.topbar-right a:hover {
  text-decoration: underline; /* opzionale: feedback hover */
}



/* =========================
   LAYOUT
   ========================= */

.layout-body {
  flex: 1;
  display: flex;
  min-height: 0; /* 🔑 fondamentale per evitare overflow */
}


/* =========================
   SIDEBAR
   ========================= */

.sidebar {
  width: 220px;
  padding: 15px;
  border-right: 1px solid #ddd;
  background-color: white; 

}

.sidebar a {
  display: block;
  padding: 6px 0;
  color: #333;
  text-decoration: none;
}

.sidebar-nav a,
.sidebar-nav .sidebar-nav-item {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
}

.sidebar-nav a.active,
.sidebar-nav .sidebar-nav-item.active {
  font-weight: bold;
  background-color: #B1A891;
  border-left: 3px solid #0056b3;
}

.sidebar-nav .sidebar-current {
  cursor: default;
}



/* =========================
   SIDEBAR – GROUP TITLE (LIKE TOP MENU)
   ========================= */

.sidebar-group-title {
  padding: 8px 12px;
  position: relative;
  font-weight: 500;
}

.sidebar-group-title.active {
  font-weight: 600;
}

/* sottolineatura come menu top */
.sidebar-group-title.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background-color: #0056b3;
}

/* =========================
   SIDEBAR – FAST SEARCH SUBMENU INDENT
   ========================= */

.sidebar-submenu {
  margin-left: 14px;        /* rientro visivo */
  border-left: 1px solid #ddd;
  padding-left: 8px;
}

.sidebar-submenu a {
  padding-left: 6px;
}


/* =========================
   SIDEBAR – FONT SIZE
   ========================= */

.sidebar,
.sidebar-nav {
  font-size: 0.9rem;   /* default ~14.4px */
  line-height: 1.3;
}

/* Titolo sezione (es. Ricerca, Amministrazione) */
.sidebar-title-only,
.sidebar-group-title {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Voci normali */
.sidebar-nav a {
  font-size: 0.88rem;
  padding: 6px 10px;
}

/* Sottovoci (ricerca veloce) */
.sidebar-submenu a {
  font-size: 0.85rem;
  padding-left: 18px;   /* rientro visivo */
}


/* =========================
   MAIN CONTENT
   ========================= */

.main-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background-color: white;
}


/* =========================
   FOOTER
   ========================= */

.footer-bar {
  background: #B1A891;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: relative;
}


/* Contenitore loghi */
.footer-logos {
  display: flex;
  align-items: center;
  gap: 24px;
   margin: 0 auto;
}

/* Loghi */
/* Altezza di riferimento = Sapienza */
.footer-logos img {
  height: 38px;          /* 🔑 tutti si adeguano */
  width: auto;
  object-fit: contain;
}

/* Sapienza leggermente più piccola e “autoriale” */
.footer-logos img.logo-sapienza {
  height: 52px;
}

/* Separatore verticale */
.footer-separator {
  width: 1px;
  height: 50px;
  background: rgba(255,255,255,0.4);
}

.footer-legal {
  position: absolute;
  right: 24px;
  font-size: 0.75rem;
  color: #eee;
  white-space: nowrap;
}

.footer-legal a {
  color: #eee;
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

.footer-legal-separator {
  margin: 0 6px;
}


/* =========================
   SYSTEM PAGE
   ========================= */

.system-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.system-header h1 {
  margin-bottom: 24px;
  font-size: 1.8rem;
}

.system-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 2fr 1.5fr 1.5fr;
  gap: 24px;
}

/* =========================
   SYSTEM – COLONNA 1 (AREE)
   ========================= */

.system-col-areas {
  display: flex;
  align-items: center;
}

.system-areas {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 50%;
}

.system-areas li {
  font-size: 1rem;
  line-height: 1.4;
}

.system-areas li::first-letter {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-right: 4px;
}

/* =========================
   SYSTEM AREAS – BULLETED
   ========================= */

.system-col-areas:has(.system-areas--bulleted) {
  align-items: flex-start;
}


.system-areas--bulleted {
  list-style: disc;
  height: 50%;                 /* occupa il 50% */
  justify-content: space-between; /* parte dall’alto */
  
}

.system-areas--bulleted li::first-letter {
  font-size: 1em;
  font-weight: normal;
  line-height: normal;
  margin-right: 0;
}

/* =========================
   SYSTEM AREAS – BULLETED (TOP + 50%)
   ========================= */




/* =========================
   SYSTEM – COLONNA 3
   ========================= */

.system-col-images-2 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.system-images-2-wrapper {
  height: 80%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 70%;
}

.system-images-2-wrapper img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* =========================
   SYSTEM – COLONNA 4
   ========================= */

.system-col-image-1 {
  display: flex;
  align-items: center;
}

.system-image-1-wrapper img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}


.department-banners {
  list-style: none;
  padding: 0;
  margin: 20px 0;

  display: flex;
  flex-direction: column;
  gap: 16px;
}

.department-banner {
  position: relative;
  min-height: 90px;
  padding: 20px;

  display: flex;
  align-items: center;

  background-size: cover;
  background-position: center;

  filter: grayscale(100%);
  transition: filter 0.3s ease;

  border-radius: 4px;
  cursor: default;
}

.department-banner:hover {
  filter: grayscale(0%);
}

.department-banner span {
  position: relative;
  z-index: 1;

  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}


.banner-sdara {
  background-image: url('/frontend/v2/images/dip_sdara.jpg');
}

.banner-antichita {
  background-image: url('/frontend/v2/images/dip_antichita.jpg');
}

.banner-terra {
  background-image: url('/frontend/v2/images/dip_terra.png');
}

.banner-biologia {
  background-image: url('/frontend/v2/images/dip_biologia.jpg');
}

/* =========================
   SIDEBAR – TITLE ONLY
   ========================= */

.sidebar-title-only {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;

  padding: 12px 8px;
  margin-top: 8px;

  border-bottom: 1px solid #ddd;
}

/* =========================
   SIDEBAR – INVESTIGATION
   ========================= */

.sidebar {
  flex: 0 0 220px;   /* 🔑 blocca a 220px */
  width: 220px;      /* ridondante ma utile */
}


/* SEZIONE MODELLI UTILIZZATI */

.models-section {
  padding: 24px;
}

.models-header h1 {
  /*margin-bottom: 12px;*/
  margin-bottom: 24px;
  font-size: 1.8rem;
}

.models-intro {
  max-width: 900px;
  margin-bottom: 32px;
  color: #444;
  line-height: 1.6;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.model-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.model-card h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.model-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.model-card a {
  margin-top: auto;
  font-size: 0.85rem;
  color: #0056b3;
  word-break: break-all;
}

.model-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.model-logo {
  height: 48px;        /* 🔑 riferimento unico */
  width: auto;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}
/* =====================================================
   PARTECIPANTI – ACCORDION (SPAZIO BIANCO REALE)
   ===================================================== */

.department-banner {
  position: relative;
  height: 90px;
  padding: 20px;

  display: flex;
  align-items: center;

  background-size: cover;
  background-position: center;
  border-radius: 4px;

  filter: grayscale(100%);
}

.department-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}


.department-people {
  font-size: 1.05rem;
  font-weight: 600;

  color: #ffffff;                 /* 🔑 bianco pieno */
  letter-spacing: 0.2px;

  text-shadow:
    0 1px 2px rgba(0,0,0,0.45);    /* 🔑 aiuta molto */
}


.department-overlay {
  position: relative;
  z-index: 1;
}


.department-banner::before {
  content: '';
  position: absolute;
  inset: 0;

  background: linear-gradient(
    to right,
    rgba(0,0,0,0.35),
    rgba(0,0,0,0.10)
  );

  border-radius: 4px;
  z-index: 0;
}

.system-video-wrapper {
  margin-top: 60px;
  text-align: center;
}

.system-video {
  width: 50%;
  max-width: 960px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ======================
   COOKIES
   ====================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2f2f2f;
  color: #fff;
  font-size: 0.8rem;
  z-index: 9999;
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-banner a {
  color: #fff;
  text-decoration: underline;
}

.cookie-btn {
  background: #B1A891;
  border: none;
  color: #000;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8rem;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.legal-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.legal-modal-content {
  position: relative;
  max-width: 880px;
  max-height: 85vh;
  margin: 5vh auto;
  background: #ffffff;

  border-radius: 50px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);

  overflow: hidden;   /* 🔑 TAGLIA la scrollbar */
}

.legal-modal-scroll {
  max-height: 85vh;
  padding: 40px 48px;
  overflow-y: auto;   /* 🔑 scroll SOLO qui */
}


.legal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.legal-text h2 {
  margin-top: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: 8px 12px;
    background: #fff;
    color: #000;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
}

.system-description {
    margin-top: 20px;
    line-height: 2;
}

.manage-users {
    margin: 30px;
}

.manage-users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.icon-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    font-size: 1rem;
}

.icon-button:focus-visible {
    outline: 3px solid #000;
    outline-offset: 3px;
}

.manage-users-header .icon-button {
    color: gray;
    font-size: 24px;
}

.edit-button {
    color: blue;
}

.delete-button {
    color: #b00000;
}

.edit-user {
    margin: 30px;
}

.edit-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-user-form {
    width: 80%;
    margin-left: 10%;
}

.warning {
    color: #b00000;
}

.search-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.search-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 650px;
    width: 90%;
}

.investigation-page {
    margin: 24px 32px;
}

.investigation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.investigation-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.shacl-container {
    border: dashed 2px gray;
    padding: 10px;
    border-radius: 5px;
    max-width: 60%;
    margin: 10px auto 0 auto;
}

.shacl-output {
    margin-top: 10px;
    border: solid 1px gray;
    border-radius: 10px;
    padding: 10px;
}

.investigation-bottom-spacer {
    margin-top: 200px;
}

.search-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.search-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 650px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 40px;
    margin-bottom: 10px;
}

.search-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.close-btn {
    align-self: flex-end;
    background: transparent;
    border: none;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}

.search-modal-select {
    width: 100%;
    padding: 5px;
    font-size: 16px;
}

.selected-instance {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.search-modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.search-modal-action {
    background: transparent;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
}

.search-modal-action-more {
    color: blue;
    border: solid 1px blue;
}

.search-modal-action-confirm {
    color: green;
    border: solid 1px green;
}

.investigation-search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.yasqe .CodeMirror {
    font-size: 0.9em;
    height: 380px;
}

.yasr_header {
    display: none;
}

.form-container {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result-container {
    margin-top: 20px;
}

.yasr_external_ref_btn {
    display: none !important;
}

.switch-accessible-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.viewer-container {
    max-width: 1100px;
    margin: 20px auto;
}

.viewer-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
}

.viewer-download-actions {
    margin-top: 20px;
}

.viewer-shacl-container {
    margin-top: 15px;
    border: dashed 2px gray;
    padding: 15px;
    border-radius: 6px;
    max-width: 60%;
}

.viewer-shacl-output {
    margin-top: 15px;
    border: solid 1px gray;
    border-radius: 6px;
    padding: 10px;
}

.viewer-actions {
    text-align: center;
    margin-top: 20px;
}

.viewer-close-hint {
    margin-top: 6px;
    color: #666;
    font-size: 0.9em;
}

.viewer-stop-icon {
    color: #b00000;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: #0645ad;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.link-button:focus-visible {
    outline: 3px solid #000;
    outline-offset: 3px;
}

.footer-legal {
  position: absolute;
  right: 24px;
  font-size: 0.75rem;
  color: #6E1B2A;
  white-space: nowrap;
}

.footer-legal a,
.footer-legal-link {
  color: #6E1B2A;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal a:hover,
.footer-legal-link:hover {
  text-decoration-thickness: 2px;
}

.footer-legal a:focus-visible,
.footer-legal-link:focus-visible {
  outline: 3px solid #6E1B2A;
  outline-offset: 3px;
}

.footer-legal-separator {
  margin: 0 6px;
  color: #6E1B2A;
}

/* Override accessibilità pulsanti login */
/* Pulsanti login e ospite - contrasto accessibile */
.login-form button[type="submit"],
.login-form .anonymous-button {
    background-color: #B1A891;
    color: #6E1B2A;
    border: 2px solid #6E1B2A;
    font-weight: 600;
}

.login-form button[type="submit"]:hover,
.login-form .anonymous-button:hover {
    background-color: #A79D84;
    color: #5F1725;
    border-color: #5F1725;
}

.login-form button[type="submit"]:focus-visible,
.login-form .anonymous-button:focus-visible {
    outline: 3px solid #6E1B2A;
    outline-offset: 3px;
}


/* =========================
   LAYOUT – EVITA DOPPIA SCROLLBAR
   ========================= */

/* Lo scroll deve restare solo dentro il contenuto centrale */
html,
body {
  overflow: hidden;
}

body.layout-v2 {
  overflow: hidden;
}

.layout-body {
  overflow: hidden;
}

.main-content {
  overflow: auto;
}

/* =========================
   CREDITI
   ========================= */

.credits-header h1 {
  font-size: 2.3rem;
}

.credits-title {
  font-size: 1.05rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.credits-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.credits-list {
  font-size: 0.95rem;
  line-height: 1.5;
}

.credits-list-title {
  margin: 8px 0 4px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: normal;
  font-style: italic;
}