/* components.css — styles for reusable UI components. */

/* Header status badge */
.status {
  display: inline-flex;
  align-items: center;
  gap: .5ch;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: #cfcde0;
}
.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background var(--dur) var(--ease);
}
.status--ok .status__dot {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 30%, transparent);
}
.status--down .status__dot { background: var(--danger); }
.status--checking .status__dot { background: var(--gold); }

/* Footer composition */
.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-5);
}
.site-footer .brand { color: #fff; font-size: var(--step-1); }
.footer-tagline { color: #cfcde0; margin-top: var(--space-2); max-width: 40ch; }
.footer-links { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; }
.footer-legal {
  max-width: var(--container);
  margin: var(--space-6) auto 0;
  color: #9d9ab5;
  border-top: 1px solid var(--ink-soft);
  padding-top: var(--space-4);
  max-width: 65ch;
}

/* Event cards + grid */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card__img--empty { background: linear-gradient(135deg, var(--surface-alt), var(--line)); aspect-ratio: 16 / 9; }
.card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.card__date { font-family: var(--font-mono); font-size: var(--step--1); color: var(--primary); margin: 0; letter-spacing: .04em; }
.card__title { font-size: var(--step-1); margin: 0; line-height: 1.2; }
.card__loc { color: var(--muted); font-size: var(--step--1); margin: 0; }

/* Notices */
.notice { padding: var(--space-4); border-radius: var(--radius); border: 1px solid transparent; }
.notice--error {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
  color: var(--danger);
}

/* Chat (Plan with AI) */
.chat { margin-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.chat__log { display: flex; flex-direction: column; gap: var(--space-3); min-height: 200px; }
.msg { display: flex; }
.msg--user { justify-content: flex-end; }
.msg--bot { justify-content: flex-start; }
.msg__bubble {
  max-width: 80%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  white-space: pre-wrap;
  line-height: 1.5;
}
.msg--user .msg__bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg--bot .msg__bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat__input { display: flex; gap: var(--space-3); align-items: flex-end; }
.chat__input textarea {
  flex: 1;
  font: inherit;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
  background: var(--surface);
  color: var(--text);
}
.chat__input textarea:focus { outline: none; border-color: var(--secondary); }
.chat__error { color: var(--danger); font-size: var(--step--1); }

/* Affiliate bar (under AI replies) */
.affbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--secondary) 8%, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 80%;
}
.affbar__label { font-weight: 600; font-size: var(--step--1); }
.affbar__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btn--sm { padding: .45em .9em; font-size: var(--step--1); }

/* Guides region selector */
.guides-controls { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; }
.guides-controls__label { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }
.select {
  font: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--secondary); }
.guides-status { color: var(--muted); font-size: var(--step--1); min-height: 1.2em; margin: 0 0 var(--space-3); }

/* Featured events (home) */
.featured { margin-top: var(--space-8); }
.featured__head { margin-bottom: var(--space-4); }
.featured__title { font-size: var(--step-3); margin: var(--space-1) 0 0; }
.featured__status { color: var(--muted); font-size: var(--step--1); min-height: 1.2em; }
.featured__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}
/* First card is a wide hero spanning the whole row with a cinematic image */
.card--featured { grid-column: 1 / -1; }
.card--featured .card__img,
.card--featured .card__img--empty { aspect-ratio: 21 / 9; }
.card--featured .card__title { font-size: var(--step-2); }

/* Guide detail page */
.guide__back { font-family: var(--font-mono); font-size: var(--step--1); color: var(--secondary); text-decoration: none; }
.guide__back
/* Genre filter bar */
.genre-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 var(--space-6); }
.genre-btn {
  font: inherit;
  font-size: var(--step--1);
  padding: .4em 1em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.genre-btn:hover { border-color: var(--secondary); }
.genre-btn--active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Month sections */
.month-section { margin-bottom: var(--space-7); }
.month-title {
  font-size: var(--step-2);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}

/* ============ UI polish overrides ============ */

/* Fixed-height card images (override earlier aspect-ratio rules) */
.card__img,
.card__img--empty {
  width: 100%;
  height: 200px;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
}
.card--featured .card__img,
.card--featured .card__img--empty { height: 200px; }

/* Responsive card grid: 1 col mobile → 2 → 3 → 4 on wider screens */
.featured__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 600px)  { .featured__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .featured__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .featured__grid { grid-template-columns: repeat(4, 1fr); } }

/* Genre bar: single-row horizontal scroll, hidden scrollbar */
.genre-bar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-6);
  padding-bottom: var(--space-1);
}
.genre-bar::-webkit-scrollbar { display: none; }
.genre-btn { flex: 0 0 auto; }

/* ============ Affiliate bar buttons — distinct colors ============ */
.affbar__actions .affbtn { color: #fff; border: none; }
.affbtn--stay { background: #2563eb; }
.affbtn--stay:hover { background: #1d4ed8; }
.affbtn--dothings { background: #16a34a; }
.affbtn--dothings:hover { background: #15803d; }
.affbtn--ai {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 2px 10px rgba(124, 58, 237, .35);
}
.affbtn--ai:hover { filter: brightness(1.08); }

/* Tighter hero: pull the events grid up under the intro text */
.featured--tight { margin-top: var(--space-4); }

/* ================= PREMIUM HOME REDESIGN ================= */

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #0d0a18;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.hero__collage {
  position: absolute; inset: 0; z-index: -2;
  display: grid; grid-template-columns: repeat(4, 1fr);
  opacity: .30; filter: blur(1px) saturate(1.1);
}
.hero__collage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(13,10,24,.60), rgba(13,10,24,.92));
}
.hero__inner { padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem); }
.hero__badge {
  display: inline-flex; align-items: center; gap: .5em;
  font: 600 var(--step--1)/1 var(--font-mono, monospace);
  color: #d7f9e4; background: rgba(22,163,74,.15);
  border: 1px solid rgba(22,163,74,.45); border-radius: 999px;
  padding: .4em .85em; letter-spacing: .04em;
}
.hero__dot {
  width: .55em; height: .55em; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
}
.hero__title {
  color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 7vw, 4rem); line-height: 1.03; letter-spacing: -.02em;
  margin: var(--space-3) 0 var(--space-2); max-width: 18ch;
}
.hero__sub { color: rgba(255,255,255,.72); font-size: var(--step-0); max-width: 46ch; margin: 0; }

/* ---- Sticky month nav ---- */
.monthnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: nowrap; gap: var(--space-4);
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: var(--space-2) var(--space-1);
  margin-bottom: var(--space-5);
}
.monthnav::-webkit-scrollbar { display: none; }
.monthnav__btn {
  flex: 0 0 auto; position: relative; cursor: pointer;
  font: 600 var(--step--1) var(--font-mono, inherit); letter-spacing: .08em;
  color: var(--muted); background: none; border: none; padding: .5em .3em;
}
.monthnav__btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0; background: transparent;
}
.monthnav__btn--active { color: var(--text); }
.monthnav__btn--active::after { background: var(--primary); }

/* ---- Month sections ---- */
.month-section { scroll-margin-top: 68px; margin-bottom: var(--space-7); }
.month-title {
  font-size: var(--step-2); letter-spacing: .03em; text-transform: uppercase;
  margin: 0 0 var(--space-4);
}
.lineup__status { color: var(--muted); }

/* ---- Grid: 1 col mobile (centered) → 2 → 3 ---- */
.featured__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
@media (min-width: 640px)  { .featured__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .featured__grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- Event card ---- */
.ec {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ec:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ec__media { position: relative; }
.ec__medialink { display: block; }
.ec__img, .ec__img--empty {
  width: 100%; height: 200px; object-fit: cover; display: block;
  background: var(--surface-alt);
}
.ec__save {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.92); border: none; color: #6b6880;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: color var(--dur), transform var(--dur);
}
.ec__save svg { fill: none; stroke: currentColor; stroke-width: 2; }
.ec__save:hover { transform: scale(1.08); }
.ec__save--on { color: var(--primary); }
.ec__save--on svg { fill: currentColor; stroke: currentColor; }
.ec__badge {
  position: absolute; left: 10px; bottom: 10px;
  font: 700 .625rem/1 var(--font-mono, sans-serif); letter-spacing: .08em;
  color: #fff; background: var(--primary); text-transform: uppercase;
  padding: .45em .6em; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(245,54,92,.40);
}
.ec__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.ec__titlelink { text-decoration: none; color: inherit; }
.ec__title {
  font-size: var(--step-1); line-height: 1.2; font-weight: 700; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ec__meta { color: var(--muted); font-size: var(--step--1); margin: 0; }
.ec__aff {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.ec__affrow {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6em .8em; text-decoration: none;
}
.ec__affrow + .ec__affrow { border-top: 1px solid var(--line); }
.ec__afflabel { color: var(--muted); font-weight: 700; letter-spacing: .05em; font-size: .6875rem; }
.ec__affval { font-size: var(--step--1); font-weight: 600; }
.ec__affrow--stay .ec__affval { color: #2563eb; }
.ec__affrow--do .ec__affval { color: var(--text); }
.ec__plan {
  margin-top: auto; text-align: center; text-decoration: none;
  font: 700 var(--step--1) var(--font-body); letter-spacing: .08em; color: #fff;
  padding: .95em 1em; border-radius: var(--radius);
  background: linear-gradient(135deg, #f5365c, #7c3aed);
  transition: filter var(--dur);
}
.ec__plan:hover { filter: brightness(1.08); }

/* ---- Card CTA buttons: two solid buttons side-by-side ---- */
.ec__ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.ec__cta {
  text-align: center; text-decoration: none;
  font: 700 .75rem var(--font-body); letter-spacing: .06em; color: #fff;
  padding: .85em .5em; border-radius: var(--radius);
  transition: filter var(--dur);
}
.ec__cta:hover { filter: brightness(1.1); }
.ec__cta--stay { background: #2563eb; }
.ec__cta--do { background: #0d9488; }

/* ---- Month nav: disabled (past/empty) months ---- */
.monthnav__btn--off {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

/* ---- Favorites page ---- */
.saved-empty {
  color: var(--muted);
  padding: var(--space-5) 0 var(--space-4);
  font-size: var(--step-0);
}

/* ---- Card CTAs: three equal pills in one row ---- */
.ec__ctas {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}
.ec__cta {
  font-size: .625rem;
  letter-spacing: .04em;
  padding: .8em .3em;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ec__cta--eat { background: #ea580c; }

/* ============ Home vibe upgrade ============ */

/* Livelier hero collage (brighter, more color) */
.hero__collage { opacity: .45; filter: saturate(1.25); }
.hero::after {
  background: linear-gradient(180deg, rgba(13,10,24,.42), rgba(13,10,24,.88));
}

/* Scrolling event ticker under the hero text */
.hero__ticker {
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.10);
  padding: .55em 0;
}
.ticker__track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll 45s linear infinite;
  font: 600 var(--step--1) var(--font-mono, monospace);
  letter-spacing: .04em;
  color: rgba(255,255,255,.82);
}
@keyframes ticker-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

/* Cards ease in when a month renders */
.featured__grid .ec { animation: card-in .45s var(--ease) both; }
.featured__grid .ec:nth-child(2) { animation-delay: .06s; }
.featured__grid .ec:nth-child(3) { animation-delay: .12s; }
.featured__grid .ec:nth-child(4) { animation-delay: .18s; }
.featured__grid .ec:nth-child(5) { animation-delay: .24s; }
.featured__grid .ec:nth-child(6) { animation-delay: .30s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .featured__grid .ec { animation: none; } }

/* Chat affiliate bar: eat button */
.affbtn--eat { background: #ea580c; }
.affbtn--eat:hover { background: #c2410c; }

/* ---- Hero search bar ---- */
.hero__search {
  display: flex; gap: var(--space-2);
  margin-top: var(--space-4);
  max-width: 520px;
}
.hero__search-input {
  flex: 1; min-width: 0;
  font: inherit; font-size: var(--step-0); color: #fff;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: .65em 1.1em;
  outline: none;
  transition: border-color var(--dur), background var(--dur);
}
.hero__search-input::placeholder { color: rgba(255,255,255,.55); }
.hero__search-input:focus { border-color: var(--primary); background: rgba(255,255,255,.14); }
.hero__search-btn {
  font: 700 var(--step--1) var(--font-body); letter-spacing: .04em;
  color: #fff; background: var(--primary);
  border: none; border-radius: 999px; cursor: pointer;
  padding: .65em 1.4em;
  transition: filter var(--dur);
}
.hero__search-btn:hover { filter: brightness(1.1); }
.hero__search-btn:disabled { opacity: .6; cursor: default; }

/* ---- Search results: clear button in title ---- */
.search-clear {
  font: 600 var(--step--1) var(--font-body);
  color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .3em .9em; margin-left: var(--space-3);
  cursor: pointer; vertical-align: middle;
  transition: color var(--dur), border-color var(--dur);
}
.search-clear:hover { color: var(--primary); border-color: var(--primary); }

/* ---- Card CTAs: symmetric 2x2 grid (4 buttons) ---- */
.ec__ctas {
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.ec__cta--fly { background: #0891b2; }

/* ============ Festival header vibe ============ */

/* Flowing gradient line along the bottom of the header */
.site-header { position: sticky; }
.site-header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, #f5365c, #7c3aed, #0891b2, #f5365c);
  background-size: 300% 100%;
  animation: header-flow 8s linear infinite;
}
@keyframes header-flow { to { background-position: 300% 0; } }

/* Animated equalizer bars next to the brand */
.eq {
  display: inline-flex; align-items: flex-end; gap: 2.5px;
  height: 1em; margin-right: .45em;
}
.eq__bar {
  width: 3.5px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #a855f7, #f5365c);
  animation: eq-bounce 1.1s ease-in-out infinite;
  transform-origin: bottom;
  height: 100%;
}
.eq__bar:nth-child(1) { animation-delay: 0s;   animation-duration: 1.0s; }
.eq__bar:nth-child(2) { animation-delay: .25s; animation-duration: .8s; }
.eq__bar:nth-child(3) { animation-delay: .1s;  animation-duration: 1.2s; }
.eq__bar:nth-child(4) { animation-delay: .35s; animation-duration: .9s; }
@keyframes eq-bounce {
  0%, 100% { transform: scaleY(.35); }
  50%      { transform: scaleY(1); }
}

/* Brand dot: animated gradient pulse */
.brand .dot {
  background: linear-gradient(90deg, #f5365c, #a855f7, #0891b2, #f5365c);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: header-flow 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .site-header::after, .eq__bar, .brand .dot { animation: none; }
}
