/**
 * eFiling Calendar (MU) — Component Stylesheet
 *
 * Everything is namespaced under .efc or .efc-single to avoid clashing with
 * the WordPress theme. Do not use bare element selectors at the top level.
 *
 * Section map:
 *   1. Base container
 *   2. Buttons
 *   3. Loading / Error states
 *   4. Search bar + tabs
 *   5. Toolbar (prev / title / next)
 *   6. Month picker dropdown
 *   7. Month grid view
 *   8. Event bubbles + hover preview card
 *   9. List view
 *  10. Day view
 *  11. Latest Past Events strip
 *  12. Single event page (.efc-single)
 *  13. Responsive overrides (≤720px)
 */

/* =============================================================================
   1. BASE CONTAINER
   ============================================================================= */

/**
 * The outermost wrapper output by the [efiling_calendar] shortcode.
 * Uses border-radius and background set by admin theme (output_theme_css in PHP).
 * overflow:visible allows the month-picker dropdown to escape the container.
 */
.efc {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  overflow: visible;
}

/* Apply border-box sizing to all children to prevent layout blowout. */
.efc *,
.efc *::before,
.efc *::after {
  box-sizing: border-box;
}

/**
 * The body wraps the loading indicator, error message, and view panels.
 * overflow-x:hidden clips horizontal bleed; overflow-y:visible allows
 * hover-cards on the bottom week row to extend beyond the container.
 */
.efc__body {
  overflow-x: hidden;
  overflow-y: visible;
}

/* =============================================================================
   2. BUTTONS
   ============================================================================= */

/**
 * Base button reset — applied to all interactive controls inside the calendar.
 * Overridden by modifier classes (.efc__btn--ghost, --primary, --tab).
 */
.efc__btn {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, .14);
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  user-select: none;
}
.efc__btn:hover  { background: rgba(0, 0, 0, .03); }
.efc__btn:active { transform: translateY(1px); }

/** Ghost variant: transparent border and background (used for nav arrows). */
.efc__btn--ghost {
  border-color: transparent;
  background: transparent;
}

/**
 * ── ACCESSIBILITY: Ghost buttons ─────────────────────────────────────────────
 * Remove cosmetic hover/active backgrounds (ghost buttons look intentionally
 * invisible against the toolbar), but KEEP a visible focus ring on :focus-visible
 * so keyboard users always see which arrow they have focused.
 * WCAG 2.4.7 Focus Visible / 2.4.11 Focus Appearance (2.2)
 */
.efc .efc__btn--ghost,
.efc .efc__btn--ghost:hover,
.efc .efc__btn--ghost:active {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* Reset any browser default outline so our custom ring is the only one shown. */
.efc .efc__btn--ghost:focus {
  outline: none;
}

/* Keyboard-only focus ring: 3 px offset ring in the accent colour. */
.efc .efc__btn--ghost:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00) !important;
  outline-offset: 2px !important;
  border-radius: 6px !important;
}

/** Primary variant: uses accent color from admin theme settings. */
.efc__btn--primary {
  border-color: rgba(0, 0, 0, .14);
  background: var(--efc-accent, #3f4b00);
  color: #fff;
}
.efc__btn--primary:hover {
  background: #fff;
  border-color: var(--efc-accent, #3f4b00);
  color: var(--efc-accent, #3f4b00); /* invert: white bg + dark-green text on hover */
}

/**
 * Tab variant: used for the List / Month / Day view switcher.
 * Underline-style active indicator instead of a pill background.
 */
.efc__btn--tab {
  background: transparent;
  border: none;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--efc-accent, #3f4b00);
  cursor: pointer;
}
.efc__btn--tab:hover,
.efc__btn--tab:active {
  background: transparent;
}
/* ── ACCESSIBILITY: Tab focus ring ──────────────────────────────────────────
 * Tab buttons only show an active underline (no pill). Remove browser default
 * outline on mouse click (:focus) but restore a custom ring on keyboard nav.
 * WCAG 2.4.7 Focus Visible
 */
.efc__btn--tab:focus {
  outline: none;
  box-shadow: none;
}
.efc__btn--tab:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Active tab: bold text + accent-colored underline bar. */
.efc__view .is-active {
  position: relative;
  color: var(--efc-accent, #3f4b00);
  font-weight: 700;
}
.efc__view .is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 3px;
  background: var(--efc-accent, #3f4b00);
  border-radius: 2px;
}

/* Suppress active tab background applied by admin theme override. */
.efc [data-efc-view].is-active { background: transparent !important; }

/* =============================================================================
   3. LOADING / ERROR STATES
   ============================================================================= */

.efc__loading,
.efc__error {
  padding: 10px 12px;
  font-size: .95rem;
}

.efc__error { color: #b00020; }

/* =============================================================================
   3b. INTRO SECTION (.efc-intro)
   Fully isolated container — shares no styles with .efc or .efc__top.
   ============================================================================= */

.efc-intro {
  all: unset;
  display: block;
  margin: 0 0 24px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.efc-intro__subtitle {
  margin: 0 0 14px;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
  border: none;
  background: none;
}

.efc-intro__divider {
  border: none;
  border-top: 2px solid var(--efc-accent, #3f4b00);
  margin: 0 0 24px;
  padding: 0;
  background: none;
}

.efc-intro__disclaimer {
  margin: 0;
  padding: 0 0 0 20px;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--efc-accent, #3f4b00);
  border: none;
  background: none;
  box-shadow: none;
}
.efc-intro__disclaimer p {
  margin: 0 0 8px;
}
.efc-intro__disclaimer p:last-child {
  margin-bottom: 0;
}

/* =============================================================================
   4. SEARCH BAR + TABS
   ============================================================================= */

/**
 * .efc__top wraps the search bar row and the toolbar row.
 * Background is transparent to let the page/card background show through.
 */
.efc__top { background: transparent; }

/**
 * Search bar row: contains search input, clear button, "Find Events" button,
 * and the List/Month/Day tab switcher.
 */
.efc__searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--efc-border, #dcdcdc);
  border-bottom: none;  /* toolbar row sits directly below, shares the border */
  border-radius: var(--efc-radius, 10px) var(--efc-radius, 10px) 0 0;
  background: #fff;
}

/**
 * Search input wrapper — flex:1 makes it expand to fill remaining space.
 * position:relative anchors the clear (×) button inside it.
 */
.efc__search {
  position: relative;
  flex: 1;
}

/** Suppress any ::before pseudo-element (some themes add a magnifying-glass icon). */
.efc__search::before {
  content: none !important;
  display: none !important;
}

/** Full-width text input with left padding for the future icon area. */
.efc__search-input {
  width: 100%;
  /* Right padding accounts for the mic + clear buttons */
  padding: 10px 76px 10px 40px;
  border: 1px solid var(--efc-border, #dcdcdc);
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  /* ── ACCESSIBILITY: Do not suppress the outline globally ──────────────────
   * Using outline:none on all states hides the focus ring for keyboard/AT
   * users. Only suppress it on mouse focus; show a ring on :focus-visible.
   * WCAG 2.4.7 Focus Visible
   */
  outline: none;  /* base reset — :focus-visible below restores it */
}
/* Mouse/pointer focus: keep a subtle glow so the field still feels "active". */
.efc__search-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .08);
}
/* Keyboard focus: solid, high-contrast ring that satisfies WCAG 2.4.11. */
.efc__search-input:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 1px;
  box-shadow: none;
}

.efc__voice-btn {
  position: absolute;
  right: 46px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  opacity: .75;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.efc__voice-btn:hover { opacity: .95; }
.efc__voice-btn.is-listening { opacity: .55; }
.efc__voice-btn[hidden] { display: none !important; }

/* ── ACCESSIBILITY: Voice button focus ring ───────────────────────────────── */
.efc__voice-btn:focus { outline: none; }
.efc__voice-btn:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
}

.efc__voice-ico {
  width: 18px;
  height: 18px;
}

/**
 * Clear (×) button: absolutely positioned at the right edge of the input.
 * Transparent by default; appears on hover via opacity.
 */
.efc__search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  opacity: .6;
  cursor: pointer;
}
.efc__search-clear:hover { opacity: .85; }

/* ── ACCESSIBILITY: Clear button focus ring ──────────────────────────────── */
.efc__search-clear:focus { outline: none; }
.efc__search-clear:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
}

/** "Find Events" button styling. */
.efc__search-submit {
  padding: 10px 18px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}

/** Tab group separator: visual divider between "Find Events" and the view tabs. */
.efc__view--tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-left: 1px solid var(--efc-border, #dcdcdc);
  margin-left: 6px;
  padding-left: 6px;
}

/** Padding on tabs creates space between text and the active underline. */
.efc__view .efc__btn {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 8px 10px 28px; /* extra bottom padding = gap above underline */
}

/* =============================================================================
   5. TOOLBAR (PREV / TITLE / NEXT)
   ============================================================================= */

/**
 * Navigation toolbar: prev arrow | month title + picker | next arrow.
 * Uses flex (not grid) so the title is naturally centered between fixed-width arrows.
 * NOTE: No !important here — admin theme CSS (output_theme_css in PHP) overrides
 * this default with the saved toolbar_bg / toolbar_text values.
 */
.efc__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
  color: #111;
}

/** Arrow nav buttons use the accent color for the SVG icon. */
.efc__arrow {
  padding: 10px 14px;
  font-size: 28px;
  color: var(--efc-accent, #3f4b00);
}

/** Navigation PNG images sized to match the surrounding text. */
.efc__navimg {
  width: 24px;
  height: 24px;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/**
 * Title button wrapper allows the picker to be positioned relative to it.
 */
.efc__titlewrap { position: relative; }

/**
 * The clickable month/year title button.
 * Styled as large bold text with no pill/bubble — remove state backgrounds.
 *
 * ── ACCESSIBILITY: Focus ring ───────────────────────────────────────────────
 * Background/shadow stay transparent for visual cleanliness, but :focus-visible
 * gets a clearly visible ring so keyboard users know what is focused.
 * WCAG 2.4.7 Focus Visible
 */
.efc__titlebtn,
.efc__titlebtn:hover,
.efc__titlebtn:active,
.efc__titlebtn:focus {
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  border-color: transparent !important;
  border: none;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Keyboard-only focus ring on the title/picker toggle button. */
.efc__titlebtn:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00) !important;
  outline-offset: 3px !important;
  border-radius: 6px !important;
}

.efc__title {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

/** Chevron down icon beside the month title. */
.efc__chev     { font-size: 18px; opacity: .7; }
.efc__chevdown { width: 14px; height: 10px; display: inline-block; vertical-align: middle; }
.efc__chevsvg  { width: 10px; height: 16px; display: block; }

/* =============================================================================
   6. MONTH PICKER DROPDOWN
   ============================================================================= */

/**
 * Dropdown panel anchored below the title button.
 * z-index:50 keeps it above grid cells but below site-level overlays.
 * Uses CSS custom property --efc-accent for color theming.
 */
.efc__picker {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  background: #fff;
  border: 1px solid var(--efc-border, #dcdcdc);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .12);
  padding: 14px;
  z-index: 50;
  color: var(--efc-accent, #3f4b00);
}

/** Picker header row: prev-year chevron | year number | next-year chevron. */
.efc__picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.efc__picker-year {
  font-weight: 700;
  color: var(--efc-accent, #3f4b00);
}

/** 4-column grid of month buttons (Jan–Dec). */
.efc__picker-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/** Individual month button: transparent border by default, accent on hover. */
.efc__picker-month {
  border: 1px solid transparent;
  background: #fff;
  border-radius: 6px;
  padding: 10px 8px;
  cursor: pointer;
  color: var(--efc-accent, #3f4b00);
}
.efc__picker-month:hover {
  border-color: var(--efc-accent, #3f4b00);
}
.efc__picker-month.is-selected,
.efc__picker-month:active {
  background: var(--efc-accent, #3f4b00);
  color: #fff;
  border-color: var(--efc-accent, #3f4b00);
}

/* ── ACCESSIBILITY: Month picker button focus ring ────────────────────────── */
.efc__picker-month:focus { outline: none; }
.efc__picker-month:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
}

/* =============================================================================
   7. MONTH GRID VIEW — week-row architecture
   ============================================================================= */

.efc__month { width: 100%; }

/**
 * Outer grid wrapper.
 * Each child is a .efc__week-row — NOT a flat 42-cell CSS grid.
 */
.efc__grid {
  border-top: 1px solid rgba(0, 0, 0, .08);
  container-type: inline-size;   /* enables cqi units for uniform row height */
}

/** Day-of-week header row (Mon Tue … Sun). */
.efc__dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(0, 0, 0, .03);
  border-top: 1px solid rgba(0, 0, 0, .08);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.efc__dow div {
  padding: 8px;
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
}

/**
 * One row of 7 days + its event bars.
 * Uses flex-column so the day-numbers strip and the events strip stack
 * vertically and the row height expands naturally with event count.
 */
.efc__week-row {
  display: flex;
  flex-direction: column;
  height: calc(100cqi / 7);     /* row height = column width → each day is a square */
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  position: relative;
  overflow: visible;
  z-index: 0;
}
/* Raise the whole row when hovered so its hovercard clears ALL subsequent rows */
.efc__week-row:hover,
.efc__week-row:focus-within { z-index: 1000; }
.efc__week-row:last-child { border-bottom: none; }

/** 7-column grid holding the date-number cells. */
.efc__week-daynums {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/**
 * Individual day-number cell — shows the date and "Today" badge.
 * Does NOT contain event bubbles.
 */
.efc__day-cell {
  padding: 6px 8px 4px;
  border-right: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
}
.efc__day-cell:last-child { border-right: none; }
.efc__day-cell--muted {
  background: rgba(0, 0, 0, .02);
  color: rgba(0, 0, 0, .55);
}
.efc__day-cell--today strong {
  color: var(--efc-accent, #3f4b00);
}

/** Day number layout (number left, "Today" badge right). */
.efc__daynum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.efc__daynum strong { font-size: .95rem; }

/** "Today" badge. */
.efc__badge {
  font-size: .72rem;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
}

/**
 * Event layer for a week row.
 *
 * KEY ELEMENT — this is a 7-column CSS Grid.
 * Each event <a> uses  grid-column: start / span N  so it genuinely spans
 * multiple columns inside a single DOM element, no hacks needed.
 *
 * flex:1 + min-height:0 lets this layer absorb the remaining height in the
 * week-row after the day-numbers strip. grid-template-rows distributes that
 * height equally among 3 event slots (matching MAX_SLOTS in JS).
 * overflow:visible lets hover-cards escape the layer boundary.
 */
.efc__week-events {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(2, 1fr) 18px; /* 2 equal event slots + fixed overflow row */
  padding: 3px 0 5px;
  flex: 1;                               /* absorb remaining height after day-numbers */
  min-height: 0;                         /* allow shrinking to fit row */
  overflow: visible;
  position: relative;
  /* 6 vertical column-separator lines matching .efc__day-cell border-right positions */
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.08)),
    linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.08)),
    linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.08)),
    linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.08)),
    linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.08)),
    linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.08));
  background-repeat: no-repeat;
  background-size: 1px 100%;
  background-position:
    calc(1 * 100% / 7) 0,
    calc(2 * 100% / 7) 0,
    calc(3 * 100% / 7) 0,
    calc(4 * 100% / 7) 0,
    calc(5 * 100% / 7) 0,
    calc(6 * 100% / 7) 0;
}

/* =============================================================================
   8. EVENT BUBBLES + HOVER PREVIEW CARD
   ============================================================================= */

/** Stacking container used in list / day views. */
.efc__events { display: grid; gap: 6px; }

/**
 * Base event bubble — list view and day view.
 * position:relative anchors the hover card.
 * padding gives the title + meta text breathing room inside the border.
 */
.efc__event,
.efc__event:hover,
.efc__event:focus {
  display: block;
  position: relative;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .10);
  padding: 10px 12px;
  text-decoration: none !important;
  color: inherit;
  background: rgba(0, 0, 0, .02);
}
.efc__event:hover { background: rgba(0, 0, 0, .05); }
.efc__event * { text-decoration: none !important; }

/**
 * .efc__event--bar  — spanning pill used in the month grid.
 *
 * IMPORTANT: overflow must be VISIBLE here so the absolutely-positioned
 * hovercard can escape. Text clipping is handled by .efc__event-bar-inner.
 */
.efc__event--bar {
  display: block;
  position: relative;   /* anchor for hovercard */
  padding: 0;
  border-radius: 6px;
  margin: 2px 3px;
  overflow: visible;    /* ← must NOT be hidden — hovercard lives here */
  min-width: 0;         /* override min-width:auto → min-content grid default;
                           without this the bar expands to the full text width
                           and bleeds into adjacent day columns */
  cursor: pointer;
  z-index: 1;
  min-height: 0;        /* scale with grid row, not a fixed size */
}
/* Override .efc__event:hover (0-2-0) which would inject padding into bars.
   These selectors also have 0-2-0 specificity but appear later, so they win.
   Also raise above sibling bars so the hovercard is never obscured. */
.efc__event--bar:hover,
.efc__event--bar:focus,
.efc__event--bar:focus-within {
  padding: 0;
  z-index: 100;
}

/**
 * Inner text wrapper — clips the time + title text without clipping
 * the hovercard which is a sibling, not a child, of this element.
 */
.efc__event-bar-inner {
  overflow: hidden;
  white-space: nowrap;
  padding: 4px 8px;
  height: 100%;
  border-radius: inherit;
}

/** Continues from the previous week row — no left radius, flush left edge. */
.efc__event--bar.efc__event--bar-open-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: 0;
}
.efc__event--bar.efc__event--bar-open-left .efc__event-bar-inner {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/** Continues into the next week row — no right radius, flush right edge. */
.efc__event--bar.efc__event--bar-open-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: 0;
}
.efc__event--bar.efc__event--bar-open-right .efc__event-bar-inner {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* =============================================================================
   A11Y — ACCESSIBILITY ENHANCEMENTS
   (Grouped here so all accessibility rules are easy to find and audit)

   Covers:
   a) Keyboard-navigable day cells in the month grid
   b) Overflow "+N more" as a keyboard-accessible button
   c) Active tab aria-selected indicator (screen-reader support)
   d) Skip-link support (if the theme provides one)
   e) prefers-reduced-motion: disable non-essential animations
   ============================================================================= */

/**
 * (a) Day cells — keyboard navigation target.
 * PHP/JS adds tabindex="0" and role="button" to each date number when the
 * Day view is available. These styles give it visible click/focus affordance.
 */
.efc__daynum-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  line-height: 1;
  border-radius: 4px;
}
.efc__daynum-btn:focus { outline: none; }
.efc__daynum-btn:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
}

/**
 * (b) "+N more" overflow — rendered as a <button> so it is reachable
 * by keyboard and announced as interactive by screen readers.
 */
.efc__event-overflow {
  font-size: .75rem;
  opacity: .7;
  padding: 2px 6px;
  align-self: center;
  white-space: nowrap;
  /* Make it a visible button, not just text */
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.efc__event-overflow:hover { opacity: 1; text-decoration: underline; }
.efc__event-overflow:focus { outline: none; }
.efc__event-overflow:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
  border-radius: 3px;
}

/**
 * (c) Event link focus ring — event bubbles in list/day views need focus
 * visibility when keyboard users tab through them.
 */
.efc__event:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
}

/**
 * Event bar (month grid pill) focus ring.
 */
.efc__event--bar:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
}

/**
 * (d) Ensure the standard WordPress `.screen-reader-text` class works
 * inside the calendar wrapper (some themes may reset it).
 */
.efc .screen-reader-text,
.efc-single .screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/**
 * (e) Respect the OS "reduce motion" preference.
 * Disables CSS transitions/animations for users who find motion problematic.
 * WCAG 2.3.3 Animation from Interactions (AAA — but still good practice).
 */
@media (prefers-reduced-motion: reduce) {
  .efc *,
  .efc *::before,
  .efc *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
    scroll-behavior: auto !important;
  }
}



.efc__event-title {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* .efc__event--bar .efc__event-title inherits all three truncation rules from
   .efc__event-title above — no override needed here. */

.efc__event-time {
  font-size: .75rem;
  opacity: .85;
  margin-top: 0;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
}

/**
 * Hover preview card.
 * The <a> bar has position:relative, so top:100% places this just below it.
 * z-index:9999 ensures it floats above all grid/week-row layers.
 * white-space:normal overrides the inner wrapper's nowrap.
 * Explicit color + background resets prevent the bar's theme colors bleeding in.
 */
.efc__hovercard {
  display: none !important;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  width: 300px;
  max-width: 360px;
  background: #fff !important;
  color: #333 !important;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  z-index: 99999;
  white-space: normal;
  overflow: visible;
  pointer-events: auto;
}

.efc__event:hover > .efc__hovercard,
.efc__event:focus > .efc__hovercard,
.efc__event:focus-within > .efc__hovercard,
.efc__event--bar:hover > .efc__hovercard,
.efc__event--bar:focus > .efc__hovercard,
.efc__event--bar:focus-within > .efc__hovercard {
  display: block !important;
}

/* Last week row: flip hovercard ABOVE the bar so it never causes page scrolling */
.efc__week-row:last-child .efc__hovercard {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 6px;
}

/* Keep bar inner content visible on hover */
.efc__event--bar:hover .efc__event-bar-inner,
.efc__event--bar:hover .efc__event-title,
.efc__event--bar:hover .efc__event-time { visibility: visible !important; opacity: 1 !important; }

/* Force hovercard sub-element colors to beat inline PHP overrides */
.efc__hovercard .efc__hovercard-when,
.efc__event .efc__hovercard .efc__hovercard-when { color: #6b7262 !important; }
.efc__hovercard .efc__hovercard-title,
.efc__event .efc__hovercard .efc__hovercard-title { color: #4a5600 !important; }
.efc__hovercard .efc__hovercard-desc,
.efc__event .efc__hovercard .efc__hovercard-desc { color: #6b7262 !important; }

.efc__hovercard-when {
  font-size: 12px;
  /* ── ACCESSIBILITY: #9fa695 only reaches ~3.5:1 contrast against white.
   * WCAG 1.4.3 requires 4.5:1 for normal text. Using #6b7262 (~4.6:1) instead. */
  color: #6b7262;
  margin-bottom: 8px;
}

.efc__hovercard-title {
  font-size: 15px;
  font-weight: 700;
  /* ── ACCESSIBILITY: Use a darker shade of the brand green so the title
   * hits the 4.5:1 ratio against the white card background (#4a5600 = ~6.8:1). */
  color: #4a5600;
  line-height: 1.25;
  margin-bottom: 8px;
}

.efc__hovercard-desc {
  font-size: 13px;
  line-height: 1.35;
  /* ── ACCESSIBILITY: Replaces #9fa695 (fails) with #6b7262 (~4.6:1). */
  color: #6b7262;
}

.efc__hovercard-more {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}

/* =============================================================================
   9. LIST VIEW
   ============================================================================= */

.efc__list {
  padding: 8px 12px 14px;
}

.efc__list-item {
  display: grid;
  gap: 8px;      /* was 2px — date header and bubble now have visible separation */
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.efc__list-item:last-child { border-bottom: none; }

.efc__list-date { font-weight: 700; }
.efc__list-meta { font-size: .9rem; opacity: .75; }
.efc__list-when { font-size: .9rem; opacity: .85; margin-top: 2px; }

/* =============================================================================
   10. DAY VIEW
   Modelled after The Events Calendar (Tribe) Day-view layout:
   time-separator headings, rich event cards with date/time/venue/description,
   and Previous Day / Next Day bottom navigation.
   ============================================================================= */

/* Container for all day-view event content. */
.efc__day-events {
  padding: 0 16px 24px;
}

/* ── Time separator heading ────────────────────────────────────────────────
 * Horizontal rule with time label (e.g. "9:00 am") matching the TEC style.
 */
.efc__day-time-separator {
  padding: 24px 0 12px;
  border-bottom: 2px solid var(--efc-accent, #3f4b00);
  margin-bottom: 20px;
}
.efc__day-time-heading {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #111;
}
.efc__day-time-heading time {
  font-weight: 400;
}

/* ── Event card (article) ──────────────────────────────────────────────────
 * Each event is a self-contained card with header (title, datetime, venue)
 * and optional description, matching the TEC day-view detail layout.
 */
.efc__day-event {
  padding: 16px 0 24px 24px;
  position: relative;
}
.efc__day-event + .efc__day-event {
  border-top: 1px solid rgba(0, 0, 0, .08);
}

.efc__day-event-content {
  width: 100%;
}

.efc__day-event-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.efc__day-event-header {
  display: flex;
  flex-direction: column;
}

/* Event title */
.efc__day-event-title {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
  order: 2;
}
.efc__day-event-title-link {
  color: var(--efc-accent, #3f4b00);
  text-decoration: none !important;
  border-bottom: none !important;
}
.efc__day-event-title-link:hover,
.efc__day-event-title-link:focus {
  text-decoration: underline !important;
  color: var(--efc-accent, #3f4b00);
}
.efc__day-event-title-link:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
}

/* Date/time range — shown above the title */
.efc__day-event-datetime-wrapper {
  font-size: 14px;
  line-height: 21px;
  color: #555;
  margin-bottom: 6px;
  order: 1;
}
.efc__day-event-datetime {
  font-style: normal;
}

/* Venue / location */
.efc__day-event-venue {
  font-size: 14px;
  line-height: 21px;
  color: #555;
  font-style: normal;
  margin-top: 6px;
  order: 3;
}
.efc__day-event-venue-title {
  font-weight: 700;
  color: #333;
}
.efc__day-event-venue-address {
  margin-left: 4px;
}

/* Event description */
.efc__day-event-description {
  font-size: 14px;
  line-height: 21px;
  color: #555;
  margin-top: 12px;
  order: 4;
}

/* ── Empty state ───────────────────────────────────────────────────────────
 * "No events scheduled" message with calendar icon and jump link.
 */
.efc__day-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f2f3f3;
  border: 1px solid #e2e6e6;
  border-radius: 6px;
  margin: 12px 16px;
  color: #111;
}

.efc__day-message-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
}
.efc__day-message-icon svg { width: 24px; height: 24px; }

.efc__day-message-text { line-height: 1.4; }

.efc__day-message-link {
  color: var(--efc-accent, #4b5b14);
  text-decoration: underline;
}

/* ── Previous Day / Next Day bottom navigation ─────────────────────────────
 * Full-width bar with prev on the left and next on the right,
 * matching TEC's day-nav pattern.
 */
.efc__day-nav {
  padding: 24px 16px;
  border-top: 1px solid rgba(0, 0, 0, .08);
  margin-top: 24px;
}
.efc__day-nav-list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.efc__day-nav-item {
  margin: 0;
  padding: 0;
}
.efc__day-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 8px 4px;
  font-size: 16px;
  line-height: 24px;
  color: var(--efc-accent, #3f4b00);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.efc__day-nav-btn:hover {
  color: #111;
}
.efc__day-nav-btn:focus {
  outline: none;
}
.efc__day-nav-btn:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
  border-radius: 4px;
}
.efc__day-nav-icon {
  width: 10px;
  height: 16px;
  fill: currentColor;
}

/* ── Responsive: day view ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .efc__day-events {
    padding: 0 12px 16px;
  }
  .efc__day-event {
    padding-left: 0;
  }
  .efc__day-event-title {
    font-size: 17px;
  }
  .efc__day-nav {
    padding: 16px 12px;
  }
  .efc__day-nav-btn {
    font-size: 14px;
  }
}

/* =============================================================================
   11. LATEST PAST EVENTS STRIP  (efc__lpe-* namespace)
   =============================================================================

   Previously this section used TEC (The Events Calendar) class names directly
   in the HTML, relying on TEC's own stylesheet for layout. TEC's CSS contains
   date-grouping rules that hide the title/content of rows 2+ when consecutive
   events share the same start date — breaking this section whenever 2 or more
   of the 3 most-recent past events land on the same day.

   The HTML now uses only efc__lpe-* classes (our own namespace). TEC has no
   rules targeting these names, so its stylesheet cannot interfere regardless
   of TEC version. All styles needed are self-contained below.
   ============================================================================= */

/* Outer wrapper — pushed down from the calendar with a top margin. */
.efc__latest-past {
  margin-top: 28px;
}

/* Section heading ("Latest Past Events"). */
.efc__lpe-heading {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Vertical list of event rows — plain block layout, no flex/grid on the
   container so each row is always its own line regardless of external CSS. */
.efc__lpe-list {
  display: block;
}

/* One event row: date-badge on the left, content on the right.
   Uses flex so the badge has a fixed width and the content fills the rest. */
.efc__lpe-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
}
.efc__lpe-row:first-of-type {
  border-top: none;
}

/* Left column: stacked month / day / year badge. */
.efc__lpe-badge {
  flex: 0 0 52px;       /* fixed width — never shrinks */
  text-align: center;
  line-height: 1;
}

.efc__lpe-badge-month {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #555;
}

.efc__lpe-badge-day {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.05;
  color: #111;
}

.efc__lpe-badge-year {
  display: block;
  font-size: 11px;
  color: #777;
}

/* Right column: human date string + linked event title. */
.efc__lpe-content {
  flex: 1;
  min-width: 0;   /* prevents flex child from overflowing long titles */
}

/* Human-readable date range (e.g. "February 19" or "February 19 – March 2"). */
.efc__lpe-when {
  font-size: .875rem;
  color: #555;
  margin-bottom: 4px;
}

/* Event title heading — reset margin/size so it fits inline with the row. */
.efc__lpe-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Event title link. */
.efc__lpe-link {
  color: var(--efc-accent, #3f4b00);
  text-decoration: none;
}
.efc__lpe-link:hover,
.efc__lpe-link:focus-visible {
  text-decoration: underline;
}
.efc__lpe-link:focus { outline: none; }
.efc__lpe-link:focus-visible {
  outline: 3px solid var(--efc-accent, #3f4b00);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =============================================================================
   12. HOMEPAGE UPCOMING WIDGET (.efc-upcoming)
   ============================================================================= */

.efc-upcoming {
  max-width: 100%;
}

.efc-upcoming__heading {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--efc-accent, #3f4b00);
  margin: 0 0 8px;
}

.efc-upcoming__divider {
  border: none;
  border-top: 3px solid var(--efc-accent, #3f4b00);
  margin: 0 0 24px;
}

.efc-upcoming__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.efc-upcoming__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.efc-upcoming__badge {
  flex: 0 0 auto;
  text-align: center;
  min-width: 48px;
}

.efc-upcoming__badge-month {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  text-transform: capitalize;
  color: #555;
  line-height: 1.2;
}

.efc-upcoming__badge-day {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: #222;
}

.efc-upcoming__detail {
  flex: 1 1 0%;
  min-width: 0;
}

.efc-upcoming__time {
  display: block;
  font-size: .82rem;
  color: #555;
  margin-bottom: 4px;
}

.efc-upcoming__bar {
  display: block;
  padding: 12px 16px;
  border-radius: 4px;
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity .15s ease;
}
.efc-upcoming__bar:hover,
.efc-upcoming__bar:focus-visible {
  opacity: .88;
  text-decoration: none;
  color: #fff;
}

/* Category colors — match the main calendar's palette. */
.efc-upcoming__bar--hearing  { background-color: var(--efc-cat-hearing, #3F4B00); }
.efc-upcoming__bar--info     { background-color: var(--efc-cat-info, #4B5962); }
.efc-upcoming__bar--closures { background-color: var(--efc-cat-closures, #022634); }

.efc-upcoming__empty {
  color: #777;
  font-style: italic;
  padding: 16px 0;
}

.efc-upcoming__footer {
  margin-top: 28px;
}

.efc-upcoming__view-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  background: #e8e8e8;
  color: #222;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  box-sizing: border-box;
  transition: background .15s ease;
}
.efc-upcoming__view-btn:hover,
.efc-upcoming__view-btn:focus-visible {
  background: #d5d5d5;
  text-decoration: none;
  color: #222;
}

/* =============================================================================
   13. SINGLE EVENT PAGE (.efc-single)
   ============================================================================= */

/** Applied to the <main> element of virtual event detail pages. */
.efc-single__wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px 16px 40px;
}

.efc-single__title   { margin: 0 0 8px; }
.efc-single__meta    { display: flex; flex-wrap: wrap; gap: 6px; opacity: .85; }
.efc-single__meta-item { white-space: nowrap; }
.efc-single__section { margin-top: 18px; }
.efc-single__h2      { margin: 0 0 8px; font-size: 1.1rem; }
.efc-single__nav     { margin-top: 18px; }

/**
 * ── Standalone fallbacks ──────────────────────────────────────────────────────
 * The single-event page HTML reuses utility/layout classes that were originally
 * provided by the theme or The Events Calendar PRO plugin. When that plugin is
 * uninstalled these classes lose their definitions and the page breaks.
 *
 * The rules below are scoped under .efc-single so they only apply to our
 * event detail page and cannot leak into the rest of the site. They act as
 * fallbacks: if the theme already defines these classes the theme wins by
 * normal cascade/specificity; if not, these ensure the page still renders.
 */

/* -- Layout container -- */
.efc-single .container {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* -- Breadcrumb bar -- */
.efc-single .breadcrumb_top {
  padding: 20px 0 10px;
}
.efc-single .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.efc-single .breadcrumb-item {
  display: inline;
}
.efc-single .breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding: 0 8px;
  color: rgba(0,0,0,.45);
}
.efc-single .breadcrumb-item a { text-decoration: none; }
.efc-single .breadcrumb-head {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
}

/* -- Section background -- */
.efc-single .calendarevent-section { background: #f5f5f5; }
.efc-single .theme-text { color: inherit; }

/* -- Flex / spacing utilities -- */
.efc-single .d-flex       { display: flex; }
.efc-single .flex-column   { flex-direction: column; }
.efc-single .bg-white      { background: #fff; }
.efc-single .mt-0  { margin-top: 0; }
.efc-single .mb-0  { margin-bottom: 0; }
.efc-single .mb-12 { margin-bottom: 12px; }
.efc-single .mb-16 { margin-bottom: 16px; }
.efc-single .mb-24 { margin-bottom: 24px; }
.efc-single .pt-24 { padding-top: 24px; }
.efc-single .pb-32 { padding-bottom: 32px; }
.efc-single .p-16  { padding: 16px; }

/* -- Two-column event layout -- */
.efc-single .events-tabbing {
  gap: 24px;
}
.efc-single .tab-left {
  flex: 1 1 0%;
  min-width: 0;
}
.efc-single .tab-right {
  flex: 0 0 320px;
  max-width: 320px;
}
.efc-single .tab-left-inner,
.efc-single .tab-right-inner {
  border-radius: 8px;
}

/* -- Common padding / shadow (the theme misspells "common" as "commom") -- */
.efc-single .commom-pd     { padding: 24px; }
.efc-single .commom-shadow { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.efc-single .shadow-top    { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* -- Typography -- */
.efc-single .font-md    { font-size: .875rem; }
.efc-single .xs-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

/* -- Event details table -- */
.efc-single .custom-table {
  width: 100%;
  border-collapse: collapse;
}
.efc-single .custom-table th,
.efc-single .custom-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  text-align: left;
  vertical-align: top;
}
.efc-single .custom-table th {
  font-weight: 600;
  white-space: nowrap;
  width: 140px;
}
.efc-single .table-fixed { table-layout: fixed; }

/* -- Mobile / desktop time rows -- */
.efc-single .desktop_time_event { display: block; }
.efc-single .mobile_time_event  { display: none; }

/* -- Buttons -- */
.efc-single .btn-green,
.efc-single .btn-grey {
  display: inline-block;
  text-decoration: none;
  border-radius: 6px;
}
.efc-single .btn-grey {
  border: 1px solid rgba(0, 0, 0, .12);
}
.efc-single .btn-block {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.efc-single .btn-3 {
  font-size: .95rem;
  font-weight: 500;
}

/**
 * Fix: "Other Calendar Events" button container.
 * Force it to be a full-width block so the btn-block class and
 * text-align:center work correctly.
 */
.efc-single .tab-btn {
  display: block;
  width: 100%;
  text-align: center;
}
.efc-single .tab-btn .btn-grey,
.efc-single .tab-btn .btn-block {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

/** Force "Add to Calendar" links to stack vertically on the single-event page. */
.efc-single .calendar_custom_links .tribe-events-cal-links {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}
.efc-single .calendar_custom_links .tribe-events-cal-links a {
  display: flex !important;
  width: 100% !important;
  margin-bottom: 12px !important;
  text-decoration: none;
  color: inherit;
  align-items: center;
  gap: 8px;
}

/** Calendar icon used in "Add to Calendar" buttons. */
.efc-single .efc__calicon {
  width: 25px;
  height: 18px;
  flex: 0 0 auto;
}

/* =============================================================================
   13. RESPONSIVE OVERRIDES (≤720px)
   ============================================================================= */

@media (max-width: 720px) {
  /**
   * Toolbar uses display:flex (not grid), so flex-specific properties apply.
   * Wrap items and centre them so prev/title/next stack gracefully on narrow
   * viewports without overflowing the container.
   */
  .efc__toolbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .efc__title  { text-align: left; }
  .efc__view   { justify-content: flex-start; flex-wrap: wrap; }

  /** Tighten day-of-week headers and day cells on small screens. */
  .efc__dow div      { font-size: .75rem; padding: 6px 4px; }
  .efc__day-cell     { padding: 4px 6px; }
  .efc__event-title  { font-size: .84rem; }

  /** Single event page: stack columns on mobile. */
  .efc-single .events-tabbing.d-flex { flex-direction: column; }
  .efc-single .tab-right { flex: 1 1 auto; max-width: 100%; }
  .efc-single .desktop_time_event { display: none; }
  .efc-single .mobile_time_event  { display: table-row; }
  .efc-single .commom-pd { padding: 16px; }
  .efc-single .breadcrumb-head { font-size: 1.35rem; }
}

@media (min-width: 721px) {
  .efc-single .flex-md-row { flex-direction: row; }
}

@media (max-width: 520px) {
  /** Constrain hover card width on very small viewports. */
  .efc__hovercard { width: min(320px, 90vw); }
}
