/* =========================================================
   LEGAL PAGES — PRIVACY POLICY & TERMS AND CONDITIONS
   Scope: /privacy-policy.php, /terms-and-conditions.php
   Typography: Poppins (headings) + Lato (body)
   Responsive: Mobile to 5K (320px - 5120px)
   ========================================================= */

/* -----------------------------
   IMPORTS & TYPOGRAPHY
------------------------------ */
/* Note: Google Fonts loaded globally via common-scripts.php */

:root {
  --legal-primary: #0b5ed7;
  --legal-primary-dark: #084298;
  --legal-accent: #10b981;
  --legal-text-dark: #1a1a1a;
  --legal-text-medium: #444;
  --legal-text-light: #666;
  --legal-bg-light: #f7f9fc;
  --legal-bg-white: #ffffff;
  --legal-border: #e5e7eb;
  --legal-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --legal-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --legal-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font stacks */
  --font-heading: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Hero gradients - Image-specific */
  /* Privacy: Lighter blue shield image - brighter, more vibrant overlay */
  --hero-gradient-privacy: linear-gradient(135deg, rgba(59, 141, 199, 0.35) 0%, rgba(29, 94, 149, 0.55) 100%);
  /* Terms: Professional signing scene with teal tones and exclamation mark - modern teal overlay */
  --hero-gradient-terms: linear-gradient(135deg, rgba(20, 110, 130, 0.35) 0%, rgba(10, 75, 95, 0.55) 100%);
}

/* Note: Body typography is handled globally. overflow-x controlled by header.css */

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--legal-text-dark);
  margin-top: 0;
}

/* -----------------------------
   HERO GRADIENT OVERRIDES
   (Uses shared hero-centered.css)
------------------------------ */
.hero-centered.hero-privacy {
  --hero-gradient: var(--hero-gradient-privacy);
}

.hero-centered.hero-terms {
  --hero-gradient: var(--hero-gradient-terms);
}

/* -----------------------------
   BREADCRUMB - Styles moved to core/breadcrumb.css
------------------------------ */

/* -----------------------------
   MAIN CONTENT CONTAINER
------------------------------ */
.legal-main {
  padding: var(--section-padding-y) var(--page-padding-x);
  max-width: 1200px;
  margin: 0 auto;
  background: var(--legal-bg-white);
}

/* Desktop: Optimized content width for readability (20% wider) */
@media (min-width: 1024px) {
  .legal-main {
    max-width: 1200px;
  }

  .legal-content {
    max-width: 1140px;
    margin: 0 auto;
  }
}

/* Large Desktop: Scale content width proportionally */
@media (min-width: 1440px) {
  .legal-content {
    max-width: min(1140px, 85%);
  }
}

/* Extra Large Screens: Cap at comfortable reading width */
@media (min-width: 1920px) {
  .legal-content {
    max-width: 1200px;
  }
}

/* -----------------------------
   DOCUMENT CONTENT STYLING
------------------------------ */
.legal-content {
  background: var(--legal-bg-white);
  padding: clamp(40px, 5vw, 60px) clamp(30px, 4vw, 50px);
  border-radius: 16px;
  box-shadow: var(--legal-shadow);
}

/* Last Updated Date */
.legal-last-updated {
  font-family: var(--font-body);
  font-size: clamp(14px, 1vw, 16px);
  color: var(--legal-text-light);
  font-style: italic;
  margin-bottom: clamp(30px, 4vw, 40px);
  padding-bottom: clamp(20px, 2.5vw, 30px);
  border-bottom: 2px solid var(--legal-border);
}

/* Introduction Paragraph */
.legal-intro {
  font-family: var(--font-body);
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.8;
  color: var(--legal-text-medium);
  margin-bottom: clamp(40px, 5vw, 50px);
  padding: clamp(24px, 3vw, 32px);
  background: var(--legal-bg-light);
  border-left: 4px solid var(--legal-primary);
  border-radius: 8px;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

/* Content Headings - Optimized for readability across resolutions */
.legal-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(22px, 1.8vw, 32px);
  font-weight: 700;
  color: var(--legal-text-dark);
  margin-top: clamp(40px, 5vw, 60px);
  margin-bottom: clamp(16px, 2vw, 24px);
  padding-bottom: clamp(10px, 1.5vw, 16px);
  border-bottom: 3px solid var(--legal-primary);
}

.legal-content h2:first-of-type {
  margin-top: 0;
}

.legal-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(18px, 1.4vw, 24px);
  font-weight: 600;
  color: var(--legal-text-dark);
  margin-top: clamp(30px, 4vw, 45px);
  margin-bottom: clamp(14px, 1.8vw, 20px);
}

.legal-content h4 {
  font-family: var(--font-heading);
  font-size: clamp(16px, 1.2vw, 20px);
  font-weight: 600;
  color: var(--legal-text-medium);
  margin-top: clamp(24px, 3vw, 35px);
  margin-bottom: clamp(12px, 1.5vw, 18px);
}

/* Desktop: Further optimize heading sizes for large screens */
@media (min-width: 1440px) {
  .legal-content h2 {
    font-size: clamp(26px, 1.6vw, 30px);
  }

  .legal-content h3 {
    font-size: clamp(20px, 1.2vw, 22px);
  }

  .legal-content h4 {
    font-size: clamp(18px, 1vw, 19px);
  }
}

/* Large Desktop: Cap maximum sizes for optimal readability */
@media (min-width: 1920px) {
  .legal-content h2 {
    font-size: 28px;
  }

  .legal-content h3 {
    font-size: 21px;
  }

  .legal-content h4 {
    font-size: 18px;
  }
}

/* Paragraphs - Justified text for professional legal documents */
.legal-content p {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.1vw, 18px);
  line-height: 1.8;
  color: var(--legal-text-medium);
  margin-bottom: clamp(16px, 2vw, 24px);
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

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

/* Lists */
.legal-content ul,
.legal-content ol {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.1vw, 18px);
  line-height: 1.8;
  color: var(--legal-text-medium);
  margin-bottom: clamp(20px, 2.5vw, 28px);
  padding-left: clamp(24px, 3vw, 40px);
}

.legal-content ul {
  list-style-type: disc;
}

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

.legal-content li {
  margin-bottom: clamp(8px, 1vw, 12px);
  padding-left: clamp(8px, 1vw, 12px);
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

.legal-content li::marker {
  color: var(--legal-primary);
  font-weight: 600;
}

.legal-content ul ul,
.legal-content ol ol,
.legal-content ul ol,
.legal-content ol ul {
  margin-top: clamp(8px, 1vw, 12px);
  margin-bottom: clamp(8px, 1vw, 12px);
}

/* Links */
.legal-content a {
  color: var(--legal-primary);
  text-decoration: underline;
  transition: var(--legal-transition);
  font-weight: 500;
}

.legal-content a:hover {
  color: var(--legal-primary-dark);
  text-decoration: none;
}

/* Strong/Bold Text */
.legal-content strong,
.legal-content b {
  font-weight: 700;
  color: var(--legal-text-dark);
}

/* Contact Information Block */
.legal-contact-info {
  margin-top: clamp(40px, 5vw, 60px);
  padding: clamp(24px, 3vw, 36px);
  background: var(--legal-bg-light);
  border-radius: 12px;
  border: 1px solid var(--legal-border);
}

.legal-contact-info h4 {
  font-family: var(--font-heading);
  font-size: clamp(18px, 1.5vw, 24px);
  font-weight: 700;
  color: var(--legal-text-dark);
  margin-top: 0;
  margin-bottom: clamp(16px, 2vw, 20px);
}

.legal-contact-info p {
  margin-bottom: clamp(8px, 1vw, 12px);
}

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

/* -----------------------------
   RESPONSIVE BREAKPOINTS
   (Hero handled by shared hero-centered.css)
   (Main padding handled by page-layout.css CSS variables)
------------------------------ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .legal-content {
    padding: clamp(32px, 4vw, 48px) clamp(24px, 3vw, 40px);
  }
}

/* Tablet Portrait & Mobile Landscape (max-width: 768px) */
@media (max-width: 768px) {
  /* Breadcrumb styles moved to core/breadcrumb.css */

  .legal-content {
    padding: clamp(28px, 4vw, 40px) clamp(20px, 3vw, 32px);
    border-radius: 12px;
  }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
  .legal-content {
    padding: clamp(24px, 4vw, 36px) clamp(16px, 3vw, 28px);
  }

  .legal-content ul,
  .legal-content ol {
    padding-left: clamp(20px, 3vw, 32px);
  }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .legal-content {
    padding: clamp(20px, 4vw, 32px) clamp(16px, 3vw, 24px);
    border-radius: 8px;
  }

  .legal-content ul,
  .legal-content ol {
    padding-left: 20px;
  }
}

/* Very Small Mobile Devices (max-width: 375px) */
@media (max-width: 375px) {
  .legal-content {
    padding: 20px 16px;
  }

  .legal-content h2 {
    font-size: clamp(22px, 6vw, 28px);
  }

  .legal-content h3 {
    font-size: clamp(18px, 5vw, 22px);
  }

  .legal-content p,
  .legal-content li {
    font-size: 15px;
  }
}

/* Large Screens (1920px - 2560px) */
@media (min-width: 1920px) {
  .legal-main {
    max-width: 1400px;
  }
}

/* 2K/QHD Displays (2560px - 3839px) */
@media (min-width: 2560px) and (max-width: 3839px) {
  .legal-main {
    max-width: 1800px;
  }
}

/* 4K Displays (3840px - 5119px) */
@media (min-width: 3840px) and (max-width: 5119px) {
  .legal-main {
    max-width: 2400px;
  }

  /* Content width for 4K - scale up from 1200px default */
  .legal-content {
    max-width: 2000px;
  }

  /* Breadcrumb 4K scaling moved to core/breadcrumb.css */

  /* Last updated 4K scaling */
  .legal-last-updated {
    font-size: clamp(17px, 1vw, 26px);
  }

  /* Intro 4K scaling */
  .legal-intro {
    font-size: clamp(20px, 1.2vw, 32px);
  }

  /* Content headings 4K scaling */
  .legal-content h2 {
    font-size: clamp(28px, 1.8vw, 44px);
  }

  .legal-content h3 {
    font-size: clamp(22px, 1.4vw, 36px);
  }

  .legal-content h4 {
    font-size: clamp(20px, 1.2vw, 32px);
  }

  /* Paragraphs and lists 4K scaling */
  .legal-content p,
  .legal-content ul,
  .legal-content ol,
  .legal-content li {
    font-size: clamp(19px, 1.1vw, 30px);
  }

  /* Contact info 4K scaling */
  .legal-contact-info h4 {
    font-size: clamp(22px, 1.5vw, 36px);
  }

  .legal-contact-info p {
    font-size: clamp(19px, 1.1vw, 30px);
  }
}

/* 5K+ Displays (5120px+) */
@media (min-width: 5120px) {
  .legal-main {
    max-width: 3200px;
  }

  /* Content width for 5K - scale up from 1200px default */
  .legal-content {
    max-width: 2600px;
  }

  /* Breadcrumb 5K scaling moved to core/breadcrumb.css */

  /* Last updated 5K scaling */
  .legal-last-updated {
    font-size: clamp(20px, 1vw, 32px);
  }

  /* Intro 5K scaling */
  .legal-intro {
    font-size: clamp(24px, 1.2vw, 40px);
  }

  /* Content headings 5K scaling */
  .legal-content h2 {
    font-size: clamp(36px, 1.8vw, 56px);
  }

  .legal-content h3 {
    font-size: clamp(28px, 1.4vw, 44px);
  }

  .legal-content h4 {
    font-size: clamp(24px, 1.2vw, 40px);
  }

  /* Paragraphs and lists 5K scaling */
  .legal-content p,
  .legal-content ul,
  .legal-content ol,
  .legal-content li {
    font-size: clamp(24px, 1.1vw, 38px);
  }

  /* Contact info 5K scaling */
  .legal-contact-info h4 {
    font-size: clamp(28px, 1.5vw, 44px);
  }

  .legal-contact-info p {
    font-size: clamp(24px, 1.1vw, 38px);
  }
}

/* -----------------------------
   BACK TO TOP BUTTON
------------------------------ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b5ed7, #084298);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(11, 94, 215, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(11, 94, 215, 0.4);
}

.back-to-top:active {
  transform: translateY(-1px);
}

/* Mobile adjustment for back-to-top */
@media (max-width: 767px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}

/* -----------------------------
   ACCESSIBILITY & PRINT
------------------------------ */

/* Focus States */
a:focus,
button:focus {
  outline: 2px solid var(--legal-primary);
  outline-offset: 3px;
}

/* Reduced Motion - hero handled by hero-centered.css */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles - hero handled by hero-centered.css */
@media print {
  .legal-content {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .legal-content h2,
  .legal-content h3,
  .legal-content h4 {
    page-break-after: avoid;
  }

  .legal-content p,
  .legal-content li {
    page-break-inside: avoid;
  }
}
