/*
 * Desa Sade — base tokens, reset, and shared chrome (nav + menu).
 * Hand-authored static file (not run through the Vite build) since it
 * needs no preprocessing. Loaded on every page.
 *
 * Palette is a placeholder inspired by Lombok's thatch roofs, terracotta
 * earth, and rice-field green — swap freely once real design refs arrive.
 */

:root {
  --color-bg: #0f2418;
  --color-bg-elevated: #16301f;
  --color-surface: #1c3a26;
  --color-ink: #f7f2e7;
  --color-ink-muted: #c9c2ac;
  --color-accent: #d98e3b;   /* thatch / terracotta */
  --color-accent-2: #7aa565; /* rice-field green */
  --color-line: rgba(247, 242, 231, 0.14);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --nav-height: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Page shell (every page except landing) -------------------------- */

main {
  min-height: 100dvh;
}

/* ---- Site header: logo + primary links + lang + burger ---------------
   Same design language as the landing page's own nav bar (see
   landing.css .landing-nav), but laid out in normal document flow (sticky
   to the top) instead of floating over a hero image. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 16px;
  padding-top: calc(10px + var(--safe-top));
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(250, 246, 236, 0.96);
  color: #2b2013;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.site-header__logo-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2b2013;
  color: var(--color-accent);
}

.site-header__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-header__logo-line1 {
  font-size: 10px;
  color: #6b5c42;
  letter-spacing: 0.02em;
}

.site-header__logo-line2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.site-header__links {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: 13.5px;
  font-weight: 500;
  color: #4a3d2a;
  white-space: nowrap;
}

.site-header__links a.is-active {
  color: #1a1206;
  font-weight: 700;
}

.site-header__right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.site-header__lang {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8a7a5c;
}

.site-header__lang a.is-active {
  color: #1a1206;
}

.site-header__burger {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.site-header__burger span {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #2b2013;
}

@media (min-width: 880px) {
  .site-header {
    padding: 12px 32px;
    padding-top: calc(12px + var(--safe-top));
  }
  .site-header__links {
    display: flex;
  }
  .site-header__burger {
    display: none;
  }
}

/* ---- Full-screen menu --------------------------------------------------- */

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 22, 15, 0.97);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.site-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  width: min(92vw, 420px);
}

.site-menu__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 20px;
}

.site-menu__link.is-active {
  background: var(--color-surface);
  color: var(--color-accent);
}

.site-menu__icon {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: var(--color-accent-2);
  opacity: 0.85;
}

/* ---- Generic page header block (used by most inner pages) ------------- */

.page-header {
  padding: 28px 20px 8px;
  max-width: 760px;
}

.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 44px);
  margin: 0 0 8px;
}

.page-header__desc {
  color: var(--color-ink-muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

/* ---- Offline banner ------------------------------------------------- */

.offline-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translate(-50%, 0);
  background: var(--color-accent);
  color: #1a1206;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 60;
  display: none;
}

.offline-banner.is-visible {
  display: block;
}

/* ---- Install prompt --------------------------------------------------- */

.install-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 60;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.install-toast.is-visible {
  display: flex;
}

.install-toast__text {
  flex: 1;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.install-toast__text strong {
  display: block;
  color: var(--color-ink);
  font-size: 14px;
  margin-bottom: 2px;
}

.install-toast__action {
  background: var(--color-accent);
  color: #1a1206;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
}

.install-toast__dismiss {
  color: var(--color-ink-muted);
  font-size: 13px;
}
