/**
 * MELT — public legal pages (confidentialité, cookies)
 * Premium typography for CMS HTML; no external dependencies.
 */

.legal-page {
  background: #FDFCFA;
}

/* —— Hero —— */
.legal-hero {
  background: linear-gradient(135deg, #3D2314 0%, #5C3A1E 46%, #A67040 78%, #C4842D 100%);
  padding: 44px 20px;
}

@media (min-width: 768px) {
  .legal-hero {
    padding: 64px 24px;
  }
}

.legal-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.legal-hero-title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.875rem, 4.2vw, 2.625rem);
  font-weight: 700;
  color: #FDFCFA;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.legal-version {
  margin-top: 0.75rem;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(253, 252, 250, 0.72);
}

/* —— Layout —— */
.legal-content-wrapper {
  max-width: 940px;
  margin: 0 auto;
  padding: 36px 16px 72px;
}

@media (min-width: 768px) {
  .legal-content-wrapper {
    padding: 48px 24px 88px;
  }
}

.legal-section-card {
  background: #FFFCF8;
  border: 1px solid rgba(108, 70, 38, 0.11);
  border-radius: 16px;
  box-shadow: 0 6px 28px rgba(61, 35, 20, 0.05);
  padding: 24px 20px;
}

@media (min-width: 768px) {
  .legal-section-card {
    padding: 52px 56px;
  }
}

.legal-section-card + .legal-section-card {
  margin-top: 2rem;
}

/* —— CMS rich HTML —— */
.legal-rich-content {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #5C4030;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .legal-rich-content {
    font-size: 16px;
  }
}

.legal-rich-content > :first-child {
  margin-top: 0;
}

.legal-rich-content > :last-child {
  margin-bottom: 0;
}

.legal-rich-content h2 {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  font-weight: 600;
  color: #3D2314;
  line-height: 1.25;
  margin: 2.25rem 0 1rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(196, 132, 45, 0.22);
}

.legal-rich-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-rich-content h2::before {
  content: '';
  display: block;
  width: 2rem;
  height: 3px;
  margin-bottom: 0.65rem;
  background: linear-gradient(90deg, #C4842D, #D4A853);
  border-radius: 2px;
}

.legal-rich-content h3 {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
  font-weight: 600;
  color: #4A2E1A;
  margin: 1.75rem 0 0.65rem;
  line-height: 1.3;
}

.legal-rich-content p {
  margin: 0 0 1.1rem;
  color: #5C4030;
}

.legal-rich-content ul,
.legal-rich-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.legal-rich-content ul {
  list-style: none;
}

.legal-rich-content ul > li {
  position: relative;
  margin-bottom: 0.55rem;
  padding-left: 0.35rem;
}

.legal-rich-content ul > li::before {
  content: '';
  position: absolute;
  left: -1.15rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C4842D;
}

.legal-rich-content ol {
  list-style: decimal;
}

.legal-rich-content ol > li {
  margin-bottom: 0.55rem;
  padding-left: 0.25rem;
}

.legal-rich-content ol > li::marker {
  color: #C4842D;
  font-weight: 600;
}

.legal-rich-content a {
  color: #C4842D;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.legal-rich-content a:hover {
  color: #A67040;
}

.legal-rich-content a:focus-visible {
  outline: 2px solid #C4842D;
  outline-offset: 2px;
  border-radius: 2px;
}

.legal-rich-content strong {
  font-weight: 600;
  color: #3D2314;
}

.legal-rich-content em {
  font-style: italic;
}

.legal-rich-content blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid #D4A853;
  background: rgba(212, 168, 83, 0.08);
  border-radius: 0 8px 8px 0;
  color: #4A2E1A;
}

.legal-rich-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
}

.legal-rich-content th,
.legal-rich-content td {
  border: 1px solid rgba(108, 70, 38, 0.14);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.legal-rich-content th {
  background: rgba(212, 168, 83, 0.1);
  color: #3D2314;
  font-weight: 600;
}

/* —— Cookie registry —— */
.legal-cookie-category {
  margin-top: 2.5rem;
}

.legal-cookie-category:first-of-type {
  margin-top: 0;
}

.legal-cookie-category-title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: #3D2314;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.legal-cookie-category-desc {
  font-size: 0.875rem;
  color: rgba(92, 64, 48, 0.78);
  margin: 0 0 1rem;
  line-height: 1.55;
}

.legal-cookie-category--necessary .legal-cookie-category-title::after {
  content: ' · Toujours actifs';
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #8B5A30;
  letter-spacing: 0.02em;
}

.legal-cookie-empty {
  font-size: 0.9375rem;
  color: rgba(92, 64, 48, 0.7);
  margin: 0;
  font-style: italic;
}

.legal-cookie-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.5rem;
}

.legal-cookie-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.legal-cookie-table th,
.legal-cookie-table td {
  border: 1px solid rgba(108, 70, 38, 0.12);
  padding: 0.7rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.legal-cookie-table th {
  background: rgba(212, 168, 83, 0.12);
  color: #3D2314;
  font-weight: 600;
  white-space: nowrap;
}

.legal-cookie-table td {
  color: #5C4030;
  line-height: 1.5;
}

.legal-cookie-table code {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 0.8125rem;
  color: #3D2314;
  background: rgba(108, 70, 38, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.legal-cookie-cards {
  display: none;
}

.legal-cookie-card {
  border: 1px solid rgba(108, 70, 38, 0.12);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  background: rgba(255, 252, 248, 0.9);
}

.legal-cookie-card-name {
  font-weight: 600;
  color: #3D2314;
  font-size: 0.9375rem;
  margin: 0 0 0.5rem;
}

.legal-cookie-card-name code {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 0.8125rem;
}

.legal-cookie-card-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.legal-cookie-card-row:last-child {
  margin-bottom: 0;
}

.legal-cookie-card-label {
  color: rgba(92, 64, 48, 0.65);
  font-weight: 500;
}

.legal-cookie-card-value {
  color: #5C4030;
}

@media (max-width: 767px) {
  .legal-cookie-table-wrap {
    display: none;
  }

  .legal-cookie-cards {
    display: block;
  }
}

/* —— Summary / actions —— */
.legal-summary {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(108, 70, 38, 0.1);
  text-align: center;
}

.legal-manage-cookies-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.75rem;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #FDFCFA;
  background: linear-gradient(135deg, #6C4626 0%, #8B5A30 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(108, 70, 38, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.legal-manage-cookies-btn:hover {
  background: linear-gradient(135deg, #5C3A1E 0%, #6C4626 100%);
  box-shadow: 0 6px 18px rgba(108, 70, 38, 0.28);
  transform: translateY(-1px);
}

.legal-manage-cookies-btn:focus-visible {
  outline: 2px solid #C4842D;
  outline-offset: 3px;
}

.legal-summary-note {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: rgba(92, 64, 48, 0.72);
  line-height: 1.5;
}
