:root {
    --earth-900: #1a2e22;
    --earth-800: #23402e;
    --earth-700: #2d5237;
    --amber-500: #c8873a;
    --amber-400: #d9a35c;
    --cream: #f6f2ea;
    --ink: #1e2321;
    --muted: #6b7570;
    --border: #e2ddd0;
    --white: #ffffff;
    --radius: 10px;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 80px; /* agar anchor #provinsi tidak tertutup header sticky */
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 32px);
}

/* Header */
header.site-header {
    background: var(--earth-900);
    color: var(--cream);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.brand {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.brand span { color: var(--amber-400); }
.site-header nav a {
    color: var(--cream);
    opacity: 0.85;
    font-size: 0.92rem;
    margin-left: 18px;
}
.site-header nav a:first-child { margin-left: 0; }
.site-header nav a:hover { opacity: 1; }

/* Hero */
.hero {
    background: linear-gradient(160deg, var(--earth-900) 0%, var(--earth-700) 100%);
    color: var(--cream);
    padding: clamp(32px, 6vw, 56px) 0 clamp(28px, 5vw, 44px);
    text-align: center;
}
.hero h1 {
    font-size: clamp(1.5rem, 4.5vw, 2.2rem);
    margin: 0 auto 10px;
    font-weight: 800;
    max-width: 700px;
    line-height: 1.25;
}
.hero p {
    color: #d9d3c4;
    max-width: 600px;
    margin: 0 auto 22px;
    font-size: clamp(0.9rem, 2vw, 1rem);
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: clamp(18px, 4vw, 28px);
    flex-wrap: wrap;
}
.hero-stats div { font-size: 0.85rem; color: #cdc7b8; }
.hero-stats strong { display: block; font-size: 1.4rem; color: var(--amber-400); }

/* Search box */
.search-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 6px;
    display: flex;
    max-width: 480px;
    width: 100%;
    margin: 20px auto 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    text-align: left;
}
.search-box input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 8px;
    outline: none;
}
.search-box button {
    background: var(--amber-500);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

/* Sections */
.section { padding: 42px 0; }
.section h2 {
    font-size: 1.4rem;
    margin: 0 0 6px;
}
.section .sub { color: var(--muted); margin: 0 0 24px; font-size: 0.94rem; }

#provinsi h2, #provinsi .sub {
    text-align: center;
}
#provinsi .sub {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* Provinsi grid — jumlah kolom otomatis menyesuaikan lebar layar (bukan angka tetap) */
.provinsi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.provinsi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: all 0.15s ease;
}
.provinsi-card:hover {
    border-color: var(--amber-500);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.provinsi-card .name { font-weight: 700; font-size: 1rem; }
.provinsi-card .count { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

/* Listing cards */
.listing-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 14px;
}
.listing-card .top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
    flex-wrap: wrap;
}
.listing-card .name { font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; }
.listing-card .loc { color: var(--muted); font-size: 0.85rem; }
.badge-featured {
    background: var(--amber-500);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}
.listing-card .desc { margin: 10px 0; font-size: 0.92rem; color: #3a423d; }
.listing-card .layanan-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
    background: var(--cream);
    border: 1px solid var(--border);
    font-size: 0.76rem;
    padding: 3px 9px;
    border-radius: 20px;
    color: var(--earth-800);
}
.contact-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-wa, .btn-tel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    flex: 1 1 150px;
    transition: filter 0.15s ease;
}
.btn-wa:hover, .btn-tel:hover { filter: brightness(0.94); }

.btn-wa {
    background: #25D366;
    color: white;
}

.btn-tel {
    background: var(--amber-500, #c8873a);
    color: white;
}

/* SEO content block */
.seo-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    font-size: 0.94rem;
    color: #3a423d;
}
.seo-content.empty {
    color: var(--muted);
    font-style: italic;
}

/* Area layanan (kota/kabupaten per provinsi) */
.wilayah-block {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-top: 20px;
}
.wilayah-block h2 {
    font-size: 1.15rem;
    margin: 0 0 8px;
}
.wilayah-intro {
    font-size: 0.92rem;
    color: #3a423d;
    margin: 0 0 14px;
}
.wilayah-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wilayah-list li {
    background: var(--cream);
    border: 1px solid var(--border);
    color: var(--earth-800);
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 20px;
}
.wilayah-note {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

.faq-block {
    margin-top: 20px;
}
.faq-block h2 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}
.faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 10px;
}
.faq-item h3 {
    font-size: 0.95rem;
    margin: 0 0 6px;
}
.faq-item p {
    font-size: 0.88rem;
    color: #3a423d;
    margin: 0;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--earth-700); }

/* Footer */
footer.site-footer {
    background: var(--earth-900);
    color: #b9b3a3;
    padding: 28px 0;
    margin-top: 40px;
    font-size: 0.85rem;
    text-align: center;
}

.footer-sitemap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    margin-bottom: 18px;
    font-size: 0.78rem;
}

.footer-sitemap a {
    color: #b9b3a3;
    text-decoration: none;
}

.footer-sitemap a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

/* Admin */
.admin-shell { min-height: 100vh; background: var(--cream); }
.admin-topbar {
    background: var(--earth-900);
    color: white;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.admin-topbar .container > div:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.admin-topbar a.logout { color: #d9a35c; font-size: 0.85rem; }
.admin-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.btn {
    background: var(--earth-700);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn.amber { background: var(--amber-500); }
.btn.danger { background: #b3453a; }
.btn.ghost { background: transparent; color: var(--earth-700); border: 1px solid var(--border); }

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.admin-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.88rem; }
table.admin-table th, table.admin-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
.row-actions a { margin-right: 10px; font-size: 0.85rem; color: var(--earth-700); }
.row-actions a.danger { color: #b3453a; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--earth-900);
}
.login-box {
    background: white;
    padding: 36px 32px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 360px;
}
.login-box h1 { font-size: 1.2rem; margin: 0 0 20px; }
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    margin-bottom: 14px;
}
.alert.error { background: #fce8e6; color: #a3352b; }
.alert.success { background: #e5f4ea; color: #1f7a44; }

/* Tablet */
@media (max-width: 900px) {
    .provinsi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile */
@media (max-width: 600px) {
    .provinsi-grid { grid-template-columns: repeat(2, 1fr); }
    .search-box { max-width: 100%; }
    .contact-buttons { flex-direction: column; }
    .btn-wa, .btn-tel { flex: 1 1 auto; width: 100%; }
    .listing-card .top { flex-direction: column; align-items: flex-start; }
    .admin-card { padding: 18px; }
}

@media (max-width: 380px) {
    .provinsi-grid { grid-template-columns: 1fr; }
}
