/**
 * Buchhandlung Events — Frontend Styles
 *
 * Design tokens (same as books plugin):
 *   --bhe-primary:    #202684   (navy — events section background)
 *   --bhe-secondary:  #F78DA7   (rose pink — date number, event-type label)
 *   --bhe-cream:      #FAF7F2   (event title colour)
 *   --bhe-ink-light:  #3D3D5C
 *
 * All selectors scoped under .bhe-* to avoid collisions.
 */

/* ── Root tokens ──────────────────────────────────────────────────────────── */
:root {
  --bhe-primary:   #202684;
  --bhe-secondary: #F78DA7;
  --bhe-cream:     #FAF7F2;
  --bhe-ink:       #1A1A2E;
  --bhe-ink-light: #3D3D5C;
  --bhe-rule:      rgba(32, 38, 132, 0.15);
}

/* ── Shared utilities ─────────────────────────────────────────────────────── */
.bhe-no-events,
.bh-editor-notice {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  color: var(--bhe-ink-light);
  font-style: italic;
  padding: 20px 0;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.bhe-events-wrap {
  /* Neutral by default — preset class adds navy background */
}

/* ── Navy preset (matches .section-events in the design) ─────────────────── */
.bhe-events-wrap.bhe-preset-navy {
  background: var(--bhe-primary);
  padding: 100px 80px;
  color: var(--bhe-cream);
}

/* ── Section header ───────────────────────────────────────────────────────── */
.bhe-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 56px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--bhe-rule);
}

/* Override rule colour inside the navy preset */
.bhe-preset-navy .bhe-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.bhe-section-title {
  font-family: 'Literata Garamond', 'Literata', Georgia, serif;
  font-size: 42px;
  font-weight: 300;
  color: var(--bhe-primary);
  font-style: italic;
  margin: 0;
}
.bhe-preset-navy .bhe-section-title {
  color: var(--bhe-cream);
}

.bhe-section-subtitle {
  font-family: 'Literata SC', 'Literata', Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--bhe-ink-light);
  text-transform: uppercase;
}
.bhe-preset-navy .bhe-section-subtitle {
  color: rgba(250, 247, 242, 0.5);
}

/* ── Events list ──────────────────────────────────────────────────────────── */
.bhe-events-list {
  display: flex;
  flex-direction: column;
}

/* ── Event row ────────────────────────────────────────────────────────────── */
/*
 * Grid layout — poster sits between the date column and the info column.
 *
 * Default (no poster):
 *   100px  date column
 *   1fr    info column
 *   auto   language tag
 *
 * With poster (.bhe-has-poster):
 *   100px  date column
 *   auto   poster thumbnail
 *   1fr    info column
 *   auto   language tag
 *
 * The class is added in BH_Event_Template_Helpers::render_event_row() when
 * the event has a _bhe_poster_id, so the row template can omit the poster
 * markup entirely when there isn't one without breaking the grid.
 */
.bhe-event-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: padding-left 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.bhe-event-row.bhe-has-poster {
  grid-template-columns: 100px auto 1fr auto;
}

/* When not inside the navy preset, use standard ink rule */
.bhe-events-wrap:not(.bhe-preset-navy) .bhe-event-row {
  border-bottom-color: var(--bhe-rule);
}

.bhe-event-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.bhe-events-wrap:not(.bhe-preset-navy) .bhe-event-row:first-child {
  border-top-color: var(--bhe-rule);
}

.bhe-event-row:hover {
  padding-left: 16px;
}

/* ── Date column ──────────────────────────────────────────────────────────── */
.bhe-event-date-col {}

.bhe-event-date {
  font-family: 'Literata Garamond', 'Literata', Georgia, serif;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  color: var(--bhe-secondary);
  font-style: italic;
}

.bhe-event-date-month {
  font-family: 'Literata SC', 'Literata', Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(250, 247, 242, 0.4);
  margin-top: 2px;
  text-transform: uppercase;
}
.bhe-events-wrap:not(.bhe-preset-navy) .bhe-event-date-month {
  color: var(--bhe-ink-light);
}

/* ── Info column ──────────────────────────────────────────────────────────── */
.bhe-event-type {
  font-family: 'Literata SC', 'Literata', Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--bhe-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.bhe-event-title {
  font-family: 'Literata Garamond', 'Literata', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--bhe-cream);
  font-style: italic;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bhe-events-wrap:not(.bhe-preset-navy) .bhe-event-title {
  color: var(--bhe-ink);
}

.bhe-event-desc {
  font-size: 12px;
  color: rgba(250, 247, 242, 0.5);
  margin-top: 4px;
  font-weight: 300;
  letter-spacing: 0.03em;
  font-family: 'Jost', sans-serif;
}
.bhe-events-wrap:not(.bhe-preset-navy) .bhe-event-desc {
  color: var(--bhe-ink-light);
}

/* Rich-text description (renders below the venue · address · time line) */
.bhe-event-description {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(250, 247, 242, 0.78);
  margin-top: 8px;
  font-weight: 300;
  font-family: 'Jost', sans-serif;
  max-width: 64ch;
}
.bhe-event-description p { margin: 0 0 0.6em; }
.bhe-event-description p:last-child { margin-bottom: 0; }
.bhe-event-description a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bhe-event-description a:hover { opacity: 0.8; }
.bhe-event-description strong { font-weight: 600; }
.bhe-event-description em     { font-style: italic; }
.bhe-event-description ul,
.bhe-event-description ol     { margin: 0.4em 0 0.6em 1.2em; padding: 0; }
.bhe-event-description li     { margin: 0.2em 0; }
.bhe-event-description blockquote {
  margin: 0.6em 0;
  padding-left: 12px;
  border-left: 2px solid currentColor;
  opacity: 0.85;
}

.bhe-events-wrap:not(.bhe-preset-navy) .bhe-event-description {
  color: var(--bhe-ink);
}

/* ── Status badges (inline in title) ─────────────────────────────────────── */
.bhe-status-badge {
  font-family: 'Literata SC', 'Literata', Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.15em;
  padding: 3px 8px;
  border-radius: 2px;
  vertical-align: middle;
  text-transform: uppercase;
  flex-shrink: 0;
}
.bhe-status-cancelled {
  background: rgba(180, 45, 45, 0.25);
  color: #ff9999;
  text-decoration: line-through;
}
.bhe-status-sold-out {
  background: rgba(201, 168, 76, 0.2);
  color: #C9A84C;
}

/* Cancelled row — dim the whole row */
.bhe-event-cancelled {
  opacity: 0.55;
}

/* ── Poster thumbnail (new field) ─────────────────────────────────────────── */
.bhe-event-poster-thumb {
  width: 150px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
  transition: opacity 0.3s ease;
  opacity: 0.6;
}
.bhe-event-row:hover .bhe-event-poster-thumb {
  opacity: 1;
}
.bhe-poster-img {
  width: 150px;
  height: 212px;       /* A4-like aspect ratio 1:√2 ≈ 1:1.41 → 150 × 212.1 */
  object-fit: cover;
  display: block;
}

/* ── Language tag column ──────────────────────────────────────────────────── */
.bhe-event-lang-tag {
  font-family: 'Literata SC', 'Literata', Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(250, 247, 242, 0.6);
  white-space: nowrap;
  text-transform: uppercase;
}
.bhe-events-wrap:not(.bhe-preset-navy) .bhe-event-lang-tag {
  border-color: var(--bhe-rule);
  color: var(--bhe-ink-light);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bhe-preset-navy { padding: 64px 32px; }

  .bhe-event-row {
    grid-template-columns: 72px 1fr;
    gap: 20px;
  }
  /* Hide poster and lang tag on tablet */
  .bhe-event-poster-thumb,
  .bhe-event-lang-tag { display: none; }

  .bhe-event-date  { font-size: 24px; }
  .bhe-event-title { font-size: 18px; }
}

@media (max-width: 600px) {
  .bhe-preset-navy { padding: 48px 20px; }

  .bhe-event-row {
    grid-template-columns: 56px 1fr;
    gap: 16px;
    padding: 20px 0;
  }
  .bhe-event-date  { font-size: 20px; }
  .bhe-event-title { font-size: 16px; }
  .bhe-event-desc  { font-size: 14px; }
  .bhe-section-header { flex-direction: column; gap: 8px; margin-bottom: 32px; }
  .bhe-section-title  { font-size: 32px; }
}

/* ── ═══════════════════════════════════════════════════════════════════════ ── */
/*    EVENTS ARCHIVE                                                            */
/* ── ═══════════════════════════════════════════════════════════════════════ ── */

/* ── Navy preset ─── matches the "BH: Events" upcoming widget's look ──────── */
/* Row-level styling is inherited from the shared .bhe-event-row rules above;
   only wrapper/header/year-specific styles need to be defined here.          */
.bhe-archive-wrap.bhe-preset-navy {
  background: var(--bhe-primary);
  padding: 100px 80px;
  color: var(--bhe-cream);
}
.bhe-archive-wrap.bhe-preset-navy .bhe-archive-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ── Light theme (preset off) ─── dimmed dark rows on warm off-white ─────── */
.bhe-archive-wrap:not(.bhe-preset-navy) {
  background: #FFFDF9;
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-header .bhe-section-title {
  color: var(--bhe-primary);
  font-size: 36px;
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-header .bhe-section-subtitle {
  color: var(--bhe-ink-light);
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-header {
  border-bottom-color: var(--bhe-rule);
}

/* Light-theme archive rows: ink colours, no hover slide */
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-row {
  border-bottom-color: var(--bhe-rule);
  transition: opacity 0.25s ease, padding-left 0.3s ease;
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-row:first-child {
  border-top-color: var(--bhe-rule);
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-row:hover {
  padding-left: 0; /* suppress the slide effect for archived rows */
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-date {
  color: var(--bhe-ink-light);
  font-size: 26px;
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-date-month {
  color: var(--bhe-ink-light);
  opacity: 0.6;
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-title {
  color: var(--bhe-ink);
  font-size: 20px;
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-type {
  color: var(--bhe-secondary);
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-desc {
  color: var(--bhe-ink-light);
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-list .bhe-event-lang-tag {
  border-color: var(--bhe-rule);
  color: var(--bhe-ink-light);
}

/* ── Year group heading ────────────────────────────────────────────────────── */
.bhe-archive-year-heading {
  font-family: 'Literata Garamond', 'Literata', Georgia, serif;
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.15em;
  padding: 28px 0 8px;
  border-bottom: 1px solid;
  margin-bottom: 0;
}
.bhe-archive-wrap.bhe-preset-navy .bhe-archive-year-heading {
  color: var(--bhe-secondary);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-archive-year-heading {
  color: var(--bhe-primary);
  border-bottom-color: var(--bhe-rule);
}

/* ── Year filter buttons ───────────────────────────────────────────────────── */
.bhe-archive-year-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

.bhe-year-btn {
  font-family: 'Literata SC', 'Literata', Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-decoration: none;
  padding: 5px 14px;
  border: 1px solid;
  transition: all 0.2s ease;
}

/* Navy preset — cream tones on navy background */
.bhe-archive-wrap.bhe-preset-navy .bhe-year-btn {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(250, 247, 242, 0.6);
}
.bhe-archive-wrap.bhe-preset-navy .bhe-year-btn:hover {
  border-color: var(--bhe-cream);
  color: var(--bhe-cream);
}
.bhe-archive-wrap.bhe-preset-navy .bhe-year-btn.bhe-year-active {
  background: var(--bhe-cream);
  border-color: var(--bhe-cream);
  color: var(--bhe-primary);
}

/* Light theme — ink on cream */
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-year-btn {
  border-color: var(--bhe-rule);
  color: var(--bhe-ink-light);
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-year-btn:hover {
  border-color: var(--bhe-primary);
  color: var(--bhe-primary);
}
.bhe-archive-wrap:not(.bhe-preset-navy) .bhe-year-btn.bhe-year-active {
  background: var(--bhe-primary);
  border-color: var(--bhe-primary);
  color: var(--bhe-cream);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bhe-archive-wrap.bhe-preset-navy { padding: 64px 32px; }
  .bhe-archive-list .bhe-event-row {
    grid-template-columns: 72px 1fr;
    gap: 20px;
  }
  .bhe-archive-list .bhe-event-poster-thumb,
  .bhe-archive-list .bhe-event-lang-tag { display: none; }
}

@media (max-width: 600px) {
  .bhe-archive-wrap.bhe-preset-navy { padding: 48px 20px; }
  .bhe-archive-list .bhe-event-row {
    grid-template-columns: 56px 1fr;
    gap: 16px;
    padding: 18px 0;
  }
  .bhe-archive-list .bhe-event-date  { font-size: 20px; }
  .bhe-archive-list .bhe-event-title { font-size: 16px; }
}
