/* ------------------------------------------------------------------ */
/*  FONT + BASE                                                       */
/* ------------------------------------------------------------------ */
@font-face {
  font-family: "Inter";
  src: url('../fonts/Inter.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #d02d00;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  overflow-x: hidden;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ------------------------------------------------------------------ */
/*  NAVBAR                                                            */
/* ------------------------------------------------------------------ */
.navbar-nav a {
  color: #d02e02;
  font-family: 'Inter', sans-serif;
}

.navbar-nav a.nav-link.active {
  font-weight: bold;
}

.nav-link {
  margin-inline: 0.5rem;
}

/* ------------------------------------------------------------------ */
/*  FOOTER                                                            */
/* ------------------------------------------------------------------ */
.site-footer {
  background: #fff;
  color: #d02d00;
  text-align: center;
  padding: 1rem 0;
  border-top: 2px solid #d02d00;
  font-size: 0.875rem;
  margin-top: 40px;
}

.site-footer a {
  color: #333;
  margin-top: 0.2rem;
  display: inline-block;
}

.site-footer i {
  font-size: 1.4rem;
}

/* ------------------------------------------------------------------ */
/*  CONTAINER + LAYOUT                                                */
/* ------------------------------------------------------------------ */

.container {
  width: 100%;
  padding-inline: 1rem; 
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 2vw;
  align-items: flex-start;
}

.info-section, .custom-margin {
  flex: 1 1 45%;
  min-width: 500px;
}

/* ------------------------------------------------------------------ */
/*  INFO SECTION                                                      */
/* ------------------------------------------------------------------ */
.info-section h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  color: #d02d00;
  margin-top: 2rem;
}

.info-section h2 {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 1rem;
  text-align: justify;
}

.info-section p, .info-section h3 {
  font-size: 0.95rem;
  text-align: justify;
  margin-bottom: 1rem;
  color: #d02d00;
}

.info-section a {
  color: inherit;                   
  text-decoration: none;           
  border-bottom: 1px dotted #d02d00; 
  transition: border-bottom 0.2s ease;
}

.info-section a:hover {
  border-bottom: 1px solid #d02d00; 
  cursor: pointer;
}


/* ------------------------------------------------------------------ */
/*  MAPPA SVG                                                         */
/* ------------------------------------------------------------------ */
.image-mapper-shape {
  cursor: pointer;
  fill: rgba(0, 0, 0, 0);
}

.image-mapper-shape:hover {
  fill-opacity: 0.6;
  fill: #D02E02;
}

.custom-margin {
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-margin svg {
  max-height: 80vh;
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/*  TABLE                                                             */
/* ------------------------------------------------------------------ */
.table-container {
  overflow-x: auto;
  margin-block: 2rem;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 100%;
}

th, td {
  padding: 0.5rem;
  border-bottom: 1px solid #d02d00;
  font-size: 0.9rem;
  color: #d02d00;
  text-align: left;
  vertical-align: top;
}

th {
  cursor: pointer;
  position: relative;
  border-bottom: 2px solid #d02d00;
  font-weight: 400;
  padding-right: 1.25rem;
}

.table th, .table td {
  color: #d02d00 !important;
}

th .sort-arrow {
  font-size: 0.75rem;
  margin-left: 5px;
  color: rgba(192, 57, 43, 0.5);
  transition: transform 0.3s, color 0.3s ease;
  display: inline-block;
}

th .sort-arrow:hover {
  color: #d02d00;
  cursor: pointer;
}

th.desc .sort-arrow, .sort-arrow.desc {
  transform: rotate(180deg);
}

thead tr {
  border-bottom: 2px solid #d02d00;
}

.table td:first-child, .table th:first-child {
  padding-right: 2px;
  width: 40px;
  text-align: center;
}

.table td:nth-child(2), .table th:nth-child(2) {
  padding-left: 6px;
}

.expanded td {
  border-bottom: none !important;
}

/* ------------------------------------------------------------------ */
/*  DROPDOWN                                                          */
/* ------------------------------------------------------------------ */
.custom-dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.dropdown-trigger {
  cursor: pointer;
  padding-right: 1rem;
  font-size: 0.9rem;
  color: #d02d00;
}

.dropdown-menu.show {
  display: block !important;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 2px solid #d02d00;
  min-width: 120px;
  z-index: 1000;
  margin-top: 0.5rem;
}

.menu-item {
  padding: 0.5rem 1rem;
  color: #d02d00;
  font-size: 0.875rem;
  transition: background 0.3s;
}

.menu-item:hover {
  background-color: #fff0ec;
}


/* ------------------------------------------------------------------ */
/*  HIDDEN INFO                                                       */
/* ------------------------------------------------------------------ */

.hidden-info {
  display: none;
  padding: 2vw;
  background: #fff;
  color: #d02d00;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  transform: translateY(-5px);
}

.hidden-info.show {
  display: table-row !important;
  opacity: 1;
  transform: translateY(0);
}

.hidden-info .row {
  display: flex;
  flex-wrap: wrap;
  gap: 2vw;
  align-items: flex-start;
}

.details-left {
  flex: 0 0 30%;
  max-width: 400px;
  text-align: center;
  align-self: center;
}

.details-right {
  flex: 1;
  padding-left: 5%;
  box-sizing: border-box;
  font-size: 0.9rem;
  text-align: justify;
}

.film-image {
  width: 100%;
}

.read-more {
  display: inline-block;
  background: #fff;
  color: #d02d00;
  border: 1px solid #d02d00;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}

.read-more:hover {
  background-color: transparent;
  border: 2px solid #d02d00;
}
/* ------------------------------------------------------------------ */
/*  VARI UTILI                                                        */
/* ------------------------------------------------------------------ */
.clickable, .filter-year, .filter-context, .filter-reality, .filter-ideals, .toggle-info {
  cursor: pointer;
  text-decoration: none;
  transition: 0.3s ease;
}

.clickable:hover, .toggle-info:hover {
  text-decoration: underline;
}

.back-button-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.back-button {
  background: transparent;
  color: #d02d00;
  padding: 0.5rem 1rem;
  border: 1px solid #d02d00;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}

.back-button:hover {
  border: 2px solid #d02d00;
}

.hidden {
  display: none !important;
}

@media (max-width: 992px) {
  html, body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
  }

  .container, .row {
    margin-inline: auto;
    padding-inline: 1rem;
    max-width: 100vw;
  }

  .custom-margin {
    flex-direction: column;
    gap: 2rem;
  }

  .table-container {
    width: 100vw;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: auto;
    display: block;
  }

  .table {
    width: 100vw;
    min-width: 700px;
    margin: 0;
    border-collapse: collapse;
  }

  th, td {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .table td:first-child, .table th:first-child {
    min-width: 40px;
    max-width: 50px;
    text-align: center;
  }

  .sort-arrow {
    font-size: 0.75rem;
    margin-left: 4px;
    vertical-align: middle;
    display: inline-block;
  }

  th .dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .hidden-info {
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

 
  .hidden-info .row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1rem;
    overflow-x: auto;
  }

  .details-left {
    flex: 0 0 auto;
    max-width: 40%;
    text-align: center;
  }

  .film-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 5px;
  }

  .details-right {
    flex: 1 1 60%;
    min-width: 0;
    padding-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: justify;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .table-container {
    width: 100vw;
    overflow-x: auto;
    margin: 1rem 0;
    padding: 0;
  }

  .table {
    min-width: 100%;
    font-size: 0.7rem;
    border-collapse: collapse;
  }

  th, td {
    padding: 0.25rem;
    font-size: 0.7rem;
    white-space: normal;
    word-break: break-word;
  }

  .table td:first-child, .table th:first-child {
    min-width: 35px;
    max-width: 45px;
    text-align: center;
  }

  .sort-arrow {
    font-size: 0.7rem;
    margin-left: 3px;
  }

  th .dropdown-trigger {
    font-size: 0.7rem;
    gap: 0.2rem;
  }

  .dropdown-menu {
    position: fixed;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 80vw;
    z-index: 2000;
    font-size: 0.7rem;
    min-width: 100px;
  }

  .details-right {
    min-width: 100% !important;
    width: 100%;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: justify;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
  }

  .hidden-info .row {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    gap: 1rem;
  }

  .details-left {
    flex: 0 0 auto;
    max-width: 100%;
    margin-bottom: 1rem;
  }

  .info-section,
  .custom-margin {
    min-width: 300px;
    width: 100%;
    flex: 1 1 100%;
  }

  .custom-dropdown .dropdown-trigger {
    padding-right: 0.5rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .info-section, .custom-margin {
    min-width: 100% !important;
    padding: 0 0.5rem;
  }

  .info-section h1 {
    font-size: 1.8rem;
  }

  .table th, .table td {
    padding: 0.2rem;
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  .hidden-img {
    max-width: 90vw;
  }
}
