/* ==========================================================================
   components.css — komponen yang dipakai ulang di semua halaman
   ========================================================================== */

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--navy);
}
.btn--primary:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
}

.btn--ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}
.btn--ghost:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.btn--outline {
  color: var(--navy);
  border-color: var(--navy);
}
.btn--outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- Tautan teks ---------- */
.text-link {
  font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.3em;
}
.text-link:hover { text-decoration-color: var(--navy); }
.is-dark .text-link { color: var(--white); }
.is-dark .text-link:hover { text-decoration-color: var(--white); }

/* ---------- Eyebrow & kepala bagian ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 var(--space-3);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--steel);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 3px;
  background: var(--orange);
}
.is-dark .eyebrow { color: var(--steel-soft); }

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-7);
}
.section-head p { margin-top: var(--space-3); color: var(--muted); }
.is-dark .section-head p { color: var(--on-dark-muted); }

/* ---------- Ikon garis ---------- */
.icon {
  flex: none;
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--steel);
}

/* ---------- Kartu ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--steel); }
.card p { margin: 0; color: var(--muted); }
.card .text-link { margin-top: auto; align-self: flex-start; padding-top: var(--space-2); }

/* ---------- Label simulasi ---------- */
.tag {
  display: inline-block;
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  background: var(--orange-tint);
  border: 1px solid var(--orange);
  border-radius: 2px;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--navy);
}

/* ---------- Daftar bertanda ---------- */
.check-list { display: grid; gap: var(--space-2); }
.check-list li { position: relative; padding-left: 1.5rem; }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.6rem;
  height: 0.6rem;
  background: var(--orange);
}

/* ---------- Header & navigasi ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--on-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  min-height: var(--header-h);
  width: min(100% - 2 * var(--gutter), var(--container-wide));
  margin-inline: auto;
}

.js .site-header__inner { flex-wrap: nowrap; }

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--white);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}
.brand__mark { width: 2rem; height: 2rem; flex: none; }

/* Tombol menu: hanya muncul bila JS aktif */
.nav-toggle { display: none; flex: none; }
.js .nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s, background-color 0.2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

/* Panel navigasi (mobile) */
.site-nav { width: 100%; }
.js .site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: auto;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--space-2) var(--gutter) var(--space-5);
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-nav__list { display: flex; flex-direction: column; }

.site-nav__link {
  display: block;
  padding: 0.85rem 0;
  color: var(--on-dark);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.site-nav__link:hover { color: var(--white); }
.site-nav__link[aria-current="page"] {
  padding-left: 0.75rem;
  color: var(--white);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--orange);
}

.site-nav .btn { width: 100%; margin-top: var(--space-4); }

@media (max-width: 1279.98px) {
  .js .site-nav.is-open { display: block; }
}

/* Navigasi desktop */
@media (min-width: 1280px) {
  .js .nav-toggle { display: none; }

  .site-nav,
  .js .site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .site-nav__list { flex-direction: row; gap: var(--space-4); }

  .site-nav__link {
    padding: 0.4rem 0;
    font-size: 0.9375rem;
    border-bottom: 2px solid transparent;
  }
  .site-nav__link:hover { border-bottom-color: rgba(255, 255, 255, 0.5); }
  .site-nav__link[aria-current="page"] {
    padding-left: 0;
    box-shadow: none;
    border-bottom-color: var(--orange);
  }

  .site-nav .btn {
    width: auto;
    min-height: 2.5rem;
    margin-top: 0;
    padding: 0.5rem 1.125rem;
    font-size: 0.9375rem;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--space-8) var(--space-6);
  background: var(--navy-deep);
  color: var(--on-dark-muted);
}

.site-footer__grid { display: grid; gap: var(--space-6); }

.site-footer h2 {
  margin-bottom: var(--space-3);
  font-size: var(--step-0);
  letter-spacing: 0;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }

.footer-list { display: grid; gap: 0.45rem; }
.footer-list strong { color: var(--on-dark); font-weight: 600; }
.footer-tagline { margin-top: var(--space-3); max-width: 22rem; }

.demo-note {
  margin: var(--space-7) 0 0;
  padding: var(--space-4) var(--space-5);
  max-width: none;
  border: 1px solid rgba(229, 138, 43, 0.6);
  border-left-width: 4px;
  border-radius: var(--radius);
  color: var(--on-dark);
  font-size: var(--step--1);
}

@media (min-width: 760px) {
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .site-footer__grid { grid-template-columns: 1.4fr 1fr 1.3fr 1fr; }
}


/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-5);
  font-size: var(--step--1);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-2);
  opacity: 0.6;
}
.breadcrumb a { text-decoration: none; color: var(--on-dark-muted); }
.breadcrumb a:hover { color: var(--white); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--white); font-weight: 600; }

/* ---------- Catatan kecil bergaris oranye ---------- */
.note {
  padding-left: var(--space-4);
  border-left: 3px solid var(--orange);
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- Tata letak dua kolom & daftar poin ---------- */
.split { display: grid; gap: var(--space-7); }
@media (min-width: 900px) {
  .split {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-8);
    align-items: start;
  }
}

.point-list { display: grid; }
.point {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line);
}
.point:last-child { border-bottom: 1px solid var(--line); }
.point strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: var(--step-1);
  color: var(--navy);
}
.point p { margin: 0; color: var(--muted); }


/* ---------- Foto (rasio dikunci, responsif lewat srcset) ----------
   Pakai: <figure class="photo photo--4x3"> ... lihat panduan-foto.md
   Rasio: photo--4x3 · photo--3x2 · photo--21x9 · photo--4x5            */
.photo { margin: 0; --photo-ratio: 4 / 3; }
.photo--4x3 { --photo-ratio: 4 / 3; }
.photo--3x2 { --photo-ratio: 3 / 2; }
.photo--21x9 { --photo-ratio: 21 / 9; }
.photo--4x5 { --photo-ratio: 4 / 5; max-width: 28rem; }

.photo__frame {
  display: block;
  width: 100%;
  aspect-ratio: var(--photo-ratio);
  overflow: hidden;
  background: #DDE5EA;
  border-radius: var(--radius);
}
.photo__frame picture { display: block; width: 100%; height: 100%; }
.photo__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-pos, center);
}

.photo__caption {
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--muted);
}
.is-dark .photo__caption { color: var(--on-dark-muted); }


/* Ikon kecil (chevron, centang) */
.icon--sm { width: 1.25rem; height: 1.25rem; }


/* ---------- Kotak keterangan (simulasi / penting) ---------- */
.notice {
  padding: var(--space-5) var(--space-6);
  background: var(--orange-tint);
  border: 1px solid var(--orange);
  border-left-width: 6px;
  border-radius: var(--radius);
}
.notice h2 { margin-bottom: var(--space-3); font-size: var(--step-2); }
.notice p { max-width: 75ch; }

/* ---------- Chip tautan (kelompok layanan terkait) ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: border-color 0.15s;
}
.chip:hover { border-color: var(--steel); }


/* ---------- Formulir (kolom, kontrol, galat) ---------- */
.form-grid { display: grid; gap: var(--space-5); }
@media (min-width: 640px) {
  .form-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

.field { display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
fieldset.field { margin: 0; padding: 0; border: 0; }
.field__label,
.field legend { padding: 0; font-weight: 600; line-height: 1.3; color: var(--navy); }
.field__req { font-size: var(--step--1); font-weight: 400; color: var(--muted); }
.field__help { margin: 0; font-size: var(--step--1); color: var(--muted); }

.field__control {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--white);
  border: 1px solid #7C8A93;
  border-radius: var(--radius);
}
.field__control:focus { border-color: var(--navy); }
textarea.field__control { min-height: 8rem; line-height: 1.5; resize: vertical; }
select.field__control {
  padding-right: 2.5rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23142B3B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1rem;
}
.field__control[aria-invalid="true"] { border-color: #B3261E; box-shadow: 0 0 0 1px #B3261E; }

.field__error { margin: 0; font-size: var(--step--1); font-weight: 600; color: #B3261E; }
.field__error[hidden] { display: none; }

.check-group { display: grid; gap: var(--space-2); }
.check { display: flex; align-items: flex-start; gap: 0.6rem; line-height: 1.4; cursor: pointer; }
.check input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--navy);
}

/* Varian kotak keterangan: informasi/status */
.notice h3 { margin-bottom: var(--space-3); font-size: var(--step-1); }
.notice--info { background: rgba(49, 86, 109, 0.08); border-color: var(--steel); }


/* Tombol nonaktif (mis. formulir demo saat JavaScript mati) */
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn--primary[disabled]:hover { background: var(--orange); border-color: var(--orange); }
