/* =========================================================
   NeroStay – Stili pagine legali
   Tipografia editoriale, leggibile, coerente con la landing
   ========================================================= */

.legal-prose {
  font-size: 16px;
  line-height: 1.75;
  color: #2c2c2c;
}

@media (min-width: 768px) {
  .legal-prose { font-size: 17px; }
}

/* Spaziature verticali ritmate */
.legal-prose > * + * {
  margin-top: 1.1em;
}

/* Heading */
.legal-prose h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #1a1a1a;
  margin-top: 2.4em;
  margin-bottom: 0.4em;
  line-height: 1.2;
}

.legal-prose h2.section-major {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid rgba(201, 169, 110, 0.3);
  position: relative;
}

.legal-prose h2.section-major::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 64px;
  height: 1px;
  background: #c9a96e;
}

.legal-prose h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 2em;
  margin-bottom: 0.3em;
  line-height: 1.3;
}

.legal-prose h3.structure-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #b08a4e;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

/* Voci dell'indice del contratto */
.legal-prose .structure-item {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.125rem;
  color: #1a1a1a;
  padding-left: 1rem;
  border-left: 2px solid rgba(201, 169, 110, 0.4);
  margin-top: 0.5em;
}

/* Paragrafi */
.legal-prose p {
  margin: 0;
}

/* Enfasi: italic resa più editoriale */
.legal-prose em {
  color: #4a4a4a;
}

/* Lead/sottotitolo: i primi <em> in apertura */
.legal-prose > p:first-of-type em,
.legal-prose > p:nth-of-type(2) em {
  font-size: 1.05em;
  color: #2c2c2c;
}

/* Bold più leggero */
.legal-prose strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* Liste */
.legal-prose ul,
.legal-prose ol {
  margin: 0;
  padding-left: 1.5rem;
}

.legal-prose ul {
  list-style: none;
  padding-left: 0;
}

.legal-prose ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 0.5em;
}

.legal-prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 6px;
  height: 1px;
  background: #c9a96e;
}

.legal-prose ul li p {
  margin: 0;
}

.legal-prose ul li + li {
  margin-top: 0.6em;
}

.legal-prose ol li {
  margin-top: 0.5em;
}

/* Link */
.legal-prose a {
  color: #b08a4e;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(201, 169, 110, 0.5);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  word-break: break-word;
}

.legal-prose a:hover {
  color: #1a1a1a;
  text-decoration-color: #1a1a1a;
}

/* Tabelle legali */
.legal-prose .legal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.8em 0;
  font-size: 0.95em;
  background: #faf6ee;
  border: 1px solid rgba(217, 200, 163, 0.6);
  border-radius: 14px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

@media (min-width: 768px) {
  .legal-prose .legal-table { display: table; }
}

.legal-prose .legal-table thead th {
  background: #e8ddc4;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(176, 138, 78, 0.3);
  vertical-align: top;
}

.legal-prose .legal-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(217, 200, 163, 0.5);
  vertical-align: top;
  line-height: 1.55;
}

.legal-prose .legal-table tbody tr:last-child td {
  border-bottom: none;
}

.legal-prose .legal-table tbody tr:nth-child(even) td {
  background: rgba(243, 236, 221, 0.5);
}

.legal-prose .legal-table p {
  margin: 0;
}

.legal-prose .legal-table p + p {
  margin-top: 0.4em;
}

/* Tabelle "callout" (riga unica con nota) */
.legal-prose .legal-table:has(tbody tr:only-child td:only-child) {
  background: linear-gradient(135deg, #f3ecdd, #faf6ee);
  border-left: 3px solid #c9a96e;
}

.legal-prose .legal-table:has(tbody tr:only-child td:only-child) tbody td {
  padding: 22px 24px;
}

/* Selezione e scroll fine come la landing */
::selection {
  background: #c9a96e;
  color: #1a1a1a;
}

/* Anchor links per le sezioni numerate (futura espansione) */
.legal-prose h2,
.legal-prose h3 {
  scroll-margin-top: 100px;
}

/* Print */
@media print {
  header, footer, .scroll-cue, #cookie-banner { display: none !important; }
  .legal-prose { font-size: 11pt; line-height: 1.5; }
  .legal-prose h2.section-major { page-break-before: always; }
}
