/* Crumbcast Events Listing Styles — standalone, no SCSS compilation needed */

/* ---- Hero ---- */

.events-hero {
  position: relative;
  height: 420px;
  background: linear-gradient(135deg, #2a3126, #182018, #0e1812);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* Viewfinder corners */
.events-hero::after {
  content: '';
  position: absolute;
  top: 24px;
  right: 32px;
  bottom: 24px;
  left: 32px;
  z-index: 3;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='32'%3E%3Cpolyline points='58.5,1.5 1.5,1.5 1.5,30.5' fill='none' stroke='white' stroke-opacity='0.15' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") top left no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='32'%3E%3Cpolyline points='1.5,1.5 58.5,1.5 58.5,30.5' fill='none' stroke='white' stroke-opacity='0.15' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") top right no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='32'%3E%3Cpolyline points='1.5,1.5 1.5,30.5 58.5,30.5' fill='none' stroke='white' stroke-opacity='0.15' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") bottom left no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='32'%3E%3Cpolyline points='58.5,1.5 58.5,30.5 1.5,30.5' fill='none' stroke='white' stroke-opacity='0.15' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") bottom right no-repeat;
}

.events-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(107,124,94,0.3), transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(90,125,154,0.15), transparent 50%);
}

.events-hero__texture {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
  opacity: 0.035;
  mix-blend-mode: overlay;
}

.events-hero__grid {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  filter: blur(3px);
  animation: focus-pull 0.5s ease-out 0.3s forwards;
}
@keyframes focus-pull {
  from { filter: blur(3px); }
  to { filter: blur(0px); }
}
.events-hero__grid canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.events-hero__route {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: route-fade 0.3s ease-out 0.8s forwards;
  pointer-events: none;
}
.events-hero__route canvas {
  width: 100%;
  height: 100%;
  display: block;
}
@keyframes route-fade {
  to { opacity: 1; }
}

.events-hero__content {
  position: relative;
  z-index: 2;
  padding: 60px;
  width: 100%;
}

.events-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sage-light);
  letter-spacing: 3px;
  opacity: 0.8;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.events-hero .events-hero__title {
  font-family: var(--font-display);
  font-size: 56px;
  color: var(--chalk);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
}

.events-hero__stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.events-hero__stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--chalk);
  display: block;
  line-height: 1;
}

.events-hero__stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
  opacity: 0.6;
  color: var(--dust);
}

/* ---- Map Button ---- */

.events-map-btn {
  position: absolute;
  bottom: 60px;
  right: 60px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(107, 124, 94, 0.25);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(107, 124, 94, 0.35);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.events-map-btn:hover {
  background: rgba(107, 124, 94, 0.45);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(107, 124, 94, 0.6);
}
.events-map-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ---- Hero Card (preview map) ---- */

.events-hero-card {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 60px 0;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}

.events-hero-card__map-wrap {
  position: relative;
  height: 350px;
  border-radius: 6px;
  border: 1px solid var(--dust);
  overflow: hidden;
}

.events-hero-card__map-wrap #crumbcast-preview-map {
  width: 100%;
  height: 100%;
}

.events-hero-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 24, 0.45) 0%, transparent 50%);
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px;
  transition: background 0.3s;
}

.events-hero-card:hover .events-hero-card__overlay {
  background: linear-gradient(to top, rgba(26, 26, 24, 0.45) 0%, transparent 50%);
}

.events-hero-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: white;
  background: var(--rust, #c4613a);
  padding: 8px 16px;
  border-radius: 2px;
  transition: background 0.3s;
}

@media (hover: hover) {
  .events-hero-card:hover .events-hero-card__cta {
    background: var(--ink, #1a1a18);
  }
}

.events-hero-card__cta svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* ---- Sections ---- */

.events-section {
  padding: 48px 60px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

.events-section__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--dust);
}
.events-section__title--rec {
  display: flex;
  align-items: center;
  gap: 8px;
}
.events-section__title--rec::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 6px var(--rust);
  animation: rec-blink 1.5s ease-in-out infinite;
}

/* ---- Event Cards Grid ---- */

.events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.event-card {
  background: white;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}
.event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
  color: inherit;
  text-decoration: none;
}

.event-card__image {
  height: 260px;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Inset border on card image */
.event-card__image::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.event-card__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.event-card__image--no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-card__image--no-photo::after {
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent) !important;
}
.event-card__no-photo-icon {
  position: relative;
  z-index: 2;
}

.event-card__date-badge {
  position: absolute;
  bottom: 20px;
  right: 22px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  color: rgba(255, 160, 50, 0.8);
  text-shadow: 0 0 6px rgba(255, 140, 30, 0.35);
}

.event-card__status {
  position: absolute;
  top: 14px;
  right: 0;
  z-index: 4;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
}
.event-card__status--live {
  background: rgba(26,26,24,0.75);
  color: white;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 5px;
}
.event-card__status--live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 6px var(--rust);
  animation: rec-blink 1.5s ease-in-out infinite;
}
.event-card__status--future {
  background: var(--sky);
  color: white;
}

.event-card__categories {
  position: absolute;
  top: 14px;
  left: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.event-card__category {
  display: inline-block;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: white;
  border-radius: 2px;
}

.event-card__body {
  padding: 20px;
}
.event-card__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--ink);
}
.event-card__meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.event-card__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--mist);
}
.event-card__meta-item strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Layout (content + sidebar) ---- */

.events-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 60px 64px;
  width: 100%;
  box-sizing: border-box;
}

.events-layout > .events-main > .events-section {
  padding: 0;
  max-width: none;
  margin: 0;
}
.events-layout > .events-main > .events-section + .events-section {
  margin-top: 40px;
}

/* Rides cards inside events layout — constrain to column, match event grid */
.events-layout .rides-cards-wrap {
  margin-left: 0;
  margin-right: 0;
}
.events-layout .rides-cards-wrap::before,
.events-layout .rides-cards-wrap::after {
  display: none;
}
.events-layout .rides-cards {
  padding-left: 0;
  padding-right: 0;
  scroll-padding-left: 0;
  gap: 28px;
}
.events-layout .rides-card {
  width: calc((100% - 28px) / 2);
}

/* ---- Sidebar ---- */

.events-sidebar {
  padding-top: 8px;
}

.events-sidebar__section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--dust);
}
.events-sidebar__section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.events-sidebar__heading {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 14px;
}

/* Search */
.events-sidebar__search {
  display: flex;
}
.events-sidebar__search-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--dust);
  border-right: none;
  border-radius: 3px 0 0 3px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.events-sidebar__search-input:focus {
  border-color: var(--rust);
}
.events-sidebar__search-input::placeholder {
  color: var(--dust);
}
.events-sidebar__search-btn {
  padding: 8px 12px;
  background: var(--ink);
  color: var(--chalk);
  border: 1px solid var(--ink);
  border-radius: 0 3px 3px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}
.events-sidebar__search-btn:hover {
  background: #2a2a26;
}

/* Lists (recent events, archives) */
.events-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.events-sidebar__list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--stone);
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.events-sidebar__list li:last-child {
  border-bottom: none;
}
.events-sidebar__list-item--active > a {
  color: var(--rust);
  font-weight: 600;
}
.events-sidebar__count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--mist);
  opacity: 0.6;
}
.events-sidebar__clear {
  margin-top: 4px;
  border-bottom: none !important;
}
.events-sidebar__clear a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mist);
  letter-spacing: 0.3px;
}
.events-sidebar__clear a:hover {
  color: var(--rust);
}
.events-sidebar__list a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.events-sidebar__list a:hover {
  color: var(--rust);
}

.events-sidebar__date {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--mist);
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Comments list */
.events-sidebar__comment-author {
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
}
.events-sidebar__list--comments li {
  display: block;
  font-size: 12px;
  color: var(--mist);
}

/* Categories */
.events-sidebar__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.events-sidebar__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-decoration: none;
  border: 1px solid;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}
.events-sidebar__category:hover {
  background: var(--stone);
}
.events-sidebar__category--active {
  background: var(--stone);
  font-weight: 600;
}
.events-sidebar__category-count {
  font-size: 10px;
  opacity: 0.5;
}

/* ---- Compact hero (search results) ---- */

.events-hero--compact {
  height: auto;
  min-height: 180px;
  align-items: center;
}
.events-hero--compact .events-hero__content {
  padding: 48px 60px;
}
.events-hero--compact .events-hero__title {
  margin-bottom: 0;
}

/* ---- Search empty state ---- */

.search-empty {
  text-align: center;
  padding: 80px 20px;
}
.search-empty__icon {
  margin-bottom: 20px;
  opacity: 0.6;
}
.search-empty__text {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 8px;
}
.search-empty__hint {
  font-size: 14px;
  color: var(--mist);
  margin-bottom: 24px;
}
.search-empty__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--rust);
  text-decoration: none;
  transition: color 0.2s;
}
.search-empty__link:hover {
  color: var(--rust-light, #e0825a);
}

/* ---- Search pagination ---- */

.search-pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

/* ---- Responsive ---- */

@media (max-width: 992px) {
  .events-hero--compact {
    min-height: 140px;
  }
  .events-hero--compact .events-hero__content {
    padding: 24px 16px 24px 27px;
  }
  .events-hero {
    height: 280px;
  }
  .events-hero::after {
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
  .events-hero__content {
    padding: 24px 16px 24px 27px;
  }
  .events-hero .events-hero__title {
    font-size: 36px;
  }
  .events-hero__stats {
    gap: 20px;
    margin-top: 16px;
  }
  .events-hero__stat-value {
    font-size: 20px;
  }
  .events-map-btn {
    bottom: 24px;
    right: 24px;
  }

  .events-hero-card {
    padding: 16px 16px 0;
  }
  .events-hero-card__map-wrap {
    height: 250px;
  }

  .events-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 48px;
    gap: 32px;
  }

  .events-section {
    padding: 24px 16px;
  }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .events-layout .rides-card {
    width: 200px;
  }

  .event-card__image {
    height: 200px;
  }
  .event-card__name {
    font-size: 18px;
  }
  .event-card__meta-item {
    font-size: 12px;
  }
}

/* ---- Events Map Modal (90% viewport) ---- */

.events-map-dialog {
  width: 90vw;
  height: 90vh;
  max-width: 90vw;
  margin: 5vh auto;
}
.events-map-dialog .modal-content {
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: none;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.events-map-dialog .modal-body {
  flex: 1;
  min-height: 0;
}

@media (max-width: 576px) {
  .events-map-dialog {
    width: 96vw;
    height: 94vh;
    max-width: 96vw;
    margin: 3vh auto;
  }
}

/* ---- Map Modal Header ---- */

.events-map-modal__header {
  background: var(--chalk, #f5f2ed);
  border: none;
  border-bottom: 1px solid var(--dust, #d4cec4);
  padding: 14px 24px;
}

.events-map-modal__title {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mist, #7a7a72);
  margin: 0;
}

.events-map-modal__header .btn-close {
  filter: none;
  opacity: 0.4;
}
.events-map-modal__header .btn-close:hover {
  opacity: 0.7;
}

/* ---- Map Modal Split Layout ---- */

.events-map-modal__split {
  display: flex;
  height: 100%;
}

.events-map-modal__map-zone {
  flex: 1.618;
  min-width: 0;
  position: relative;
}

.events-map-modal__info-panel {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--dust, #d4cec4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: white;
}

@media (max-width: 992px) {
  .events-map-modal__split {
    flex-direction: column;
  }
  .events-map-modal__map-zone {
    flex: 0.618;
    min-height: 0;
  }
  .events-map-modal__info-panel {
    flex: 1;
    min-height: 0;
    border-left: none;
    border-top: 1px solid var(--dust, #d4cec4);
  }
}
