:root {
  --primary: #31499C;
  --secondary: #B89A4A;
  --bg: #f3f3f3;
  --text: #222;
  --white: #ffffff;
}

/* RESET */
body {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 16.2px;
  background: var(--bg);
  color: var(--text);
}

/* SIDEBAR */

/* SIDEBAR */
.sidebar {
  position: fixed;
  width: 250px;
  height: 100vh;
  box-sizing: border-box;
  background: var(--primary);
  color: white;
  padding: 20px;
  display: flex !important;
  flex-direction: column !important;
}

.brand {
  font-size: 28px;
  font-weight: bold;
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 10px;
}

.nav a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 10px 0;
  margin-top: 10px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.nav a:hover,
.nav .active {
  border-left: 3px solid var(--secondary);
  padding-left: 10px;
}

/* MAIN */

main {
  margin-left: 250px;
  padding: 40px 60px 10px;
  display: flex;
  justify-content: center;
}

.content {
  width: min(100%, 1300px);
  max-width: none;
}

/* HERO */

.hero {
  margin-bottom: 20px;
}

.hero h1 {
  margin: 0;
  color: var(--primary);
  font-size: 2.2rem;
  line-height: 1.2;
  text-align: justify;
  text-align-last: left;
}

/* TEXT */

section {
  margin-bottom: 40px;
}

section p {
  line-height: 1.75;
  margin-bottom: 20px;
  text-align: justify;
  font-size: 1.08rem;
}

/* TITLES */

h2 {
  margin-top: 50px;
  margin-bottom: 15px;
  font-size: 1.4rem;
  color: var(--primary);
  text-align: justify;
  text-align-last: left;
}

h3 {
  color: var(--primary);
  margin-top: 30px;
  margin-bottom: 10px;
}

/* TABLES */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0 35px 0;
  font-size: 1.08rem;
}

td {
  border-bottom: 1px solid #e5e5e5;
  padding: 8px 10px;
  vertical-align: top;
}

td:first-child {
  width: 180px;
  font-weight: 500;
  color: var(--primary);
  text-align: left;
}

td:last-child {
  text-align: justify;
}

tr:nth-child(even) {
  background: #fafafa;
}

table p {
  margin: 6px 0 0 0;
  line-height: 1.6;
}

.indent {
  margin-left: 20px;
}

/* SEARCH FILTERS */

.table-filters {
  display: grid;
  grid-template-columns: 180px 1fr;
  width: 100%;
  margin: 25px 0 12px 0;
  column-gap: 0;
}

#searchCol1,
#searchCol2 {
  width: 100%;
  box-sizing: border-box;
}

#searchCol1 {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#searchCol2 {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.table-search {
  padding: 12px 16px;
  font-family: Georgia, serif;
  font-size: 0.95rem;
  color: var(--text);

  background: #ffffff;
  border: 1px solid #ddd7cf;

  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.table-search::placeholder {
  color: #9a9187;
  font-style: italic;
}

.table-search:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(201,162,39,0.12);
  background: #fffdf9;
}

/* OUTPUTS */

.output-list {
  list-style: none;
  padding: 0;
}

.output-list li {
  border-bottom: 1px solid #e5e5e5;
  padding: 10px 0;
  line-height: 1.6;
}

.date {
  font-weight: bold;
  color: var(--primary);
}

/* CARDS */

.index-cards {
  display: flex;
  gap: 20px;
  margin-top: 40px;
}

.card {
  flex: 1;
  padding: 18px 22px 22px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-top: 4px solid var(--secondary);
  border-radius: 6px;
  transition: all 0.2s ease;
  display: block;
  color: inherit;
  text-decoration: none;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.card p {
  text-align: justify;
  font-size: 1rem;
  line-height: 1.6;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  cursor: pointer;
}

/* TEAM */

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-top: 25px;
}

.member {
  display: flex;
  gap: 15px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-top: 3px solid var(--secondary);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.member:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.member img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #f0f0f0;
}

.member h4 {
  margin: 0;
  font-size: 1rem;
}

.member .role {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 4px 0;
  color: #666;
}

.member .bio {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  text-align: justify;
}

.team-grid .member:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 400px;
}

/* PROJECT LIST */

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: Georgia, serif;
}

.project-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid #ddd7cf;
  line-height: 1.65;
}

.project-list li::before {
  content: "—";
  color: var(--primary);
  font-weight: bold;
}

.project-list li {
  text-align: justify;
  text-align-last: left;
}

.project-list .title {
  display: block;
  font-weight: 600;
  color: #222;
}

.project-list .meta {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-top: 2px;
}

.indented {
  padding-left: 1rem;
  border-left: 2px solid #eee;
}

/* FOOTER */

.footer {
  margin-left: 250px;
  display: flex;
  justify-content: center;
  padding: 0 0 8px;
}

.footer-logos {
  display: flex;
  gap: 20px;
}

.footer-logos img {
  max-height: 50px;
  background: #fff;
  padding: 6px;
  border-radius: 4px;
}

/* SMALL CAPS */

u {
  text-decoration: none;
  font-variant: small-caps;
  letter-spacing: 0.5px;
}

/* MOBILE */

@media (max-width: 1050px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  main,
  .footer {
    margin-left: 0;
  }

  main {
    display: block;
    padding: 20px;
  }

  .content {
    max-width: 100%;
  }

  .index-cards {
    flex-direction: column;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .table-filters {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #searchCol1,
  #searchCol2 {
    border-radius: 8px;
  }
}

.columns-guide {
  margin-top: 45px;
  border-top: 1px solid #ddd7cf;
}

.column-entry {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid #ddd7cf;
}

.column-label {
  width: 46px;
  height: 46px;
  border: 1px solid #c8bfb4;
  border-radius: 50%;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.column-body h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 1.25rem;
}

.column-body h3 span {
  font-style: normal;
}

.column-body h3 em {
  color: #6d645b;
  font-weight: normal;
  margin-left: .4rem;
}

.column-body p {
  margin: 0 0 12px;
  font-size: 1.08rem;
  line-height: 1.7;
}

.image-strip {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.image-strip img {
  max-width: 220px;
  border: 1px solid #ddd7cf;
  background: white;
  padding: 6px;
}

@media (max-width: 700px) {
  .column-entry {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .image-strip {
    flex-direction: column;
  }

  .image-strip img {
    max-width: 100%;
  }
}

.funding-bodies {
  margin-top: 60px;
}

.funding-bodies h2 {
  margin-bottom: 22px;
}

.funding-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid #ddd7cf;
}

.funding-list li {
  padding: 18px 0;
  border-bottom: 1px solid #ddd7cf;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  text-align: justify;
  text-align-last: left;
}

.funding-list li::before {
  content: "—";
  color: var(--primary);
  margin-right: 10px;
  font-weight: bold;
}

.funding-list span {
  color: #666;
  font-size: 0.95rem;
}

.encoding-page {
  width: min(100%, 1280px);
  max-width: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: bold;
}

.encoding-hero h1 {
  margin-bottom: 10px;
}

.hero-subtitle {
  margin: 0;
  font-size: 1.15rem;
  color: #666;
  line-height: 1.6;
  text-align: left;
}

.encoding-intro {
  margin: 34px 0 46px;
  padding: 24px 28px;
  background: #ffffff;
  border-left: 4px solid var(--secondary);
  border-radius: 8px;
}

.encoding-intro p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.75;
  text-align: left;
}

/* AT A GLANCE */

.at-a-glance {
  margin: 50px 0;
}

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

.glance-grid article {
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-top: 3px solid var(--secondary);
  border-radius: 8px;
  padding: 16px 18px;
}

.glance-grid span {
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.08em;
}

.glance-grid h3 {
  margin: 8px 0;
  color: var(--primary);
  font-size: 1rem;
}

.glance-grid p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}

/* GENERAL SECTIONS */

.encoding-section {
  margin: 48px 0;
}

.encoding-section h2,
.encoding-anatomy h2,
.visual-examples h2,
.genre-section h2,
.search-context h2 {
  color: var(--primary);
}

.encoding-section p,
.genre-section p,
.search-context p {
  font-size: 1rem;
  line-height: 1.75;
  text-align: justify;
}

/* ANATOMY */

.encoding-anatomy {
  margin: 54px 0;
}

.anatomy-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
}

.anatomy-image {
  margin: 0;
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 10px;
  padding: 14px;
}

.anatomy-image img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

.anatomy-image figcaption {
  margin-top: 10px;
  color: #666;
  font-size: 0.85rem;
  line-height: 1.45;
}

.anatomy-cards {
  display: grid;
  gap: 16px;
}

.anatomy-cards article {
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 8px;
}

.anatomy-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: bold;
}

.anatomy-cards h3 {
  margin: 0 0 8px;
  color: var(--primary);
}

.anatomy-cards p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: left;
}

/* CODE COMPARISON */

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}

.code-panel {
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 8px;
  overflow: hidden;
}

.code-panel h3 {
  margin: 0;
  padding: 12px 16px;
  color: var(--primary);
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.code-panel pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: #fafafa;
}

.code-panel code {
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* VISUAL EXAMPLES */

.visual-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 56px 0;
}

.example-block {
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 10px;
  padding: 22px 24px;
}

.example-block h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.example-block p {
  margin-bottom: 18px;
  font-size: 0.96rem;
  line-height: 1.65;
  text-align: left;
}

.transform-list {
  display: grid;
  gap: 10px;
}

.mini-transform {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}

.mini-transform span {
  padding: 8px 10px;
  background: #f7f7f7;
  border: 1px solid #e4e0d8;
  border-radius: 6px;
  text-align: center;
}

.mini-transform strong {
  color: var(--primary);
}

/* CITATION */

.citation-demo {
  border: 1px solid #ddd7cf;
  border-radius: 8px;
  overflow: hidden;
}

.citation-main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px;
  background: #fafafa;
  color: var(--primary);
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.03em;
}

.citation-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.citation-parts span {
  padding: 8px;
  border-top: 1px solid #ddd7cf;
  border-right: 1px solid #ddd7cf;
  font-size: 0.78rem;
  text-align: center;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.citation-parts span:last-child {
  border-right: 0;
}

/* GENRES */

.genre-section {
  margin: 54px 0;
  padding: 26px 30px;
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 10px;
}

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.genre-tags span {
  padding: 7px 12px;
  background: #f7f7f7;
  border: 1px solid #ddd7cf;
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--primary);
}

/* SEARCH CONTEXT */

.search-context {
  margin: 56px 0;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 24px 0;
  width: 100%;
}

.search-card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 8px;
  padding: 18px 20px;
}

.fake-search {
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #fafafa;
  border: 1px solid #ddd7cf;
  border-radius: 999px;
  color: var(--text);
}

.results-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.results-comparison h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--primary);
}

.results-comparison ul {
  margin: 0;
  padding-left: 18px;
}

.results-comparison li {
  margin: 5px 0;
  line-height: 1.45;
}

.hierarchy-result p {
  margin: 6px 0;
  text-align: left;
  line-height: 1.5;
}

.indent-line {
  margin-left: 22px !important;
  color: #555;
}

.indent-line::before {
  content: "↳ ";
  color: var(--primary);
}

.indent-line.second {
  margin-left: 44px !important;
}

.closing-section {
  border-top: 1px solid #ddd7cf;
  padding-top: 34px;
}

/* MOBILE */

@media (max-width: 900px) {
  .glance-grid,
  .anatomy-layout,
  .comparison-grid,
  .visual-examples,
  .results-comparison {
    grid-template-columns: 1fr;
  }

  .encoding-intro,
  .genre-section {
    padding: 20px;
  }
}

.image-gallery {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.gallery-card {
  width: 250px;
  margin: 0;
  flex-shrink: 1;
  background: #fff;
  border: 2px solid #e6dfd2;
  border-radius: 14px;
  padding: 0.6rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  text-align: center;
  box-sizing: border-box;
}

.gallery-card img {
  width: 100%;
  height: clamp(115px, 14vw, 150px);;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ddd;
  display: block;
}

.gallery-card figcaption {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  color: #5a4c3b;
  font-style: italic;
}

.gallery-card {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* MODAL */

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(4px);

  justify-content: center;
  align-items: center;
  padding: 30px;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  background: white;
  padding: 12px 12px 18px;
  border-radius: 14px;
  width: min(92vw, 1050px);
  max-height: 90vh;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}

.modal-img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto 10px;
}

#modalCaption {
  margin-top: 18px;
  font-size: 1.05rem;
  color: #5a4c3b;
  font-style: italic;
  width: 100%;

  text-align: center !important;
  text-align-last: center !important;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: white;
  font-size: 1.8rem;
  cursor: pointer;
  color: #444;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.modal-close:hover {
  background: #f5f5f5;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  font-size: 2rem;
  cursor: pointer;
  color: #444;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.05);
}

.prev {
  left: -70px;
}

.next {
  right: -70px;
}

p {
  text-align: justify !important;
  text-align-last: left;
}

main > .content > p {
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 28px;
}

.reencode-gallery {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 22px;
}

.reencode-card {
  width: 360px;
  margin: 0;
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.07);
  cursor: pointer;
}

.reencode-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid #e4e0d8;
}

.reencode-card figcaption {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #5a4c3b;
  font-style: italic;
  text-align: center;
}

.reencode-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.reencode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.glance-grid article:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.anatomy-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-top: 30px;
}

.anatomy-col {
  text-align: center;
  padding: 10px 8px;
}

.anatomy-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #ddd7cf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.anatomy-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b68f2d;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.anatomy-col h3 {
  margin: 0 0 12px;
  color: #2f4ba5;
}

.anatomy-col p {
  margin: 0;
  line-height: 1.7;
  text-align: center;
}

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

.chronology-flow {
  display: grid;
  grid-template-columns: 0.85fr auto 1.15fr auto 1fr;
  gap: 18px;
  align-items: center; /* frecce come prima */
  margin-top: 28px;
}

.chronology-step {
  display: flex;
  flex-direction: column;
}

.chronology-box {
  height: 135px;
  min-height: 135px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chronology-box p,
.order-column p {
  line-height: 1.35;
}

.chronology-step h3 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 0.95rem;
}

.chronology-box {
  background: #ffffff;
  border: 1px solid #ddd7cf;
  border-radius: 10px;
  padding: 16px 18px;
}

.chronology-box p {
  margin: 8px 0;
  display: flex;
  justify-content: space-between;
  text-align: left;
}

.code-like {
  font-family: "Courier New", monospace;
  background: #fafafa;
}

.chronology-arrow {
  font-size: 2rem;
  color: var(--primary);
  font-weight: bold;
}

.structured-dates {
  display: grid;
  gap: 10px;
}

.date-row {
  display: grid;
  grid-template-columns: 95px 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.date-row .author {
  font-weight: bold;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
  white-space: nowrap;
}

.date-field {
  background: #ffffff;
  border: 1px solid #e4e0d8;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.82rem;
  text-align: center;
}

.chronological-order {
  height: 135px;
  min-height: 135px;
  box-sizing: border-box;
  align-content: center;
}

.order-column h4 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.9rem;
  text-align: center;
}

.order-column p {
  justify-content: center;
  margin: 6px 0;
  line-height: 1.25;
}

.order-column h4 {
  margin: 0 0 8px;
}

.sort-arrow {
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1rem;
}

.chronology-step:first-child .chronology-box p {
  margin: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body {
  overflow-x: hidden;
}

.chronological-order {
  height: 135px;
  min-height: 135px;
  box-sizing: border-box;

  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  align-content: center;
}

.order-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.order-column h4 {
  margin: 0 0 8px;
}

.order-column p {
  margin: 5px 0;
  line-height: 1.2;
  justify-content: center;
}

@media (max-width: 1450px) {
  .chronology-flow {
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: center;
  }

  .chronology-step {
    width: min(100%, 720px);
  }

  .chronology-arrow {
    transform: rotate(90deg);
    margin: 0;
  }

  .hero {
  border-bottom: none !important;
  padding-bottom: 28px;
  margin-bottom: 36px;
}

.encoding-page > p,
.encoding-page .reencode-text p,
.encoding-page .anatomy-col p,
.encoding-page .comparison-grid + p,
.encoding-page h2 + p {
  line-height: 1.7;
}

.encoding-page .reencode-text p {
  font-size: 1.08rem;
  line-height: 1.75 !important;
  text-align: justify;
}

.sidebar {
  display: flex;
  flex-direction: column;
}
}


/* --- AGGIUNTE DEFINITIVE PER SIDEBAR E LINGUE --- */
.language-switcher {
  margin-top: auto !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 20px 0 0 0;
  width: 100%;
}

.language-switcher a.lang {
  display: inline-block;
  text-decoration: underline !important; 
  text-decoration-color: rgba(255, 255, 255, 0.3) !important; 
  text-underline-offset: 6px !important; 
  text-decoration-thickness: 3px !important;
  opacity: 0.7;
  transition: all 0.3s ease;
  margin: 0;
}

.language-switcher a.lang:hover,
.language-switcher a.lang.active {
  opacity: 1;
  transform: translateY(-3px);
  text-decoration-color: var(--secondary) !important;
}
