/* =========================
   Legal Article Styles
   Scoped under .legal-article
   ========================= */

/* ----- Section Counters (opt-in via .legal-numbered) ----- */

/*Reset margin top for legal pages*/
.legal-article ol ~ p {
    margin-top: 0;
}

.legal-numbered {
  counter-reset: section;
}

.legal-numbered h2.section-category {
  counter-increment: none;
}

.legal-numbered h2:not(.section-category) {
  counter-increment: section;
  counter-reset: clause;
}



/* ----- Headings ----- */

/* H1 — page title (matches .fr-article-title) */
.legal-article h1 {
  font-size: 36px !important;
  line-height: 42px !important;
  font-weight: 700 !important;
  margin-bottom: 0.5rem;
  font-family: Larken;
}

/* H2 — section headings (matches .fr-article-subtitle) */
.legal-article h2 {
  font-size: 24px !important;
  line-height: 28px !important;
  font-weight: 700 !important;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-family: Larken;
  text-transform: uppercase;
}

/* H3–H6 — sub-headings (fr-body-2 size + bold) */
.legal-article h3,
.legal-article h4,
.legal-article h5,
.legal-article h6 {
  font-size: 18px !important;
  line-height: 27px !important;
  font-weight: 700 !important;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-family: Larken;
}

/* ----- Body Text ----- */

.legal-article p,
.legal-article li,
.legal-article dt,
.legal-article dd,
.legal-article td,
.legal-article th,
.legal-article blockquote {
  font-size: 1.125rem;        /* 18px — matches fr-body-2 desktop */
  line-height: 1.5;           /* 27px */
}

.legal-article p {
  margin-bottom: 1rem;
}

/* ----- Ordered Lists (hierarchical decimal numbering) ----- */

.legal-article ol {
  counter-reset: item;
  list-style: none;
  padding-left: 3rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}


.legal-article ol > li {
  counter-increment: item;
  margin-bottom: 1rem;
  position: relative;
}

.legal-article ol > li::before {
  content: counters(item, ".") ". ";
  position: absolute;
  left: -3rem;
  min-width: 3rem;
}

.legal-article ol ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}


.legal-article ul ul.none, .legal-article ul.none, .legal-article ul.none{
    list-style-type: none;
}

/* ----- Numbered clause lists (opt-in via .legal-numbered) ----- */

.legal-numbered ol {
  list-style: none;
  padding-left: 3.5rem;
  counter-reset: clause calc(attr(start number, 1) - 1);
}

.legal-numbered ol > li {
  counter-increment: clause;
  position: relative;
}

.legal-numbered ol > li::before {
  content: counter(clause) ".\00a0";
  position: absolute;
  left: -3rem;
  min-width: 3rem;
}

/* Nested ol inside .legal-numbered — use lower-alpha, no counter */
.legal-numbered ol ol {
  list-style-type: lower-alpha;
  padding-left: 1.5rem;
  counter-reset: none;
}

.legal-numbered ol ol > li {
  counter-increment: none;
}

.legal-numbered ol ol > li::before {
  content: none;
}

.legal-numbered ol ol ol {
  list-style-type: lower-roman;
}

/* ----- Unordered Lists ----- */

.legal-article ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.legal-article ul ul {
  list-style-type: circle;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.legal-article ul ul ul {
  list-style-type: square;
}

.legal-article ul li {
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

/* ----- Tables ----- */

.legal-article table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  font-size: inherit;
  line-height: inherit;
}

.legal-article th,
.legal-article td {
  border: 1px solid #D1D5DB;
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}

.legal-article thead th {
  background-color: #F3F4F8;
  font-weight: 700;
}

.legal-article tbody tr:nth-child(even) {
  background-color: #F9FAFB;
}

/* Responsive table wrapper */
.legal-article .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

/* Dark mode text */
.dark-mode .legal-article {
  color: #ffffff;
}

.dark-mode .legal-article .fr-body-2 .fr-article-ordered-list,
.dark-mode .legal-article .fr-body-2 .fr-article-text-bold{
    color: #ffffff !important;
}

.dark-mode .legal-article .fr-body-2{
    color: var(--off-white) !important;
}

/* Dark mode tables */
.dark-mode .legal-article th,
.dark-mode .legal-article td {
  border-color: #424252;
}

.dark-mode .legal-article thead th {
  background-color: #2D2D3A;
}

.dark-mode .legal-article tbody tr:nth-child(even) {
  background-color: rgba(66, 66, 82, 0.3);
}

/* ----- Definition Sections ----- */

.legal-article dl {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.legal-article dt {
  font-weight: 700;
  margin-top: 0.75rem;
}

.legal-article dd {
  margin-left: 0;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

/* ----- Blockquotes ----- */

.legal-article blockquote {
  border-left: 4px solid var(--aqua);
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1.25rem;
  background-color: #F9FAFB;
}

.dark-mode .legal-article blockquote {
  background-color: rgba(66, 66, 82, 0.3);
  border-left-color: var(--aqua);
}

.legal-article blockquote p:last-child {
  margin-bottom: 0;
}

/* ----- Links ----- */

.legal-article a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--aqua);
  text-underline-offset: 3px;
  border-bottom: none !important;
}

.legal-article a:hover,
.legal-article a:focus {
    color: var(--custom-btn-tertiary-hover-color);
    text-decoration-color: var(--custom-btn-tertiary-hover-color);
}

/* ----- Utilities ----- */

.legal-divider {
  border: none;
  border-top: 1px solid #D1D5DB;
  margin: 2rem 0;
}

.legal-fine-print {
  font-size: 14px !important;
  line-height: 20px !important;
  color: #6B7280;
}

.legal-red {
  color: #ff0000;
}

.legal-toc,
.legal-toc ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0.5rem;
}

.legal-toc > li {
  margin-bottom: 0.75rem;
}

.legal-toc ul {
  padding-left: 1.5rem;
  margin-top: 0.25rem;
}

.legal-toc li {
  margin-bottom: 0.25rem;
}

.legal-toc a {
  font-weight: normal;
}

/* ----- Disclosure Links (external icon bullets) ----- */

.legal-article ul.disclosure-links {
  list-style: none;
  padding-left: 0;
}

.legal-article ul.disclosure-links > li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-left: 0;
}

.legal-article ul.disclosure-links > li::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_4675_3522)'%3E%3Cpath d='M9.66699 6H6V18H18V14.333H20V20H4V4H9.66699V6Z' fill='%232D2D3A'/%3E%3Cpath d='M22 10C22 10.5523 21.5523 11 21 11C20.4477 11 20 10.5523 20 10V5.41406L10.707 14.707L9.29297 13.293L18.5859 4H14C13.4477 4 13 3.55228 13 3C13 2.44772 13.4477 2 14 2H22V10Z' fill='%232D2D3A'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_4675_3522'%3E%3Crect width='24' height='24' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
  background-size: 18px 18px;
  background-repeat: no-repeat;
}

/* ----- Content Side Padding ----- */

@media (max-width: 1199px) {
  .legal-article {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 1200px) {
  .legal-article {
    padding-left: 12rem;
    padding-right: 12rem;
  }
}

/* ----- Mobile (< 1366px) ----- */

@media (max-width: 1365px) {
  .legal-article p,
  .legal-article li,
  .legal-article dt,
  .legal-article dd,
  .legal-article td,
  .legal-article th,
  .legal-article blockquote {
    font-size: 1rem;            /* 16px — matches fr-body-2 mobile */
    line-height: 1.5;           /* 24px */
  }

  .legal-article h2 {
    font-size: 20px !important;
    line-height: 24px !important;
  }

  .legal-article h3,
  .legal-article h4,
  .legal-article h5,
  .legal-article h6 {
    font-size: 16px !important;
    line-height: 24px !important;
  }
}
