/* One card presentation for the public catalog and Můj Shark.
   Keep public markup intact: saved editorial edits depend on its ancestry. */
html body .public-event-grid[data-view="cards"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
html body .public-event-grid[data-view="cards"] > article {
  --chip-start: #e8f8ff;
  --chip-end: #c2e5f8;
  --chip-ink: #123a50;
  --chip-border: #3885ac5c;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card-paper);
  color: var(--card-ink);
  box-shadow: 0 3px 14px #173c4906;
  transition: box-shadow .2s, border-color .2s;
}
html body .public-event-grid[data-view="cards"] > article[hidden] { display: none; }
html body .public-event-grid[data-view="cards"] > article[data-category="vikendovka"] { --chip-start: #fff4df; --chip-end: #f5dfb3; --chip-ink: #755019; --chip-border: #b58b435c; }
html body .public-event-grid[data-view="cards"] > article[data-category="prednaska"] { --chip-start: #e7fbef; --chip-end: #c4ecd6; --chip-ink: #1c5b33; --chip-border: #2e844857; }
html body .public-event-grid[data-view="cards"] > article[data-category="trenink"] { --chip-start: #eee7ff; --chip-end: #d7caff; --chip-ink: #453078; --chip-border: #7054be57; }
html body .public-event-grid[data-view="cards"] > article[data-category="jama"] { --chip-start: #e0faff; --chip-end: #beebf6; --chip-ink: #14546b; --chip-border: #2785a257; }
html body .public-event-grid[data-view="cards"] > article[data-category="deti"] { --chip-start: #fff0f3; --chip-end: #f5d7e3; --chip-ink: #7a3954; --chip-border: #b86a8857; }
html body .public-event-grid[data-view="cards"] > article:hover { transform: none; }
html body .public-event-grid[data-view="cards"] > article > a {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  height: auto;
  min-width: 0;
  color: var(--card-ink);
  text-decoration: none;
  border-radius: 0;
}
html body .public-event-grid[data-view="cards"] .event-photo { position: relative; flex: none; height: 176px; overflow: hidden; }
html body .public-event-grid[data-view="cards"] .event-photo img { width: 100%; height: 100%; object-fit: cover; transform: none; }
html body .public-event-grid[data-view="cards"] .event-photo-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  border: 1px solid var(--chip-border);
  border-radius: 20px;
  background: linear-gradient(110deg, var(--chip-start), var(--chip-end));
  color: var(--chip-ink);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}
/* The full, accessible date remains in the copy; the decorative calendar is for list view. */
html body .public-event-grid[data-view="cards"] .event-date-badge { display: none; }
html body .public-event-grid[data-view="cards"] .event-copy { display: flex; flex: 1; flex-direction: column; align-items: stretch; gap: 0; padding: 16px 18px; }
html body .public-event-grid[data-view="cards"] .event-date { min-height: 0; margin: 0 0 9px; padding: 0; color: var(--card-ink); font-size: 12px; line-height: 1.5; font-weight: 700; }
html body .public-event-grid[data-view="cards"] :is(h2, h3) { margin: 0 0 8px; color: var(--card-ink); font-size: 27px; line-height: 1.12; overflow-wrap: anywhere; }
html body .public-event-grid[data-view="cards"] .event-location { margin: 0 0 10px; color: var(--card-muted); font-size: 12px; line-height: 1.5; }
html body .public-event-grid[data-view="cards"] .event-location > span { display: none; }
html body .public-event-grid[data-view="cards"] .event-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0 0 14px; color: var(--card-muted); font-size: 13px; line-height: 1.6; }
html body .public-event-grid[data-view="cards"] .event-open { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin: auto 0 0; padding-top: 0; border-top: 0; color: var(--card-ink); font-size: 12px; line-height: 1.5; font-weight: 700; }
html body .public-event-grid[data-view="cards"] .event-open > span { font-size: 18px; transform: none; }
html body .public-event-grid[data-view="cards"] .event-row-arrow { display: none; }
html body .public-event-grid[data-view="cards"] > article > a:focus-visible { outline: 3px solid #59aabd; outline-offset: -4px; }
html body .public-event-grid[data-view="cards"] > article > a:active { background: color-mix(in srgb, var(--card-paper), #59aabd 8%); }
@media (hover: hover) and (pointer: fine) {
  html body .public-event-grid[data-view="cards"] > article:hover { border-color: #77a4b2; box-shadow: 0 8px 24px #173c4914; }
  html body .public-event-grid[data-view="cards"] > article > a:hover .event-open { text-decoration: underline; text-underline-offset: 3px; }
}
@media (max-width: 1050px) { html body .public-event-grid[data-view="cards"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { html body .public-event-grid[data-view="cards"] { grid-template-columns: 1fr; gap: 16px; } }
@media (prefers-reduced-motion: reduce) { html body .public-event-grid[data-view="cards"] > article { transition: none; } }

/* Shared actions for static public cards and the authenticated catalog. */
html body .public-event-grid { --card-ink: #173c49; --card-muted: #536e78; --card-paper: #fff; --card-line: #cedee2; }
html[data-theme="dark"] body .public-event-grid { --card-ink: #edf8fa; --card-muted: #b0c8d1; --card-paper: #142e3a; --card-line: #395664; }
html body .public-event-grid[data-view="list"] .event-card-footer { padding-top: 12px; }
html body .public-event-grid .event-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
html body .public-event-grid .event-card-footer { padding: 0 18px 16px; }
html body .public-event-grid .event-card-actions [data-group-checkout] { min-width: 0; }
html body .public-event-grid :is(.event-card-button, .event-card-actions [data-group-checkout] > button) {
  --surface-tone-text: var(--card-ink);
  --modern-action-text: var(--card-ink);
  --btn-glass-text: var(--card-ink);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  box-sizing: border-box; width: auto; min-height: 44px; margin: 0; padding: 9px 16px;
  border: 1px solid var(--card-line); border-radius: 9px;
  background: var(--card-paper); color: var(--card-ink); -webkit-text-fill-color: currentColor;
  font: 700 13px/1.5 Arial, sans-serif; text-decoration: none; box-shadow: none;
  transform: none; cursor: pointer; transition: background-color .15s, border-color .15s;
}
html body .public-event-grid :is(.event-card-primary, .event-card-actions [data-group-checkout] > button) {
  --surface-tone-text: #fff; --modern-action-text: #fff; --btn-glass-text: #fff;
  background: #176780; color: #fff; border-color: #176780;
}
html body .public-event-grid .event-card-actions :is(a,button)::before,
html body .public-event-grid .event-card-actions :is(a,button)::after { content: none; }
html body .public-event-grid .event-card-actions :is(a,button):focus-visible { outline: 3px solid #59aabd; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  html body .public-event-grid .event-card-button:hover { background: color-mix(in srgb, var(--card-paper), #59aabd 15%); border-color: #59aabd; text-decoration: none; }
  html body .public-event-grid :is(.event-card-primary, .event-card-actions [data-group-checkout] > button):hover:not(:disabled) { background: #12546a; border-color: #12546a; }
}
html body .public-event-grid .event-card-actions :is(a,button):active:not(:disabled) { filter: brightness(.92); transform: none; }
html body .public-event-grid .event-card-actions button:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: reduce) { html body .public-event-grid :is(.event-card-button, .event-card-actions [data-group-checkout] > button) { transition: none; } }
html body .public-event-grid[data-view="list"] > article { display: flex; flex-direction: column; }
html body .public-event-grid[data-view="list"] > article > a { height: auto; }
