/* ============================================================
   LEGAL.CSS · Typography-first layout for legal and policy pages
   ------------------------------------------------------------
   Used by: politica-confidentialitate.html, politica-cookies.html,
   declaratie-accesibilitate.html, termeni-conditii.html, harta-site.html
   (and their EN/DE equivalents)

   Design philosophy:
     · Reader-first · narrow column (720px max), generous line-height
     · Quiet · chantilly background, essex deep text, no decoration
     · Honest · explicit headings, citation accents, legal references
     · Print-friendly · clean breaks, no chrome on print
   ============================================================ */


/* ----- PAGE WRAPPER ----- */

.legal-page {
  background: var(--chantilly);
  min-height: 60vh;
  padding: 80px 0 120px;
}

.legal-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
}


/* ----- PAGE HEADER · title + intro + metadata ----- */

.legal-header {
  padding-bottom: 48px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--stone-hearth-soft);
}

.legal-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rustic-taupe);
  font-weight: 500;
  margin-bottom: 20px;
}

.legal-title {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 500;
  color: var(--essex);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 20px;
}

.legal-lead {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--essex);
  opacity: 0.84;
  margin: 0;
  max-width: 620px;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 32px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--essex);
  opacity: 0.7;
}
.legal-meta strong {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--rustic-taupe);
  margin-bottom: 4px;
}


/* ----- TABLE OF CONTENTS · sticky on desktop, collapsed on mobile ----- */

.legal-toc {
  background: rgba(31, 45, 39, 0.03);
  border-left: 2px solid var(--essex);
  padding: 24px 28px;
  margin-bottom: 56px;
}
.legal-toc-label {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rustic-taupe);
  font-weight: 500;
  margin: 0 0 14px;
}
.legal-toc ol {
  margin: 0;
  padding-left: 22px;
  list-style: decimal;
  color: var(--essex);
}
.legal-toc li {
  margin-bottom: 8px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.legal-toc a {
  color: var(--essex);
  text-decoration: none;
  transition: color 0.2s ease;
}
.legal-toc a:hover {
  color: var(--rustic-taupe);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}


/* ----- BODY PROSE · headings + paragraphs + lists ----- */

.legal-body {
  color: var(--essex);
  font-size: 1.0rem;
  line-height: 1.75;
}

.legal-body h2 {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--essex);
  margin: 64px 0 20px;
  padding-top: 8px;
  scroll-margin-top: 100px;     /* anchor offset for sticky header */
}
.legal-body h2:first-child {
  margin-top: 0;
}

.legal-body h3 {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--essex);
  margin: 36px 0 14px;
  scroll-margin-top: 100px;
}

.legal-body p {
  margin: 0 0 18px;
}

.legal-body strong {
  font-weight: 600;
  color: var(--essex);
}

.legal-body em {
  font-style: normal;
  font-weight: 500;
}

.legal-body a {
  color: var(--essex);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rustic-taupe);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.legal-body a:hover {
  color: var(--rustic-taupe);
  text-decoration-color: var(--rustic-taupe);
}


/* ----- LISTS · refined bullets with subtle accent ----- */

.legal-body ul,
.legal-body ol {
  margin: 0 0 20px;
  padding-left: 28px;
}

.legal-body ul {
  list-style: none;
  padding-left: 0;
}
.legal-body ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  line-height: 1.7;
}
.legal-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 14px;
  height: 1px;
  background: var(--rustic-taupe);
}

.legal-body ol li {
  margin-bottom: 10px;
  line-height: 1.7;
  padding-left: 6px;
}


/* ----- CALLOUTS · for legal citations and key boxed info ----- */

.legal-callout {
  background: rgba(31, 45, 39, 0.03);
  border-left: 2px solid var(--rustic-taupe);
  padding: 22px 28px;
  margin: 28px 0;
  font-size: 0.96rem;
  line-height: 1.65;
}
.legal-callout p:last-child {
  margin-bottom: 0;
}
.legal-callout strong {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rustic-taupe);
  font-weight: 500;
  margin-bottom: 8px;
}


/* ----- TABLES · for cookie lists and structured data ----- */

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 0.9rem;
  line-height: 1.55;
}
.legal-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rustic-taupe);
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--stone-hearth-soft);
}
.legal-table tbody td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid rgba(31, 45, 39, 0.07);
  vertical-align: top;
  color: var(--essex);
}
.legal-table tbody tr:last-child td {
  border-bottom: none;
}


/* ----- CONTACT BLOCK · DPO / Operator etc. ----- */

.legal-contact {
  background: var(--chantilly-pure);
  border: 1px solid var(--stone-hearth-soft);
  padding: 28px 32px;
  margin: 32px 0;
}
.legal-contact h3 {
  margin-top: 0 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  color: var(--rustic-taupe) !important;
  font-weight: 500 !important;
}
.legal-contact p {
  margin: 6px 0;
}
.legal-contact a {
  font-weight: 500;
}


/* ----- FOOTER · last-updated + back to home ----- */

.legal-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--stone-hearth-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.8rem;
  color: var(--essex);
  opacity: 0.7;
}
.legal-footer a {
  color: var(--essex);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.legal-footer a:hover {
  color: var(--rustic-taupe);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ----- RESPONSIVE · mobile adjustments ----- */

@media (max-width: 760px) {
  .legal-page {
    padding: 56px 0 80px;
  }
  .legal-container {
    padding: 0 24px;
  }
  .legal-header {
    padding-bottom: 36px;
    margin-bottom: 40px;
  }
  .legal-meta {
    gap: 24px;
    margin-top: 24px;
  }
  .legal-toc {
    padding: 20px 22px;
    margin-bottom: 40px;
  }
  .legal-body h2 {
    font-size: 1.4rem;
    margin: 48px 0 16px;
  }
  .legal-body h3 {
    margin: 28px 0 12px;
  }
  .legal-callout {
    padding: 18px 22px;
  }
  .legal-contact {
    padding: 22px 24px;
  }
  .legal-table {
    font-size: 0.84rem;
  }
  .legal-table thead th,
  .legal-table tbody td {
    padding: 10px 8px 10px 0;
  }
}


/* ----- RESPONSIVE · narrow phones (≤ 480px) -----
   At this width, 4-column tables (Nume / Furnizor / Durată / Scop) get
   too cramped. Force fixed layout so columns share width equally and
   allow long text to break inside cells. Code cells (cookie names) get
   break-all because identifiers like brebunou_consent have no spaces. */

@media (max-width: 480px) {
  .legal-table {
    font-size: 0.76rem;
    table-layout: fixed;
    word-wrap: break-word;
  }
  .legal-table thead th {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    padding: 8px 6px 8px 0;
  }
  .legal-table tbody td {
    padding: 10px 6px 10px 0;
    word-break: break-word;
    hyphens: auto;
  }
  .legal-table tbody td code {
    font-size: 0.7rem;
    word-break: break-all;
    overflow-wrap: anywhere;
  }
}


/* ----- BREADCRUMBS · navigation path above page title -----
   Visible nav at the top of every legal page, mirrored by a Schema.org
   BreadcrumbList in <head> for rich snippets in Google SERP. Uses CSS
   var() colors for consistency with the rest of legal.css. */

.legal-breadcrumb {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.legal-breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.legal-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legal-breadcrumb li + li::before {
  content: '›';
  color: var(--text-mute);
  font-size: 0.9rem;
}
.legal-breadcrumb a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.legal-breadcrumb a:hover {
  color: var(--essex);
}
.legal-breadcrumb li[aria-current="page"] {
  color: var(--essex);
  font-weight: 500;
}

@media (max-width: 480px) {
  .legal-breadcrumb {
    font-size: 0.72rem;
    margin-bottom: 28px;
    padding-bottom: 18px;
  }
}


/* ----- PRINT STYLES · clean printable version ----- */

@media print {
  .top-bar,
  .main-header,
  .mobile-menu,
  .splash-footer,
  .cookie-banner,
  .floating-toolbar,
  .legal-footer {
    display: none !important;
  }
  .legal-page {
    background: white;
    padding: 0;
  }
  .legal-container {
    max-width: 100%;
    padding: 0;
  }
  .legal-body {
    font-size: 11pt;
    line-height: 1.55;
  }
  .legal-body h2 {
    font-size: 14pt;
    margin-top: 24pt;
    page-break-after: avoid;
  }
  .legal-body a {
    color: black;
    text-decoration: underline;
  }
  .legal-callout,
  .legal-contact {
    border: 1px solid #999;
    background: transparent;
  }
}