/* ==========================================================================
   Code1001 - Legal Pages Stylesheet (Privacy Policy, Terms, Cookies)
   File: assets/css/legal.css
   ========================================================================== */

/* Main Page Container */
.legal-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
}

/* Atmospheric Ambient Hero Glow */
.legal-hero-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 1000px;
  height: 520px;
  background: radial-gradient(circle at 50% 20%, rgba(129, 140, 248, 0.12) 0%, rgba(56, 189, 248, 0.04) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] .legal-hero-glow {
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.08) 0%, rgba(14, 165, 233, 0.03) 45%, transparent 70%);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.legal-hero {
  position: relative;
  z-index: 1;
  padding: 84px 0 60px;
  text-align: center;
}

.legal-hero-inner {
  max-width: 780px;
  margin: 0 auto;
}

/* Top Pill Chip */
.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--card-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.legal-badge .badge-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

/* Hero Title */
.legal-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--text) 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .legal-title {
  background: linear-gradient(135deg, var(--text) 45%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hero Subtitle */
.legal-lead {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 20px;
}

/* Meta Line */
.legal-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 500;
}

.legal-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legal-meta-row .sep {
  opacity: 0.4;
}

/* ==========================================================================
   Two-Column Layout
   ========================================================================== */
.legal-content-wrap {
  position: relative;
  z-index: 1;
  padding-bottom: 100px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.legal-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   Sticky Sidebar Navigation
   ========================================================================== */
.legal-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 0;
  scrollbar-width: none;
}

.legal-sidebar::-webkit-scrollbar {
  display: none;
}

.legal-nav-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.legal-nav-header {
  display: none;
}

.legal-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legal-nav-link {
  display: block;
  padding: 4px 0 4px 18px;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--text-faint);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
  line-height: 1.45;
  background: transparent;
}

.legal-nav-link:hover {
  color: var(--text);
  background: transparent;
}

/* Active State with Illuminated Left Bar (Exact Match to Reference Mockup) */
.legal-nav-link.active {
  color: var(--text);
  font-weight: 500;
  background: transparent;
}

.legal-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ec4899 0%, #a855f7 100%);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

html[data-theme="light"] .legal-nav-link.active::before {
  background: linear-gradient(180deg, #db2777 0%, #7c3aed 100%);
  box-shadow: 0 0 8px rgba(219, 39, 119, 0.4);
}

/* ==========================================================================
   Main Legal Content Sections
   ========================================================================== */
.legal-main {
  min-width: 0;
}

.legal-section {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border-soft);
  scroll-margin-top: 100px; /* Ensures anchor links clear the sticky nav bar */
}

.legal-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Section Header */
.legal-section-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-section-num {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* Subheadings */
.legal-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 10px;
}

.legal-section h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 8px;
}

/* Paragraphs & Text */
.legal-section p {
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 14px;
}

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

.legal-section strong {
  color: var(--text);
  font-weight: 600;
}

.legal-section a {
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.legal-section a:hover {
  color: #818cf8;
  text-decoration: underline;
}

/* ==========================================================================
   List Styles (Unordered with Check Icon & Ordered Lists)
   ========================================================================== */

/* Unordered Lists with Check Icon */
.legal-section ul,
.legal-wp-content ul {
  list-style: none;
  padding-left: 0;
  margin: 14px 0 22px 0;
}

.legal-section ul > li,
.legal-wp-content ul > li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.68;
}

.legal-section ul > li:last-child,
.legal-wp-content ul > li:last-child {
  margin-bottom: 0;
}

/* Lucide Check Icon Bullet Marker (from better-icons) */
.legal-section ul > li::before,
.legal-wp-content ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background-color: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.legal-section ul > li:hover::before,
.legal-wp-content ul > li:hover::before {
  border-color: rgba(56, 189, 248, 0.45);
  background-color: rgba(56, 189, 248, 0.18);
  transform: scale(1.08);
}

/* Light Mode Check Marker */
html[data-theme="light"] .legal-section ul > li::before,
html[data-theme="light"] .legal-wp-content ul > li::before {
  background-color: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

html[data-theme="light"] .legal-section ul > li:hover::before,
html[data-theme="light"] .legal-wp-content ul > li:hover::before {
  border-color: rgba(2, 132, 199, 0.4);
  background-color: rgba(2, 132, 199, 0.14);
}

/* Nested Unordered Lists */
.legal-section ul ul,
.legal-wp-content ul ul {
  margin: 8px 0 10px 0;
  padding-left: 8px;
}

/* Ordered Lists */
.legal-section ol,
.legal-wp-content ol {
  margin: 14px 0 22px 24px;
  padding-left: 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.68;
}

.legal-section ol > li,
.legal-wp-content ol > li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.legal-section ol > li:last-child,
.legal-wp-content ol > li:last-child {
  margin-bottom: 0;
}

/* Callout Box */
.legal-callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid #38bdf8;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
}

.legal-callout strong {
  color: var(--text);
}

.legal-callout.callout-warning {
  border-left-color: #f59e0b;
}

/* ==========================================================================
   Data & Cookies Table
   ========================================================================== */
.legal-table-wrap {
  margin: 24px 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.55;
}

.legal-table th {
  background: var(--card-2);
  color: var(--text);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.legal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table tr:hover td {
  background: var(--card-2);
}

.legal-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #38bdf8;
}

/* Tag Pill in Table */
.tag-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--card-3);
  color: var(--text-dim);
}

.tag-badge.tag-green {
  background: rgba(19, 165, 127, 0.14);
  color: #13a57f;
}

/* ==========================================================================
   Contact / Footer Action Box
   ========================================================================== */
.legal-contact-card {
  margin-top: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow);
}

.legal-contact-card .contact-info h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.legal-contact-card .contact-info p {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.legal-contact-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* WordPress Content Fallback Wrapper */
.legal-wp-content {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px dashed var(--border);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Tablet & Smaller Screens (<= 1024px) */
@media (max-width: 1024px) {
  .legal-content-wrap {
    padding-bottom: 60px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Full-width single column layout */
  .legal-grid {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Hide the left column (Table of Contents sidebar) on mobile and tablets */
  .legal-sidebar {
    display: none !important;
  }

  .legal-main {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .legal-page {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .legal-page .wrap {
    padding: 0 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }

  .legal-hero-glow {
    width: 100%;
    max-width: 100vw;
    height: 300px;
    left: 0;
    right: 0;
    transform: none;
    margin: 0 auto;
  }

  .legal-hero {
    padding: 44px 0 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .legal-hero-inner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .legal-title {
    font-size: clamp(26px, 7.5vw, 34px);
    line-height: 1.18;
    margin-bottom: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .legal-lead {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 0;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Meta Row Pills on Mobile */
  .legal-meta-row {
    gap: 8px;
    font-size: 11px;
    justify-content: center;
  }

  .legal-meta-row .sep {
    display: none;
  }

  .legal-meta-row span {
    background: var(--card-2);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 9999px;
  }

  /* Section Spacing & Text */
  .legal-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-bottom: 28px;
    margin-bottom: 28px;
    scroll-margin-top: 76px;
    overflow: visible;
  }

  .legal-section-title {
    font-size: 18.5px;
    gap: 8px;
    line-height: 1.35;
    margin-bottom: 12px;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .legal-section-num {
    font-size: 11px;
    padding: 2px 6px;
  }

  .legal-section h4 {
    font-size: 14.5px;
    margin: 16px 0 6px;
  }

  .legal-section h5 {
    font-size: 13px;
    margin: 12px 0 5px;
  }

  .legal-section-body,
  .legal-section p,
  .legal-section ul,
  .legal-section ol,
  .legal-section li {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .legal-section p {
    font-size: 13.5px;
    line-height: 1.65;
    margin-bottom: 12px;
  }

  /* List Items with Check Icon */
  .legal-section ul,
  .legal-wp-content ul {
    margin: 10px 0 16px 0;
    padding-left: 0;
  }

  .legal-section ul > li,
  .legal-wp-content ul > li {
    padding-left: 26px;
    font-size: 13.5px;
    line-height: 1.62;
    margin-bottom: 10px;
  }

  .legal-section ul > li::before,
  .legal-wp-content ul > li::before {
    top: 2px;
    width: 16px;
    height: 16px;
    background-size: 10px 10px;
  }

  .legal-section ol,
  .legal-wp-content ol {
    margin: 10px 0 16px 18px;
    font-size: 13.5px;
    line-height: 1.62;
  }

  /* Table Mobile Horizontal Scrolling */
  .legal-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 16px 0;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .legal-table {
    width: 100%;
    min-width: 480px;
    max-width: none;
    font-size: 12px;
    table-layout: auto;
  }

  .legal-table th,
  .legal-table td {
    padding: 8px 10px;
  }

  /* Callout Box Mobile */
  .legal-callout {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    margin: 14px 0;
    font-size: 13px;
    line-height: 1.6;
    border-radius: 10px;
  }

  /* Contact Card Mobile */
  .legal-contact-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
    border-radius: 14px;
    margin-top: 24px;
    gap: 14px;
  }

  .legal-contact-card .contact-info h3 {
    font-size: 16px;
  }

  .legal-contact-card .contact-info p {
    font-size: 12.5px;
  }

  .legal-contact-actions {
    width: 100%;
  }

  .legal-contact-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .legal-page .wrap {
    padding: 0 20px;
  }

  .legal-hero {
    padding: 36px 0 18px;
  }

  .legal-badge {
    font-size: 10px;
    padding: 4px 10px;
    margin-bottom: 12px;
  }

  .legal-title {
    font-size: 25px;
  }

  .legal-lead {
    font-size: 13px;
  }

  .legal-nav-card {
    padding: 10px 12px;
  }

  .legal-nav-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .legal-section-title {
    font-size: 17px;
  }

  .legal-section-num {
    font-size: 10.5px;
  }

  .legal-table th,
  .legal-table td {
    padding: 7px 9px;
    font-size: 11.5px;
  }
}
