/* Shared styles for the policy pages (/privacy, /terms, /refund).
   Colors, nav, footer and section styles mirror index.html. */

@font-face {
  font-family: 'Noto Sans Khmer';
  src: url('/fonts/NotoSansKhmer-Khmer.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
  /* Includes Noto's Latin glyphs: on index.html (full font) Latin words inside
     Khmer text render in Noto, which is heavier than the Open Sans fallback. */
  unicode-range: U+0020-007E, U+00A0-00FF, U+1780-17FF, U+19E0-19FF, U+200B-200D,
                 U+2013-2014, U+2018-201E, U+2022, U+2026, U+20AC, U+25CC;
}
@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0D1B3E;
  --navy-light: #162650;
  --red: #E8212A;
  --red-dark: #C41920;
  --white: #FFFFFF;
  --light-bg: #F5F7FA;
  --muted: #6B7A99;
  --text: #1A2340;
  --border: #DDE2ED;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans Khmer', 'Open Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

[data-lang="en"] body {
  font-family: 'Open Sans', sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

h1, h2, h3, h4 { font-weight: 600; }

/* index.html sets text in English mode to weight 400 (its headings wrap their
   text in spans, so they render at 400 too); match that here. */
[data-lang="en"] p,
[data-lang="en"] span,
[data-lang="en"] div,
[data-lang="en"] li,
[data-lang="en"] a,
[data-lang="en"] h1,
[data-lang="en"] h2 {
  font-weight: 400;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* NAV */
nav {
  background: var(--navy);
  position: relative;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(232,33,42,0.55) 50%, transparent 100%);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: 'Open Sans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.3px;
  text-decoration: none;
}

.logo span { color: var(--red); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.lang-toggle {
  display: flex;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  overflow: hidden;
}

.lang-toggle button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  transition: background 0.15s, color 0.15s;
}

#btn-km { font-family: 'Noto Sans Khmer', sans-serif; }

.lang-toggle button.active {
  background: var(--red);
  color: var(--white);
}

/* SECTIONS */
.section { padding: 64px 0 80px; }

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 12px;
}

.section-divider {
  width: 36px; height: 3px;
  background: var(--red);
  border-radius: 2px;
  margin-bottom: 18px;
}

.section-lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 540px;
  margin-bottom: 48px;
}

/* POLICY TEXT */
.policy {
  max-width: 720px;
}

.policy h1 {
  font-size: 32px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

[data-lang="en"] .policy h1 { font-size: 34px; line-height: 1.2; }

.policy-version {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.policy .policy-summary {
  font-size: 17px;
  color: var(--text);
  padding: 16px 20px;
  background: var(--light-bg);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
}

.policy h2 {
  font-size: 20px;
  color: var(--text);
  line-height: 1.5;
  margin: 40px 0 12px;
}

.policy p,
.policy li {
  font-size: 16px;
  color: var(--text);
}

.policy p { margin-bottom: 14px; }

.policy ul,
.policy ol {
  margin: 0 0 16px 22px;
}

.policy li { margin-bottom: 6px; }
.policy li::marker { color: var(--red); }

.policy strong { font-weight: 600; }

.policy a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy a:hover { color: var(--red-dark); }

/* Tables scroll sideways on narrow screens instead of breaking the layout */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.policy table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.policy th,
.policy td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.policy th {
  background: var(--light-bg);
  font-weight: 600;
  white-space: nowrap;
}

.policy tr:last-child td { border-bottom: none; }

.policy-contact {
  margin-top: 48px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.policy-contact h2 { margin-top: 0; }
.policy-contact p:last-child { margin-bottom: 0; }

/* FOOTER */
footer {
  font-family: 'Open Sans', sans-serif;
  background: #080F1F;
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

footer .km { font-family: 'Noto Sans Khmer', sans-serif; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: #5A6A8A;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--white); }

.footer-copy {
  font-size: 12px;
  color: #3A4A60;
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* LANG VISIBILITY */
.km { display: block; }
.en { display: none; }
span.km { display: inline; }
span.en { display: none; }

[data-lang="en"] .km { display: none; }
[data-lang="en"] .en { display: block; }
[data-lang="en"] span.km { display: none; }
[data-lang="en"] span.en { display: inline; }

@media (max-width: 720px) {
  .section { padding: 40px 0 56px; }
  .policy h1,
  [data-lang="en"] .policy h1 { font-size: 26px; }
  .policy h2 { font-size: 18px; margin-top: 32px; }
}
