/* ============================================================
   Società Trasparente — CoopSolaris
   Integrato con design sito principale
   ============================================================ */

:root {
  --viola:      #561D95;
  --viola-dark: #490a8d;
  --arancio:    #F58223;
  --blu-med:    #2980b9;
  --grigio-bg:  #f4f6f9;
  --testo:      #2c3e50;
  --sidebar-w:  380px;
}

/* ---- Arial su tutta l'area ST ---- */
.st-wrap,
.st-wrap * {
  font-family: Arial, sans-serif !important;
}

/* ---- Nav font override ---- */
.nav > ul > li,
.nav > ul > li > a,
.nav .dropdown li,
.nav .dropdown li a {
  font-family: Arial, sans-serif !important;
}

/* ---- Nav active item ---- */
.st-nav-active,
.st-nav-active:hover {
  background: #F58223 !important;
  background-color: #F58223 !important;
}
.st-nav-active > a,
.st-nav-active > a:hover {
  color: #fff !important;
}

/* ---- Accessibilità: skip link ---- */
.st-skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--viola-dark);
  color: #fff;
  padding: .6rem 1.2rem;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 4px 0;
}
.st-skip-link:focus { top: 0; }

/* ---- Focus visibile ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--arancio);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Body ST ---- */
body.trasparenza-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Layout a due colonne ---- */
.st-wrap {
  display: flex;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  gap: 2rem;
  flex: 1;
}

/* ---- Sidebar menu ---- */
.st-sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
}

/* ---- Heading sopra il card (fuori dalla nav) ---- */
.st-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
}
.st-sidebar-title {
  font-family: Arial, sans-serif !important;
  font-size: 1.9rem;
  font-weight: 700;
  color: #561D95;
  margin: 0;
  line-height: 1.15;
}
.st-sidebar-chevron { display: none; font-size: .9rem; color: #561D95; }

.st-menu {
  position: sticky;
  top: 1rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8e0f0;
  box-shadow: 0 2px 12px rgba(86,29,149,.07);
  font-family: Arial, sans-serif !important;
  padding: .8rem .75rem;
}

.st-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Sezione padre */
.st-menu-section {
  margin-bottom: .6rem;
}
.st-menu-section > a {
  display: block;
  font-weight: 700;
  font-size: .84rem;
  color: #fff;
  background: var(--viola);
  padding: .6rem 1.1rem;
  text-decoration: none;
  border-radius: 20px;
  transition: background .15s;
}
.st-menu-section > a:hover {
  background: var(--viola-dark);
}
.st-menu-section > a.active {
  background: var(--arancio);
}

/* Voci figlie */
.st-menu-children {
  margin-top: .1rem;
  margin-bottom: .3rem;
}
.st-menu-children li {
  border-bottom: 1px solid #e5ddf0;
}
.st-menu-children li:last-child {
  border-bottom: none;
}
.st-menu-children li a {
  display: block;
  font-size: .82rem;
  color: #444;
  padding: .5rem .8rem .5rem 1.1rem;
  text-decoration: none;
  transition: color .12s;
}
.st-menu-children li a:hover {
  color: var(--viola);
}
.st-menu-children li a.active {
  color: var(--arancio);
  font-weight: 700;
}

/* ---- Contenuto principale ---- */
.st-content {
  flex: 1;
  min-width: 0;
}

.st-breadcrumb {
  font-size: .78rem;
  color: #7f8c8d;
  margin-bottom: .8rem;
}
.st-breadcrumb a { color: #444; text-decoration: underline; }
.st-breadcrumb a:hover { color: #561D95; }
.st-breadcrumb span + span::before { content: ' › '; }
.st-breadcrumb span:last-child { color: #F58223; font-weight: 600; }

.st-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #561D95;
  border-bottom: 2px solid #e4ddf0;
  padding-bottom: .5rem;
  margin-bottom: .5rem;
  font-family: Arial, sans-serif !important;
}

.st-updatedat {
  font-size: .78rem;
  color: #7f8c8d;
  margin-bottom: 1.2rem;
}

/* ---- Title row + pulsante archivio ---- */
.st-title-row {
  overflow: hidden;
  padding-bottom: .5rem;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid #e0e0e0;
}
.st-title-row .st-page-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.st-archivio-btn {
  float: right;
  margin-top: .4rem;
  margin-left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border: 1px solid var(--viola);
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--viola);
  text-decoration: none;
  white-space: nowrap;
  background: #fff;
  transition: background .15s, color .15s;
}
.st-archivio-btn:hover { background: #ede8f5; }
.st-archivio-btn.active {
  background: var(--viola);
  color: #fff;
  border-color: var(--viola);
}
.st-archivio-icon::before { content: '🗂'; font-size: 1em; }

/* ---- Banner archivio ---- */
.st-arch-banner {
  background: #fef9ec;
  border-left: 4px solid #f39c12;
  padding: .6rem 1rem;
  border-radius: 4px;
  font-size: .85rem;
  color: #7d6608;
  margin-bottom: 1.2rem;
}
.st-arch-banner a { color: #7d6608; font-weight: 600; text-decoration: underline; }

/* ---- Record / card contenuto ---- */
.st-record {
  background: #fff;
  border: none;
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  padding: 1.1rem 1.3rem;
  margin-bottom: .9rem;
}
.st-record:last-child { margin-bottom: 0; }

.st-record-title {
  font-size: 1rem;
  font-weight: 700;
  color: #561D95;
  margin-bottom: .5rem;
}

.st-record-body { line-height: 1.7; margin-bottom: .6rem; font-size: .9rem; word-break: break-word; overflow-wrap: break-word; }
.st-record-body p { margin: 0 0 .5rem; }
.st-record-body img { max-width: 100%; height: auto; display: block; }
.st-record-body table { max-width: 100%; width: 100%; display: block; overflow-x: auto; }
.st-record-body iframe, .st-record-body script, .st-record-body object { display: none !important; }

.st-record-meta {
  font-size: .75rem;
  color: #999;
  margin-top: .5rem;
}

.st-files {
  margin-top: .8rem;
}
.st-files a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .85rem;
  color: #F58223;
  text-decoration: underline;
  margin-right: 1.2rem;
  margin-bottom: .4rem;
}
.st-files a:hover { color: #d4700f; }
.st-files a::before { content: none; }

/* ---- Sezione padre: lista figli ---- */
.st-children-list { margin-top: 1.2rem; }
.st-children-list h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #999;
  margin-bottom: .5rem;
}
.st-children-list ul { list-style: none; padding: 0; margin: 0; }
.st-children-list li { border-bottom: 1px solid #f0eaf8; }
.st-children-list li a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .4rem;
  color: var(--viola);
  text-decoration: none;
  font-size: .9rem;
}
.st-children-list li a::before { content: '›'; color: var(--arancio); font-weight: 700; font-size: 1.1em; }
.st-children-list li a:hover { background: #faf8fd; color: var(--viola-dark); }

/* ---- Non applicabile / In allestimento ---- */
.st-non-applicabile,
.st-in-allestimento {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
  line-height: 1.5;
}
.st-non-applicabile {
  background: #f5f5f5;
  border-left: 4px solid #bbb;
  color: #666;
}
.st-in-allestimento {
  background: #fef9ec;
  border-left: 4px solid #f39c12;
  color: #7d6608;
}
.st-na-icon { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }

/* ---- Paginazione ---- */
.st-pager {
  margin-top: 1.2rem;
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.st-pager a, .st-pager span {
  display: inline-block;
  padding: .3rem .65rem;
  border: 1px solid #d0c0e8;
  border-radius: 4px;
  font-size: .82rem;
  text-decoration: none;
  color: var(--viola);
}
.st-pager span.current {
  background: var(--viola);
  color: #fff;
  border-color: var(--viola);
}
.st-pager a:hover { background: #ede8f5; }

/* ---- Footer ST ---- */
.st-footer-main {
  margin-top: auto;
  font-family: Arial, sans-serif;
}
.st-footer-top {
  background: #561D95;
  padding: .85rem 1rem;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .04em;
}
.st-footer-bottom {
  background: #111;
  padding: .75rem 1rem;
  text-align: center;
  color: #fff;
  font-size: .78rem;
  line-height: 1.7;
  border-bottom: 3px solid #2980b9;
}
.st-footer-bottom a { color: #fff; text-decoration: none; }
.st-footer-bottom a:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .st-wrap { flex-direction: column; padding: .8rem .6rem 1.5rem; gap: 1rem; }
  .st-sidebar { width: 100%; flex: none; }
  .st-menu { position: static; }

  .st-sidebar-head { cursor: pointer; user-select: none; }
  .st-sidebar-chevron {
    display: inline-block;
    transition: transform .2s ease;
    flex-shrink: 0;
  }
  .st-sidebar-head[aria-expanded="false"] .st-sidebar-chevron {
    transform: rotate(-90deg);
  }
  .st-menu-body--closed { display: none; }

  .st-title-row { overflow: visible; }
  .st-archivio-btn { float: none; display: inline-flex; margin: 0 0 .6rem 0; }
  .st-record { padding: .8rem 0; }
  .st-footer-main-data { font-size: .75rem; }
}

@media (max-width: 480px) {
  .st-page-title { font-size: 1.2rem; }
}
