/* ==========================================================================
   Paviliun · style.css
   Daftar isi:
   1. Variabel & reset
   2. Teks & utilitas
   3. Navbar & dock
   4. Tombol & tombol melayang
   5. Layout
   6. Hero
   7. Card & post
   8. Filter & daftar
   9. Kamar & tim
   10. Form
   11. Chat
   12. Dialog
   13. Responsif
   ========================================================================== */

/* 1. Variabel & reset ------------------------------------------------------ */
:root {
  --bg: #EFE9D5;
  --surface: #F7F3E5;
  --hi: #FCFAF3;
  --tonal: #E4DDC4;
  --line: #D6CFB6;
  --primary: #4A79C0;
  --ink-p: #2D5596;
  --pc: #D5E1F5;
  --on-pc: #16294A;
  --ink: #1F2430;
  --ink2: #555B6B;
  --r: 6px;
  --pad: clamp(16px, 4vw, 48px);
  --gap: 16px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

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

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r);
}

/* 2. Teks & utilitas ------------------------------------------------------- */
h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 800;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}

.redup {
  color: var(--ink2);
}

.kecil {
  font-size: 0.875rem;
}

code {
  background: var(--tonal);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.875em;
}

/* 3. Navbar & dock --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
  padding: 0 var(--pad);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
}

.brand img {
  width: 34px;
  height: 34px;
}

.menu {
  display: flex;
  flex: 1;
  gap: 4px;
  margin-left: 12px;
}

.menu a,
.dock a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink2);
}

.menu a:hover {
  background: var(--tonal);
}

.menu a[aria-current] {
  background: var(--pc);
  color: var(--on-pc);
}

.menu svg,
.dock svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.dock {
  display: none;
}

/* 4. Tombol ---------------------------------------------------------------- */
.tombol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r);
  font: 600 0.9375rem var(--font);
  cursor: pointer;
  transition: background 0.15s;
}

.isi {
  background: var(--primary);
  color: #fff;
}

.isi:hover {
  background: #3F6CB0;
}

.tonal {
  background: var(--pc);
  color: var(--on-pc);
}

.tonal:hover {
  background: #C6D6F0;
}

.garis {
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--ink-p);
}

.garis:hover {
  background: var(--pc);
}

.mini {
  min-height: 36px;
  padding: 0 16px;
}

/* tombol bulat melayang (tulis diskusi) */
.fab {
  position: fixed;
  right: var(--pad);
  bottom: 24px;
  z-index: 25;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 36, 48, 0.28);
  transition: background 0.15s, transform 0.15s;
}

.fab:hover {
  background: #3F6CB0;
  transform: scale(1.05);
}

.fab svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* 5. Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  padding-inline: var(--pad);
}

main {
  padding: 16px 0 64px;
}

.kolom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 400px);
  gap: var(--gap);
  align-items: start;
}

.tumpuk {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.judul {
  max-width: 640px;
  padding: 24px 0;
}

.judul p {
  margin-top: 8px;
  color: var(--ink2);
}

.kembali {
  padding-block: 12px;
}

.tanggapan {
  padding-block: 8px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--ink2);
  font-size: 0.875rem;
}

/* 6. Hero ------------------------------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 24px;
  margin-bottom: var(--gap);
  padding: clamp(24px, 5vw, 56px) clamp(20px, 4vw, 48px);
  border-radius: var(--r);
  background: var(--pc);
  color: var(--on-pc);
}

.hero p {
  max-width: 30em;
  margin: 14px 0 28px;
  font-size: 1.125rem;
}

.baris {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 7. Card & post ----------------------------------------------------------- */
.card,
.panel {
  padding: 24px;
  background: var(--surface);
  border-radius: var(--r);
}

.panel {
  background: var(--hi);
}

.card > h3 {
  margin-bottom: 12px;
}

.post h2 a:hover {
  color: var(--ink-p);
}

.post .ringkas {
  margin-top: 6px;
  color: var(--ink2);
}

.post .atas {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.utas {
  margin-bottom: 12px;
  font-size: 1.75rem;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tonal);
  font-weight: 700;
  font-size: 0.875rem;
}

.nama {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.nama b {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
}

.label {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--pc);
  color: var(--on-pc);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.aksi {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.aksi.mulai {
  justify-content: flex-start;
  margin-top: 0;
}

.kanan {
  margin-left: auto;
}

.pil {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
}

.pil:hover {
  background: var(--tonal);
}

/* tombol dukung: checkbox tersembunyi + label */
.vote {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vote:focus-visible + .pil {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.vote:checked + .pil {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.vote + .pil .baru,
.vote:checked + .pil .lama {
  display: none;
}

.vote:checked + .pil .baru {
  display: inline;
}

.lapor {
  padding: 6px 10px;
  border-radius: var(--r);
  font-size: 0.875rem;
  color: var(--ink2);
}

.lapor:hover {
  background: var(--tonal);
}

/* 8. Filter & daftar ------------------------------------------------------- */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 12px;
}

.filter a {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink2);
}

.filter a:hover {
  background: var(--tonal);
}

.filter a.on {
  background: var(--pc);
  border-color: var(--pc);
  color: var(--on-pc);
}

.daftar {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}

.daftar li a,
.daftar li.baris {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.daftar li:first-child a,
.daftar li:first-child.baris {
  border-top: 0;
}

.daftar a:hover {
  color: var(--ink-p);
}

.daftar span {
  color: var(--ink2);
  font-size: 0.875rem;
}

.badan {
  margin-top: 8px;
}

/* 9. Kamar & tim ----------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.kamar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 200px;
}

.kamar p {
  color: var(--ink2);
  font-size: 0.9375rem;
}

.kamar .bawah {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
}

.tim {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.tim .avatar {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  background: var(--pc);
  color: var(--on-pc);
  font-size: 1.0625rem;
}

.tim h2 {
  font-size: 1.0625rem;
}

.peran {
  margin: 2px 0 12px;
}

.email {
  overflow-wrap: anywhere;
}

.warna {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.warna:first-of-type {
  border-top: 0;
}

.warna i {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

details {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

details:first-of-type {
  border-top: 0;
}

summary {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

summary::after {
  content: "+";
  font-weight: 400;
  color: var(--ink2);
}

details[open] summary::after {
  content: "–";
}

details p {
  margin-top: 8px;
  color: var(--ink2);
  font-size: 0.9375rem;
}

/* 10. Form ----------------------------------------------------------------- */
.cari {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
}

.cari .input {
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.875rem;
  font-weight: 600;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--hi);
  font: inherit;
  color: var(--ink);
}

.input::placeholder {
  color: #7A7F8C;
}

.input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--pc);
}

textarea.input {
  min-height: 140px;
  resize: vertical;
}

.draft {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.draft:first-of-type {
  border-top: 0;
}

.draft p {
  margin-top: 6px;
  font-weight: 600;
}

/* 11. Chat ----------------------------------------------------------------- */
.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}

.pesan {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: var(--r);
  background: var(--surface);
  font-size: 0.9rem;
}

.pesan.saya {
  align-self: flex-end;
  background: var(--pc);
  color: var(--on-pc);
}

.pesan b {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-p);
}

.kirim {
  display: flex;
  gap: 8px;
}

/* 12. Dialog (:target) ----------------------------------------------------- */
.dialog {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  place-items: center;
  padding: var(--pad);
}

.dialog:target {
  display: grid;
}

.dialog > a.latar {
  position: absolute;
  inset: 0;
  background: rgba(31, 36, 48, 0.45);
}

.lembar {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  padding: 28px;
  overflow: auto;
  border-radius: var(--r);
  background: var(--hi);
}

.lembar h2 {
  margin-bottom: 6px;
}

.lembar .aksi {
  justify-content: flex-end;
  margin-top: 20px;
}

.pilihan {
  margin-top: 12px;
}

.opsi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.opsi input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 16px 0 20px;
  padding: 4px;
  border-radius: var(--r);
  background: var(--tonal);
}

.tab label {
  padding: 8px;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

#t1:checked ~ .tab label[for=t1],
#t2:checked ~ .tab label[for=t2] {
  background: var(--hi);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

#t1:checked ~ .form2,
#t2:checked ~ .form1 {
  display: none;
}

/* 13. Responsif ------------------------------------------------------------ */
@media (max-width: 960px) {
  .kolom {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero figure {
    display: none;
  }
}

@media (max-width: 720px) {
  .nav {
    height: 60px;
  }

  .menu {
    display: none;
  }

  .nav .tombol {
    margin-left: auto;
  }

  .dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  .dock a {
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
    font-size: 0.6875rem;
  }

  .dock a[aria-current] {
    color: var(--on-pc);
  }

  .dock a[aria-current] svg {
    width: 56px;
    height: 28px;
    padding: 4px 18px;
    border-radius: var(--r);
    background: var(--pc);
  }

  .fab {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  main {
    padding-bottom: 96px;
  }

  footer {
    padding-bottom: 88px;
  }

  .card,
  .panel {
    padding: 20px;
  }

  .aksi {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
