/* Legal pages (privacy policy, terms of use, delete account) inside a coach's website theme.
   Everything comes from the theme's own variables (--c-*), so each coach's colors and fonts carry through.
   views/themes/base/sections/legal.ejs · behaviour: public/js/site-legal.js
   --lg-offset is set by the script to the height of the theme's sticky header. */
.lg {
  --lg-line: var(--c-border, rgba(127, 127, 127, .28));
  --lg-line-2: color-mix(in srgb, var(--c-text, #161616) 24%, transparent);
  --lg-soft: color-mix(in srgb, var(--c-text, #161616) 5%, var(--c-bg, #fff));
  --lg-tint: color-mix(in srgb, var(--c-accent, #111) 14%, var(--c-bg, #fff));
  --lg-danger: #B3261E; --lg-ok: #1B7F45; --lg-warn: #C77700;
  --lg-r: var(--radius, 14px);
  position: relative; max-width: 1200px; margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem); padding-block: clamp(1.2rem, 3vw, 2.2rem) clamp(2.5rem, 6vw, 4.5rem);
}
.lg * { min-width: 0; }
.lg svg.lg-ic { flex: none; }

/* ---- reading progress ---- */
.lg-progress { position: fixed; z-index: 70; inset: 0 0 auto 0; height: 3px; pointer-events: none; }
.lg-progress i { display: block; height: 100%; background: var(--c-accent, currentColor); transform-origin: left center; transform: scaleX(var(--lg-p, 0)); }
[dir="rtl"] .lg-progress i { transform-origin: right center; }

/* ---- top bar: EN / AR (always left to right) and tools ---- */
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); padding-bottom: 1rem; border-bottom: 1px solid var(--lg-line); }
.lg-lang { display: inline-flex; align-items: center; gap: .15rem; padding: .22rem; border: 1px solid var(--lg-line-2); border-radius: 999px; background: var(--c-surface, var(--lg-soft)); }
.lg-lang-ic { display: grid; place-items: center; width: 34px; height: 34px; color: var(--c-muted, inherit); }
.lg-lang-btn { display: inline-grid; place-items: center; min-width: 54px; height: 38px; padding-inline: .9rem; border-radius: 999px; font-weight: 800; font-size: .88rem; letter-spacing: .06em; text-decoration: none; color: var(--c-text, inherit); transition: background .15s, color .15s; }
.lg-lang-btn:hover { background: var(--lg-soft); }
.lg-lang-btn.is-on { background: var(--c-accent, #111); color: var(--c-on-accent, #fff); }
.lg-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.lg-tool { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .35rem .95rem; border: 1px solid var(--lg-line-2); border-radius: 999px; background: transparent; color: var(--c-text, inherit); font: inherit; font-size: .88rem; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.lg-tool:hover { background: var(--lg-soft); border-color: var(--c-text, currentColor); }

/* ---- header ---- */
.lg-head { max-width: 860px; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.t .lg-title { font-size: clamp(2rem, 4.8vw, 3.3rem); margin: 0 0 .45em; }
.lg-intro { font-size: clamp(1rem, 1.4vw, 1.14rem); line-height: 1.75; color: var(--c-muted, inherit); margin: 0 0 1.25rem; max-width: 68ch; }
.lg-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; padding: 0; }
.lg-meta div { display: inline-flex; gap: .5rem; align-items: baseline; padding: .32rem .85rem; border: 1px solid var(--lg-line); border-radius: 999px; background: var(--lg-soft); font-size: .86rem; }
.lg-meta dt { color: var(--c-muted, inherit); }
.lg-meta dd { margin: 0; font-weight: 700; }
.lg-related { display: flex; flex-wrap: wrap; gap: .5rem; }
.lg-chip { display: inline-flex; align-items: center; min-height: 42px; padding: .4rem 1.05rem; border: 1px solid var(--lg-line-2); border-radius: 999px; text-decoration: none; font-weight: 650; font-size: .93rem; transition: background .15s, border-color .15s; }
.lg-chip:hover { border-color: var(--c-text, currentColor); background: var(--lg-soft); }
.lg-chip.is-on { background: var(--c-accent, #111); color: var(--c-on-accent, #fff); border-color: transparent; }

/* ---- at a glance ---- */
.lg-glance { list-style: none; margin: 0 0 clamp(1.8rem, 4vw, 3rem); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: .9rem; }
.lg-glance li { display: flex; gap: .85rem; align-items: flex-start; padding: 1.05rem 1.1rem; background: var(--c-surface, var(--lg-soft)); border: 1px solid var(--lg-line); border-radius: var(--lg-r); }
.lg-glance-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: calc(var(--lg-r) - 4px); background: var(--c-accent, #111); color: var(--c-on-accent, #fff); }
.lg-glance strong { display: block; margin-bottom: .15rem; }
.lg-glance p { margin: 0; color: var(--c-muted, inherit); font-size: .92rem; line-height: 1.5; }

/* ---- layout: contents + document ---- */
.lg-body { display: block; }
@media (min-width: 980px) {
  .lg-body.has-toc { display: grid; grid-template-columns: 252px minmax(0, 780px); justify-content: center; column-gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; }
}

/* contents sidebar (wide screens) */
.lg-toc { display: none; }
@media (min-width: 980px) {
  .lg-toc { display: block; position: sticky; top: calc(var(--lg-offset, 5rem) + .75rem); max-height: calc(100vh - var(--lg-offset, 5rem) - 1.5rem); overflow-y: auto; overscroll-behavior: contain; padding-block: .25rem; scrollbar-width: thin; }
}
.lg-toc-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 .7rem; padding-inline: .9rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted, inherit); font-weight: 800; }
.lg-toc-h em { font-style: normal; font-variant-numeric: tabular-nums; letter-spacing: 0; opacity: .8; }
[dir="rtl"] .lg-toc-h { letter-spacing: 0; text-transform: none; font-size: .9rem; }
.lg-toc ol, .lg-toc-m ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.lg-toc a, .lg-toc-m a { display: flex; gap: .65rem; align-items: baseline; padding: .5rem .9rem; border-inline-start: 3px solid transparent; border-radius: 0 10px 10px 0; text-decoration: none; font-size: .9rem; line-height: 1.4; color: var(--c-muted, inherit); transition: background .15s, color .15s, border-color .15s; }
[dir="rtl"] .lg-toc a, [dir="rtl"] .lg-toc-m a { border-radius: 10px 0 0 10px; }
.lg-toc a:hover, .lg-toc-m a:hover { color: var(--c-text, inherit); background: var(--lg-soft); }
.lg-toc a.is-on, .lg-toc-m a.is-on { color: var(--c-text, inherit); font-weight: 700; border-inline-start-color: var(--c-accent, currentColor); background: var(--lg-tint); }
.lg-n { flex: none; min-width: 1.4em; font-variant-numeric: tabular-nums; font-weight: 700; opacity: .65; }
.lg-toc a.is-on .lg-n, .lg-toc-m a.is-on .lg-n { opacity: 1; color: var(--c-accent-text, inherit); }

/* contents menu (phones and tablets) */
.lg-toc-m { margin: 0 0 1.8rem; border: 1px solid var(--lg-line-2); border-radius: var(--lg-r); background: var(--c-surface, var(--lg-soft)); }
@media (min-width: 980px) { .lg-toc-m { display: none; } }
.lg-toc-m summary { display: flex; align-items: center; gap: .7rem; min-height: 52px; padding: .6rem 1rem; cursor: pointer; font-weight: 700; list-style: none; }
.lg-toc-m summary::-webkit-details-marker { display: none; }
.lg-toc-m summary small { margin-inline-start: auto; font-weight: 500; color: var(--c-muted, inherit); }
.lg-toc-m summary::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; margin-inline-start: .4rem; }
.lg-toc-m[open] summary::after { transform: rotate(-135deg); }
.lg-toc-m ol { padding: 0 .4rem .7rem; border-top: 1px solid var(--lg-line); padding-top: .6rem; }

/* ---- document ---- */
.lg-doc { max-width: 780px; }
.lg-sec { position: relative; padding-block: 1.9rem; border-top: 1px solid var(--lg-line); scroll-margin-top: calc(var(--lg-offset, 5rem) + .5rem); }
.lg-sec:first-child { border-top: 0; padding-top: 0; }
.t .lg-sec h2 { display: flex; align-items: center; gap: .75rem; font-size: clamp(1.28rem, 2.2vw, 1.62rem); line-height: 1.25; margin: 0 0 1rem; outline: none; }
.lg-num { flex: none; display: inline-grid; place-items: center; min-width: 2.1rem; height: 2.1rem; padding-inline: .45rem; border-radius: 999px; font-size: .86rem; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--lg-tint); border: 1px solid var(--lg-line); color: var(--c-text, inherit); }
.lg-h { min-width: 0; }
.lg-anchor { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--c-muted, inherit); opacity: 0; transition: opacity .15s, background .15s; }
.lg-sec h2:hover .lg-anchor, .lg-anchor:focus-visible { opacity: 1; }
.lg-anchor:hover { background: var(--lg-soft); color: var(--c-text, inherit); }
@media (hover: none) { .lg-anchor { display: none; } }
.lg-sec p { margin: 0 0 .9rem; line-height: 1.8; }
.lg-list, .lg-steps { margin: 0 0 1.05rem; padding-inline-start: 1.35rem; display: grid; gap: .6rem; line-height: 1.75; }
.lg-list li::marker { color: var(--c-accent-text, currentColor); }
.lg-steps li::marker { font-weight: 800; color: var(--c-accent-text, currentColor); }

.lg-note { margin: 1.1rem 0; padding: 1rem 1.2rem; border-radius: var(--lg-r); border: 1px solid var(--lg-line); border-inline-start-width: 4px; background: var(--lg-soft); }
.lg-note strong { display: block; margin-bottom: .25rem; }
.lg-note p { margin: 0; line-height: 1.7; }
.lg-note.is-warn { border-inline-start-color: var(--lg-warn); background: color-mix(in srgb, var(--lg-warn) 10%, var(--c-bg, #fff)); }
.lg-note.is-info { border-inline-start-color: var(--c-accent, currentColor); }

.lg-table-wrap { overflow-x: auto; margin: 1.1rem 0; border: 1px solid var(--lg-line); border-radius: var(--lg-r); }
.lg-table { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.6; }
.lg-table th, .lg-table td { padding: .8rem .95rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--lg-line); }
.lg-table thead th { background: var(--lg-soft); font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; color: var(--c-muted, inherit); }
[dir="rtl"] .lg-table thead th { letter-spacing: 0; text-transform: none; font-size: .88rem; }
.lg-table tbody tr:last-child > * { border-bottom: 0; }
.lg-table tbody tr:hover { background: var(--lg-soft); }
.lg-table tbody th { font-weight: 700; width: 18%; }
@media (max-width: 720px) {
  .lg-table-wrap { border: 0; overflow: visible; }
  .lg-table thead { display: none; }
  .lg-table, .lg-table tbody, .lg-table tr, .lg-table th, .lg-table td { display: block; width: 100%; }
  .lg-table tr { margin-bottom: .85rem; border: 1px solid var(--lg-line); border-radius: var(--lg-r); overflow: hidden; }
  .lg-table th, .lg-table td { border-bottom: 1px solid var(--lg-line); }
  .lg-table tbody th { background: var(--lg-soft); width: 100%; }
  .lg-table td::before { content: attr(data-label); display: block; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted, inherit); margin-bottom: .15rem; }
  [dir="rtl"] .lg-table td::before { letter-spacing: 0; text-transform: none; font-size: .82rem; }
}

.lg-cta { margin: 1.6rem 0 0; }

/* ---- contact ---- */
.lg-contact { padding-bottom: 0; }
.lg-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.2rem; padding: 1.2rem 1.3rem; border: 1px solid var(--lg-line); border-radius: var(--lg-r); background: var(--c-surface, var(--lg-soft)); }
.lg-contact-h { margin: 0 0 .5rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted, inherit); font-weight: 800; }
[dir="rtl"] .lg-contact-h { letter-spacing: 0; text-transform: none; font-size: .88rem; }
.lg-contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.lg-contact-list li { display: flex; flex-wrap: wrap; gap: .2rem .7rem; }
.lg-contact-list li > span:first-child:not(:only-child) { color: var(--c-muted, inherit); min-width: 6.5rem; }
.lg-contact-list a { font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* ---- delete form ---- */
.lg-form { margin: 1.3rem 0 .4rem; padding: 1.4rem; border: 1px solid var(--lg-line-2); border-radius: var(--lg-r); background: var(--c-surface, var(--lg-soft)); max-width: 540px; }
.t .lg-form h3 { margin: 0 0 .9rem; font-size: 1.08rem; }
.lg-form label { display: grid; gap: .4rem; margin: 0 0 .95rem; font-size: .9rem; font-weight: 650; }
.lg-form input[type="text"], .lg-form input[type="password"] { width: 100%; min-height: 48px; padding: .6rem .85rem; border: 1px solid var(--lg-line-2); border-radius: calc(var(--lg-r) - 4px); background: var(--c-bg, #fff); color: var(--c-text, inherit); font: inherit; }
.lg-form input:focus-visible { outline: 2px solid var(--c-accent, currentColor); outline-offset: 2px; }
.lg-form .lg-check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.lg-form .lg-check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex: none; accent-color: var(--lg-danger); }
.t button.t-btn.lg-danger { background: var(--lg-danger); color: #fff; width: 100%; }
.t button.t-btn.lg-danger:hover { filter: brightness(1.12); }
.lg-error { margin: 0 0 .95rem; color: var(--lg-danger); font-weight: 700; }
.lg-done { margin: 0; color: var(--lg-ok); font-weight: 700; font-size: 1.05rem; }

/* ---- floating: back to top, toast ---- */
.lg-up { position: fixed; z-index: 60; inset-block-end: 1.2rem; inset-inline-end: 1.2rem; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--c-accent, #111); color: var(--c-on-accent, #fff); cursor: pointer; box-shadow: 0 8px 26px rgba(0, 0, 0, .3); transition: transform .15s; }
.lg-up:hover { transform: translateY(-2px); }
.lg-up[hidden], .lg-toast[hidden] { display: none; }
.lg-toast { position: fixed; z-index: 80; inset-inline: 0; inset-block-end: 1.4rem; width: max-content; max-width: calc(100vw - 2rem); margin-inline: auto; padding: .7rem 1.2rem; border-radius: 999px; background: var(--c-text, #111); color: var(--c-bg, #fff); font-weight: 650; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

@media (max-width: 560px) {
  .lg-top { gap: .7rem; }
  .lg-tool span { display: none; }
  .lg-tool { padding-inline: .75rem; }
  .lg-lang-btn { min-width: 48px; }
}
@media (prefers-reduced-motion: reduce) { .lg *, .lg-progress i { transition: none !important; } }

@media print {
  .lg-top, .lg-toc, .lg-toc-m, .lg-related, .lg-glance, .lg-cta, .lg-form, .lg-up, .lg-toast, .lg-progress, .lg-anchor { display: none !important; }
  .lg-body { display: block !important; }
  .lg-sec { break-inside: avoid; }
}

/* One language switch is enough: the EN / AR switch at the top of the document replaces the theme's own */
.t:has(.sec-legal) .t-lang { display: none !important; }

/* phones: the at-a-glance cards become a swipeable strip, so the contents menu is not pushed far down */
@media (max-width: 640px) {
  .lg-glance { display: flex; gap: .7rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; scrollbar-width: none; }
  .lg-glance::-webkit-scrollbar { display: none; }
  .lg-glance li { flex: 0 0 84%; scroll-snap-align: start; }
}
