/* ========================================================
   AMERICANA WINS — TERMS OF SERVICE & ARCHIVAL SYNDICATION
   Clean, Focused Single-Chapter Broadsheet Layout.
   Ivory paper, ink black, editorial crimson, and heritage typography.
   ======================================================== */

.legal-page-body {
  background-color: var(--bg-page, #F8F6F0);
  color: var(--color-dark, #111111);
  font-family: var(--font-serif-body, 'Merriweather', Georgia, serif);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================================
   1. BREADCRUMBS BAR (Matches contact.html & category.html)
   ======================================================== */
.editorial-breadcrumbs-bar {
  background-color: #f2ece0;
  border-top: 1px solid #111111;
  border-bottom: 1px solid #dcd7ca;
  padding: 9px 0;
  font-family: var(--font-barlow-condensed, 'Barlow Condensed', sans-serif);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumbs-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumbs-path {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs-path .back-link {
  color: #8B1E1E;
  text-decoration: none;
  font-weight: 800;
  transition: color 0.15s ease;
}

.breadcrumbs-path .back-link:hover {
  color: #111111;
  text-decoration: underline;
}

.breadcrumbs-path .crumb-sep {
  color: #999999;
}

.breadcrumbs-path .crumb-current {
  color: #111111;
  font-weight: 900;
}

.breadcrumbs-edition-tag {
  font-weight: 800;
  color: #777777;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}

/* ========================================================
   2. CHAPTER HEADER (INSIDE CARD)
   ======================================================== */
.panel-header-block {
  border-bottom: 2px solid #111111;
  padding-bottom: 24px;
  margin-bottom: 34px;
}

.panel-lead-badge {
  font-family: var(--font-barlow-condensed, 'Barlow Condensed', sans-serif);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #8B1E1E;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.panel-title {
  font-family: var(--font-cinzel, 'Cinzel', serif);
  font-size: 2.5rem;
  font-weight: 900;
  color: #111111;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.panel-meta-line {
  font-family: var(--font-barlow-condensed, 'Barlow Condensed', sans-serif);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #777777;
  text-transform: uppercase;
}

/* ========================================================
   3. MAIN CONTENT CONTAINER & CARD
   ======================================================== */
.legal-main-wrapper {
  flex: 1;
  max-width: 1080px;
  margin: 36px auto 60px;
  padding: 0 24px;
  width: 100%;
}

.legal-card-clean {
  background-color: #FFFFFF;
  border: 1.5px solid #111111;
  box-shadow: 4px 4px 0px rgba(17, 17, 17, 0.06);
  padding: 48px 52px;
}

/* ========================================================
   4. NUMBERED CLAUSES LEDGER
   ======================================================== */
.clauses-ledger {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.clause-item {
  border-top: 1px solid #ECE7DE;
  padding-top: 28px;
  scroll-margin-top: 40px;
  transition: background-color 0.2s ease;
}

.clause-item:first-child {
  border-top: none;
  padding-top: 0;
}

.clause-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.clause-anchor-num {
  font-family: var(--font-cinzel, 'Cinzel', serif);
  font-size: 1.2rem;
  font-weight: 900;
  color: #8B1E1E;
  flex-shrink: 0;
}

.clause-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111111;
  line-height: 1.3;
  margin: 0;
  flex: 1;
}

.btn-copy-clause {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #999999;
  border-radius: 2px;
  opacity: 0.4;
  transition: opacity 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clause-item:hover .btn-copy-clause,
.btn-copy-clause:focus {
  opacity: 1;
}

.btn-copy-clause:hover {
  color: #8B1E1E;
}

.btn-copy-clause svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.clause-body {
  padding-left: 36px;
}

.clause-body p {
  font-family: var(--font-serif-body, 'Merriweather', Georgia, serif);
  font-size: 1rem;
  line-height: 1.78;
  color: #333333;
  margin: 0 0 16px;
}

.clause-body p:last-child {
  margin-bottom: 0;
}

.clause-item:target,
.clause-item.search-matched {
  background-color: #FFFDF7;
  outline: 2px solid #C5A059;
  outline-offset: 6px;
  border-radius: 3px;
}

/* ========================================================
   5. TOAST NOTIFICATION UTILITY
   ======================================================== */
.legal-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background-color: #111111;
  color: #FFFFFF;
  padding: 12px 24px;
  border: 1.5px solid #C5A059;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.legal-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-barlow-condensed, 'Barlow Condensed', sans-serif);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.toast-icon {
  color: #C5A059;
  font-size: 1.1rem;
}

/* ========================================================
   6. RESPONSIVE DESIGN
   ======================================================== */
@media (max-width: 860px) {
  .panel-title {
    font-size: 2.15rem;
  }

  .legal-card-clean {
    padding: 34px 28px;
  }

  .clause-body {
    padding-left: 0;
  }
}

@media (max-width: 600px) {
  .panel-title {
    font-size: 1.75rem;
    line-height: 1.18;
  }

  .legal-card-clean {
    padding: 24px 18px;
    margin: 20px auto 40px;
  }

  .clause-title {
    font-size: 1.18rem;
  }
}

/* ========================================================
   7. PRINT BROADSHEET STYLES
   ======================================================== */
@media print {
  .top-bar,
  .site-header,
  .primary-nav,
  .mobile-nav-drawer,
  .mobile-nav-backdrop,
  .editorial-breadcrumbs-bar,
  .btn-copy-clause,
  .legal-toast,
  .site-footer {
    display: none !important;
  }

  body.legal-page-body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  .panel-header-block {
    border-bottom: 2pt solid #000000;
    padding: 0 0 10pt;
    margin-bottom: 15pt;
  }

  .panel-title {
    font-size: 18pt;
    color: #000000;
  }

  .legal-main-wrapper {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .legal-card-clean {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}

/* ========================================================
   LEGAL GAZETTE — DARK MODE OVERRIDES
   ======================================================== */
html[data-theme="dark"] .legal-page-body {
  background-color: #0B131F !important;
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .editorial-breadcrumbs-bar {
  background-color: #070D14 !important;
  border-top-color: #1E2D3E !important;
  border-bottom-color: #1E2D3E !important;
}

html[data-theme="dark"] .breadcrumbs-path .back-link {
  color: #C93B3B !important;
}

html[data-theme="dark"] .breadcrumbs-path .back-link:hover {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .breadcrumbs-path .crumb-sep {
  color: #475569 !important;
}

html[data-theme="dark"] .breadcrumbs-path .crumb-current {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .breadcrumbs-edition-tag {
  color: #8B9BAE !important;
}

html[data-theme="dark"] .legal-card-clean,
html[data-theme="dark"] .legal-panel,
html[data-theme="dark"] .legal-sidebar-card {
  background-color: #0E1926 !important;
  border-color: #1E2D3E !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .panel-header-block {
  border-bottom-color: #1E2D3E !important;
}

html[data-theme="dark"] .panel-lead-badge {
  color: #C93B3B !important;
}

html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .legal-title {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .panel-meta-line,
html[data-theme="dark"] .panel-subtitle,
html[data-theme="dark"] .legal-subtitle {
  color: #8B9BAE !important;
}

html[data-theme="dark"] .clause-item {
  border-top-color: #1E2D3E !important;
}

html[data-theme="dark"] .clause-anchor-num {
  color: #C93B3B !important;
}

html[data-theme="dark"] .clause-title {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .clause-body p,
html[data-theme="dark"] .clause-text,
html[data-theme="dark"] .legal-prose p {
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .btn-copy-clause {
  color: #8B9BAE !important;
}

html[data-theme="dark"] .btn-copy-clause:hover {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .legal-toast {
  background-color: #162436 !important;
  border-color: #3B82F6 !important;
  color: #FFFFFF !important;
}

/* Targeted / Searched Clause Highlight in Dark Mode */
html[data-theme="dark"] .clause-item:target,
html[data-theme="dark"] .clause-item.search-matched {
  background-color: #142234 !important;
  outline: 2px solid #C5A059 !important;
  outline-offset: 6px !important;
  border-radius: 3px !important;
}

html[data-theme="dark"] .clause-item:target .clause-title,
html[data-theme="dark"] .clause-item.search-matched .clause-title {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .clause-item:target .clause-body p,
html[data-theme="dark"] .clause-item.search-matched .clause-body p,
html[data-theme="dark"] .clause-item:target .clause-text,
html[data-theme="dark"] .clause-item.search-matched .clause-text {
  color: #E2E8F0 !important;
}

html[data-theme="dark"] .clause-item:target .clause-anchor-num,
html[data-theme="dark"] .clause-item.search-matched .clause-anchor-num {
  color: #E25C5C !important;
}

html[data-theme="dark"] .clause-item:target .btn-copy-clause,
html[data-theme="dark"] .clause-item.search-matched .btn-copy-clause {
  color: #CBD5E1 !important;
}


