/* ================================================================
   EVENTS-UPCOMING PARTIAL CSS
   ================================================================ */

/* ── HERO ────────────────────────────────────────────────────── */
.events-upcoming-hero {
  position: relative;
  height: 58vh; min-height: 400px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; overflow: hidden;
  background: linear-gradient(155deg, #141414 0%, #1e1c18 55%, #141414 100%);
}

.events-upcoming-hero svg.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/*
  Inner row: constrains content to 1100px max so text and calendar
  stay close. Text takes the left ~55%, calendar takes the right ~40%.
*/
.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1100px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.events-upcoming-hero .about-hero-content {
  flex: 1;
  max-width: 520px;
  text-align: left;
  animation: heroIn 0.85s var(--ease-out) both;
  font-family: 'Poppins', sans-serif;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

.events-upcoming-hero .eyebrow {
  display: block;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); margin-bottom: 0.9rem;
}

.events-upcoming-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.01em;
  margin-bottom: 0.9rem; color: #fff;
  font-family: 'Poppins', sans-serif;
}

.events-upcoming-hero .hero-sub {
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  font-weight: 300; color: rgba(255,255,255,0.78); line-height: 1.7;
  font-family: 'Poppins', sans-serif;
}

/* Desktop: calendar sits in the flex row — no absolute positioning */
.hero-calendar-wrap {
  flex-shrink: 0;
  width: 270px;
  /* Remove absolute positioning — it's in the flow now */
  position: relative;
  overflow: visible;
  z-index: 3;
}

/* ── CALENDAR (shared styles for both desktop widget + mobile strip) ── */
.hero-calendar {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative; /* needed for tooltip absolute positioning */
  overflow: visible;  /* CRITICAL — tooltip overflows the calendar card */
}

.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.9rem;
}

.cal-month-label {
  font-size: 0.82rem; font-weight: 600;
  color: #fff; letter-spacing: 0.04em;
  font-family: 'Poppins', sans-serif;
}

.cal-nav-btn {
  background: rgba(255,255,255,0.12); border: none;
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease; font-family: 'Poppins', sans-serif;
}
.cal-nav-btn:hover { background: rgba(255,255,255,0.25); }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; margin-bottom: 0.4rem;
}
.cal-weekdays span {
  font-size: 0.6rem; font-weight: 700;
  color: rgba(255,255,255,0.45); letter-spacing: 0.05em;
  font-family: 'Poppins', sans-serif;
}

.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: rgba(255,255,255,0.7);
  border-radius: 6px; cursor: default;
  font-family: 'Poppins', sans-serif;
  transition: background 0.2s ease; position: relative;
}
.cal-day.empty   { visibility: hidden; pointer-events: none; }
.cal-day.today   { background: rgba(255,255,255,0.2); color: #fff; font-weight: 700; }
.cal-day.has-event { color: #fff; font-weight: 600; cursor: pointer; }
.cal-day.has-event::after {
  content: ''; position: absolute; bottom: 2px;
  width: 4px; height: 4px; background: rgba(210,175,110,0.9);
  border-radius: 50%;
}
.cal-day:hover:not(.empty) { background: rgba(255,255,255,0.12); }

.cal-legend {
  display: flex; gap: 1rem; justify-content: center;
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.cal-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.62rem; color: rgba(255,255,255,0.55);
  font-family: 'Poppins', sans-serif;
}
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.cal-legend-dot.today-dot { background: rgba(255,255,255,0.4); }
.cal-legend-dot.event-dot { background: rgba(210,175,110,0.85); }

/* ── MOBILE CALENDAR SECTION ─────────────────────────────────── */
/*
  Shown below the hero on ≤900px.
  Uses a lighter surface background so it blends with the page
  rather than being another heavy dark block.
*/
.mobile-calendar-section {
  display: none;
  background: var(--surface-off);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

/* Inner wrapper centres calendar and reserves space for tooltip */
.mobile-calendar-inner {
  max-width: 400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  position: relative; /* tooltip anchors here, not on .hero-calendar */
}

/* Override calendar colours for light background */
.mobile-calendar-section .hero-calendar {
  background: #fff;
  border: 1px solid var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.mobile-calendar-section .cal-month-label { color: var(--ink); }
.mobile-calendar-section .cal-weekdays span { color: var(--ink-muted); }
.mobile-calendar-section .cal-day { color: var(--ink-soft); }
.mobile-calendar-section .cal-day.today {
  background: var(--ink); color: #fff;
}
.mobile-calendar-section .cal-day.has-event { color: var(--ink); font-weight: 700; }
.mobile-calendar-section .cal-day:hover:not(.empty) { background: var(--surface-mid); }
.mobile-calendar-section .cal-nav-btn {
  background: var(--surface-mid); color: var(--ink);
}
.mobile-calendar-section .cal-nav-btn:hover { background: var(--surface-mid); filter: brightness(0.9); }
.mobile-calendar-section .cal-legend {
  border-top: 1px solid var(--border);
}
.mobile-calendar-section .cal-legend-item { color: var(--ink-muted); }
.mobile-calendar-section .cal-legend-dot.today-dot { background: var(--ink); }

/* Mobile tooltip — anchors to .mobile-calendar-inner, appears BELOW calendar */
.mobile-calendar-section .cal-tooltip {
  position: absolute;
  top: calc(100% - 1.5rem); /* relative to .mobile-calendar-inner */
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: calc(100% - 2.5rem);
  max-width: 360px;
  animation: tipInDown 0.18s var(--ease-out) both;
  /* Ensure it sits above events body */
  z-index: 500;
}

/* ── CALENDAR TOOLTIP ────────────────────────────────────────── */
/* Desktop: to the LEFT of the calendar widget */
.cal-tooltip {
  position: absolute;
  top: 0;
  right: calc(100% + 10px);
  left: auto;
  transform: none;
  width: 240px; min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  overflow: hidden;
  animation: tipIn 0.18s var(--ease-out) both;
}

@keyframes tipIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes tipInDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.cal-tip-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0.9rem;
  background: var(--ink); color: #fff;
}
.cal-tip-date {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
}
.cal-tip-close {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0;
  transition: color 0.2s ease; font-family: inherit;
}
.cal-tip-close:hover { color: #fff; }

.cal-tip-list { list-style: none; margin: 0; padding: 0.4rem 0; }
.cal-tip-item {
  padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.cal-tip-item:last-child { border-bottom: none; }
.cal-tip-name {
  font-size: 0.83rem; font-weight: 600; color: var(--ink); line-height: 1.3;
  font-family: 'Poppins', sans-serif;
}
.cal-tip-time {
  font-size: 0.75rem; color: var(--ink-muted);
  font-family: 'Poppins', sans-serif;
}
.cal-tip-loc {
  font-size: 0.72rem; color: var(--ink-muted);
  display: flex; align-items: center; gap: 0.3rem;
  font-family: 'Poppins', sans-serif;
}
.cal-tip-loc i { font-size: 0.65rem; }

/* ── EVENTS BODY ─────────────────────────────────────────────── */
.events-body {
  max-width: 1100px; margin: 0 auto;
  padding: 3.5rem 2rem 6rem;
  background: var(--surface);
}

.events-section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 1rem; margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.events-section-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700; color: var(--ink); line-height: 1.2;
  padding-bottom: 0.7rem; position: relative;
  font-family: 'Poppins', sans-serif;
}
.events-section-title::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 36px; height: 3px; background: var(--ink); border-radius: 2px;
}

/* Search */
.events-search { position: relative; flex-shrink: 0; }
.events-search input {
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  border: 1px solid var(--border); border-radius: 50px;
  font-size: 0.88rem; color: var(--ink); background: var(--surface-off);
  outline: none; width: 200px;
  transition: border-color 0.25s ease, width 0.3s ease;
  font-family: 'Poppins', sans-serif;
}
.events-search input:focus {
  border-color: var(--ink); width: 240px;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06); background: var(--surface);
}
.events-search input::placeholder { color: var(--ink-muted); }
.events-search::before {
  content: '\f002'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); font-size: 0.78rem; pointer-events: none;
}

/* Filter pills */
.events-filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.filter-pill {
  padding: 0.42rem 1rem; border: 1px solid var(--border); border-radius: 50px;
  font-size: 0.78rem; font-weight: 500; color: var(--ink-soft);
  background: var(--surface); cursor: pointer; transition: all 0.22s ease;
  font-family: 'Poppins', sans-serif;
}
.filter-pill:hover { border-color: var(--ink); color: var(--ink); }
.filter-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── EVENT SECTIONS (big events separate from small) ─────────── */
.events-section-group {
  margin-bottom: 3rem;
}

.events-group-label {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-muted);
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.25rem;
  font-family: 'Poppins', sans-serif;
}
.events-group-label::before,
.events-group-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Big events — full width featured cards */
.event-grid-big {
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* Small events — 3-column grid */
.event-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ── BASE CARD ───────────────────────────────────────────────── */
.event-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s var(--ease-out);
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* Date band */
.event-card-date {
  background: var(--ink); color: #fff;
  padding: 1rem 1.4rem;
  display: flex; align-items: baseline; gap: 0.5rem;
}
.event-card-day {
  font-size: 2rem; font-weight: 200; line-height: 1; color: #fff;
  font-family: 'Poppins', sans-serif; font-variant-numeric: tabular-nums;
}
.event-card-month {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); font-family: 'Poppins', sans-serif;
}

/* Card body */
.event-card-body {
  padding: 1.4rem; display: flex; flex-direction: column;
}
.event-card-title {
  font-size: 1rem; font-weight: 700; color: var(--ink); line-height: 1.3;
  margin-bottom: 0.65rem; font-family: 'Poppins', sans-serif;
}
.event-card-meta {
  display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.8rem;
}
.event-card-meta-item {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; color: var(--ink-muted); font-family: 'Poppins', sans-serif;
}
.event-card-meta-item i { font-size: 0.72rem; }

.event-card-desc {
  font-size: 0.9rem; font-weight: 300;
  color: var(--ink-soft); line-height: 1.75; margin-bottom: 1rem;
  font-family: 'Poppins', sans-serif;
}

/* Time-left badge */
.time-left-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--surface-off); border: 1px solid var(--border);
  padding: 0.28rem 0.8rem; border-radius: 20px;
  font-size: 0.73rem; font-weight: 600; color: var(--ink-soft);
  font-family: 'Poppins', sans-serif; align-self: flex-start;
}
.time-left-badge.soon   { background: #fff8e6; border-color: rgba(180,130,0,0.2); color: #8a6000; }
.time-left-badge.urgent { background: #fff0f0; border-color: rgba(200,0,0,0.15);  color: #900; }

/* ── BIG CARD OVERRIDES ──────────────────────────────────────── */
.event-card.big {
  flex-direction: row;  /* horizontal layout */
}
.event-card.big .event-card-date {
  flex-direction: column; justify-content: center; align-items: center;
  min-width: 110px; padding: 1.75rem 1.25rem;
}
.event-card.big .event-card-day   { font-size: 2.8rem; }
.event-card.big .event-card-body  { padding: 1.75rem 2rem; flex: 1; }
.event-card.big .event-card-title { font-size: 1.2rem; }

/* ── EMPTY / SPINNER ─────────────────────────────────────────── */
.events-empty {
  grid-column: 1 / -1; text-align: center;
  padding: 3rem 2rem; color: var(--ink-muted);
  font-size: 1rem; font-family: 'Poppins', sans-serif;
}
.events-spinner {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem; color: var(--ink-muted); font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
}
.spinner-ring {
  width: 34px; height: 34px;
  border: 3px solid var(--surface-mid); border-top-color: var(--ink);
  border-radius: 50%; animation: spin 0.85s linear infinite; margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Load more */
.load-more-wrap { display: flex; justify-content: center; margin-top: 2.25rem; }
.load-more-btn {
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 1.9rem;
  font-size: 0.87rem; font-weight: 600; color: var(--ink);
  cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  font-family: 'Poppins', sans-serif;
}
.load-more-btn:hover {
  background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-1px);
}
.load-more-btn[hidden] { display: none; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */

/* ≤900px: stack hero vertically, show mobile calendar below */
@media (max-width: 900px) {
  .hero-calendar-wrap        { display: none; }
  .mobile-calendar-section   { display: block; }

  /* Stack text centred when calendar is gone */
  .hero-inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0;
  }
  .events-upcoming-hero .about-hero-content {
    text-align: center; max-width: 600px;
  }
  .events-upcoming-hero .eyebrow,
  .events-upcoming-hero h1,
  .events-upcoming-hero .hero-sub { text-align: center; }

  .event-card.big { flex-direction: column; }
  .event-card.big .event-card-date {
    flex-direction: row; min-width: auto; padding: 1rem 1.4rem;
  }
  .event-card.big .event-card-day { font-size: 2rem; }
}

/* ≤600px */
@media (max-width: 600px) {
  .events-upcoming-hero     { height: auto; min-height: 0; }
  .events-upcoming-hero svg.hero-bg { display: none; }
  .hero-inner               { padding: 3rem 1.25rem 2.5rem; }
  .events-body              { padding: 2.5rem 1rem 4rem; }
  .events-section-header    { flex-direction: column; align-items: flex-start; }
  .events-search            { width: 100%; }
  .events-search input      { width: 100%; }
  .event-grid-small         { grid-template-columns: 1fr; }
}

/* ≤400px */
@media (max-width: 400px) {
  .hero-inner   { padding: 2.5rem 1rem 2rem; }
  .events-body  { padding: 2rem 0.75rem 3rem; }
  .mobile-calendar-inner { padding: 1rem 0.75rem; }
}