/* ==========================================================================
   Terms and Conditions Page Styles - Honey Translations
   Brand Colors:
   - Primary Blue: var(--sky)
   - Sky Blue: var(--aqua)
   - Light Blue: var(--sky-tint)
   - Light Border: var(--aqua-tint) / var(--border)
   - Slate Dark Headings: var(--ink)
   - Slate Body Text: var(--ink)
   - Muted Slate: var(--muted)
   - Page Background: var(--pale-sky)
   - White: #FFFFFF
   ========================================================================== */

.terms-page-main {
  width: 100%;
  background-color: var(--pale-sky);
  font-family: var(--font-sans, 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: var(--ink);
  overflow-x: hidden;
}

/* Common Container */
.terms-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(16px, 3vw, 28px);
  box-sizing: border-box;
}

/* Category Pill Badge */
.terms-pill {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 9999px;
  background-color: var(--sky-tint);
  color: var(--link);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ==========================================================================
   BANNER / HEADER AREA
   ========================================================================== */
.terms-banner-section {
  padding: clamp(48px, 6vw, 72px) 0 clamp(32px, 4vw, 48px);
  background: linear-gradient(180deg, var(--pale-sky) 0%, #FFFFFF 100%);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.terms-main-title {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  font-weight: 700;
  color: var(--link);
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.terms-updated-date {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 16px 0;
}

.terms-intro-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   TWO-COLUMN LAYOUT (Sticky TOC + Content Card)
   ========================================================================== */
.terms-layout-section {
  padding: clamp(40px, 5vw, 68px) 0 clamp(64px, 7vw, 96px);
}

.terms-layout-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: clamp(32px, 4vw, 54px);
  align-items: start;
}

/* Mobile Bar (Hidden on desktop) */
.terms-toc-mobile-bar {
  display: none;
}

/* ==========================================================================
   LEFT COLUMN: STICKY TABLE OF CONTENTS (25%)
   ========================================================================== */
.terms-sidebar-aside {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom scrollbar for TOC */
.terms-sidebar-aside::-webkit-scrollbar {
  width: 5px;
}
.terms-sidebar-aside::-webkit-scrollbar-track {
  background: var(--pale-sky);
  border-radius: 4px;
}
.terms-sidebar-aside::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.terms-sidebar-aside::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.terms-toc-nav {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  box-shadow: 0 4px 16px var(--shadow);
}

.terms-toc-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--sky-tint);
  display: flex;
  align-items: center;
  gap: 8px;
}

.terms-toc-heading::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background-color: var(--link);
  border-radius: 2px;
}

.terms-toc-group {
  margin-bottom: 22px;
}

.terms-toc-group:last-child {
  margin-bottom: 0;
}

.terms-toc-group-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--link);
  margin: 0 0 10px 0;
  padding: 4px 8px;
  background-color: var(--pale-sky);
  border-radius: 6px;
}

.terms-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.terms-toc-item {
  margin: 0;
}

.terms-toc-link {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
  padding: 6px 12px;
  text-decoration: none;
  border-left: 2.5px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.4;
  border-radius: 0 6px 6px 0;
}

.terms-toc-link:hover {
  color: var(--link);
  background-color: var(--pale-sky);
  border-left-color: var(--aqua);
}

.terms-toc-link.active {
  color: var(--link);
  font-weight: 700;
  background-color: var(--sky-tint);
  border-left-color: var(--link);
}

.terms-toc-link:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   RIGHT COLUMN: LEGAL CONTENT CARD (75%)
   ========================================================================== */
.terms-content-card {
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
  padding: clamp(32px, 4vw, 56px);
  box-sizing: border-box;
}

.terms-group-block {
  margin-bottom: 54px;
}

.terms-group-block:last-child {
  margin-bottom: 0;
}

.terms-group-header {
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--aqua-tint);
}

#group-tos .terms-group-header {
  margin-top: 48px;
}

.terms-group-title {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.7rem, 2.5vw, 2.1rem);
  font-weight: 700;
  color: var(--link);
  margin: 0;
  line-height: 1.25;
}

.terms-article-block {
  margin-bottom: 38px;
  scroll-margin-top: 110px; /* Offset for smooth scroll under sticky header */
}

.terms-article-block:last-child {
  margin-bottom: 0;
}

.terms-section-title {
  font-size: clamp(1.18rem, 1.6vw, 1.38rem);
  font-weight: 700;
  color: var(--ink);
  border-left: 4px solid var(--border);
  padding-left: 14px;
  margin: 0 0 16px 0;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.terms-subheading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--link);
  margin: 22px 0 10px 0;
  line-height: 1.4;
}

.terms-paragraph {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--ink);
  max-width: 80ch; /* Optimal line length */
  margin: 0 0 16px 0;
}

.terms-paragraph:last-child {
  margin-bottom: 0;
}

/* Email Links */
.terms-email-link {
  color: var(--link);
  text-decoration: underline;
  font-weight: 600;
  word-break: break-all;
  transition: color 0.2s ease;
}

.terms-email-link:hover {
  color: var(--link);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 991px) {
  .terms-layout-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .terms-sidebar-aside {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    margin-bottom: 24px;
  }

  /* Mobile Dropdown Bar */
  .terms-toc-mobile-bar {
    display: block;
    margin-bottom: 12px;
  }

  .terms-toc-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #FFFFFF;
    border: 1px solid var(--aqua-tint);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--link);
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.25s ease;
  }

  .terms-toc-toggle-btn:hover {
    background-color: var(--pale-sky);
    border-color: var(--aqua);
  }

  .toc-toggle-title {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .toc-toggle-arrow {
    transition: transform 0.25s ease;
  }

  .terms-toc-toggle-btn[aria-expanded="true"] .toc-toggle-arrow {
    transform: rotate(180deg);
  }

  /* Collapsible Nav on Mobile */
  .terms-toc-nav {
    display: none;
    margin-top: 8px;
    max-height: 380px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--aqua-tint);
  }

  .terms-toc-nav.is-open {
    display: block;
  }

  .terms-content-card {
    padding: clamp(24px, 4vw, 36px) clamp(16px, 3vw, 28px);
  }

  .terms-article-block {
    scroll-margin-top: 80px;
  }
}

@media (max-width: 576px) {
  .terms-section-title {
    font-size: 1.15rem;
  }

  .terms-paragraph {
    font-size: 0.95rem;
    line-height: 1.68;
  }
}

/* ==========================================================================
   PRINT STYLESHEET
   ========================================================================== */
@media print {
  /* Hide site chrome & navigation */
  .top-bar,
  .main-header,
  .footer-bg,
  .footer-bottom,
  .floating-quick-bar,
  .floating-chat-widget,
  .terms-sidebar-aside,
  .terms-toc-mobile-bar,
  .terms-pill,
  #scroll-to-top,
  .enquiry-modal-overlay {
    display: none !important;
  }

  body,
  .terms-page-main,
  .terms-banner-section,
  .terms-content-card {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  .terms-main-title,
  .terms-group-title,
  .terms-section-title,
  .terms-subheading {
    color: #000000 !important;
  }

  .terms-section-title {
    border-left-color: var(--ink) !important;
    page-break-after: avoid;
  }

  .terms-article-block {
    page-break-inside: avoid;
    margin-bottom: 24px;
  }

  .terms-email-link {
    color: #000000 !important;
    text-decoration: underline !important;
  }
}
