/* ── Event teasers — public-facing view ─────────────────────────────── */

/* This file was written against a design-system convention (--text,
   --surface, etc.) that index.css — the only other stylesheet this page
   loads — never defines. Every var(--x, fallback) below was silently
   resolving to its fallback, and those fallbacks assume a light theme
   (e.g. --text's fallback of #111), while the rest of the site is dark
   (body background #000). That's what put near-black heading text like
   .et-heading directly on the page's black background. Defining the
   variables here, matching the dark palette already used elsewhere on the
   site (see user.profile.css), makes every var() resolve to its intended
   value instead of falling through to the light-theme default. */
:root {
  --text: #f5f5f7;
  --text-3: #999;
  --surface: #1a1a1a;
  --surface2: #222;
  --border: rgba(255, 255, 255, 0.08);
  --red: #b30000;
}

*, *::before, *::after { box-sizing: border-box; }

.et-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Page header ──────────────────────────────────────────────────────── */
.et-heading {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text, #111);
  margin: 0 0 8px;
}
.et-subheading {
  font-size: 1rem;
  color: var(--text-3, #666);
  margin: 0 0 24px;
}

/* ── Layout toggle ────────────────────────────────────────────────────── */
.et-layout-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}
.et-layout-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border, #ddd);
  background: transparent;
  color: var(--text-3, #888);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.et-layout-btn:hover { color: var(--text, #111); border-color: var(--text-3, #aaa); }
.et-layout-btn.active {
  background: var(--red, #b30000);
  border-color: var(--red, #b30000);
  color: #fff;
}
/* #et-btn-calendar is a <button>, not an <a> like its siblings -- reset
   the parts a browser's default button chrome would otherwise add so it
   reads as the same control. Calendar is now a plain link out to
   /calendar (its own section), not an inline toggle, so it needs no
   special rule beyond the shared .et-layout-btn styling. */

/* ── Empty state ──────────────────────────────────────────────────────── */
.et-empty {
  text-align: center;
  color: var(--text-3, #888);
  padding: 64px 0;
  font-size: 15px;
}

/* ── Shared goal bar ──────────────────────────────────────────────────── */
.et-goal {
  margin-top: 14px;
}
.et-goal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3, #888);
  margin-bottom: 5px;
}
.et-goal-bar-wrap {
  height: 6px;
  background: var(--border, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
}
.et-goal-bar {
  height: 100%;
  background: var(--red, #b30000);
  border-radius: 3px;
  transition: width .4s ease;
  min-width: 2px;
}
.et-goal-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3, #888);
  margin-top: 4px;
}

/* ── Grid layout ──────────────────────────────────────────────────────── */
.et-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.et-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--surface, #fff);
  transition: box-shadow .2s, transform .2s;
}
.et-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.et-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface2, #f3f4f6);
  flex-shrink: 0;
}
.et-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.et-card:hover .et-card-image img { transform: scale(1.03); }
.et-card-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface2, #f3f4f6);
  /* The wordmark stands in for artwork an event does not have, so it has
     to sit in the MIDDLE of the box -- it was rendering hard against the
     top-left corner because the placeholder was a plain block. */
  display: flex;
  align-items: center;
  justify-content: center;
}

.et-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.et-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0 0 8px;
}
.et-card-desc {
  font-size: 13px;
  color: var(--text-3, #666);
  line-height: 1.6;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.et-card-cta {
  display: inline-block;
  margin-top: auto;
  padding-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--red-link, #ff6b6b);
}

/* ── Linear layout ────────────────────────────────────────────────────── */
.et-linear {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.et-row {
  display: flex;
  align-items: center;
  gap: 48px;
  text-decoration: none;
  color: inherit;
  transition: opacity .15s;
}
.et-row:hover { opacity: .9; }

.et-row-reverse {
  flex-direction: row-reverse;
}

.et-row-image {
  flex: 0 0 48%;
  max-width: 48%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface2, #f3f4f6);
  aspect-ratio: 16 / 9;
}
.et-row-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.et-row:hover .et-row-image img { transform: scale(1.02); }
.et-row-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface2, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.et-row-body {
  flex: 1;
  min-width: 0;
}
.et-row-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text, #111);
  margin: 0 0 12px;
}
.et-row-desc {
  font-size: 14px;
  color: var(--text-3, #555);
  line-height: 1.7;
  margin: 0 0 4px;
}
.et-row-cta {
  display: inline-block;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--red-link, #ff6b6b);
}

/* ── Offset for fixed nav ─────────────────────────────────────────────── */
.et-offset { height: 64px; }
@media (max-width: 768px) { .et-offset { display: none; } }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .et-grid {
    grid-template-columns: 1fr;
  }
  .et-row,
  .et-row-reverse {
    flex-direction: column;
  }
  .et-row-image {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
}

/* ── The stand-in when an event has no artwork ────────────────────────────
 *
 * Centred in its box, and sized against the box rather than the viewport
 * so a card in a three-up grid and a full-width linear row both read
 * sensibly. Replaced automatically the moment
 * modules/frontend/static/img/site-logo.png exists -- see
 * event/handlers/presentation.go.
 */
.et-wordmark {
  font-size: clamp(11px, 1.6vw, 16px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  text-align: center;
  padding: 0 14px;
  max-width: 100%;
  background: linear-gradient(135deg, #fff 0%, #8a8a8a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
