/* ═══════════════════════════════════════════════════════════════
   PDGT Hub · policy pages (terms.html, privacy.html, refund.html)
   Loaded after tahoe-ds.css and sh-public.css, so the pastel
   background, card glass and dark-mode tokens come from there.
   Each page holds a Malay and an English copy; js/legal.js shows
   the one that matches the site language.
   ═══════════════════════════════════════════════════════════════ */

html[data-page="legal"] { background: #F4F3FB; }
html[data-page="legal"][data-theme="dark"] { background: #0E0C1A; }

body.sh-legal {
  margin: 0;
  min-height: 100vh;
  background: var(--pub-bg);
  background-attachment: fixed;
  font-family: var(--font);
  color: var(--pub-t1);
  -webkit-font-smoothing: antialiased;
}

/* Top bar: brand on the left, language + theme on the right */
.lgl-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--pub-card-solid) 80%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--pub-line);
}
.lgl-brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--pub-t1); text-decoration: none; font-weight: 700; font-size: 16px;
}
.lgl-brand .sh-logo {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-grid; place-items: center;
  background: var(--accent-grad); color: #fff;
}
.lgl-brand .sh-logo .material-symbols-rounded { font-size: 18px; }
.lgl-brand .sh-logo:has(.sh-logo-img) { background: none; overflow: hidden; }
.lgl-bar .tb-right { display: flex; align-items: center; gap: 8px; }
.lgl-bar .tb-theme {
  width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer;
  display: inline-grid; place-items: center;
  background: var(--pub-card); color: var(--pub-t2);
  box-shadow: inset 0 0 0 1px var(--pub-line);
}

.lgl-wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 56px; }

/* Tabs between the three policies */
.lgl-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 4px 0 18px;
}
.lgl-tabs a {
  padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--pub-t2); background: var(--pub-card);
  box-shadow: inset 0 0 0 1px var(--pub-line);
}
.lgl-tabs a[aria-current="page"] { color: #fff; background: var(--accent-grad); box-shadow: none; }

.lgl-card {
  background: var(--pub-card);
  box-shadow: var(--pub-card-sh);
  border-radius: 22px;
  padding: 28px 24px;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
@media (min-width: 700px) { .lgl-card { padding: 40px 48px; } }

/* Only the copy in the current language is shown */
.lgl-doc[lang="en"] { display: none; }
html.lgl-en .lgl-doc[lang="en"] { display: block; }
html.lgl-en .lgl-doc[lang="ms"] { display: none; }

.lgl-doc h1 { margin: 0 0 6px; font-size: clamp(26px, 5vw, 34px); letter-spacing: -0.6px; line-height: 1.15; }
.lgl-meta { margin: 0 0 22px; color: var(--pub-t3); font-size: 14px; }
.lgl-doc h2 {
  margin: 30px 0 10px; font-size: 19px; letter-spacing: -0.2px;
  padding-top: 18px; border-top: 1px solid var(--pub-line);
}
.lgl-doc h3 { margin: 18px 0 6px; font-size: 16px; }
.lgl-doc p, .lgl-doc li { font-size: 15.5px; line-height: 1.7; color: var(--pub-t2); }
.lgl-doc p { margin: 0 0 12px; }
.lgl-doc ul, .lgl-doc ol { margin: 0 0 12px; padding-left: 22px; }
.lgl-doc li { margin: 3px 0; }
.lgl-doc a { color: var(--pub-link); }
.lgl-doc strong { color: var(--pub-t1); }

.lgl-summary {
  margin: 0 0 8px; padding: 14px 16px; border-radius: 14px;
  background: rgba(124, 108, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(124, 108, 255, 0.18);
}
.lgl-summary p:last-child, .lgl-summary ul:last-child { margin-bottom: 0; }

/* Who runs the service / contact block */
.lgl-contact {
  display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px;
  margin: 0 0 12px; font-size: 15px; color: var(--pub-t2);
}
.lgl-contact dt { font-weight: 600; color: var(--pub-t1); }
.lgl-contact dd { margin: 0; overflow-wrap: anywhere; }

/* Data table in the privacy policy; scrolls sideways on phones */
.lgl-table-wrap { overflow-x: auto; margin: 0 0 12px; }
.lgl-doc table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14.5px; }
.lgl-doc th, .lgl-doc td {
  text-align: left; vertical-align: top; padding: 9px 10px;
  border-bottom: 1px solid var(--pub-line); color: var(--pub-t2); line-height: 1.55;
}
.lgl-doc th { color: var(--pub-t1); font-weight: 600; }

.lgl-foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  margin-top: 22px; font-size: 13px; color: var(--pub-t3);
}
.lgl-foot a { color: inherit; text-decoration: none; }
.lgl-foot a:hover { color: var(--pub-link); }

@media print {
  .lgl-bar, .lgl-tabs, .lgl-foot { display: none; }
  .lgl-card { box-shadow: none; padding: 0; background: none; }
}
