:root {
  --color-primary: #dc2626;
  --color-on-primary: #ffffff;
  --color-secondary: #f87171;
  --color-accent: #c9a227;
  --color-background: #0b0a09;
  --color-foreground: #fff7ed;
  --color-muted: #1c1917;
  --color-muted-fg: #a8a29a;
  --color-border: rgba(201, 162, 39, 0.28);
  --color-card: #141110;
  --font-display: "Playfair Display SC", "Playfair Display", serif;
  --font-body: "Kanit", "Karla", sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --space: 8px;
  --max: 1120px;
  --menu-max: 700px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-foreground);
  background: #000;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button,
a,
input,
select,
label {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.page-public {
  background: #000;
}

.page-wrap {
  width: min(100% - 12px, var(--menu-max));
  margin: 0 auto;
  padding: 8px 0 32px;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - 12px, var(--menu-max));
  margin: 0 auto;
  padding: 8px 0 4px;
}

.site-logo {
  width: min(230px, 58vw);
}

.category-nav {
  width: min(100% - 6px, 600px);
  margin: 0 auto 8px;
  padding: 4px 2px 0;
}

.nav-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.nav-btn {
  display: block;
  cursor: pointer;
  line-height: 0;
}

.nav-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.nav-btn.is-active {
  cursor: default;
}

.hero {
  margin: 8px 0 10px;
}

.hero img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 700px;
  margin: 0 auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.menu-card {
  position: relative;
  overflow: hidden;
  background: #000;
}

.menu-card a {
  cursor: pointer;
  display: block;
}

.menu-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.page-public .site-footer {
  display: none;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--color-muted-fg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-muted-fg);
  font-size: 13px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 12px 8px;
  align-items: center;
}

.lightbox-frame {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.lightbox-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #111;
  display: block;
}

.lightbox-nav,
.lightbox-close {
  cursor: pointer;
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(20, 17, 16, 0.92);
  color: #fff7ed;
  display: grid;
  place-items: center;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}

.lightbox-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.lightbox-nav:hover,
.lightbox-close:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.lightbox-nav[hidden] {
  visibility: hidden;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.lightbox-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 52px 0;
}

.lightbox-caption {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #fff7ed;
}

.lightbox-count {
  margin: 0;
  font-size: 13px;
  color: #a8a29a;
  white-space: nowrap;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox-dialog {
    grid-template-columns: 1fr;
    width: min(94vw, 420px);
  }

  .lightbox-frame {
    grid-column: 1;
  }

  .lightbox-nav {
    position: absolute;
    top: 46%;
    z-index: 2;
  }

  .lightbox-prev {
    left: 6px;
  }

  .lightbox-next {
    right: 6px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }

  .lightbox-meta {
    padding: 4px 8px 0;
  }
}

.page-admin {
  --color-background: #fef2f2;
  --color-foreground: #450a0a;
  --color-muted: #ffffff;
  --color-muted-fg: #7f1d1d;
  --color-border: #fecaca;
  --color-card: #ffffff;
  background:
    radial-gradient(900px 400px at 0% 0%, rgba(220, 38, 38, 0.1), transparent 50%),
    var(--color-background);
  color: var(--color-foreground);
}

.admin-bar {
  background: #450a0a;
  color: #fff7ed;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
}

.admin-bar-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.admin-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-brand b {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  font-size: 18px;
}

.admin-brand small {
  color: #fecaca;
  font-size: 12px;
}

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-nav a {
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #fff7ed;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}

.admin-nav a:hover,
.admin-nav a.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.admin-wrap {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(69, 10, 10, 0.06);
  overflow: hidden;
}

.panel-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-head h1 {
  margin: 0;
  font-size: 24px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

.menu-table {
  width: 100%;
  border-collapse: collapse;
}

.menu-table th,
.menu-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.menu-table th {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted-fg);
  background: #fff7f7;
}

.menu-table tr:hover td {
  background: #fff7f7;
}

.thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
}

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

.btn {
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-foreground);
}

.btn-muted {
  background: #f5f5f4;
  color: #78716c;
  cursor: default;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.form-card {
  max-width: 640px;
  margin: 0 auto;
}

.form-card .form-grid {
  padding: 24px 28px 28px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--color-muted-fg);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-foreground);
  font-size: 16px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.preview-img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--color-border);
}

.file-field {
  display: flex;
  gap: 10px;
  align-items: center;
}

.file-field .form-control {
  flex: 1;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.file-field .btn {
  background: #450a0a;
  color: #fff7ed;
}

.invalid-feedback {
  display: none;
  color: var(--color-primary);
  font-size: 13px;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .menu-table thead {
    display: none;
  }

  .menu-table,
  .menu-table tbody,
  .menu-table tr,
  .menu-table td {
    display: block;
    width: 100%;
  }

  .menu-table tr {
    padding: 12px 16px 16px;
    border-bottom: 1px solid var(--color-border);
  }

  .menu-table td {
    border: 0;
    padding: 6px 0;
  }

  .admin-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 0;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
