:root {
  --bg: #f5f3f7;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7680;
  --line: #d9d2df;
  --primary: #7c3a8d;
  --primary-dark: #3d096a;
  --accent: #d8b4e2;
  --red: #c83f45;
  --red-soft: #fde7e8;
  --shadow: 0 18px 50px rgba(31, 41, 51, .08);
  --gallery-columns: 4;
  --home-markets-width: 50fr;
  --home-news-width: 50fr;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }

.app-shell { min-height: calc(100vh - 78px); }

.public-hero {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: var(--primary-dark);
}

.public-hero-image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(61, 9, 106, .95), rgba(61, 9, 106, .72), rgba(61, 9, 106, .38)),
    url("../hero-dekoideen.png");
  background-size: cover;
  background-position: center right;
  background-blend-mode: multiply, normal;
}

.public-hero-content {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  display: grid;
  gap: 24px;
  margin: 0 auto;
  padding: 36px 0 42px;
  color: #fff;
}

.hero-title h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  line-height: 1.02;
}

.hero-title p {
  max-width: 680px;
  margin-bottom: 0;
  color: #f1e8f5;
  font-size: 1.05rem;
}

.public-main {
  width: min(1120px, calc(100% - 32px));
  position: relative;
  margin: -24px auto 64px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 22px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 800;
}

.tab:hover {
  background: #f3ecfa;
  color: var(--primary-dark);
}

.mobile-nav-toggle,
.mobile-nav {
  display: none;
}

.mobile-nav-toggle {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  width: 42px;
  height: 36px;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.mobile-nav-toggle span {
  width: 23px;
  height: 2px;
  display: block;
  background: #fff;
  border-radius: 999px;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.mobile-nav[hidden] { display: none; }

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .48);
}

.mobile-nav-panel {
  position: relative;
  width: min(310px, 86vw);
  height: 100%;
  padding: 18px;
  background: var(--primary);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 18px 0 60px rgba(15, 23, 42, .22);
  transform: translateX(-100%);
  animation: mobileNavSlideIn .18s ease forwards;
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
}

.mobile-nav-head strong {
  color: #fff;
  font-size: 1.15rem;
}

.mobile-nav-head .icon-button {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.mobile-nav-links {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mobile-nav-links a {
  display: block;
  padding: 13px 12px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.mobile-nav-links a:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

@keyframes mobileNavSlideIn {
  to { transform: translateX(0); }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, var(--home-markets-width)) minmax(0, var(--home-news-width));
  gap: 18px;
  align-items: start;
}

.home-left-column {
  display: grid;
  gap: 18px;
}

.summary-card,
.panel,
.login-card,
.admin-card,
.admin-menu a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.summary-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f3ecfa;
  color: var(--primary-dark);
  font-weight: 900;
  font-size: .78rem;
}

.summary-card strong {
  color: var(--primary-dark);
  font-size: 1.08rem;
}

.summary-card p {
  margin: 0;
  color: var(--muted);
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.muted, .item__meta {
  color: var(--muted);
}

.item-list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.item__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.item__meta {
  font-size: .9rem;
}

.news-item {
  grid-template-columns: 1fr;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.news-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.news-item p {
  margin: 0;
  color: var(--muted);
}

.news-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.news-thumb {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
}

.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.ghost:hover,
.button:hover {
  background: #f3ecfa;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: .9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3ecfa;
  color: var(--primary-dark);
  font-size: .84rem;
  font-weight: 900;
}

.event-card {
  width: 100%;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.event-date {
  color: var(--ink);
}

.event-title {
  color: var(--muted);
  font-weight: 400;
}

.event-card address {
  white-space: pre-line;
  color: var(--muted);
  font-style: normal;
}

.shop-address,
.shop-hours {
  display: grid;
  gap: 6px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.shop-address span,
.shop-hours p {
  margin: 0;
  color: var(--muted);
}

.shop-address a,
.shop-hours a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

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

.thumb {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  cursor: pointer;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .18s ease;
}

.thumb:hover img {
  transform: scale(1.04);
}

.content-page {
  max-width: 1120px;
  color: #36414c;
  white-space: pre-line;
}

.content-page img,
.content-image {
  max-width: min(100%, 620px);
  height: auto;
  display: block;
  margin: 14px 0;
  border-radius: 8px;
}

.content-page a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 26px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty-state strong {
  color: var(--ink);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .58);
}

.lightbox[hidden] { display: none; }

.event-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.event-modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
}

.modal-card {
  position: relative;
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-head h2 {
  margin: 10px 0 0;
  color: var(--primary-dark);
}

.icon-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 10px;
  font-weight: 800;
}

.event-modal-description {
  white-space: pre-line;
  color: var(--muted);
}

.event-modal-address {
  white-space: pre-line;
  color: var(--muted);
  font-style: normal;
}

.lightbox button {
  max-width: min(960px, 94vw);
  max-height: 90vh;
  padding: 0;
  border: 0;
  background: transparent;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px max(16px, calc((100vw - 1120px) / 2));
  color: #fff;
  background: var(--primary-dark);
}

.site-footer a { color: #fff; }

.site-footer div a {
  font-weight: 700;
  text-decoration: none;
}

.footer-admin-link {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

.footer-admin-link svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-admin-link:hover {
  background: rgba(255, 255, 255, .16);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.admin { background: #f6f2f7; }

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.admin-brand {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
}

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

.admin-bar a {
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
}

.admin-bar a:hover { background: var(--soft, #f7f1f8); }

.admin-page {
  width: min(1080px, calc(100% - 30px));
  margin: 28px auto 60px;
}

.admin-hero {
  padding: 30px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 24px;
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.admin-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.nav-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 22px;
}

.nav-editor > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfc;
}

.nav-editor small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.admin-menu a,
.admin-card,
.login-card {
  padding: 22px;
}

.admin-menu a { text-decoration: none; }
.admin-menu strong, .admin-menu span { display: block; }
.admin-menu strong { color: var(--primary); font-size: 1.25rem; }
.admin-menu span { margin-top: 8px; color: var(--muted); }

.admin-card { margin-top: 18px; }
.editor { max-width: 820px; }

.notice {
  padding: 12px 14px;
  color: var(--primary);
  background: #f3ecfa;
  border-radius: 12px;
}

label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  font-weight: 700;
}

.field-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 400;
}

.image-upload-list {
  display: grid;
  gap: 10px;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

textarea.large { min-height: 300px; }

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
}

.toolbar-color {
  width: 42px;
  height: 34px;
  padding: 2px;
  border-radius: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input { width: auto; }

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-table > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.admin-table small {
  display: block;
  color: var(--muted);
}

.admin-table > div > span:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-form { display: inline-flex; }

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.danger {
  background: #8b3344;
  color: #fff;
  box-shadow: none;
}

.admin-thumb {
  width: 54px;
  height: 54px;
  margin-right: 12px;
  object-fit: cover;
  border-radius: 12px;
  vertical-align: middle;
}

.admin-preview {
  display: block;
  max-width: 280px;
  max-height: 180px;
  margin: 12px 0;
  object-fit: cover;
  border-radius: 14px;
}

.admin-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.admin-preview-grid .admin-preview {
  width: 92px;
  height: 92px;
  margin: 0;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f3ecfa, #fff);
}

.login-card {
  width: min(420px, calc(100% - 28px));
  display: grid;
  gap: 14px;
}

.login-card h1 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 2rem;
}

@media (max-width: 840px) {
  .tabs {
    display: none;
  }

  .mobile-nav-toggle {
    display: grid;
  }

  .mobile-nav:not([hidden]) {
    display: block;
  }

  .summary-grid,
  .home-columns,
  .split,
  .admin-menu,
  .nav-editor {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .item__top,
  .admin-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-item {
    grid-template-columns: 1fr;
  }

  .news-thumb .news-image {
    height: 100%;
  }
}

@media (max-width: 560px) {
  .public-main,
  .public-hero-content {
    width: min(100% - 20px, 1120px);
  }

  .public-hero {
    min-height: 230px;
  }

  .public-hero-content {
    gap: 18px;
    padding: 28px 0 34px;
  }

  .panel,
  .admin-card {
    padding: 14px;
  }

  .hero-title h1 {
    font-size: 2rem;
  }

  .admin-table > div {
    align-items: flex-start;
    flex-direction: column;
  }
}
