/* =====================================================================
   בתאל רוקח – עמודי מידע (הצהרת נגישות · מדיניות פרטיות · תנאי הזמנה ושימוש)
   Loaded after css/fonts.css + css/style.css; reuses their tokens and the
   .container / .brand / .btn / .site-footer components. Token fallbacks keep
   the pages readable if a token is renamed.
   ===================================================================== */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Slim header: logo + back home ---------- */
/* Anchor jumps, focus scrolling and scrollIntoView all stop below the sticky header
   (min-height 76px + 1px border) with 12px to spare. One rule on the root instead of a
   scroll-margin on every [id], so the two never add up. style.css gives the sections of
   non-home pages a scroll-margin-top (for the home header's height); it is reset here so it
   does not stack on top of the root padding. */
html { scroll-padding-top: calc(77px + 12px); }
.legal [id] { scroll-margin-top: 0; }
.page-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 247, 242, .95); border-bottom: 1px solid var(--line, #E6D9CD);
  -webkit-backdrop-filter: saturate(150%) blur(12px); backdrop-filter: saturate(150%) blur(12px);
}
.page-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 76px; padding-block: 10px; flex-wrap: wrap; }
.page-nav .brand img { width: 46px; height: 46px; }
.page-nav .brand-name { font-size: 1.45rem; }
.back-home { min-height: 44px; padding: 8px 20px; font-size: 1rem; }
.back-home .icon { font-size: 1.15rem; }   /* "לאתר ←", same pattern as the client-area pages (login) */
@media (max-width: 420px) {
  .page-nav .brand-sub { display: none; }
  .back-home { padding: 8px 14px; }
}

/* ---------- Page layout: title, table of contents, readable column ---------- */
.legal { padding: clamp(32px, 6vw, 64px) 0 clamp(64px, 9vw, 104px); }
.legal:focus { outline: none; }
.legal-layout {
  display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 72ch);
  gap: 28px clamp(32px, 5vw, 64px); justify-content: center; align-items: start;
}
.legal-head { grid-column: 1 / -1; max-width: 72ch; }
.legal-head .crumbs { margin: 0 0 10px; font-size: .9375rem; color: var(--muted, #76655C); }
.legal-head .crumbs a { color: var(--cocoa, #3E2C26); text-underline-offset: 3px; }
.legal-head h1 {
  margin: 0; font-family: var(--font-display); font-weight: 400; color: var(--cocoa, #3E2C26);
  font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1.08; text-wrap: balance;
}
.legal-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 1rem; color: var(--muted, #76655C); }
.legal-lead { margin: 18px 0 0; font-size: 1.2rem; line-height: 1.75; color: var(--ink, #4A3A33); text-wrap: pretty; }

/* Table of contents (sticky beside the text on wide screens) */
.toc {
  position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper, #FFFDFB); border: 1px solid var(--line, #E6D9CD); border-radius: 22px; padding: 18px 16px;
}
.toc h2 {
  margin: 0 0 8px; padding-inline: 10px; font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  line-height: 1.4; letter-spacing: .02em; color: var(--cocoa, #3E2C26);
}
.toc ol { counter-reset: toc; display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.toc li { margin: 0; }
.toc a {
  display: flex; align-items: flex-start; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: 12px;
  color: var(--ink, #4A3A33); text-decoration: none; font-size: 1rem; line-height: 1.45;
}
.toc a::before {
  counter-increment: toc; content: counter(toc); flex: none; min-width: 1.5em;
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--blush-text, #8F5545);
}
.toc a:hover { background: var(--blush-soft, #F6E6DF); color: var(--cocoa, #3E2C26); text-decoration: underline; text-underline-offset: 3px; }

/* Body text */
.legal-body { min-width: 0; max-width: 72ch; font-size: 1.125rem; line-height: 1.8; color: var(--ink, #4A3A33); }
.legal-body > section { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line, #E6D9CD); }
.legal-body > section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.legal-body h2 {
  margin: 0 0 14px; font-family: var(--font-display); font-weight: 400; color: var(--cocoa, #3E2C26);
  font-size: clamp(1.7rem, 3.2vw, 2.05rem); line-height: 1.2; text-wrap: balance;
}
.legal-body h3 { margin: 24px 0 6px; font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; line-height: 1.45; color: var(--cocoa, #3E2C26); }
.legal-body p { margin: 0 0 14px; text-wrap: pretty; }
.legal-body ul, .legal-body ol { margin: 0 0 16px; padding-inline-start: 1.35em; }
.legal-body li { margin-bottom: 8px; padding-inline-start: .2em; }
.legal-body li::marker { color: var(--blush-deep, #B97C6B); }
.legal-body a:not(.btn) { color: var(--cocoa, #3E2C26); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal-body a:not(.btn):hover { text-decoration-thickness: 2px; }
.legal-body strong { color: var(--cocoa, #3E2C26); font-weight: 700; }
.legal-body bdi { unicode-bidi: isolate; }

/* Definition-style rows (contact details, controller details) */
.facts-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0 0 16px; }
.facts-list dt { font-weight: 700; color: var(--cocoa, #3E2C26); }
.facts-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .facts-list { grid-template-columns: 1fr; gap: 0; }
  .facts-list dd { margin-bottom: 10px; }
}

/* Soft callout */
.note {
  margin: 0 0 18px; padding: 16px 20px; border-radius: 18px;
  background: var(--blush-soft, #F6E6DF); color: var(--ink, #4A3A33);
  border-inline-start: 4px solid var(--blush-deep, #B97C6B);
}
.note p:last-child { margin-bottom: 0; }

/* Clearly marked placeholder for a business fact that is not known yet (filled from the admin) */
.ph {
  display: inline; padding: 1px 7px; border-radius: 6px; font-weight: 600; font-size: .95em;
  background: var(--warning-soft, #FBF0D9); color: var(--warning, #7A5512);
  border: 1px dashed currentColor; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
a.ph:not([href]) { text-decoration: none; }
p.ph, div.ph { display: block; padding: 10px 14px; margin: 0 0 14px; }

/* Simple data table with a keyboard-scrollable wrapper (no horizontal page scroll) */
.table-wrap { margin: 0 0 18px; overflow-x: auto; border: 1px solid var(--line, #E6D9CD); border-radius: 16px; background: var(--paper, #FFFDFB); }
.table-wrap:focus-visible { outline: 2px solid var(--cocoa, #3E2C26); outline-offset: 2px; }
.legal table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 1rem; line-height: 1.55; }
.legal caption { padding: 12px 14px 0; text-align: start; font-weight: 700; color: var(--cocoa, #3E2C26); }
.legal th, .legal td { padding: 12px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line, #E6D9CD); }
.legal thead th { background: var(--sand, #F4ECE3); color: var(--cocoa, #3E2C26); font-weight: 700; }
.legal tbody tr:last-child > * { border-bottom: 0; }
.legal td bdi, .legal th bdi { white-space: nowrap; }

/* Contact card at the end of each page */
.contact-box {
  margin-top: 8px; padding: clamp(22px, 4vw, 34px); border-radius: 26px;
  background: var(--blush-soft, #F6E6DF); color: var(--cocoa, #3E2C26);
}
.legal-body > section.contact-box { padding: clamp(22px, 4vw, 34px); margin-bottom: 30px; border-bottom: 0; }
.contact-box h2 { margin-bottom: 8px; }
.contact-box p { color: var(--ink, #4A3A33); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.contact-actions .btn { min-height: 48px; padding: 10px 22px; font-size: 1rem; }
.contact-actions .btn-ghost { background: var(--paper, #FFFDFB); }
.contact-actions .btn .icon { font-size: 1.2rem; }

.to-top { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; min-height: 44px; font-weight: 600; color: var(--cocoa, #3E2C26); text-underline-offset: 3px; }
.to-top .icon { transform: rotate(90deg); }

/* ---------- Footer (reuses .site-footer from style.css) ---------- */
.page-footer .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
.page-footer .footer-title {
  margin: 6px 0 12px; font-family: var(--font-body); font-size: .9375rem; font-weight: 600;
  line-height: 1.4; letter-spacing: .08em; color: var(--blush, #EBCFC4);
}
.page-footer li a { display: inline-block; padding: 8px 2px; min-height: 40px; }
.page-footer a[aria-current="page"] { color: #FFF6EF; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { .page-footer li a { padding: 10px 6px; min-height: 44px; } }

/* ---------- Narrow screens: one column, contents box above the text ---------- */
@media (max-width: 960px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); max-width: 72ch; margin-inline: auto; }
  .toc { position: static; max-height: none; overflow: visible; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 8px; }
}
@media (max-width: 600px) {
  .legal-body { font-size: 1.0625rem; }
  .legal-lead { font-size: 1.125rem; }
  .toc { padding: 14px 10px; }
}

/* ---------- Accessibility-menu modes that need a page-level touch ---------- */
html.a11y-contrast .note { border-inline-start-color: #000; border: 2px solid #000; }
html.a11y-contrast .ph { background: #FFFFFF; color: #000000; border: 2px dashed #000000; }
html.a11y-contrast .contact-box, html.a11y-contrast .toc, html.a11y-contrast .table-wrap { border: 2px solid #000000; }
html.a11y-contrast .legal thead th { background: #FFFFFF; border-bottom: 2px solid #000000; }

/* ---------- Print: just the text ---------- */
@media print {
  .page-header, .page-footer, .toc, .to-top, .skip, .contact-actions { display: none !important; }
  .legal { padding: 0; }
  .legal-layout { display: block; }
  .legal-body { max-width: none; font-size: 11pt; color: #000; }
  .legal-body a[href^="http"]:not([href*="wa.me/"])::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .legal-body h2, .legal-body h3 { break-after: avoid; }
}
