/**
 * Peselma Frontend Events — premium dark event grid
 * All rules scoped under .peselma-events or .peselma-event or .peselma-ticket-selector
 * Mobile-first, no Elementor dependency.
 */

/* ─── Reset / base ────────────────────────────────────────────────────────── */

.peselma-events *,
.peselma-event *,
.peselma-ticket-selector * {
  box-sizing: border-box;
}

/* ─── Archive grid ────────────────────────────────────────────────────────── */

.peselma-events-archive {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 0;
  margin: 0;
}

@media (min-width: 600px) {
  .peselma-events-archive.peselma-cols-2,
  .peselma-events-archive.peselma-cols-3,
  .peselma-events-archive.peselma-cols-4,
  .peselma-events-archive.peselma-cols-5,
  .peselma-events-archive.peselma-cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .peselma-events-archive.peselma-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .peselma-events-archive.peselma-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .peselma-events-archive.peselma-cols-5 { grid-template-columns: repeat(5, 1fr); }
  .peselma-events-archive.peselma-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

.peselma-events--empty {
  color: #888;
  font-style: italic;
  padding: 24px 0;
}

/* ─── Event card ──────────────────────────────────────────────────────────── */

.peselma-event-card {
  background: #14141c;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.peselma-event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.peselma-event-card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Poster */
.peselma-event-card__poster {
  position: relative;
  aspect-ratio: 3 / 4;
  /* background: #1e1e2a; */
  overflow: hidden;
}

.peselma-event-card__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.peselma-event-card:hover .peselma-event-card__poster img {
  transform: scale(1.04);
}

.peselma-event-card__poster-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e1e2a 0%, #2a2a3a 100%);
}

/* Availability badge */
.peselma-event-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.peselma-badge--available    { background: rgba(34, 197, 94, 0.9);  color: #fff; }
.peselma-badge--sold_out     { background: rgba(239, 68, 68, 0.9);  color: #fff; }
.peselma-badge--sales_closed { background: rgba(161, 161, 170, 0.9); color: #fff; }
.peselma-badge--unavailable  { background: rgba(100, 100, 120, 0.9); color: #fff; }

/* Card body */
.peselma-event-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.peselma-event-card__title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: capitalize;
  color: #f0f0f5;
  margin: 0 0 2px;
  line-height: 1.3;
}

.peselma-event-card__date,
.peselma-event-card__venue {
  font-size: 11px;
  color: #a0a0b8;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.peselma-event-card__venue-address {
  font-size: 11px;
  color: #7070a0;
}

.peselma-event-card__price {
  font-size: 13px;
  font-weight: 600;
  color: #e8c96e;
  margin: 3px 0 0;
}

.peselma-price-from {
  font-size: 11px;
  font-weight: 400;
  color: #a0a0b8;
  margin-right: 3px;
}

/* CTA button on card */
.peselma-event-card__btn {
  display: inline-block;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--peselma-accent);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ─── Single event detail ─────────────────────────────────────────────────── */

/* Hero image — full bleed, no radius */
.peselma-event__hero {
  position: relative;
  aspect-ratio: 16 / 6;
  overflow: hidden;
  border-radius: 0;
  background: #1a1a28;
  margin: 0 calc(-1 * var(--peselma-event-padding-mobile, 16px)) 28px;
}

@media (min-width: 600px) {
  .peselma-event__hero { aspect-ratio: 16 / 5; margin-bottom: 36px; }
}

.peselma-event__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.peselma-event__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(5, 5, 14, 0.55) 100%);
  pointer-events: none;
}

.peselma-event__hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #14141e 0%, #1e1e30 50%, #14141e 100%);
}

/* Sales status banner */
.peselma-event__status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.peselma-event__status-banner--sold_out {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.peselma-event__status-banner--sales_closed {
  background: rgba(161, 161, 170, 0.08);
  border: 1px solid rgba(161, 161, 170, 0.2);
  color: #a1a1aa;
}

.peselma-event__status-banner--unavailable {
  background: rgba(100, 100, 120, 0.08);
  border: 1px solid rgba(100, 100, 120, 0.18);
  color: #9090b0;
}

/* Two-column layout
 * DOM order: header → sidebar → sections
 * Mobile: flex-column — title/date/venue first, then ticket selector, then sections.
 * Desktop (≥900px): CSS grid — header + sections in left col; sidebar sticky right.
 */
.peselma-event__layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Explicit mobile reset — beats any theme rule that forces grid or row-flex
 * on narrow viewports. !important on display/flex-direction/position only. */
@media screen and (max-width: 1023px) {
  .peselma-event__layout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none;
  }
  .peselma-event__sidebar {
    position: static !important;
    width: 100%;
    grid-column: auto;
    grid-row: auto;
  }
  .peselma-tier-row {
    flex-wrap: wrap;
    padding: 16px 18px;
  }
  .peselma-tier-info {
    flex-basis: 100%;
  }
  .peselma-tier-name {
    font-size: 17px;
  }
  .peselma-tier-price {
    font-size: 16px;
  }
  .peselma-tier-qty {
    width: 100%;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #22223a;
    margin-top: 6px;
    gap: 10px;
  }
  .peselma-qty-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 8px;
  }
  .peselma-qty-input {
    width: 54px;
    font-size: 16px;
    padding: 8px 4px;
  }
  .peselma-btn--primary {
    font-size: 17px;
    padding: 16px 24px;
  }
}

@media (min-width: 1024px) {
  .peselma-event__layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    column-gap: 48px;
    row-gap: 28px;
    align-items: start;
  }

  .peselma-event__header {
    grid-column: 1;
    grid-row: 1;
  }

  .peselma-event__sections {
    grid-column: 1;
    grid-row: 2;
    padding-bottom: 40px;
  }

  .peselma-event__sidebar {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 80px;
    align-self: start;
  }
}

/* Event title */
.peselma-event__title {
  font-size: 26px;
  font-weight: 800;
  color: #f0f0f5;
  margin: 0 0 18px;
  line-height: 1.2;
}

@media (min-width: 600px) {
  .peselma-event__title { font-size: 32px; }
}

@media (min-width: 900px) {
  .peselma-event__title { font-size: 36px; }
}

/* Meta items */
.peselma-event__meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.peselma-event__meta-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #a0a0b8;
}

.peselma-meta-icon {
  flex-shrink: 0;
  color: var(--peselma-accent);
  margin-top: 1px;
  display: flex;
}

.peselma-event__venue-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.peselma-event__venue-name {
  font-weight: 600;
  color: #d0d0e0;
}

.peselma-event__venue-address {
  font-size: 13px;
  color: #7070a0;
}

.peselma-event__maps-link {
  font-size: 12px;
  color: var(--peselma-accent);
  text-decoration: none;
  margin-top: 3px;
  display: inline-block;
}

.peselma-event__maps-link:hover {
  text-decoration: underline;
}

/* Back-nav — full-bleed bar, zero gap above (navbar) and below (hero).
 * Negative horizontal margins cancel the page wrapper's side padding so the
 * bar stretches edge-to-edge at every breakpoint. */
.peselma-event__back-nav {
  background: var(--peselma-card-footer-bg);
  margin: 0 calc(-1 * var(--peselma-event-padding-mobile, 16px));
  padding: 12px var(--peselma-event-padding-mobile, 16px);
}

.peselma-event__back-link {
  font-size: 13px;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.peselma-event__back-link:hover {
  color: var(--peselma-accent);
}

/* Prevent theme article top-margin from creating space between back-nav and hero */
.peselma-event-detail {
  margin-top: 0;
}

/* Content sections wrapper */
.peselma-event__sections {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.peselma-event__section-heading {
  font-size: 12px;
  font-weight: 700;
  color: #6060a0;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1e1e2e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* About This Event */
.peselma-event__description {
  font-size: 15px;
  line-height: 1.75;
  color: #b8b8cc;
}

.peselma-event__description p { margin: 0 0 1em; }

/* Location section */
.peselma-event__location {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.peselma-event__location-name {
  font-size: 15px;
  font-weight: 600;
  color: #d0d0e0;
}

.peselma-event__location-address {
  font-size: 14px;
  color: #7070a0;
}

.peselma-event__maps-link--block {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: #18182a;
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--peselma-accent);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.peselma-event__maps-link--block:hover {
  border-color: var(--peselma-card-hover-accent);
  text-decoration: none;
}

/* Terms & Conditions */
.peselma-event__terms {
  font-size: 14px;
  line-height: 1.7;
  color: #8080a0;
}

.peselma-event__terms p { margin: 0 0 0.8em; }

/* Sidebar ticket card */
.peselma-event__ticket-card {
  background: var(--peselma-ticket-card-bg);
  border: 1px solid #28283c;
  border-radius: 14px;
  padding: 22px 20px 20px;
}

.peselma-event__ticket-heading {
  font-size: 17px;
  font-weight: 700;
  color: #f0f0f5;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #22223a;
}

/* ─── Ticket selector ─────────────────────────────────────────────────────── */

.peselma-ticket-selector {
  width: 100%;
}

.peselma-ticket-selector--closed,
.peselma-ticket-selector--sold-out,
.peselma-ticket-selector--unavailable {
  padding: 14px 18px;
  background: #1a1a28;
  border-radius: 8px;
  color: #a0a0b8;
  font-size: 14px;
}

/* Tier list */
.peselma-tier-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* Ticket tier card */
.peselma-tier-row {
  background: #18182a;
  border: 1px solid #2a2a3e;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.15s ease;
}

.peselma-tier-row:not(.peselma-tier-row--unavailable):hover {
  border-color: var(--peselma-card-hover-accent);
}

.peselma-tier-row--unavailable {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Tier info (left side) */
.peselma-tier-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.peselma-tier-info-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.peselma-tier-name {
  font-size: 15px;
  font-weight: 600;
  color: #f0f0f5;
}

.peselma-tier-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
}

.peselma-tier-badge--sold-out {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}

.peselma-tier-badge--unavailable {
  background: rgba(100, 100, 120, 0.14);
  color: #9090b0;
}

.peselma-tier-price {
  font-size: 14px;
  color: #e8c96e;
  font-weight: 500;
}

.peselma-tier-stock {
  font-size: 11px;
  color: #34c764;
}

.peselma-tier-unavailable {
  font-size: 13px;
  color: #6060a0;
}

/* Quantity controls (right side) */
.peselma-tier-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Scoped to (0,2,0) to beat Hello Elementor reset.css [type=button] at (0,1,0). */
.peselma-ticket-selector .peselma-qty-btn,
.peselma-qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #3a3a54;
  background: #22223a;
  color: #f0f0f5;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.peselma-ticket-selector .peselma-qty-btn:hover,
.peselma-qty-btn:hover {
  background: var(--peselma-button-bg, #c8a840);
  border-color: var(--peselma-button-bg, #c8a840);
  color: var(--peselma-button-text, #050505);
}

/* Scoped to (0,2,0) — reset.css sets input[type=number]{width:100%} at (0,1,0) after us. */
.peselma-ticket-selector .peselma-qty-input,
.peselma-qty-input {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  text-align: center;
  background: #14141c;
  border: 1px solid #3a3a54;
  border-radius: 6px;
  color: #f0f0f5;
  font-size: 14px;
  font-weight: 600;
  padding: 5px 4px;
  -moz-appearance: textfield;
  flex-shrink: 0;
}

.peselma-qty-input::-webkit-outer-spin-button,
.peselma-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Cart actions */
.peselma-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

/* Generic button */
/* Base: (0,1,0). Scoped variants below reach (0,2,0) to survive reset.css. */
.peselma-btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.1s ease;
  text-decoration: none;
}

.peselma-ticket-selector .peselma-btn,
.peselma-event .peselma-btn,
.peselma-events .peselma-btn {
  border: none;
}

.peselma-btn--primary {
  background: var(--peselma-button-bg, #c8a840);
  color: var(--peselma-button-text, #050505);
  width: 100%;
  font-size: 15px;
  padding: 13px 24px;
}

.peselma-ticket-selector .peselma-btn--primary,
.peselma-event .peselma-btn--primary,
.peselma-events .peselma-btn--primary {
  background: var(--peselma-button-bg, #c8a840);
  background-color: var(--peselma-button-bg, #c8a840);
  color: var(--peselma-button-text, #050505);
  border: none;
}

.peselma-btn--primary:hover {
  background: #e8c860;
  transform: translateY(-1px);
}

.peselma-ticket-selector .peselma-btn--primary:hover,
.peselma-event .peselma-btn--primary:hover,
.peselma-events .peselma-btn--primary:hover {
  background: #e8c860;
  background-color: #e8c860;
}

.peselma-btn--primary:disabled,
.peselma-btn--primary.is-loading {
  background: #555;
  color: #999;
  cursor: not-allowed;
  transform: none;
}

/* Cart summary (ticket count + price estimate) */
.peselma-cart-summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--peselma-accent);
  text-align: center;
  min-height: 18px;
}

/* Cart message */
.peselma-cart-msg {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.peselma-cart-msg.is-error   { color: #ef4444; }
.peselma-cart-msg.is-success { color: #22c55e; }

/* Trust / security text */
.peselma-trust-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: #50507a;
  padding-top: 12px;
  border-top: 1px solid #1e1e2e;
  line-height: 1.6;
  text-align: center;
}

.peselma-trust-sep {
  color: #38385a;
}

/* ─── Event filter bar ────────────────────────────────────────────────────── */

.peselma-filters {
  margin-bottom: 28px;
}

.peselma-filters__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.peselma-filters__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Desktop: filters inline, actions on the right */
@media (min-width: 640px) {
  .peselma-filters__fields {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .peselma-filters__field--search {
    flex: 1 1 200px;
    min-width: 140px;
  }

  .peselma-filters__field--venue,
  .peselma-filters__field--date {
    flex: 0 1 170px;
  }
}

@media (min-width: 900px) {
  .peselma-filters__form {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .peselma-filters__fields {
    flex: 1;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .peselma-filters__actions {
    flex-shrink: 0;
  }
}

.peselma-filters__input,
.peselma-filters__select {
  display: block;
  width: 100%;
  height: 44px;
  background: #14141c;
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  color: #e0e0f0;
  font-size: 14px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.peselma-filters__input::placeholder {
  color: #60608a;
}

.peselma-filters__input:focus,
.peselma-filters__select:focus {
  border-color: var(--peselma-accent);
}

/* Custom dropdown arrow */
.peselma-filters__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0a0b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.peselma-filters__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.peselma-btn--filter-apply {
  height: 44px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  /* Uses accent so Elementor widget color overrides take effect. Fallback matches defaults. */
  background: var(--peselma-accent, #c8a840);
  color: #05050e;
  white-space: nowrap;
  border-radius: 8px;
  border: none;
  transition: background 0.18s ease, opacity 0.15s ease;
}

.peselma-btn--filter-apply:hover {
  background: var(--peselma-card-hover-accent, #e8c860);
  transform: none;
}

/* Hide Apply when JS auto-submit is active (filter changes trigger form submit). */
.peselma-filters--js-active .peselma-btn--filter-apply {
  display: none;
}

.peselma-filters__clear {
  font-size: 13px;
  font-weight: 500;
  color: #6060a0;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.peselma-filters__clear:hover {
  color: #f0f0f5;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

/* ─── Filter AJAX loading state ─────────────────────────────────────────── */

.peselma-events-archive.peselma-is-loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* ─── Load More ────────────────────────────────────────────────────────────── */

/* Full-width span inside the CSS grid so it sits below the cards. */
.peselma-load-more-wrap {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.peselma-btn--load-more {
  display: inline-block;
  min-width: 180px;
  padding: 12px 36px;
  background: transparent;
  border: 2px solid var(--peselma-accent, #c8a840);
  border-radius: 8px;
  color: var(--peselma-accent, #c8a840);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease;
}

.peselma-btn--load-more:hover:not(:disabled) {
  background: var(--peselma-accent, #c8a840);
  border-color: var(--peselma-accent, #c8a840);
  color: #05050e;
}

.peselma-btn--load-more:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.peselma-load-more-msg {
  font-size: 13px;
  color: #ef4444;
  min-height: 18px;
  margin: 0;
}

/* ─── Peselma event route page wrapper ───────────────────────────────────── */

/* Dark body on event route pages keeps the design consistent and ensures
 * footer text (light-coloured by Elementor design) is readable.
 * The peselma-event-route class is added via EventRouter::add_body_class(). */
body.peselma-event-route {
  background-color: var(--peselma-event-bg, #050505);
}

.peselma-event-page {
  padding: 0 var(--peselma-event-padding-mobile, 16px) 40px;
  max-width: var(--peselma-event-max-width, 1140px);
  margin: 0 auto;
  background-color: var(--peselma-event-bg);
  color: var(--peselma-event-text);
}

/* Beat theme .entry-content top padding — EventRouter outputs both classes
 * on the same div, so many themes add unwanted space above the back-nav bar. */
.peselma-event-page.entry-content {
  padding-top: 0 !important;
}

@media (min-width: 768px) {
  .peselma-event-page {
    padding-left: var(--peselma-event-padding-tablet, 24px);
    padding-right: var(--peselma-event-padding-tablet, 24px);
    padding-bottom: 48px;
  }
  .peselma-event__back-nav {
    margin: 0 calc(-1 * var(--peselma-event-padding-tablet, 24px));
    padding: 12px var(--peselma-event-padding-tablet, 24px);
  }
  .peselma-event__hero {
    margin-left: calc(-1 * var(--peselma-event-padding-tablet, 24px));
    margin-right: calc(-1 * var(--peselma-event-padding-tablet, 24px));
  }
}

@media (min-width: 1200px) {
  .peselma-event-page {
    padding-left: var(--peselma-event-padding-desktop, 32px);
    padding-right: var(--peselma-event-padding-desktop, 32px);
    padding-bottom: 56px;
  }
  .peselma-event__back-nav {
    margin: 0 calc(-1 * var(--peselma-event-padding-desktop, 32px));
    padding: 12px var(--peselma-event-padding-desktop, 32px);
  }
  .peselma-event__hero {
    margin-left: calc(-1 * var(--peselma-event-padding-desktop, 32px));
    margin-right: calc(-1 * var(--peselma-event-padding-desktop, 32px));
  }
}

/* ─── Poster card ─────────────────────────────────────────────────────────── */

.peselma-card--poster {
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
}

.peselma-card--poster .peselma-event-card__inner {
  display: block;
  height: 100%;
}

.peselma-card-poster__image {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #1e1e2a;
}

.peselma-card-poster__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.peselma-card--poster:hover .peselma-card-poster__image img {
  transform: scale(1.06);
}

.peselma-card--poster:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(-4px);
}

/* Date badge */
.peselma-card-poster__date-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 10, 20, 0.82);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 7px 10px;
  text-align: center;
  min-width: 46px;
}

.peselma-card-poster__date-day {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #f0f0f5;
  line-height: 1;
}

.peselma-card-poster__date-month {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--peselma-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Gradient overlay */
.peselma-card-poster__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 12px 14px;
  background: linear-gradient(to top, rgba(5, 5, 14, 0.97) 0%, rgba(5, 5, 14, 0.65) 55%, transparent 100%);
}

.peselma-card-poster__title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: capitalize;
  color: #f0f0f5;
  margin: 0 0 4px;
  line-height: 1.25;
}

.peselma-card-poster__venue {
  font-size: 11px;
  color: #b0b0cc;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.peselma-card-poster__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.peselma-card-poster__price {
  font-size: 13px;
  font-weight: 600;
  color: #e8c96e;
}

.peselma-card-poster__btn {
  font-size: 11px;
  padding: 6px 12px;
}

/* ─── Compact card ────────────────────────────────────────────────────────── */

.peselma-card--compact {
  /* background: #14141c; */
  border-radius: 10px;
  border: 1px solid #2a2a3c;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.peselma-card--compact:hover {
  border-color: var(--peselma-card-hover-accent);
  transform: translateX(4px);
  box-shadow: none;
}

.peselma-card--compact .peselma-event-card__inner {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  height: auto;
}

/* Date block */
.peselma-card-compact__date {
  flex-shrink: 0;
  width: 50px;
  text-align: center;
  background: #1e1e2a;
  border-radius: 8px;
  padding: 8px 6px;
}

.peselma-card-compact__date-day {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #f0f0f5;
  line-height: 1;
}

.peselma-card-compact__date-month {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--peselma-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Info */
.peselma-card-compact__info {
  flex: 1;
  min-width: 0;
}

.peselma-card-compact__title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: capitalize;
  color: #f0f0f5;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peselma-card-compact__venue {
  font-size: 12px;
  color: #a0a0b8;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action */
.peselma-card-compact__action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.peselma-card-compact__price {
  font-size: 14px;
  font-weight: 600;
  color: #e8c96e;
  white-space: nowrap;
}

.peselma-card-compact__btn {
  font-size: 12px;
  padding: 8px 14px;
  white-space: nowrap;
}

/* Compact grid — single column always looks best for list-style */
.peselma-style--compact.peselma-events-archive {
  grid-template-columns: 1fr !important;
  max-width: 780px;
}

/* Poster grid — taller cards suit fewer columns */
@media (min-width: 900px) {
  .peselma-style--poster.peselma-events-archive.peselma-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── Minimal card (poster-footer) ───────────────────────────────────────── */

.peselma-card--minimal {
  position: relative;
  background: var(--peselma-card-footer-bg);
}

/* Accent line — slides in from left on hover */
.peselma-card--minimal::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--peselma-card-hover-accent);
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.35s ease;
  pointer-events: none;
}

.peselma-card--minimal:hover::after {
  transform: scaleX(0);
}

/* Poster — portrait ratio, image-dominant */
.peselma-card-minimal__poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #1a1a28;
}

.peselma-card-minimal__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.peselma-card--minimal:hover .peselma-card-minimal__poster img {
  transform: scale(1.04);
}

/* Footer — horizontal layout; color controlled by --peselma-card-footer-bg */
.peselma-card-minimal__footer {
  background: var(--peselma-card-footer-bg);
  display: flex;
  align-items: stretch;
  min-height: 58px;
}

/* Date block — stacked weekday / month / day */
.peselma-card-minimal__date {
  flex-shrink: 0;
  width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  gap: 1px;
}

.peselma-card-minimal__weekday {
  font-size: 10px;
  font-weight: 700;
  color: #60608a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}

.peselma-card-minimal__month {
  font-size: 11px;
  font-weight: 700;
  color: var(--peselma-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-top: 3px;
}

.peselma-card-minimal__day {
  font-size: 20px;
  font-weight: 800;
  color: #f0f0f5;
  line-height: 1;
  margin-top: 3px;
}

/* Divider — thin vertical rule between date and title */
.peselma-card-minimal__divider {
  flex-shrink: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.33);
  margin: 14px 0;
}

/* Title — fills remaining footer width */
.peselma-card-minimal__title {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: capitalize;
  color: #f0f0f5;
  margin: 0;
  line-height: 1.35;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Elementor widget integration
   Scoped modifiers applied by SingleEventWidget and EventGridWidget.
   These rules have no effect outside of .peselma-elementor-widget contexts.
   ========================================================================== */

/* Back-nav is contextual to the /peselma-event/{slug}/ route; hide it when
   the event detail is embedded inside an Elementor page widget. */
.peselma-elementor-widget .peselma-event__back-nav {
  display: none;
}

/* Editor placeholder — shown when no event is selected in the widget panel */
.peselma-elementor-placeholder {
  padding: 16px;
  background: #1a1a1a;
  color: #888;
  border: 1px dashed #444;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
}

/* ─── Carousel layout ─────────────────────────────────────────────────────── */

.peselma-events-carousel {
  width: 100%;
  position: relative;
  isolation: isolate;
}

.peselma-carousel-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.peselma-carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.35s ease;
  will-change: transform;
}

/* Each direct child (card) gets its width set by JS; prevent flex shrink/grow. */
.peselma-carousel-track > * {
  flex: 0 0 auto;
  min-width: 0;
}

/* Side arrows: absolute overlay spanning the full viewport height, centered. */
.peselma-carousel-controls {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  padding: 0 8px;
  z-index: 2;
}

.peselma-carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 20, 28, 0.82);
  border: 1px solid #3a3a54;
  color: #f0f0f5;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  pointer-events: all;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.peselma-carousel-btn:hover:not(:disabled) {
  background: var(--peselma-button-bg, #c8a840);
  border-color: var(--peselma-button-bg, #c8a840);
  color: #05050e;
  box-shadow: 0 4px 16px rgba(200, 168, 64, 0.35);
}

.peselma-carousel-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.peselma-events-carousel.peselma-is-loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Mobile: compact arrows so they don't dominate the narrow single-slide view. */
@media (max-width: 639px) {
  .peselma-carousel-controls {
    padding: 0 4px;
  }

  .peselma-carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* ─── Mobile density polish ──────────────────────────────────────────────── */

/* Grid: 2 columns on narrow mobile only.
 * Upper bound prevents this later-in-source rule from overriding the
 * min-width:900px multi-column rules at desktop widths (same specificity,
 * source order wins without the bound).
 * Compact style is protected by its own `!important` rule above.
 * Carousel uses .peselma-events-carousel, not .peselma-events-archive. */
@media (min-width: 360px) and (max-width: 599px) {
  .peselma-events-archive.peselma-cols-2,
  .peselma-events-archive.peselma-cols-3,
  .peselma-events-archive.peselma-cols-4,
  .peselma-events-archive.peselma-cols-5,
  .peselma-events-archive.peselma-cols-6 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Card: scale proportional elements for ~160 px mobile column slots. */
@media (max-width: 599px) {
  .peselma-events-archive .peselma-event-card {
    border-radius: 8px;
  }

  .peselma-events-archive .peselma-event-card__body {
    padding: 8px 10px 10px;
  }

  .peselma-events-archive .peselma-event-card__title {
    font-size: 13px;
  }

  /* Minimal card footer */
  .peselma-events-archive .peselma-card-minimal__footer {
    min-height: 50px;
  }

  .peselma-events-archive .peselma-card-minimal__date {
    width: 52px;
    padding: 8px 5px;
  }

  .peselma-events-archive .peselma-card-minimal__day {
    font-size: 16px;
  }

  .peselma-events-archive .peselma-card-minimal__month {
    font-size: 9px;
  }

  .peselma-events-archive .peselma-card-minimal__title {
    font-size: 12px;
    padding: 8px 8px;
  }

  /* Poster card */
  .peselma-events-archive .peselma-card--poster {
    border-radius: 8px;
  }

  .peselma-events-archive .peselma-card-poster__image {
    border-radius: 8px;
  }

  .peselma-events-archive .peselma-card-poster__overlay {
    padding: 24px 10px 12px;
  }

  .peselma-events-archive .peselma-card-poster__title {
    font-size: 13px;
  }

  .peselma-events-archive .peselma-card-poster__date-badge {
    top: 8px;
    left: 8px;
    padding: 5px 8px;
    min-width: 38px;
  }

  .peselma-events-archive .peselma-card-poster__date-day {
    font-size: 18px;
  }
}

/* Toggle button element: always hidden; only shown on mobile when
 * .peselma-filters--collapsible is set by the widget setting.
 * !important beats any theme button reset (display:block/inline-block). */
.peselma-filters__toggle {
  display: none !important;
}

@media (max-width: 639px) {
  /* No gap between filter bar and events grid on mobile. */
  .peselma-filters {
    margin-bottom: 0;
  }

  /* ── Collapsible mode (widget setting: Collapse Filters on Mobile = yes) ── */

  .peselma-filters--collapsible .peselma-filters__toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: #14141c;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    color: #e0e0f0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.15s ease;
  }

  .peselma-filters--collapsible .peselma-filters__toggle:hover {
    background: var(--peselma-accent, #c8a840);
    border-color: var(--peselma-accent, #c8a840);
    color: #05050e;
  }

  .peselma-filters--collapsible.peselma-filters--open .peselma-filters__toggle {
    border-color: var(--peselma-accent, #d4af37);
  }

  .peselma-filters__toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .peselma-filters__toggle-badge {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--peselma-accent, #d4af37);
    display: inline-block;
  }

  .peselma-filters__toggle-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  .peselma-filters--collapsible.peselma-filters--open .peselma-filters__toggle-chevron {
    transform: rotate(180deg);
  }

  .peselma-filters--collapsible .peselma-filters__form {
    display: none;
  }

  .peselma-filters--collapsible.peselma-filters--open .peselma-filters__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* ── Compact fields layout — applies in all mobile filter modes ── */

  .peselma-filters__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .peselma-filters__field--search {
    flex: 0 0 100%;
  }

  .peselma-filters__field--venue,
  .peselma-filters__field--date {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .peselma-filters__input,
  .peselma-filters__select {
    height: 40px;
    font-size: 13px;
  }

  .peselma-btn--filter-apply {
    height: 40px;
    padding: 0 16px;
    font-size: 12px;
  }
}

/* ─── SingleEventWidget — section visibility modifiers ───────────────────── */

/* SingleEventWidget — section visibility modifiers.
   Each modifier class hides its corresponding section (heading + content).
   :has() is supported in all modern browsers; Elementor requires the same. */
.peselma-hide-hero .peselma-event__hero {
  display: none !important;
}

.peselma-hide-description .peselma-event__section:has(.peselma-event__description) {
  display: none !important;
}

.peselma-hide-location .peselma-event__section:has(.peselma-event__location) {
  display: none !important;
}

.peselma-hide-terms .peselma-event__section:has(.peselma-event__terms) {
  display: none !important;
}
