:root {
  --bg: #120c08;
  --ink: #fff3d8;
  --paper: #fff6e7;
  --muted: rgba(255, 243, 216, 0.72);
  --gold: #e5ad42;
  --gold-bright: #ffc96a;
  --green: #0d6d47;
  --red: #a62b1f;
  --line: rgba(255, 243, 216, 0.14);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(166, 43, 31, 0.32), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(13, 109, 71, 0.34), transparent 32%),
    linear-gradient(135deg, #120c08, #24140d 52%, #0b2f26);
  font-family: Inter, Arial, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 8px clamp(18px, 3vw, 34px);
  background: rgba(18, 12, 8, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
}

.topbar nav a {
  padding: 8px 0;
  color: rgba(255, 243, 216, 0.78);
  font-size: 16px;
  font-weight: 900;
}

.topbar nav a:hover {
  color: var(--gold-bright);
}

.lang-toggle {
  display: inline-flex;
  gap: 5px;
  min-width: 82px;
  min-height: 38px;
  padding: 4px;
  color: rgba(255, 243, 216, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 243, 216, 0.18);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.lang-toggle span {
  display: grid;
  width: 34px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
}

.lang-toggle.is-en [data-lang-option="en"],
.lang-toggle.is-es [data-lang-option="es"] {
  color: #7c1f16;
  background: #fff;
}

.gallery-hero,
.admin-login {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.7fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
  min-height: 72svh;
  padding: 128px clamp(22px, 6vw, 84px) 70px;
}

.gallery-hero img {
  width: min(480px, 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(48px, 7vw, 98px);
  line-height: 1.02;
}

.gallery-hero p:last-child,
.admin-login p:last-child {
  max-width: 620px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
}

.gallery-wall,
.gallery-manager,
.restaurant-panel {
  padding: clamp(44px, 7vw, 86px) clamp(18px, 6vw, 84px);
}

.restaurant-panel {
  min-height: 72svh;
  padding-top: 128px;
}

.restaurant-panel-head {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 210px);
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  margin-bottom: 28px;
}

.restaurant-panel-head p:last-child {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.restaurant-panel-head img {
  width: min(200px, 100%);
  justify-self: end;
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.34));
  transform: translateY(-14px);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 16px;
}

.portal-grid a,
.portal-grid button {
  position: relative;
  min-height: 128px;
  padding: 22px;
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    radial-gradient(circle at top right, rgba(229, 173, 66, 0.24), transparent 45%);
  border: 1px solid rgba(255, 243, 216, 0.14);
  border-radius: 26px 8px 26px 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.portal-grid a:nth-child(even),
.portal-grid button:nth-child(even) {
  border-radius: 8px 26px 8px 26px;
}

.portal-grid a::after,
.portal-grid button::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 120px;
  height: 120px;
  background: rgba(13, 109, 71, 0.42);
  border-radius: 50%;
}

.portal-grid a:hover,
.portal-grid button:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 201, 106, 0.5);
  background:
    linear-gradient(135deg, rgba(166, 43, 31, 0.44), rgba(13, 109, 71, 0.28)),
    radial-gradient(circle at top right, rgba(255, 201, 106, 0.34), transparent 45%);
}

.gallery-toolbar,
.manager-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.gallery-toolbar p {
  margin: 0;
  color: var(--muted);
}

.gallery-toolbar a,
.manager-actions a,
.manager-actions button,
.login-card button,
.login-card .login-back {
  min-height: 44px;
  padding: 12px 17px;
  color: #201108;
  background: var(--gold);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.login-card .login-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  text-decoration: none;
}

.login-card .login-back:hover {
  background: rgba(255, 255, 255, 0.14);
}

.manager-actions .danger {
  color: #fff;
  background: var(--red);
}

.photo-mosaic {
  columns: 4 230px;
  column-gap: 14px;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
  cursor: zoom-in;
}

.photo-card img {
  width: 100%;
  min-height: 220px;
  object-fit: cover;
  transition: transform 420ms ease;
}

.photo-card:nth-child(3n) img {
  min-height: 330px;
}

.photo-card:hover img {
  transform: scale(1.05);
}

.photo-dialog {
  width: min(980px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #000;
}

.photo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.photo-dialog img {
  width: 100%;
  max-height: 86vh;
  object-fit: contain;
}

.photo-dialog button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 24px;
  cursor: pointer;
}

.login-card {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 4vw, 34px);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-card input {
  min-height: 48px;
  padding: 12px 14px;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.silent-upload {
  display: none;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.admin-photo {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.admin-photo input {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 22px;
  height: 22px;
}

.admin-photo img {
  width: 100%;
  aspect-ratio: 1 / 0.82;
  object-fit: cover;
}

.admin-photo span {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 13px 16px;
  color: #201108;
  background: var(--gold-bright);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .gallery-hero,
  .admin-login,
  .restaurant-panel-head,
  .manager-head,
  .gallery-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .restaurant-panel-head img {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .topbar {
    position: absolute;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
  }

  .topbar nav {
    flex: 1;
    flex-wrap: nowrap;
    gap: 13px;
    overflow-x: auto;
  }

  .topbar nav a {
    flex: 0 0 auto;
    font-size: 13px;
  }

  h1 {
    font-size: 42px;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }
}
