/* Palette C (Petrinja), SPEC "Grafike i vizualni identitet". White dominates, black carries text,
   red is only an accent. */
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(/fonts/poppins.regular.ttf); }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(/fonts/poppins.bold.ttf); }
@font-face { font-family: Poppins; font-weight: 900; font-display: swap; src: url(/fonts/poppins.black.ttf); }

:root {
  --white: #ffffff;
  --light: #f3f1ef;
  --line: #e3dfdc;
  --black: #1a1818;
  --muted: #5a5454;
  --red: #c4161c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font: 16px/1.5 Poppins, system-ui, sans-serif;
}

a { color: inherit; }

.stripe {
  height: 6px;
  width: 50%;
  background: var(--red);
}

.site-header,
main,
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header.wide,
main.wide,
.site-footer.wide { max-width: 1200px; }

.site-header-bar,
body.admin > .site-header { border-bottom: 1px solid var(--line); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.logo-53 {
  padding: 0 0.45em;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 0.72em;
  letter-spacing: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.button.light { background: var(--white); color: var(--black); }

h1 {
  margin: 32px 0 0;
  font-size: 2.125rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.empty {
  padding: 32px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--light);
  text-align: center;
}

.empty p { margin: 0 0 16px; }

.site-footer-bar { margin-top: 48px; border-top: 1px solid var(--line); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding-top: 20px;
  padding-bottom: 32px;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer a { color: var(--red); }

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

/* --- Forms (/objavi) --- */
.lead { color: var(--muted); margin: 8px 0 24px; }

.form-alert {
  padding: 12px 16px;
  border-left: 4px solid var(--red);
  background: var(--light);
  font-weight: 700;
}

.event-form { display: grid; gap: 20px; max-width: 640px; }

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }

.field > label,
.field > legend,
.price-text > label { font-weight: 700; }

.field > legend { padding: 0; margin-bottom: 6px; }

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

.hint { margin: 0; color: var(--muted); font-size: 0.875rem; }

input:not([type="checkbox"], [type="radio"]),
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--black);
  /* 16px stops iOS from zooming into the field. */
  font: inherit;
  font-size: 16px;
}

input[type="file"] { padding: 10px; background: var(--light); }

input:focus,
textarea:focus { outline: 2px solid var(--black); outline-offset: 1px; }

.has-error input:not([type="checkbox"], [type="radio"]),
.has-error textarea { border-color: var(--red); border-width: 2px; }

.field-error { margin: 0; color: var(--red); font-weight: 700; font-size: 0.875rem; }

.field-warning {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--light);
  font-size: 0.875rem;
}

.field-warning[hidden] { display: none; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }

.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--red); flex: none; }

fieldset.field .check { margin-bottom: 4px; }

.price-text { display: grid; gap: 6px; margin-top: 8px; }

.price-text[hidden] { display: none; }

.suggest { position: relative; }

.suggest-list {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 24px rgb(26 24 24 / 12%);
}

.suggest-list li { display: grid; padding: 10px 12px; cursor: pointer; }

.suggest-list li small { color: var(--muted); }

.suggest-list li[aria-selected="true"],
.suggest-list li:hover { background: var(--light); }

.poster-kept { display: flex; gap: 12px; align-items: flex-start; }

.poster-kept img { border-radius: 4px; border: 1px solid var(--line); height: auto; }

.poster-kept p { margin: 0 0 6px; }

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.event-form button { justify-self: start; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 14px 24px; }

.message-page { max-width: 640px; }

.message-page .button { margin-top: 8px; }

@media (max-width: 420px) {
  .row { grid-template-columns: 1fr; }
  .event-form button { justify-self: stretch; }
}

/* --- Header navigation and buttons --- */
.site-nav { display: flex; align-items: center; gap: 14px; }

.site-nav > a:not(.button),
.site-nav .link-button { font-weight: 700; text-decoration: none; font-size: 0.9375rem; }
.site-nav form { margin: 0; }

.button.secondary { background: var(--white); color: var(--black); border: 1px solid var(--line); }

.button.danger { background: var(--black); }

button.button { border: 0; font: inherit; font-weight: 700; cursor: pointer; }

button.button.secondary { border: 1px solid var(--line); }

.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

.flash { padding: 12px 16px; border-left: 4px solid var(--black); background: var(--light); }

.form-page.narrow { max-width: 440px; }

h2 { margin: 32px 0 12px; font-size: 1.25rem; font-weight: 700; }

/* --- Moji događaji --- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.my-event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.my-event {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.my-event h3 { margin: 6px 0 2px; font-size: 1.0625rem; }

.my-event p { margin: 0; }

.my-event-actions { display: flex; gap: 8px; align-items: center; }

.my-event-actions .button { padding: 8px 14px; font-size: 0.875rem; }

.reason { margin-top: 6px !important; }

.status {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--light);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-approved { background: var(--black); color: var(--white); }

.status-rejected,
.status-cancelled { background: var(--white); border: 1px solid var(--red); color: var(--red); }

.account-links { display: flex; gap: 20px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }

@media (max-width: 420px) {
  .site-header .button { padding: 8px 12px; font-size: 0.875rem; }
  .site-nav { gap: 10px; }
}

/* --- Admin --- */
.logo small { font-size: 0.875rem; font-weight: 400; color: var(--muted); }

.admin-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-nav a { padding: 8px 10px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.9375rem; }

.admin-nav a[aria-current="page"] { background: var(--light); }

.count {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  text-align: center;
  vertical-align: 2px;
}

.count.big { font-size: 1rem; vertical-align: 6px; }

.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.admin-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}

.admin-card > span { display: grid; gap: 2px; min-width: 0; }

.admin-card img { object-fit: cover; border-radius: 4px; flex: none; }

.admin-card-noposter {
  display: grid;
  place-items: center;
  width: 56px;
  height: 70px;
  flex: none;
  border-radius: 4px;
  background: var(--light);
  color: var(--red);
  font-weight: 900;
}

.filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }

.filter label { display: grid; gap: 4px; font-weight: 700; font-size: 0.875rem; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }

.facts dt { font-weight: 700; }

.facts dd { margin: 0; overflow-wrap: anywhere; }

.review-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin: 16px 0; }

.review-actions .button { padding: 12px 22px; }

details > summary { list-style: none; cursor: pointer; }

details > summary::-webkit-details-marker { display: none; }

.reject[open] { flex-basis: 100%; }

.reject form { margin-top: 12px; }

.description { white-space: pre-line; margin: 24px 0; padding: 16px; background: var(--light); border-radius: 12px; }

.edit-box { margin: 24px 0; }

.edit-box[open] > summary { margin-bottom: 8px; }

.table-wrap { overflow-x: auto; }

table.compare,
table.data { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }

table.compare th,
table.compare td,
table.data th,
table.data td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

table.compare tr.changed td:last-child { background: #fbe9e9; font-weight: 700; }

.change { padding: 16px 0; border-bottom: 1px solid var(--line); }

.change h2 { margin: 0; }

.change-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }

.change-actions .check { flex-basis: 100%; }

.status-pub-published { background: var(--black); color: var(--white); }

.status-pub-failed { background: var(--red); color: var(--white); }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.inline-form input,
.inline-form select { flex: 1 1 160px; }

select { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font: inherit; font-size: 16px; }

.free-place { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }

.place-form { margin: 12px 0 4px; }

.admin-list details { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }

.user-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }

.user-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.user-actions .button { padding: 8px 12px; font-size: 0.875rem; }

/* --- Home page (mockup "Glavna stranica") --- */
.day-section { margin-top: 32px; }

.day-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 12px; margin-bottom: 16px; }

.day-head h1 { margin: 0; }

.day-head p { margin: 0; }

.kicker { margin: 0 0 2px; color: var(--red); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.day-section h2 { margin: 0 0 14px; font-size: 1.5rem; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.event-card {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  background: var(--white);
}

.card-image { width: 92px; min-height: 115px; flex: none; align-self: stretch; object-fit: contain; background: var(--light); }

.card-image-empty {
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--light);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.card-image-empty.big { width: 100%; aspect-ratio: 4 / 5; font-size: 6rem; border-radius: 14px; }

.card-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; padding: 12px 14px; }

.time-pill {
  align-self: flex-start;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}

.time-pill.dark { background: var(--black); }

.card-title { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }

.card-place { color: var(--muted); font-size: 0.8125rem; }

.cancelled-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 0 8px;
  border: 1px solid var(--red);
  border-radius: 999px;
  color: var(--red);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.is-cancelled .card-title,
.is-cancelled .week-title { color: var(--muted); }

.week { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.week li + li { border-top: 1px solid #eeeae7; }

.week a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; }

.week-date { display: flex; flex-direction: column; align-items: center; width: 44px; flex: none; line-height: 1.1; }

.week-date span { color: var(--red); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; }

.week-date strong { font-size: 1.25rem; font-weight: 900; }

.week-main { display: flex; flex-direction: column; min-width: 0; }

.week-main .muted { font-size: 0.8125rem; }

.week-title { font-weight: 700; font-size: 0.9375rem; }

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-top: 40px;
  padding: 24px 20px;
  border-radius: 16px;
  background: var(--red);
  color: var(--white);
}

.cta h2 { margin: 0 0 6px; font-size: 1.375rem; line-height: 1.2; }

.cta p { margin: 0; font-size: 0.875rem; max-width: 640px; }

@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
  .event-card { flex-direction: column; border-radius: 16px; }
  .card-image { width: 100%; height: auto; aspect-ratio: 4 / 5; }
  .card-body { justify-content: flex-start; padding: 14px 16px 16px; gap: 6px; }
  h1 { font-size: 3rem; }
  .day-section { margin-top: 48px; }
  .day-section h2 { font-size: 1.875rem; }
  .cta { padding: 36px 32px; border-radius: 20px; }
  .cta h2 { font-size: 1.75rem; }
  .cta p { font-size: 1rem; }
}

/* --- Event page --- */
.back { margin: 20px 0 0; font-size: 0.875rem; }

.back a { text-decoration: none; color: var(--muted); }

.banner { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--light); font-weight: 700; }

.banner.cancelled { background: var(--red); color: var(--white); }

.event-layout { display: grid; gap: 24px; margin-top: 20px; }

.event-poster img { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--light); }

.event-info h1 { margin: 0 0 16px; }

.event-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }

.share-status { margin: 0; font-size: 0.875rem; overflow-wrap: anywhere; }

.event-description { margin-top: 20px; white-space: pre-line; overflow-wrap: anywhere; }

.event-map { margin-top: 32px; }

.event-map iframe { width: 100%; height: 300px; border: 1px solid var(--line); border-radius: 14px; }

.event-map p { margin: 6px 0 0; font-size: 0.875rem; }

@media (min-width: 820px) {
  .event-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: start; }
  .event-poster { position: sticky; top: 16px; }
}

/* --- Text pages --- */
.prose { max-width: 680px; }

.prose h2 { margin-top: 28px; }

.prose li { margin-bottom: 6px; }

.previews { margin: 24px 0; }

.preview-grid { display: grid; grid-template-columns: 4fr 3fr; gap: 12px; align-items: start; }

.preview-grid figure { margin: 0; }

.preview-grid img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--light); }

.preview-grid figcaption { margin-top: 4px; color: var(--muted); font-size: 0.8125rem; }

.poster-kept[hidden] { display: none; }

/* Step 1 of publishing: the poster (/objavi). */
.poster-upload { display: grid; gap: 10px; max-width: 640px; }

.poster-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 20px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--light);
  text-align: center;
  cursor: pointer;
}

.poster-drop:hover,
.poster-drop:focus-within { border-color: var(--red); }

.poster-drop-title { font-size: 1.375rem; font-weight: 900; }

.poster-drop-hint { color: var(--muted); max-width: 420px; }

/* The real input covers the whole box (tap anywhere), invisibly. */
.poster-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.poster-busy { margin: 0; font-weight: 700; }

.poster-busy[hidden],
.no-js-only[hidden] { display: none; }

.poster-upload.is-busy .poster-drop { opacity: 0.6; pointer-events: none; }

.poster-skip { margin-top: 20px; }

/* Fields filled from the poster, until the organizer touches them. */
.ai-filled { background: #fff8e6 !important; }

.account-offer { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--light); }

.account-offer h2 { margin-top: 0; }

/* Admin "Mjesta": the map for a place's coordinates (public/mjesta.js) */
.place-map-tools[hidden] { display: none; }
.place-map { height: 280px; margin: 8px 0; border: 1px solid var(--line); border-radius: 12px; z-index: 0; }
.place-map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Where a submitted event stands (thank-you and confirmation pages) */
.progress-steps { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.progress-steps li {
  counter-increment: step; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}
.progress-steps li::before {
  content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: var(--light); color: var(--black);
}
.progress-steps li small { margin-left: auto; font-weight: 700; white-space: nowrap; }
.progress-steps .done::before { content: "✓"; background: var(--black); color: var(--white); }
.progress-steps .current { border: 2px solid var(--red); color: var(--black); font-weight: 700; }
.progress-steps .current::before { background: var(--red); color: var(--white); }
.progress-steps .current small { color: var(--red); }
.next-steps li { margin-bottom: 8px; }

/* Possible duplicates (admin) */
.status-duplicate { background: #fff8e6; border: 1px solid #c98a00; color: #7a5200; }
.duplicate-alert p { margin: 0 0 6px; }
.duplicate-alert ul { margin: 0 0 6px; padding-left: 20px; font-weight: 400; }
.delete-event { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--red); }
.admin-card .status { justify-self: start; }

/* Cancelled events: the poster greyed out, on cards and on the event page */
.is-cancelled .card-image,
.event-poster.is-cancelled img,
.event-poster.is-cancelled .card-image-empty { filter: grayscale(1); opacity: 0.5; }

/* Home: event count and a small "Objavi događaj" next to today's heading (the big one is at the bottom) */
.day-head-side { display: flex; align-items: center; gap: 12px; }
.button.small { padding: 8px 14px; font-size: 0.875rem; }
