/* Custom Policies Stylesheet for Neara Website */

/* Reset & Variables */
:root {
  --primary-color: #9112BC;
  --primary-dark: #500569;
  --primary-light: #F9F5FC;
  --bg-dark: #1A111E;
  --text-main: #332238;
  --text-muted: #6e5e74;
  --border-color: #E6E1E8;
  --card-shadow: 0 4px 20px rgba(145, 18, 188, 0.05);
  --header-height: 80px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Prevent ANY element from pushing the page wider than the viewport ── */
html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background-color: #FFFFFF;
  line-height: 1.6;
  scroll-behavior: smooth;
  overflow-x: hidden;   /* belt-and-braces: stops horizontal page scroll */
  max-width: 100%;
}

/* All images are fluid by default */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Bricolage Grotesque', sans-serif;
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.8rem;
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}

h3 {
  font-size: 1.4rem;
  margin-top: 1.5rem;
}

p {
  font-size: 1rem;
  margin-bottom: 1.2rem;
  color: var(--text-muted);
  /* Stop long words / URLs from stretching the page */
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
  overflow-wrap: break-word;
  word-break: break-word;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
  overflow-wrap: break-word;
  word-break: break-word;
}

li {
  margin-bottom: 0.5rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Hero Section */
.policy-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--bg-dark) 100%);
  color: #FFFFFF;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.policy-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(145, 18, 188, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.policy-hero h1 {
  color: #FFFFFF;
  font-size: 3rem;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}

.policy-hero p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Main Layout */
.policy-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 20px;
  display: block;
  /* Prevent the grid from ever being wider than the screen */
  overflow-x: hidden;
}

/* Sidebar Navigation */
.policy-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 15px;
  /* Prevent sidebar from forcing the grid wider than the screen */
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.policy-sidebar::-webkit-scrollbar {
  width: 4px;
}

.policy-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.policy-sidebar h4 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-dark);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
}

.policy-nav {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.policy-nav li {
  margin-bottom: 8px;
  padding-left: 0;
}

.policy-nav a {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

.policy-nav a:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  text-decoration: none;
  padding-left: 16px;
}

.policy-nav li.active a {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
}

/* Content Styles */
.policy-content {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 40px;
  border: 1px solid var(--border-color);
  /* Keep all child content within the card — no bleed-out */
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;        /* crucial: lets the grid column shrink below content intrinsic width */
  overflow: hidden;   /* clips any stray overflow */
}

.policy-section {
  scroll-margin-top: 100px;
  margin-bottom: 40px;
}

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

/* Tables inside content — wrapped in a scrollable box so only
   the table scrolls, not the entire page */
.policy-content table,
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 0.95rem;
  text-align: left;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.02);
  border: 1px solid var(--border-color);
  /* Word wrap inside cells */
  word-break: break-word;
  overflow-wrap: break-word;
}

thead tr {
  background-color: var(--primary-dark);
  color: #FFFFFF;
  font-weight: bold;
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  /* No min-width — let cells shrink naturally and text wrap */
  overflow-wrap: break-word;
  word-break: break-word;
  vertical-align: top;
}

tbody tr:nth-of-type(even) {
  background-color: var(--primary-light);
}

tbody tr:last-of-type {
  border-bottom: 2px solid var(--primary-color);
}

th p, td p {
  margin-bottom: 0;
  color: inherit;
}

th ul, td ul {
  margin-bottom: 0;
}

/* Subheadings & Dividers */
.policy-content hr {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 30px 0;
}

/* Highlight box/Annex */
.annex-box {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary-color);
  padding: 20px;
  margin: 25px 0;
  border-radius: 0 12px 12px 0;
}

.annex-box h4 {
  margin-top: 0;
  color: var(--primary-dark);
}

.annex-box p:last-child {
  margin-bottom: 0;
}

/* Back to Top */
#scrollToTopBtn {
  position: fixed;
  right: 30px;
  bottom: 30px;
  background: var(--primary-color);
  color: #FFFFFF;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(145, 18, 188, 0.3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  z-index: 9999;
}

#scrollToTopBtn.show {
  opacity: 1;
  visibility: visible;
}

#scrollToTopBtn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
}

#scrollToTopBtn img {
  width: 24px;
  height: 24px;
  filter: invert(1);
}

/* ============================================================
   RESPONSIVENESS — full breakpoint coverage
   ============================================================ */

/* Large tablet / small desktop */
@media (max-width: 1200px) {
  .policy-container {
    max-width: 100%;
    padding: 50px 30px;
  }
}

/* Tablet — stack sidebar above content */
@media (max-width: 992px) {
  .policy-container {
    padding: 36px 20px;
  }

  .policy-sidebar {
    position: relative;
    top: 0;
    max-height: 220px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 4px;
    width: 100%;
    padding-right: 0;
  }

  .policy-content {
    padding: 28px 24px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  /* Tables — block display allows internal horizontal scroll on small screens & tablets */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;  /* KEEP text on one line so columns do not squeeze */
    font-size: 0.9rem;
  }

  th, td {
    padding: 12px 14px;
    font-size: 0.85rem;
    white-space: normal; /* Allow text to wrap if it needs to, but we'll use a min-width to prevent squeezing */
    min-width: 150px; /* Ensures text has enough space to be readable */
  }
}

/* Mobile landscape / large phone */
@media (max-width: 768px) {
  .policy-hero {
    padding: 50px 16px 44px;
  }

  .policy-hero h1 {
    font-size: 1.9rem;
    letter-spacing: -0.3px;
  }

  .policy-hero p {
    font-size: 0.95rem;
  }

  .policy-container {
    padding: 28px 16px;
    gap: 20px;
  }

  .policy-sidebar {
    max-height: 200px;
  }

  .policy-content {
    padding: 22px 18px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
    margin-top: 1.5rem;
  }

  h3 {
    font-size: 1.1rem;
    margin-top: 1.2rem;
  }

  h4, h5, h6 {
    font-size: 1rem;
  }

  p {
    font-size: 0.95rem;
  }

  ul, ol {
    padding-left: 1.2rem;
    font-size: 0.95rem;
  }

  /* Back-home button adjustments */
  .back-home-btn {
    font-size: 0.85rem;
    padding: 7px 16px;
  }

  /* Scroll-to-top */
  #scrollToTopBtn {
    right: 14px !important;
    bottom: 16px !important;
  }

  #scrollToTopBtn img {
    width: 42px !important;
    height: 42px !important;
  }

  /* Footer links — center + wrap on mobile */
  .ekit-template-content-footer .elementor-icon-list-items {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  /* Footer logo */
  .ekit-template-content-footer img {
    max-width: 150px !important;
    height: auto !important;
  }

  /* Footer top row: stack logo + social icons */
  .ekit-template-content-footer .elementor-element-14e02cf {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    text-align: center !important;
  }

  /* Social icons: center on mobile */
  .ekit-template-content-footer .elementor-grid {
    justify-content: center !important;
  }
}

/* Small phone */
@media (max-width: 480px) {
  .policy-hero {
    padding: 40px 14px 36px;
  }

  .policy-hero h1 {
    font-size: 1.6rem;
  }

  .policy-hero p {
    font-size: 0.9rem;
  }

  .policy-container {
    padding: 22px 14px;
  }

  .policy-sidebar {
    max-height: 180px;
  }

  .policy-sidebar h4 {
    font-size: 0.95rem;
  }

  .policy-nav a {
    font-size: 0.88rem;
    padding: 5px 10px;
  }

  .policy-content {
    padding: 18px 14px;
    border-radius: 10px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1rem;
  }

  p, ul, ol, li {
    font-size: 0.9rem;
  }

  th, td {
    padding: 8px 10px;
    font-size: 0.8rem;
    min-width: 120px; /* Prevent extreme squeezing */
  }

  .back-home-btn {
    font-size: 0.8rem;
    padding: 6px 14px;
  }
}

/* Very small phone (≤360px) */
@media (max-width: 360px) {
  .policy-hero h1 {
    font-size: 1.4rem;
  }

  .policy-content {
    padding: 14px 12px;
  }

  h2 {
    font-size: 1.1rem;
  }

  p, ul, ol, li {
    font-size: 0.85rem;
  }

  th, td {
    font-size: 0.75rem;
    padding: 7px 8px;
    min-width: 100px; /* Prevent extreme squeezing */
  }
}

/* Elementor animation override for static pages */
.elementor-invisible {
  visibility: visible !important;
  opacity: 1 !important;
  animation: none !important;
}

/* Back Button Style */
.back-home-btn {
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  margin-bottom: 24px;
  transition: all 0.25s ease-in-out;
}

.back-home-btn:hover {
  background-color: #FFFFFF;
  color: var(--primary-dark) !important;
  border-color: #FFFFFF;
  transform: translateX(-4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.back-home-btn svg {
  transition: transform 0.25s ease-in-out;
}

.back-home-btn:hover svg {
  transform: translateX(-2px);
}

/* Make sure the hero content coordinates properly */
.policy-hero-content {
  max-width: 800px;
  margin: 0 auto;
  z-index: 2;
  position: relative;
}

/* Ensure high contrast white text for all elements inside tables (which have dark backgrounds) */
table, 
table tr, 
table th, 
table td, 
table p, 
table li, 
table ul, 
table ol,
table strong, 
table span, 
table a {
  color: #FFFFFF !important;
}

/* Header & Footer spacing adjustments to fix 'big space' and match index.html exactly */
.ekit-template-content-header {
  background-color: #9212bd !important;
  box-shadow: none !important;
  border-bottom: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  /* Prevent the header from ever exceeding viewport width */
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* Elementor inner containers — clamp to viewport */
.ekit-template-content-header .e-con,
.ekit-template-content-header .e-con-inner,
.ekit-template-content-header .elementor-element {
  max-width: 100% !important;
  min-width: 0 !important;
}

.ekit-template-content-header .elementor-element-288f763f {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: auto !important;
}

.ekit-template-content-header img {
  max-height: 48px !important;
  width: auto !important;
  padding-top: 0 !important; /* Remove the inline 10% padding which causes excessive spacing on clean loads */
}

/* Header button styling to match index.html exactly */
.ekit-template-content-header .elementor-button {
  background-color: transparent !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out !important;
}

.ekit-template-content-header .elementor-button:hover {
  background-color: #ffffff !important;
  color: #9212bd !important;
}

/* Adjust footer vertical spacing and background to match index.html */
.ekit-template-content-footer {
  margin-top: 50px !important;
  background-color: #ffffff !important;
  border-top: 1px solid #eaeaea !important;
}

.ekit-template-content-footer .elementor-element-15dea7b {
  padding-top: 30px !important;
  padding-bottom: 30px !important;
}

/* Footer links style override to match index.html exactly */
.ekit-template-content-footer a {
  color: #333333 !important;
  text-decoration: none !important;
  transition: color 0.2s ease-in-out !important;
}

.ekit-template-content-footer a:hover {
  color: #9212bd !important;
}

.ekit-template-content-footer .elementor-social-icon svg {
  fill: #333333 !important;
  transition: fill 0.2s ease-in-out !important;
}

.ekit-template-content-footer .elementor-social-icon:hover svg {
  fill: #9212bd !important;
}

/* Ensure the footer links list is horizontal and matches the image layout */
.ekit-template-content-footer .elementor-icon-list-items {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  gap: 24px !important;
  list-style: none !important;
  list-style-type: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ekit-template-content-footer .elementor-icon-list-item {
  display: inline-flex !important;
  list-style: none !important;
  list-style-type: none !important;
}

.ekit-template-content-footer .elementor-icon-list-item::before {
  content: none !important;
  display: none !important;
}

.ekit-template-content-footer ul,
.ekit-template-content-footer li {
  list-style: none !important;
  list-style-type: none !important;
}

/* Scroll-to-top button styling matching index.html */
#scrollToTopBtn {
  position: fixed !important;
  right: 20px !important;
  bottom: 24px !important;
  background: transparent !important;
  border: none !important;
  padding: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  cursor: pointer !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .18s ease !important;
  z-index: 9999 !important;
}

#scrollToTopBtn.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

#scrollToTopBtn img {
  width: 50px !important;
  height: 50px !important;
  display: block !important;
}

