/*
 * Traders Till — Legal page styles (Privacy Policy, Terms of Use, etc.)
 *
 * Scoped to body.page-template-page-legal — WordPress automatically adds
 * this class to any page using the "Legal Page" page template. Loaded
 * conditionally by tt_help_enqueue_styles() in functions.php.
 *
 * No new tokens. All values come from the :root block in style.css.
 */

/* ── Kadence wrapper reset (same pattern as coming-soon.css) ───────────── */
body.page-template-page-legal .content-area,
body.page-template-page-legal .site-content,
body.page-template-page-legal .content-wrap,
body.page-template-page-legal .entry-content {
  max-width: none;
  padding: 0;
  margin: 0;
}

body.page-template-page-legal {
  background: var(--tt-cream);
  color: var(--tt-stone-800);
  font-family: var(--tt-font-sans);
}

/* Shared container — narrower than the site max-width; prose reads best
   at 65–72ch. 720px ≈ 70ch at 16px. */
body.page-template-page-legal .tt-legal-container {
  width: min(720px, calc(100% - 48px));
  margin: 0 auto;
}

/* ── Hero header ────────────────────────────────────────────────────────── */
body.page-template-page-legal .tt-legal-hero {
  padding: 56px 0 44px;
  background: var(--tt-cream);
  border-bottom: 1px solid var(--tt-stone-100);
}

body.page-template-page-legal .tt-legal-h1 {
  font-family: var(--tt-font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--tt-primary-green);
  margin: 0;
  text-wrap: balance;
}

/* ── Prose content area ─────────────────────────────────────────────────── */
body.page-template-page-legal .tt-legal-content {
  padding: 48px 0 80px;
}

body.page-template-page-legal .tt-legal-prose {
  font-family: var(--tt-font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--tt-stone-800);
}

/* "Last updated …" — first paragraph in the doc; rendered smaller + muted. */
body.page-template-page-legal .tt-legal-prose > p:first-child,
body.page-template-page-legal .tt-legal-prose > .wp-block-paragraph:first-child p {
  font-size: 0.875rem;
  color: var(--tt-stone-600);
  margin-bottom: 36px;
}

/* Section headings */
body.page-template-page-legal .tt-legal-prose h2,
body.page-template-page-legal .tt-legal-prose .wp-block-heading h2 {
  font-family: var(--tt-font-sans);
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--tt-stone-800);
  margin: 44px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--tt-stone-100);
}

body.page-template-page-legal .tt-legal-prose h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

body.page-template-page-legal .tt-legal-prose h3,
body.page-template-page-legal .tt-legal-prose .wp-block-heading h3 {
  font-family: var(--tt-font-sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--tt-stone-800);
  margin: 24px 0 8px;
}

/* Body paragraphs */
body.page-template-page-legal .tt-legal-prose p,
body.page-template-page-legal .tt-legal-prose .wp-block-paragraph {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--tt-stone-800);
}

/* Lists */
body.page-template-page-legal .tt-legal-prose ul,
body.page-template-page-legal .tt-legal-prose ol,
body.page-template-page-legal .tt-legal-prose .wp-block-list {
  padding-left: 1.5rem;
  margin: 0 0 16px;
}

body.page-template-page-legal .tt-legal-prose li {
  margin-bottom: 8px;
  line-height: 1.65;
  font-size: 1rem;
  color: var(--tt-stone-800);
}

/* Links */
body.page-template-page-legal .tt-legal-prose a {
  color: var(--tt-primary-green);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

body.page-template-page-legal .tt-legal-prose a:hover,
body.page-template-page-legal .tt-legal-prose a:focus-visible {
  color: var(--tt-leaf-green);
}

/* Bold */
body.page-template-page-legal .tt-legal-prose strong {
  font-weight: 600;
  color: var(--tt-stone-800);
}

/* Horizontal rule (between major sections if used) */
body.page-template-page-legal .tt-legal-prose hr,
body.page-template-page-legal .tt-legal-prose .wp-block-separator {
  border: none;
  border-top: 1px solid var(--tt-stone-200);
  margin: 44px 0;
  background: none;
}

/* Footer attribution line — last <p> in the document */
body.page-template-page-legal .tt-legal-prose > p:last-child,
body.page-template-page-legal .tt-legal-prose > .wp-block-paragraph:last-child {
  font-size: 0.875rem;
  color: var(--tt-stone-600);
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--tt-stone-100);
}

/* ── Shared footer (inc/footer-tt.php) ─────────────────────────────────── */
body.page-template-page-legal .tt-cs-footer {
  border-top: 1px solid var(--tt-stone-100);
  padding: 24px 0;
  background: var(--tt-cream);
}

body.page-template-page-legal .tt-cs-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--tt-font-sans);
  font-size: 13px;
  color: var(--tt-stone-600);
}

body.page-template-page-legal .tt-cs-footer__copyright {
  flex: 0 0 auto;
}

body.page-template-page-legal .tt-cs-footer__nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body.page-template-page-legal .tt-cs-footer__nav a {
  color: var(--tt-stone-600);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 4px;
  border-radius: 4px;
}

body.page-template-page-legal .tt-cs-footer__nav a:hover,
body.page-template-page-legal .tt-cs-footer__nav a:focus-visible {
  color: var(--tt-primary-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.page-template-page-legal .tt-cs-footer__sep {
  color: var(--tt-stone-400);
}

body.page-template-page-legal .tt-cs-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.page-template-page-legal .tt-cs-footer__social-link {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tt-stone-600);
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
}

body.page-template-page-legal .tt-cs-footer__social-link:hover,
body.page-template-page-legal .tt-cs-footer__social-link:focus-visible {
  background: rgba(91, 102, 41, 0.08);
  color: var(--tt-primary-green);
  outline: none;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body.page-template-page-legal .tt-legal-container {
    width: calc(100% - 40px);
  }

  body.page-template-page-legal .tt-legal-hero {
    padding: 36px 0 28px;
  }

  body.page-template-page-legal .tt-legal-h1 {
    font-size: 1.875rem;
  }

  body.page-template-page-legal .tt-legal-content {
    padding: 32px 0 56px;
  }

  body.page-template-page-legal .tt-legal-prose h2 {
    font-size: 1.125rem;
    margin: 36px 0 10px;
  }

  body.page-template-page-legal .tt-cs-footer__row {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}
