/* ISPA Taman — shared frontend styles, built on tokens.css only.
   No hard-coded colours: every value comes from a token variable. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--navy-900);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: var(--leaf-700); }
a:hover { color: var(--navy-900); }
img { max-width: 100%; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--leaf-600);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- Shells ---------- */
/* Phone app pages: centred column, fluid up to 480px */
.shell {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
}
@media (min-width: 768px) {
  .shell { border-inline: 1px solid var(--line-subtle); }
}

/* ---------- Responsive widening ---------- */
/* App/phone pages widen gracefully instead of staying phone-sized */
@media (min-width: 768px) {
  .shell { max-width: 720px; }
  .page-body { padding: 24px; gap: 24px; }
  .tiles--3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tiles--auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (min-width: 1024px) {
  .tiles--2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (min-width: 1200px) {
  .shell { max-width: 800px; }
  .shell--wide { max-width: 1120px; }
}

/* Readable text column inside wide layouts (keeps lines ~70 chars) */
.prose { max-width: 680px; }

/* Generic responsive card grid */
.grid-auto { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }

/* Two-column split at desktop: main content + side panel */
@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Desktop marketing site: full-width bands with centred containers */
.site { min-height: 100dvh; display: flex; flex-direction: column; background: var(--surface-page); }
.container { max-width: 1200px; margin: 0 auto; padding-inline: var(--space-4); width: 100%; }
@media (min-width: 768px) { .container { padding-inline: var(--space-8); } }
.band { background: var(--surface-panel); }
.site__footer { margin-top: auto; }

/* ISPA admin: sidebar + main */
.admin { display: flex; flex-wrap: wrap; min-height: 100dvh; }
.admin__side {
  flex: 1 1 220px; max-width: 260px;
  background: var(--surface-panel);
  padding: var(--space-6) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-1);
}
.admin__main {
  flex: 999 1 560px; min-width: 0;
  padding: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-8);
}
@media (max-width: 767px) {
  .admin__side { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin__side .nav-side__item { flex: 1 1 auto; text-align: center; }
  .admin__main { padding: var(--space-6) var(--space-4); }
}

/* Responsive visibility helpers — composition-safe.
   At ≥768px the element gets the display it declares:
   .show-desktop.block | .show-desktop.inline | .show-desktop.flex | .show-desktop.grid */
.show-desktop { display: none !important; }
@media (min-width: 768px) {
  .show-mobile { display: none !important; }
  .show-desktop.block { display: block !important; }
  .show-desktop.inline { display: inline !important; }
  .show-desktop.flex { display: flex !important; }
  .show-desktop.grid { display: grid !important; }
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--surface-card);
  border-bottom: 1px solid var(--line-subtle);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2);
  height: 56px;
  padding-inline: var(--space-4);
}
.topbar--lg .topbar__inner { min-height: 72px; height: auto; flex-wrap: wrap; padding-block: var(--space-2); }
.topbar__title { font-weight: 700; font-size: 17px; }
.topbar__textlink {
  height: 44px; padding: 0 var(--space-3);
  display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 600; text-decoration: none;
}

/* Wordmark: ISPA (serif bold navy) + Taman (serif italic leaf) */
.wordmark { font-weight: 700; font-size: 18px; text-decoration: none; white-space: nowrap; }
.wordmark b { font-family: var(--font-serif); font-weight: 700; color: var(--navy-900); }
.wordmark i { font-family: var(--font-serif); font-style: italic; font-weight: 500; color: var(--leaf-600); }
.wordmark small { font-size: 13px; font-weight: 600; color: var(--text-muted); font-family: var(--font-sans); }

/* Icon-only button (44px touch target) */
.iconbtn {
  width: 44px; height: 44px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--navy-900); text-decoration: none;
}

/* Language toggle */
.lang {
  height: 44px; padding: 0 var(--space-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-size: 14px; font-weight: 600; color: var(--navy-900);
  cursor: pointer;
}

/* Hamburger dropdown menu */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  min-width: 220px;
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-2);
  display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu a {
  display: block; padding: 12px 14px;
  font-size: 15px; text-decoration: none; color: var(--navy-900);
  border-radius: var(--radius-sm);
}
.menu a:hover { background: var(--surface-panel); color: var(--navy-900); }

/* Desktop site nav */
.nav-top { display: flex; flex-wrap: wrap; gap: var(--space-6); font-size: 15px; flex: 1; }
.nav-top a { text-decoration: none; color: var(--navy-900); }
.nav-top a:hover { color: var(--leaf-700); }

/* Bottom tab navigation (committee app) */
.tabs-bottom {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-subtle);
  min-height: 64px; margin-top: auto;
  background: var(--surface-card);
}
.tabs-bottom a, .tabs-bottom span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--text-muted); text-decoration: none;
  padding-block: var(--space-2);
}
.tabs-bottom a:hover { color: var(--navy-900); }
.tabs-bottom .is-active { font-weight: 700; color: var(--navy-900); }
.tabs-bottom .is-active svg { stroke: var(--navy-900); }

/* Admin sidebar navigation */
.nav-side__item {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
  padding: 12px; border-radius: var(--radius-sm);
  font-size: 15px; text-decoration: none; color: var(--navy-900);
}
.nav-side__item:hover { background: var(--surface-card); color: var(--navy-900); }
.nav-side__item.is-active {
  background: var(--surface-card); font-weight: 700;
  box-shadow: 0 0 0 1px var(--line-subtle);
}
.nav-side__note { padding: 12px; font-size: 14px; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 52px; padding: 0 20px;
  border-radius: var(--radius-md);
  border: 0; cursor: pointer;
  font-size: 16px; font-weight: 600; text-decoration: none;
  color: var(--navy-900); background: var(--surface-card);
}
.btn--primary { background: var(--leaf-600); color: var(--surface-card); font-weight: 700; }
.btn--primary:hover { background: var(--leaf-700); color: var(--surface-card); }
.btn--secondary { background: var(--surface-card); border: 1.5px solid var(--navy-900); color: var(--navy-900); }
.btn--secondary:hover { color: var(--navy-900); }
.btn--outline { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--navy-900); background: var(--surface-card); font-size: 14px; }
.btn--quiet { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); background: var(--surface-card); font-size: 14px; }
.btn--danger { border: 1.5px solid var(--coral-700); color: var(--coral-700); background: var(--surface-card); }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 56px; font-size: 17px; }
.btn--block { width: 100%; }
.btn--danger-primary { background: var(--coral-700); color: var(--surface-card); font-weight: 700; }
.btn--danger-primary:hover { color: var(--surface-card); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
a.card { display: block; text-decoration: none; color: var(--navy-900); }
a.card:hover { border-color: var(--line-strong); color: var(--navy-900); }
.card--panel { background: var(--surface-panel); border-color: transparent; }
.card--highlight { border: 2px solid var(--leaf-600); background: var(--leaf-100); }
.card--active { border: 1.5px solid var(--navy-900); }
.card--dash { border: 1.5px dashed var(--line-strong); background: transparent; }
.card--pad-lg { padding: var(--space-6); }
.card--radius-lg { border-radius: var(--radius-lg); }

/* Grouped list inside one card */
.group {
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column;
}
.group > * + * { border-top: 1px solid var(--line-subtle); }
.group a, .group__item {
  display: block; padding: 14px; font-size: 16px; text-decoration: none; color: var(--navy-900);
}
.group a:hover { background: var(--surface-panel); color: var(--navy-900); }

/* ---------- Tags / chips ---------- */
.tag {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; line-height: 18px;
}
.tag--muted { background: var(--surface-panel); border: 1px dashed var(--text-muted); color: var(--text-body); }
.tag--ok { background: var(--sage-200); color: var(--navy-900); }
.tag--info { background: var(--leaf-100); color: var(--navy-900); }
.tag--note { background: var(--note-200); color: var(--navy-900); }
.tag--plan { background: var(--leaf-100); color: var(--leaf-700); }
.tag--urgent { background: var(--coral-700); color: var(--surface-card); }
.tag--outline { border: 1px solid var(--line-strong); color: var(--text-body); }

/* Kicker: small uppercase label above posts */
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-body); }

/* ---------- Section headers ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.section-head h2 { font-family: var(--font-sans); font-size: 18px; font-weight: 700; }
.section-head a { font-size: 14px; font-weight: 600; text-decoration: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 600; }
.field__hint { font-size: 13px; color: var(--text-muted); }
.field__error { font-size: 13px; font-weight: 600; color: var(--coral-700); }
.field__req { color: var(--coral-700); }

.input, .textarea, .select {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  font: 400 16px var(--font-sans);
  color: var(--navy-900);
}
.input--strong { border: 1.5px solid var(--navy-900); }
.textarea { min-height: 120px; padding-block: 12px; resize: vertical; line-height: 22px; }
.input:focus, .textarea:focus, .select:focus {
  outline: 2px solid var(--leaf-600); outline-offset: 2px; border-color: var(--leaf-600);
}
.select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--navy-900) 50%), linear-gradient(135deg, var(--navy-900) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }

.search { position: relative; display: flex; align-items: center; }
.search__icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.search .input { padding-left: 42px; }

.choice { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 22px; cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--leaf-600); flex-shrink: 0; }

/* Segmented filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-card);
  font-size: 14px; font-weight: 600; color: var(--navy-900);
  cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--navy-900); }
.chip.is-selected { background: var(--leaf-600); border-color: var(--leaf-600); color: var(--surface-card); }

/* ---------- Tables (admin) ---------- */
.table-wrap {
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.table th {
  text-align: left; padding: 12px 16px;
  background: var(--surface-panel);
  font-weight: 700; white-space: nowrap;
}
.table td { padding: 14px 16px; vertical-align: top; }
.table tbody tr { border-top: 1px solid var(--line-subtle); }

/* ---------- Stat cards ---------- */
.stat {
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat__label { font-size: 14px; color: var(--text-body); }
.stat__value { font-size: 30px; font-weight: 700; line-height: 1.2; }
.stat__sub { font-size: 13px; color: var(--text-muted); }

/* ---------- Tiles (dashboard quick actions, Taman section nav) ---------- */
.tiles { display: grid; gap: 10px; }
.tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles--auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile {
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; color: var(--navy-900);
  min-height: 64px; justify-content: center; text-align: center; align-items: center;
}
.tile:hover { border-color: var(--line-strong); color: var(--navy-900); }
.tile--left { text-align: left; align-items: flex-start; justify-content: flex-start; }
.tile--disabled { border-style: dashed; color: var(--text-muted); font-size: 13px; background: var(--surface-card); }
.tile__title { font-size: 15px; font-weight: 600; }
.tile__sub { font-size: 13px; color: var(--text-muted); }

/* ---------- Date badge (events) ---------- */
.datebadge {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  background: var(--surface-panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.datebadge__month { font-size: 12px; font-weight: 600; }
.datebadge__day { font-size: 20px; font-weight: 700; line-height: 1.1; }

/* ---------- Ad slot placeholder ---------- */
.adslot {
  background: var(--surface-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}

/* ---------- Avatar ---------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--leaf-100); color: var(--leaf-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}

/* ---------- Empty / placeholder states ---------- */
.empty {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center;
  color: var(--text-muted); font-size: 15px;
}

/* ---------- Notes / callouts ---------- */
.note {
  background: var(--note-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 15px; line-height: 22px;
  display: flex; flex-direction: column; gap: 4px;
}
.note--panel { background: var(--surface-panel); }
.note--leaf { background: var(--leaf-100); }

/* ---------- Steps (numbered) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps__item { display: flex; gap: 12px; align-items: center; font-size: 16px; }
.steps__num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--leaf-600); color: var(--surface-card);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}

/* ---------- Media ---------- */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.media { overflow: hidden; padding: 0; background: var(--sage-200); }
.media--banner { height: 130px; }
.media--hero { height: 200px; margin-inline: var(--space-4); border-radius: var(--radius-md); }
.media--round { border-radius: var(--radius-md); }

/* ---------- Site footer ---------- */
.footer { border-top: 1px solid var(--line-subtle); }
.footer__inner {
  display: flex; flex-wrap: wrap; gap: 12px 32px;
  padding-block: var(--space-6);
  font-size: 15px;
}
.footer__inner a { text-decoration: none; }
.footer__tag { font-size: 13px; color: var(--text-muted); flex: 1 1 100%; }
.footer__brand { font-weight: 700; flex: 1 1 240px; }

/* ---------- Misc ---------- */
.hr { border: 0; border-top: 1px solid var(--line-subtle); margin: 0; width: 100%; }
.page-title { font-size: 22px; font-weight: 700; font-family: var(--font-sans); }
.page-sub { font-size: 16px; color: var(--text-muted); line-height: 24px; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; line-height: 20px; }
.caption-text { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-muted); }
.center { text-align: center; }
.full { width: 100%; }
.mt-auto { margin-top: auto; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }

/* Flex helpers: .stack = column, .row = inline axis; --g sets the gap */
.stack { display: flex; flex-direction: column; gap: var(--g, 16px); }
.row { display: flex; align-items: center; gap: var(--g, 8px); }
.row--between { justify-content: space-between; }
.row--top { align-items: flex-start; }
.row--end { align-items: flex-end; }
.row--baseline { align-items: baseline; }
.row--wrap { flex-wrap: wrap; }
.row--stretch { align-items: stretch; }
.g0 { --g: 0; } .g1 { --g: 2px; }
.g2 { --g: 4px; } .g4 { --g: 8px; } .g6 { --g: 12px; } .g8 { --g: 16px; }
.g10 { --g: 20px; } .g12 { --g: 24px; } .g14 { --g: 28px; } .g16 { --g: 32px; }
.g20 { --g: 40px; } .g24 { --g: 48px; }

/* Page body padding for phone screens */
.page-body { flex: 1; padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.page-body--flush { padding-inline: 0; }

/* Hero title accent (one italic leaf accent per marketing heading) */
.accent { font-style: italic; font-weight: 500; color: var(--leaf-600); }

/* Check list */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 22px; }
.checklist svg { flex-shrink: 0; margin-top: 2px; }
