:root {
  --ink: #232b21;
  --paper: #eff1e9;
  --paper-raised: #f8f9f4;
  --coffee: #4a3327;
  --coffee-dark: #2f2118;
  --kembang: #e0577a;
  --daun: #6f8f5f;
  --line: #cdd2c2;
  --line-strong: #9aa38a;
  --warn: #b5502e;

  --font-display: "Fraunces", serif;
  --font-body: "Plus Jakarta Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body { padding: 0; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--kembang); outline-offset: 2px; }
img { max-width: 100%; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-narrow { max-width: 720px; }
.page-narrow-inner { max-width: 720px; margin: 0 auto; }

/* Hero */
.hero { margin-bottom: 40px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--daun);
}
.hero h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 6px 0 12px;
  color: var(--coffee);
}
.tagline {
  max-width: 560px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #4b5245;
  margin: 0;
}

/* Compact top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.logo-link { text-decoration: none; }
.logo-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--coffee);
}
.search-form-compact {
  display: flex;
  align-items: center;
  width: 260px;
  max-width: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  box-sizing: border-box;
}
.search-icon {
  font-size: 0.8rem;
  margin-right: 8px;
  flex-shrink: 0;
}
.search-input-compact {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 9px 0;
  font-size: 0.85rem;
  color: var(--ink);
}
.search-input-compact:focus { outline: none; }

/* Filter pills row */
.filter-section { margin-bottom: 28px; }
.filter-pills-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.pill-trigger {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--coffee);
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.pill-trigger.is-active {
  background: var(--kembang);
  color: white;
  border-color: var(--kembang);
}
.pill-trigger .chev { font-size: 0.65rem; margin-left: 2px; }

.pill-dropdown {
  display: none;
  position: fixed;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 220px;
  max-width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 10px 24px -10px rgba(35, 43, 33, 0.3);
  z-index: 100;
}
.pill-dropdown.open { display: block; }
.pill-dropdown-wide { min-width: 280px; }

.dd-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dd-chip {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.dd-chip:hover { border-color: var(--line-strong); }
.dd-chip.sel {
  background: var(--coffee);
  color: white;
  border-color: var(--coffee);
  font-weight: 600;
}
.dd-chip-all {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 600;
}
.dd-chip-region {
  font-weight: 600;
  border-color: var(--line-strong);
}
.dd-region-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--daun);
  margin: 10px 0 6px;
}
.dd-region-label:first-of-type { margin-top: 0; }

@media (max-width: 640px) {
  .page { padding: 20px 16px 60px; }
  .topbar { padding-bottom: 12px; margin-bottom: 12px; }
  .logo-text { font-size: 1.3rem; }
  .search-form-compact { width: 100%; order: 3; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-row select {
  padding: 8px 10px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--ink);
}
.toggle-chip {
  padding: 8px 14px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--coffee);
  text-decoration: none;
  display: inline-block;
}
.toggle-chip.is-active {
  background: var(--kembang);
  border-color: var(--kembang);
  color: white;
}
.clear-btn {
  padding: 8px 14px;
  background: none;
  border: none;
  font-size: 0.82rem;
  color: var(--warn);
  text-decoration: underline;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
}

/* Results */
.results-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--coffee);
  margin-bottom: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.empty-state { padding: 48px 0; text-align: center; }
.empty-state p { margin: 0 0 6px; }
.empty-sub { color: #6b7263; font-size: 0.9rem; }

/* Cafe card */
.cafe-card {
  display: block;
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.cafe-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -14px rgba(35, 43, 33, 0.35);
}
.cafe-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--coffee);
}
.cafe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cafe-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0, transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(255,255,255,0.06) 0, transparent 40%),
    linear-gradient(135deg, var(--coffee), var(--coffee-dark));
}
.cafe-card-placeholder span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3.2rem;
  color: rgba(247, 244, 236, 0.85);
}
.featured-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  background: var(--kembang);
  color: white;
  border-radius: 999px;
}
.price-badge {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  background: rgba(35, 43, 33, 0.72);
  color: var(--paper);
  border-radius: 999px;
}
.cafe-card-body { padding: 16px 18px 18px; }
.cafe-card-area {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--daun);
}
.cafe-card-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 4px 0 8px;
  line-height: 1.2;
  color: var(--coffee);
}
.cafe-card-desc {
  font-size: 0.87rem;
  line-height: 1.5;
  color: #4b5245;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cafe-card-perforation {
  position: relative;
  height: 1px;
  margin: 0 -18px 14px;
  background-image: repeating-linear-gradient(to right, var(--line) 0, var(--line) 6px, transparent 6px, transparent 12px);
}
.cafe-card-perforation::before, .cafe-card-perforation::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
}
.cafe-card-perforation::before { left: -6px; }
.cafe-card-perforation::after { right: -6px; }
.cafe-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--coffee);
  text-transform: capitalize;
}
.photo-count-badge {
  position: absolute;
  bottom: 10px; left: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  background: rgba(35, 43, 33, 0.72);
  color: var(--paper);
  border-radius: 999px;
}
.cafe-card-cta {
  display: block;
  text-align: center;
  margin-top: 14px;
  padding: 9px;
  background: var(--kembang);
  color: white;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s ease;
}
.cafe-card:hover .cafe-card-cta {
  background: #c94766;
}

/* Detail page */
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--coffee);
  text-decoration: none;
  margin-bottom: 24px;
}
.back-link:hover { text-decoration: underline; }
.detail-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.detail-photo { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0, transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(255,255,255,0.06) 0, transparent 40%),
    linear-gradient(135deg, var(--coffee), var(--coffee-dark));
}
.detail-photo-placeholder span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 5rem;
  color: rgba(247, 244, 236, 0.85);
}
.detail-top { padding: 28px 36px 0; }
.thumb-strip {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  overflow-x: auto;
}
.thumb-strip-item {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.thumb-strip-item:hover { opacity: 1; }
.thumb-strip-item.is-active {
  border-color: var(--kembang);
  opacity: 1;
}
.btn-external {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.btn-external-primary {
  background: var(--kembang);
  color: white;
}
.btn-external-primary:hover { background: #c94766; }
.btn-external-ghost {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  color: var(--coffee);
}
.btn-external-ghost:hover { background: var(--paper); }

/* Stacked detail sections (replaced tabs) */
.detail-section { margin-top: 22px; }
.detail-section:first-child { margin-top: 0; }
.detail-section-divider {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.section-heading {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--coffee);
  margin: 0 0 14px;
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-grid-item {
  aspect-ratio: 1;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 1px solid var(--line);
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-stage {
  position: relative;
  max-width: 90vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 6px;
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 6px 14px;
  user-select: none;
}
.lightbox-arrow-left { left: -10px; }
.lightbox-arrow-right { right: -10px; }
.lightbox-dots {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}
.lightbox-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.lightbox-dot.active { background: white; }
.detail-content { padding: 0 36px 36px; }
.detail-top h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 500;
  margin: 6px 0 4px;
  color: var(--coffee);
}
.address { color: #6b7263; margin: 0 0 20px; font-size: 0.92rem; }
.description { font-size: 1rem; line-height: 1.6; margin-bottom: 28px; }
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 24px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  margin-bottom: 20px;
}
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a9179;
}
.fact-value { font-size: 0.92rem; }
.purposes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.external-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* Footer */
.site-footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6b7263;
}
.site-footer a { color: var(--coffee); text-decoration: underline; }

/* Admin */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.admin-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 4px 0 0;
  color: var(--coffee);
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.ghost-btn, .primary-btn {
  padding: 9px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--line);
  display: inline-block;
}
.ghost-btn { background: var(--paper-raised); color: var(--ink); }
.primary-btn { background: var(--coffee); color: white; border-color: var(--coffee); font-weight: 600; }
.status { color: #6b7263; }
.cafe-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.cafe-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a9179;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.cafe-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  vertical-align: middle;
}
.cafe-table tr:last-child td { border-bottom: none; }
.cafe-table a { color: var(--coffee); text-decoration: none; }
.cafe-table a:hover { text-decoration: underline; }
.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; display: block; }
.thumb-empty { background: linear-gradient(135deg, var(--coffee), var(--coffee-dark)); }
.row-actions { display: flex; gap: 12px; }
.row-actions form { display: inline; }
.row-actions button {
  background: none; border: none; color: var(--warn); font-size: 0.85rem; padding: 0;
  text-decoration: underline; cursor: pointer;
}
.pagination { display: flex; gap: 8px; margin-top: 20px; align-items: center; font-size: 0.85rem; }
.pagination a, .pagination span {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink);
}
.pagination .current { background: var(--coffee); color: white; border-color: var(--coffee); }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.login-card {
  width: 320px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 4px 0 4px;
  color: var(--coffee);
}
.login-card .sub { font-size: 0.85rem; color: #6b7263; margin: 0 0 20px; }

/* Forms */
.cafe-form {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
  max-width: 640px;
}
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 5px;
  color: #4b5245;
}
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="file"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
}
.checkbox-group { display: flex; flex-wrap: wrap; gap: 14px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink); }
.checkbox-label input { width: auto; }
.form-error {
  color: var(--warn);
  font-size: 0.85rem;
  background: #fbeae5;
  border: 1px solid #f0c8bb;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.form-success {
  color: #2f5c30;
  font-size: 0.85rem;
  background: #e7f0e3;
  border: 1px solid #c3d9bb;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-submit {
  padding: 10px 20px;
  background: var(--coffee);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.88rem;
}
.btn-cancel {
  padding: 10px 16px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--ink);
}
.photo-preview { width: 220px; }
.photo-preview img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--line); display: block; margin-bottom: 6px;
}
.remove-photo-link { font-size: 0.8rem; color: var(--warn); text-decoration: underline; }
.gallery-manage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.gallery-manage-item {
  text-align: center;
}
.gallery-manage-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 4px;
}
.gallery-manage-item .checkbox-label {
  font-size: 0.72rem;
  justify-content: center;
}
.upload-label {
  display: inline-block;
  padding: 9px 16px;
  background: var(--coffee);
  color: white;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.upload-label input[type="file"] {
  display: none;
}
.upload-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.78rem;
}
.upload-progress-name {
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4b5245;
}
.upload-progress-track {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--kembang);
  transition: width 0.15s ease;
}
.upload-progress-pct {
  flex-shrink: 0;
  width: 36px;
  text-align: right;
  color: #8a9179;
  font-family: var(--font-mono);
}
.delete-photo-btn {
  background: none;
  border: none;
  color: var(--warn);
  font-size: 0.72rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
