/* Font */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

body {
  font-family: 'Lato', sans-serif;
  color: #000000;
  background-color: #FFFFFF;
}

/* affinché html/body non escano dalla viewport */
html, body {
  height: 100%;
  margin: 0;
}

/* Hero Section */
.bg-gradient {
  background: linear-gradient(135deg, #FFFFFF, #4793AF);
  color: #8B322C;
}

.hero-image {
  background-image: url('assets/filling/8.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-attachment: fixed;
  text-align: center;
  color: #FFFFFF;
}

/* Pseudo-elemento per scurire l'immagine di sfondo */
.hero-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* Assicura che il contenuto (testo) sia posizionato sopra l'overlay */
.hero-image > * {
  position: relative;
  z-index: 2;
}

/* Hero piena altezza */
#home {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Container interno per centrare titolo + vasi */
#home .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Titolo più grande su fullscreen (lato o verticale) */
@media (min-width: 1200px), (min-height: 800px) {
  #home h1 {
    font-size: clamp(4rem, 8vw, 6rem);
    line-height: 1.1;
  }
}

/* Portrait mode: titolo alto e linea spezzata */
@media (orientation: portrait) {
  #home h1 {
    font-size: clamp(3.5rem, 10vw, 5rem);
    text-align: center;
    margin-bottom: 2rem;
  }
}

/* Titolo responsive nella hero section (unificato) */
#home h1,
#home h1.typewriter {
  font-family: 'Agu Display', cursive;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.2;
  letter-spacing: 1px;
  text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.2);
  width: 90%;
  margin: 0 auto;
}

/* (DISABILITATO) Ombre testo hero-image non in uso
.hero-image h1 {
  font-family: 'Agu Display', cursive;
  font-size: 3.2rem;
  letter-spacing: 1px;
  text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.8);
}
.hero-image p {
  font-size: 1.2rem;
  text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.8);
}
*/

h2{
  font-family: 'Righteous', cursive;
}

/* Map Section */
#map {
  width: 100%;
  height: 600px;
  border: 2px solid #4793AF;
}

/* MarkerCluster */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: #4793AF;
}

.about-image {
  background-image: url('assets/filling/3.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-attachment: fixed;
}

.about-overlay {
  width: 100%;
  height: 100%;
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.about-overlay h2{
  font-size: 2rem;
  text-shadow: none; /* niente ombra testo */
}

/* Social Icons */
.btn-social {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background-color: #DD5746;
  color: #FFFFFF;
  transition: background-color 0.3s ease;
}

.btn-social img,
.btn-social i {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.btn-social:hover {
  background-color: #8B322C;
}

/* Team Section */
.team-member {
  text-align: center;
  margin-bottom: 2rem;
}

.team-member img.rounded-circle {
  width: 160px;
  height: 160px;
  object-fit: cover;
  margin-bottom: 1rem;
}

/* Card Styling (no ombre scure) */
.card.team-card {
  border: 2px solid #4793AF;
  background-color: #FFFFFF;
  transition: transform 0.3s ease;
  height: 100%;
}
.card.team-card:hover { transform: translateY(-5px); }

.card-body p {
  font-size: 0.95rem;
  color: #000000;
}

/* Custom Button */
.btn-custom {
  background-color: #DD5746;
  color: #FFFFFF;
  border: none;
}
.btn-custom:hover {
  background-color: #8B322C;
  color: #FFFFFF;
}

/* Responsive */
@media (max-width: 768px) {
  #map { height: 400px; }

  .team-member img.rounded-circle {
    width: 120px;
    height: 120px;
  }

  .btn-social {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .btn-social img,
  .btn-social i {
    width: 20px;
    height: 20px;
  }
}

/* Sezione Collections */
#collections {
  background: linear-gradient(135deg, #8B322C, #B36A5E);
  color: #FFFFFF;
  padding: 4rem 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Stili per i titoli e paragrafi nella sezione */
#collections h2,
#collections h3,
#collections p {
  text-align: center;
  margin-bottom: 1rem;
}

/* Stili specifici per l'hero della collezione MIC */
#mic-hero {
  background: url('assets/filling/10.jpg') no-repeat center center;
  background-size: cover;
  position: relative;
  color: #FFFFFF;
  text-align: center;
}
#mic-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}
/* Assicura che il contenuto (testo) sia sempre in primo piano */
#mic-hero > * { position: relative; z-index: 2; }
#mic-hero h1 {
  font-family: 'Agu Display', cursive;
  font-size: 3.2rem;
  letter-spacing: 1px;
  text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.8);
}

/* Stili specifici per l'hero della collezione SEVRES */
#sevres-hero {
  background: url('assets/filling/11.jpg') no-repeat center center;
  background-size: cover;
  position: relative;
  color: #FFFFFF;
  text-align: center;
}
#sevres-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}
/* Assicura che il contenuto (testo) sia sempre in primo piano */
#sevres-hero > * { position: relative; z-index: 2; }
#sevres-hero h1 {
  font-family: 'Agu Display', cursive;
  font-size: 3.2rem;
  letter-spacing: 1px;
  text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.8);
}

.subtitle-paragraph {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 800px;
  font-size: 1.2rem;
  padding: 0 1rem;
}

.card-img-top {
  object-fit: cover;
  height: 200px;
  width: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Vases container in piena larghezza e altezza disponibile */
.vases {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex-grow: 1;
}

/* Ogni vaso prenda uno spazio uguale */
.vase-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* SVG che scala fino a un massimo in viewport */
.vase-container svg {
  max-height: 80vh;
  max-width: 30vw;
  width: auto;
  height: auto;
}

/* In portrait riduco leggermente i vasi per farli stare */
@media (orientation: portrait) {
  .vase-container svg {
    max-height: 50vh;
    max-width: 80vw;
  }
}

/* Stati iniziali offscreen */
.offscreen-left   { transform: translateX(-150%); }
.offscreen-right  { transform: translateX(150%); }
.offscreen-up     { transform: translateY(-150%); }

/* Stato finale onscreen */
.onscreen         { transform: translate(0,0) !important; }

/* Transizione liscia (tutti gli stati) */
.vase-container image,
.offscreen-left,
.offscreen-right,
.offscreen-up,
.onscreen { transition: transform 0.6s ease-out; }

/* Pulsante sempre sotto i vasi */
.vase-container + a.btn { margin-top: 1rem; }

/* Typewriter effect for hero title without caret */
#home h1.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 3s steps(30, end) forwards;
}
@keyframes typing { from { width: 0; } to { width: 100%; } }

/* ====== Mobile breakpoint ====== */
@media (max-width: 576px) {
  #home { height: auto; padding: 2rem 0; }
  #home h1 {
    font-size: clamp(4rem, 14vw, 5rem);
    animation: bounceMobile 1.5s ease-out;
    overflow-wrap: break-word;
    word-break: keep-all;
    margin: 0 auto 1rem;
    line-height: 1.1;
  }
  #home h1.typewriter {
    overflow: visible;
    white-space: normal;
    animation: none;
    border: none;
    width: auto;
  }
  .vase-container { display: none; }
  .vase-container.center {
    display: flex;
    flex: 0 0 auto;
    width: 70vw;
    max-width: 300px;
    margin: 0 auto;
  }
}

/* Keyframes per bounce dall’alto su mobile */
@keyframes bounceMobile {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(10%); }
  80%  { transform: translateY(-5%); }
  100% { transform: translateY(0); }
}

/* ====== Breakpoint fino a 992px per wrap titolo Hero ====== */
@media (max-width: 992px) {
  #home h1, #home h1.typewriter {
    white-space: normal !important;
    overflow: visible !important;
    width: 90% !important;
    margin: 0 auto !important;
    font-size: clamp(2.5rem, 7vw, 5rem) !important;
  }
  #home h1.typewriter { animation: none !important; width: auto !important; }
}

/* ====== Fix per caroselli MIC (versione unica, niente duplicati) ====== */
#catalogue-container .carousel-inner {
  position: relative;
  overflow: hidden;
  height: 300px;
}
#catalogue-container .carousel-item { transition: transform .6s ease; }
#catalogue-container .carousel-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;      /* evita tagli */
  object-position: center;
  margin: 0 auto;
}
#catalogue-container .carousel-control-prev,
#catalogue-container .carousel-control-next { z-index: 10; }

/* =========================
   CUSTOM ACCORDION STYLES
   ========================= */
.accordion-button {
  background: transparent !important;
  border: none !important;
  padding: 1rem 0 !important;
  font-family: 'Righteous', cursive;
  font-size: 2.4rem;
  letter-spacing: 1px;
  color: #333 !important;
  position: relative;
}
/* Sottolineatura */
.accordion-button::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px; background: #8B322C;
}
/* Freccia a destra (FontAwesome) */
.accordion-button::before {
  font-family: "Font Awesome 5 Free";
  content: "\f078";
  font-weight: 900;
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.3s ease;
}
/* Stato aperto */
.accordion-button:not(.collapsed) { color: #4793AF !important; }
.accordion-button:not(.collapsed)::before {
  transform: translateY(-50%) rotate(180deg);
}
.accordion-item { border: none; }
.accordion-body { padding: 1.5rem 0; border-top: none; }
.accordion-item + .accordion-item { margin-top: 2rem; }

/* HEATMAP */
.heatmap-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}
.heatmap-table th,
.heatmap-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 4px;
}
#heatmapContainer { margin-top: 1rem; }

.chart-container {
  width: 100%;
  overflow-x: auto;
  padding: 0 1rem;
}

/* Tutti i canvas dei grafici Chart.js */
canvas { width: 100% !important; height: 400px !important; }

/* Container responsive per il Sankey */
#sankeyChart { width: 100%; }

/* Quando ci troviamo dentro #collapseCondition, container diventa full-width */
#collapseCondition .container { max-width: none; width: 100%; }

.modal-body canvas { width: 100% !important; height: auto !important; }

/* Colorazione label SPARQL Interface */
#sparql-interface .form-label.fw-bold.fs-5 { color: #DD5746; }

.model-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  /* ombra leggera, non nera/pesante */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  height: 100%;
}
model-viewer {
  width: 100%;
  height: 300px;
  border-radius: 4px;
}

/* =========================
   TABELLE CSV UNIFICATE
   ========================= */

/* Contenitore scrollabile (classe riusabile + compat con ID esistenti) */
.csv-table-container,
#table-container,
#table-container-obj,
#table-container-pro {
  max-height: 600px;
  overflow: auto;
  border: 1px solid #ddd;
  padding: 0.5rem;
  background: #fff;
  margin: 1rem 0;
}

/* Stili base per le tabelle */
.csv-table,
#table-container table,
#table-container-obj table,
#table-container-pro table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.csv-table th, .csv-table td,
#table-container th, #table-container td,
#table-container-obj th, #table-container-obj td,
#table-container-pro th, #table-container-pro td {
  padding: 0.4rem;
  border: 1px solid #ccc;
  white-space: normal;
  word-break: break-word;
  min-width: 150px;
}

/* Header più evidente (sticky opzionale) */
.csv-table thead th,
#table-container thead th,
#table-container-obj thead th,
#table-container-pro thead th {
  font-weight: 600;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

/* Colori pastello a colonne (1..6 ricorrenti) */
.csv-table :is(th, td):nth-child(6n+1),
#table-container :is(th, td):nth-child(6n+1),
#table-container-obj :is(th, td):nth-child(6n+1),
#table-container-pro :is(th, td):nth-child(6n+1) { background-color: #C3D9ED; }

.csv-table :is(th, td):nth-child(6n+2),
#table-container :is(th, td):nth-child(6n+2),
#table-container-obj :is(th, td):nth-child(6n+2),
#table-container-pro :is(th, td):nth-child(6n+2) { background-color: #EBC6B0; }

.csv-table :is(th, td):nth-child(6n+3),
#table-container :is(th, td):nth-child(6n+3),
#table-container-obj :is(th, td):nth-child(6n+3),
#table-container-pro :is(th, td):nth-child(6n+3) { background-color: #E1A298; }

.csv-table :is(th, td):nth-child(6n+4),
#table-container :is(th, td):nth-child(6n+4),
#table-container-obj :is(th, td):nth-child(6n+4),
#table-container-pro :is(th, td):nth-child(6n+4) { background-color: #EFE3B0; }

.csv-table :is(th, td):nth-child(6n+5),
#table-container :is(th, td):nth-child(6n+5),
#table-container-obj :is(th, td):nth-child(6n+5),
#table-container-pro :is(th, td):nth-child(6n+5) { background-color: #F9F3E9; }

.csv-table :is(th, td):nth-child(6n+6),
#table-container :is(th, td):nth-child(6n+6),
#table-container-obj :is(th, td):nth-child(6n+6),
#table-container-pro :is(th, td):nth-child(6n+6) { background-color: #FDFBF6; }

/* ——— Unifica stile e colori per TUTTE le tabelle CSV ——— */
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro) {
  max-height: 600px;
  overflow: auto;
  border: 1px solid #ddd;
  padding: 0.5rem;
  background: #fff;
  margin: 1rem 0;
}

/* disattiva lo striped Bootstrap dentro i nostri container */
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro)
  table.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: transparent;
}

/* colonne a colori (stessa palette ovunque) */
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro)
  table :is(th,td):nth-child(6n + 1) { background-color:#C3D9ED; }
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro)
  table :is(th,td):nth-child(6n + 2) { background-color:#EBC6B0; }
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro)
  table :is(th,td):nth-child(6n + 3) { background-color:#E1A298; }
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro)
  table :is(th,td):nth-child(6n + 4) { background-color:#EFE3B0; }
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro)
  table :is(th,td):nth-child(6n + 5) { background-color:#F9F3E9; }
:where(.csv-table-container, #table-container, #process-table-container, #table-container-obj, #table-container-pro)
  table :is(th,td):nth-child(6n + 6) { background-color:#FDFBF6; }
