:root {
  --internal-sidebar-width: 190px;
  --internal-gap: 30px;
}

.internal-shell {
  flex: 1;
  min-width: 0;
  padding: 24px 0 28px;
}

.internal-layout {
  display: grid;
  grid-template-columns: var(--internal-sidebar-width) minmax(0, 1fr);
  gap: var(--internal-gap);
  align-items: start;

  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.internal-sidebar {
  position: sticky;
  top: 18px;

  min-width: 0;
  max-width: 100%;
}

/* Contenitore nel quale include.js inserisce sidebar.html */
[data-include="/components/sidebar.html"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;

  min-width: 0;
  max-width: 100%;
}

.sidebar-title {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-link {
  display: block;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-link.active {
  border-left-color: var(--accent);
  color: var(--cream);
  background: rgba(231, 111, 81, 0.07);
}

.internal-content {
  min-width: 0;
  max-width: 700px;
}

.internal-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.internal-content h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.internal-lead {
  max-width: 600px;
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.internal-block {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.internal-block h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.internal-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .internal-shell {
    padding-top: 18px;
    min-width: 0;
    max-width: 100%;
  }

  .internal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;

    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .internal-sidebar {
    position: static;

    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  [data-include="/components/sidebar.html"] {
    display: block;

    width: 100%;
    min-width: 0;
    max-width: 100%;

    overflow: hidden;
  }

.sidebar-nav {
  flex-direction: row;
  align-items: center;
  gap: 10px;

  width: calc(100vw - 16px);
  max-width: calc(100vw - 16px);
  min-width: 0;

  overflow-x: auto;
  overflow-y: hidden;

  padding-bottom: 4px;
  box-sizing: border-box;

  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

  .sidebar-title {
    display: none;
  }

  .sidebar-link {
    flex: 0 0 auto;
    white-space: nowrap;

    padding: 6px 8px;

    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .sidebar-link.active {
    border-bottom-color: var(--accent);
  }
}
