/* Public events — gold/glass, RTL-friendly */

.events-page {
  padding-bottom: calc(var(--bottom-nav-offset, 83px) + 16px);
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.events-page__header {
  margin-bottom: 8px;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 22px;
  margin-top: 8px;
  width: 100%;
  min-width: 0;
}

.events-page .event-card {
  padding: 0;
  margin-bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  border-color: rgba(218, 178, 93, 0.14);
}

.events-page .event-card:hover {
  transform: translateY(-4px);
  border-color: rgba(218, 178, 93, 0.36);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .events-page .event-card {
  border-color: rgba(196, 157, 74, 0.22);
}

[data-theme="light"] .events-page .event-card:hover {
  box-shadow: 0 14px 32px rgba(72, 52, 20, 0.08);
}

[data-theme="light"] .event-card__cover {
  background: #efe8d8;
}

.event-card__cover {
  display: block;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 220px;
}

.event-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.events-page .event-card:hover .event-card__cover img {
  transform: scale(1.035);
}

.event-card__body {
  padding: clamp(18px, 2.5vw, 24px);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(218, 178, 93, 0.22);
  background: rgba(218, 178, 93, 0.08);
  color: var(--text-secondary, var(--text-muted));
  font-size: 0.82rem;
  font-weight: 600;
  font-family: Kalameh, Arial, sans-serif;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.event-chip--type {
  color: var(--primary-color, #dab25d);
  border-color: rgba(218, 178, 93, 0.4);
  background: rgba(218, 178, 93, 0.14);
}

.event-card__title {
  margin: 0 0 10px;
  font-size: clamp(1.1rem, 2vw, 1.28rem);
  line-height: 1.5;
  font-family: Kalameh, Arial, sans-serif;
  overflow-wrap: anywhere;
}

.event-card__title a {
  color: var(--text-heading, var(--text-primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

.event-card__title a:hover {
  color: var(--primary-color, #dab25d);
}

.event-card__location {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.event-card__excerpt {
  margin: 0 0 14px;
  color: var(--text-secondary, var(--text-primary));
  line-height: 1.85;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.events-page .event-actions {
  margin-top: auto;
  padding-top: 4px;
}

.events-empty {
  color: var(--text-muted);
  margin: 0;
  padding: 8px 4px;
}

.event-card--empty {
  grid-column: 1 / -1;
  padding: 22px;
}

/* Single event */
.event-detail {
  padding: 0;
  overflow: hidden;
  border-color: rgba(218, 178, 93, 0.16);
}

.event-detail__hero {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(218, 178, 93, 0.12);
}

.event-detail__cover {
  width: 100%;
  max-height: min(52vh, 480px);
  aspect-ratio: 21 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
}

.event-detail__body {
  padding: clamp(20px, 3vw, 36px);
}

.event-detail__title {
  font-family: Kalameh, Arial, sans-serif;
  color: var(--text-heading, var(--text-primary));
  margin: 0 0 18px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  overflow-wrap: anywhere;
}

.event-detail__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 14px 20px;
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(218, 178, 93, 0.14);
  background: rgba(218, 178, 93, 0.05);
}

.event-detail__meta dt {
  margin: 0 0 4px;
  color: var(--primary-color, #dab25d);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: Kalameh, Arial, sans-serif;
}

.event-detail__meta dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

.event-detail__tz {
  color: var(--text-muted);
  font-size: 0.85em;
  margin-inline-start: 4px;
}

.event-detail__link {
  color: var(--primary-color, #dab25d);
  text-decoration: none;
  word-break: break-all;
}

.event-detail__link:hover {
  text-decoration: underline;
}

.event-detail__desc {
  color: var(--text-primary);
  line-height: 2;
  white-space: pre-line;
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.event-chip--free {
  background: rgba(80, 170, 120, 0.18);
  color: #8ee0b0;
}

.event-chip--price {
  background: rgba(218, 178, 93, 0.16);
}

.event-chip--waitlist {
  background: rgba(200, 140, 60, 0.18);
  border-color: rgba(218, 178, 93, 0.45);
  color: var(--primary-color, #dab25d);
}

.event-features {
  margin: 0 0 18px;
  padding: 0 1.2em;
  color: var(--text-primary);
  line-height: 1.9;
}

.event-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(218, 178, 93, 0.12);
  line-height: 1.7;
}

.event-banner--ok {
  background: rgba(80, 170, 120, 0.14);
}

.event-banner--warn {
  background: rgba(200, 80, 80, 0.14);
}

.event-welcome {
  white-space: pre-line;
  line-height: 1.8;
  margin: 0 0 16px;
}

.event-register {
  margin: 8px 0 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(218, 178, 93, 0.18);
  min-width: 0;
}

.event-register__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.event-register__form input,
.event-register__form textarea,
.event-register__form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.event-register .btn-gold,
.event-register .btn-ghost {
  min-width: 0;
}

.event-extras {
  border: 0;
  padding: 0;
  margin: 8px 0;
}

.event-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-buy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  min-width: 0;
}

.event-buy-actions .btn-gold,
.event-buy-actions .btn-ghost {
  min-width: 0;
}

.coupon-apply {
  margin: 12px 0 4px;
  min-width: 0;
  max-width: 100%;
}
.coupon-apply__label {
  display: block;
  font-size: .86rem;
  margin-bottom: 6px;
  opacity: .9;
}
.coupon-apply__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.coupon-apply__input {
  flex: 1 1 140px;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(218,178,93,.42);
  background: rgba(0,0,0,.12);
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25;
  box-sizing: border-box;
}
.coupon-apply__btn {
  min-height: 44px;
  height: 44px;
  padding: 0 14px;
  line-height: 1.25;
  box-sizing: border-box;
}
.coupon-apply__clear {
  opacity: .88;
}
.coupon-apply__msg,
.coupon-apply__price {
  margin: 8px 0 0;
  font-size: .88rem;
  overflow-wrap: anywhere;
}
.coupon-apply__msg.is-error { color: #e07070; }
.coupon-apply__price { color: var(--primary-color, #dab25d); font-weight: 700; }
.event-buy-actions .btn-gold:disabled,
.event-register .btn-gold:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .events-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .event-card__cover {
    max-height: 168px;
  }

  .event-card__body {
    padding: 16px;
  }

  .event-card__title {
    font-size: 1.1rem;
  }

  .event-detail__cover {
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }

  .event-detail__body {
    padding: 16px;
  }

  .event-detail__title {
    font-size: 1.3rem;
  }

  .event-detail__meta {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .events-page .event-actions,
  .event-buy-actions,
  .coupon-apply__row {
    flex-direction: column;
    align-items: stretch;
  }

  .events-page .event-actions .btn-gold,
  .events-page .event-actions .btn-ghost,
  .event-buy-actions .btn-gold,
  .event-buy-actions .btn-ghost,
  .event-register .btn-gold,
  .event-register .btn-ghost,
  input.coupon-apply__input,
  .coupon-apply__btn {
    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 14px;
    font-size: 0.875rem;
    line-height: 1.25;
    box-sizing: border-box;
    justify-content: center;
  }

  input.coupon-apply__input {
    padding: 0 12px;
    font-size: 16px;
    line-height: 42px;
  }

  .events-page .event-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .events-page .event-card,
  .event-card__cover img {
    transition: none;
  }

  .events-page .event-card:hover {
    transform: none;
  }

  .events-page .event-card:hover .event-card__cover img {
    transform: none;
  }
}
