/* =========================================================
   TERMS & CONDITIONS — page-scoped styles (tc- prefix)
   Light theme. Depends on Bootstrap 5, Font Awesome 6, and
   Inter / Space Grotesk already loaded via global_head.php.
   ========================================================= */

.tc-wrap {
  --tc-bg: #FBFAF7;
  --tc-surface: #F1EFEA;
  --tc-surface-solid: #FFFFFF;
  --tc-line: #E4E1D8;
  --tc-text: #20241F;
  --tc-body-text: #3D4136;
  --tc-muted: #6B6F63;
  --tc-accent: #3D5AF1;
  --tc-accent-soft: #3D5AF114;
  --tc-teal: #0E8F72;
  --tc-teal-soft: #0E8F7214;

  background: var(--tc-bg);
  color: var(--tc-text);
  font-size: 16px;
  line-height: 1.65;
  scroll-behavior: smooth;
}

.tc-wrap * {
  box-sizing: border-box;
}

.tc-wrap h1,
.tc-wrap h2,
.tc-wrap .tc-num {
}

.tc-wrap a {
  color: var(--tc-accent);
  text-decoration: none;
}

.tc-wrap a:hover {
  color: var(--tc-teal);
}

/* ---------- Breadcrumb ---------- */
.tc-breadcrumb {
  --bs-breadcrumb-divider: '›';
  font-size: .875rem;
  padding: 1.25rem 0 0;
}

.tc-breadcrumb a {
  color: var(--tc-muted);
}

.tc-breadcrumb a:hover {
  color: var(--tc-teal);
}

.tc-breadcrumb .active {
  color: var(--tc-text);
  font-weight: 500;
}

.tc-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--tc-line);
  font-size: 1rem;
}

/* ---------- Hero ---------- */
.tc-hero {
  padding: 1.5rem 0 2.5rem;
  border-bottom: 1px solid var(--tc-line);
}

.tc-hero h1 {
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.9rem);
  letter-spacing: -.02em;
  margin-bottom: .75rem;
}

.tc-hero p {
  color: var(--tc-muted);
  max-width: 64ch;
  margin-bottom: 0;
}

.tc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-top: 1.5rem;
  font-size: .875rem;
  color: var(--tc-muted);
}

.tc-meta span i {
  color: var(--tc-teal);
  margin-right: .4rem;
}

/* ---------- Layout ---------- */
.tc-layout {
  padding: 2.5rem 0 4rem;
}

.tc-sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

/* Search */
.tc-search {
  position: relative;
  margin-bottom: 1.25rem;
}

.tc-search input {
  background: var(--tc-surface-solid);
  border: 1px solid var(--tc-line);
  color: var(--tc-text);
  border-radius: 8px;
  padding: .55rem .8rem .55rem 2.2rem;
  font-size: .875rem;
  width: 100%;
}

.tc-search input:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 3px var(--tc-accent-soft);
}

.tc-search i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tc-muted);
  font-size: .8rem;
}

/* Table of contents */
.tc-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--tc-line);
}

.tc-toc a {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .5rem .9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--tc-muted);
  font-size: .875rem;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.tc-toc a:hover {
  color: var(--tc-text);
  background: var(--tc-surface);
}

.tc-toc a.active {
  color: var(--tc-text);
  border-left-color: var(--tc-teal);
  background: var(--tc-teal-soft);
  font-weight: 500;
}

.tc-toc .tc-num {
  color: var(--tc-accent);
  font-size: .75rem;
  min-width: 1.4rem;
}

.tc-toc a.active .tc-num {
  color: var(--tc-teal);
}

.tc-no-results {
  display: none;
  color: var(--tc-muted);
  font-size: .85rem;
  padding: .5rem .9rem;
}

/* Mobile TOC */
.tc-mobile-toc {
  display: none;
}

@media (max-width: 991.98px) {
  .tc-sidebar {
    display: none;
  }

  .tc-mobile-toc {
    display: block;
    margin-bottom: 2rem;
  }

  .tc-mobile-toc select {
    width: 100%;
    background: var(--tc-surface-solid);
    border: 1px solid var(--tc-line);
    color: var(--tc-text);
    border-radius: 8px;
    padding: .6rem .8rem;
    font-size: .9rem;
  }
}

/* ---------- Content sections ---------- */
.tc-section {
  padding-top: 1.5rem;
  margin-top: -1.5rem;
  border-bottom: 1px solid var(--tc-line);
  padding-bottom: 2.25rem;
  margin-bottom: 2.25rem;
}

.tc-section:last-child {
  border-bottom: none;
}

.tc-section-head {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  margin-bottom: .9rem;
}

.tc-section-head .tc-num {
  font-size: 1rem;
  color: var(--tc-teal);
  font-weight: 600;
  flex-shrink: 0;
}

.tc-section-head h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.01em;
}

.tc-section p,
.tc-section li {
  color: var(--tc-body-text);
}

.tc-section strong {
  color: var(--tc-text);
}

.tc-section ul {
  padding-left: 1.2rem;
  margin-bottom: .75rem;
}

.tc-section li {
  margin-bottom: .4rem;
}

.tc-section li:last-child {
  margin-bottom: 0;
}

.tc-section p:last-child {
  margin-bottom: 0;
}

.tc-section .fa-solid,
.tc-section .fa-regular {
  color: var(--tc-teal);
}

.tc-highlight {
  background: var(--tc-surface);
  border: 1px solid var(--tc-line);
  border-left: 3px solid var(--tc-accent);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  font-size: .925rem;
  color: var(--tc-muted);
  margin-top: 1rem;
}

.tc-highlight strong {
  color: var(--tc-text);
}

/* ---------- Back to top ---------- */
#tcTop {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tc-accent);
  color: #fff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(61, 90, 241, .3);
  z-index: 50;
  transition: transform .15s ease, background .15s ease;
}

#tcTop:hover {
  transform: translateY(-3px);
  background: var(--tc-teal);
}

@media (prefers-reduced-motion: reduce) {
  .tc-wrap * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}