/* Token sama dengan app (lib/core/theme/theme_manager.dart) */
:root {
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #6B7280;
  --divider: #E8E3DB;
  --brand-a: #FD8400;
  --brand-b: #DA4F06;
  --accent: #F4511E;
  --shadow: 0 16px 48px rgba(64, 43, 19, .09);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .04);
  --soft: #F3EEE6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #222222;
    --text: #FFFFFF;
    --muted: #A0A4AB;
    --divider: #34332F;
    --soft: #24231F;
    --shadow: 0 18px 54px rgba(0, 0, 0, .32);
    --shadow-sm: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
site-header, site-footer {
  display: block;
  width: 100%;
}
site-footer {
  margin-top: auto;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SHARED PAGE SKELETON
   ============================================================ */
.page-shell, .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Kolom isi ramping terpusat untuk halaman artikel / form (mis. privacy, delete) */
.content-narrow {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  flex: 1 0 auto;
  padding-bottom: 40px;
}

.content-narrow.narrow {
  max-width: 680px;
}

a { color: var(--accent); }

/* ============================================================
   SHARED HEADER
   ============================================================ */
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex: none;
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-copy b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.4px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.top-links a {
  text-decoration: none;
  color: var(--muted);
  transition: color .15s ease;
}

.top-links a:hover {
  color: var(--text);
}

.top-links .top-cta {
  color: var(--accent);
  padding: 8px 14px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--surface);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.top-links .top-cta:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.lang {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 999px;
  flex: none;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}

.lang button:hover {
  color: var(--text);
}

.lang button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   SHARED FOOTER
   ============================================================ */
footer.site-footer {
  color: var(--muted);
  font-size: 13px;
  padding: 36px 0 44px;
  border-top: 1px solid var(--divider);
  margin-top: 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  max-width: 580px;
  line-height: 1.6;
}

.footer-brand {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.footer-brand b {
  font-weight: 800;
  letter-spacing: -.3px;
}

.footer-copy p {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-copy p a {
  color: inherit;
  text-decoration: underline;
}

.footer-copy p a:hover {
  color: var(--text);
}

.footer-meta {
  font-size: 12px;
  color: var(--muted);
  opacity: .85;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
  transition: color .15s ease;
}

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

/* ============================================================
   TIPITAKA CARD (<tipitaka-card> / .tipitaka-card / .sutta-card)
   ============================================================ */
tipitaka-card,
#notice-body tipitaka-card,
#notice-preview-body tipitaka-card {
  display: block;
  box-sizing: border-box;
  margin: 14px 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

tipitaka-card:last-child,
#notice-body tipitaka-card:last-child,
#notice-preview-body tipitaka-card:last-child {
  margin-bottom: 0;
}

.notice-article img,
.notice-article a,
tipitaka-card a,
tipitaka-card img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

tipitaka-card > a.tipitaka-card-link,
#notice-body tipitaka-card > a.tipitaka-card-link,
#notice-preview-body tipitaka-card > a.tipitaka-card-link,
a.tipitaka-card,
a.sutta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  background: var(--tc-bg, var(--soft, #fafaf9));
  border: 1px solid var(--tc-border, var(--divider, #e7e5e4));
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0;
  text-decoration: none !important;
  color: inherit !important;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

tipitaka-card > a.tipitaka-card-link:hover,
#notice-body tipitaka-card > a.tipitaka-card-link:hover,
#notice-preview-body tipitaka-card > a.tipitaka-card-link:hover,
a.tipitaka-card:hover,
a.sutta-card:hover {
  border-color: var(--saffron, var(--brand-a, #d97706));
  background: var(--saffron-light, rgba(253, 132, 0, .09));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, .12);
}

.tipitaka-card-info,
#notice-body .tipitaka-card-info,
#notice-preview-body .tipitaka-card-info,
.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
  padding: 0;
  margin: 0;
}

.tipitaka-card-code,
#notice-body .tipitaka-card-code,
#notice-preview-body .tipitaka-card-code,
.sutta-code {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--saffron, var(--brand-b, #d97706));
  letter-spacing: 0.5px;
  line-height: 1.35;
  margin: 0 0 1px;
  padding: 0;
}

.tipitaka-card-pali,
#notice-body .tipitaka-card-pali,
#notice-preview-body .tipitaka-card-pali,
.sutta-pali {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--brown-dark, var(--text, #292524));
  line-height: 1.35;
  margin: 0;
  padding: 0;
}

.tipitaka-card-title,
#notice-body .tipitaka-card-title,
#notice-preview-body .tipitaka-card-title,
.sutta-title {
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--brown-dark, var(--text, #292524));
  line-height: 1.4;
  margin: 0;
  padding: 0;
}

.tipitaka-card-pali + .tipitaka-card-title,
#notice-body .tipitaka-card-pali + .tipitaka-card-title,
#notice-preview-body .tipitaka-card-pali + .tipitaka-card-title,
.sutta-pali + .sutta-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted, var(--muted, #57534e));
  line-height: 1.42;
}

.tipitaka-card-sub,
#notice-body .tipitaka-card-sub,
#notice-preview-body .tipitaka-card-sub {
  font-size: 0.9rem;
  color: var(--text-muted, var(--muted, #57534e));
  line-height: 1.45;
  margin: 0;
  padding: 0;
}

.tipitaka-card-url,
#notice-body .tipitaka-card-url,
#notice-preview-body .tipitaka-card-url,
.sutta-url {
  font-size: 0.85rem;
  color: var(--text-muted, var(--muted, #57534e));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  padding: 0;
}

.tipitaka-card-arrow,
#notice-body .tipitaka-card-arrow,
#notice-preview-body .tipitaka-card-arrow,
.card-arrow {
  background: var(--saffron, var(--brand-a, #d97706));
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  transition: background .2s ease, transform .2s ease;
}

.tipitaka-card-arrow svg,
.card-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}

tipitaka-card > a.tipitaka-card-link:hover .tipitaka-card-arrow,
a.tipitaka-card:hover .tipitaka-card-arrow,
a.sutta-card:hover .card-arrow {
  background: var(--brown-dark, var(--brand-b, #451a03));
  transform: translateX(2px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 800px) {
  .page-shell, .wrap {
    padding: 0 20px;
  }
}

@media (max-width: 680px) {
  header.top {
    padding: 14px 0;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
  .brand-copy small {
    display: none;
  }
  .top-links a.nav-features-link {
    display: none;
  }
  .top-actions {
    gap: 10px;
  }
  .top-links .top-cta {
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .lang button {
    padding: 4px 9px;
    font-size: 11px;
  }
  footer.site-footer {
    flex-direction: column;
    gap: 20px;
    padding: 26px 0 34px;
  }
  .footer-links {
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .page-shell, .wrap {
    padding: 0 16px;
  }
}

