/* ===================================================================
   YUNI Rent Car & Travel - custom styles
   Tailwind via CDN menangani sebagian besar styling.
   File ini untuk hal yang tidak praktis ditulis sebagai utility class.
   =================================================================== */

:root {
  --brand: #facc15;
  --brand-dark: #eab308;
  --ink: #18181b;
}

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }

::selection { background: var(--brand); color: var(--ink); }

/* --- Scrollbar ---------------------------------------------------- */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 11px; }
  ::-webkit-scrollbar-track { background: #f4f4f5; }
  ::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 99px; border: 3px solid #f4f4f5; }
  ::-webkit-scrollbar-thumb:hover { background: var(--brand-dark); }
}

/* --- Fokus aksesibilitas ----------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* --- Konten dari admin (WYSIWYG / HTML di tabel pages) ----------- */
.prose-yuni { color: #3f3f46; line-height: 1.75; }
.prose-yuni > * + * { margin-top: 1.1rem; }
.prose-yuni h2,
.prose-yuni h3,
.prose-yuni h4 {
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 800;
  color: #18181b;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  margin-bottom: 0.65rem;
  line-height: 1.25;
}
.prose-yuni h2 { font-size: 1.6rem; }
.prose-yuni h3 { font-size: 1.3rem; }
.prose-yuni h4 { font-size: 1.1rem; }
.prose-yuni p  { margin-bottom: 0; }
.prose-yuni strong { color: #18181b; font-weight: 700; }
.prose-yuni a { color: #a16207; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.prose-yuni a:hover { color: #854d0e; }
.prose-yuni ul,
.prose-yuni ol { padding-left: 1.4rem; }
.prose-yuni ul { list-style: disc; }
.prose-yuni ol { list-style: decimal; }
.prose-yuni li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
.prose-yuni li::marker { color: var(--brand-dark); font-weight: 700; }
.prose-yuni blockquote {
  border-left: 4px solid var(--brand);
  background: #fefce8;
  padding: 1rem 1.25rem;
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
}
.prose-yuni img { border-radius: 0.9rem; max-width: 100%; height: auto; }
.prose-yuni table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.prose-yuni th,
.prose-yuni td { border: 1px solid #e4e4e7; padding: 0.6rem 0.8rem; text-align: left; }
.prose-yuni th { background: #fafafa; font-weight: 700; color: #18181b; }

/* --- Pembatas teks ----------------------------------------------- */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Animasi masuk ----------------------------------------------- */
@keyframes yuniFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: yuniFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fade-up-1 { animation-delay: 0.06s; }
.fade-up-2 { animation-delay: 0.12s; }
.fade-up-3 { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: none; }
  html { scroll-behavior: auto; }
}

/* --- Pola latar belakang ----------------------------------------- */
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}

.bg-diag-brand {
  background-image: repeating-linear-gradient(
    45deg,
    var(--brand) 0, var(--brand) 14px,
    var(--ink) 14px, var(--ink) 28px
  );
}

/* --- Scroll horizontal tanpa scrollbar --------------------------- */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* --- Cetak ------------------------------------------------------- */
@media print {
  header, footer, .no-print, a[aria-label="Chat WhatsApp"] { display: none !important; }
  body { color: #000; }
}

/* ===================================================================
   Tata letak 2 kolom untuk layar HP
   Dipakai bersama kelas Tailwind grid-cols-2 pada kartu-kartu katalog.
   =================================================================== */

/* Kartu terakhir melebar penuh bila jumlahnya ganjil (hanya di HP),
   supaya tidak ada kolom kosong yang menggantung. */
@media (max-width: 767px) {
  .span-last-odd:last-child:nth-child(odd) {
    grid-column: span 2 / span 2;
  }
}

/* Bintang rating ikut mengecil di layar kecil */
@media (max-width: 639px) {
  .stars-compact svg { width: 0.85rem; height: 0.85rem; }
}

/* Pembatas teks tambahan untuk kartu sempit */
.line-clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-5 { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 640px) {
  .sm\:line-clamp-none { -webkit-line-clamp: unset; display: block; overflow: visible; }
}

/* ===================================================================
   Menu bawah (bottom navigation) khusus layar HP & tablet kecil
   =================================================================== */

/* Ruang di bawah halaman agar konten terakhir tidak tertutup menu.
   env(safe-area-inset-bottom) untuk iPhone dengan home indicator. */
@media (max-width: 1023px) {
  body.has-bottomnav {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* Penyangga area aman di dalam bar dan panel */
.bottomnav-safe { height: env(safe-area-inset-bottom, 0px); }

/* Tombol menu bawah: hilangkan highlight biru bawaan browser mobile */
#bottomNav a,
#bottomNav button {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Saat panel "Lainnya" terbuka, halaman di belakang tidak ikut bergeser */
#moreSheet { max-height: 85vh; overflow-y: auto; }

@media (prefers-reduced-motion: reduce) {
  #moreSheet, #moreOverlay { transition: none; }
}
