/* Malaylingua shared styles, used on every page.
   Palette: midnight blue range with soft teal, sky blue and beige. */
:root {
  --midnight: #112a46;
  --ocean: #1b3b5a;
  --teal: #4b6b7c;
  --sky: #c8d9e6;
  --beige: #f2efe7;
  --haze: #f2f6fb;
  --white: #ffffff;
  --ink: #1b2b40;
  --muted: #52627a;
  --line: #d9e2ec;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--white); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; color: var(--midnight); font-variant-numeric: lining-nums; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-bottom: 1rem; }
h3 { font-size: 1.3rem; }
section { padding: 4.5rem 0; }

/* Buttons */
.btn { display: inline-block; padding: .8rem 1.5rem; border: 1px solid transparent; border-radius: 4px; font-size: .95rem; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn-dark { background: var(--midnight); color: var(--white); }
.btn-dark:hover { background: var(--ocean); }
.btn-light { background: var(--sky); color: var(--midnight); }
.btn-light:hover { background: var(--white); }
.btn-outline { border-color: rgba(200, 217, 230, .55); color: var(--white); }
.btn-outline:hover { border-color: var(--sky); background: rgba(200, 217, 230, .1); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 2rem; padding: .5rem 0; }
.logo { display: block; margin-right: auto; }
.logo img { display: block; height: 35px; width: auto; }
.site-nav { display: flex; gap: 2rem; }
.site-nav a { padding: .4rem 0; border-bottom: 2px solid transparent; color: var(--ink); font-size: .875rem; font-weight: 500; text-decoration: none; }
.site-nav a:hover { border-bottom-color: var(--teal); }

/* Footer */
.site-footer { background: #0b1f35; color: #9fb3cb; padding: 3.5rem 0 2rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
.footer-brand { margin: 0 0 .5rem; font-family: var(--serif); font-size: 1.5rem; color: var(--white); font-variant-numeric: lining-nums; }
.footer-title { margin: 0 0 .75rem; color: var(--white); font-size: .95rem; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.site-footer a { color: #9fb3cb; text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.legal { padding-top: 1.5rem; border-top: 1px solid rgba(200, 217, 230, .2); font-size: .85rem; }

/* Back to top button */
.to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 20; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border: 2px solid var(--sky); border-radius: 50%; background: var(--midnight); color: var(--white); box-shadow: 0 2px 12px rgba(17, 42, 70, .3); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s, transform .25s, visibility .25s, background .15s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--ocean); }

@media (max-width: 860px) {
  .bar { flex-wrap: wrap; gap: .25rem 1rem; }
  .logo img { height: 32px; }
  .site-nav { order: 3; width: 100%; gap: 1.25rem; padding-bottom: .5rem; overflow-x: auto; }
  section { padding: 3.5rem 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
