/* ============================================================
   Organiser Plus — shared SHELL (token-only custom layout).
   Chrome lifted from the events-landing demo; every value is a
   DWTC DS token. PAGE CONTENT must use DS component classes
   (.event-card, .service-tile, .data-table, .accordion, .timeline,
    .doc-checklist, .badge, .metric, .btn, .input, .alert, …).
   See PAGE-SPEC.md.
   ============================================================ */

body {
  background: var(--bg-section);
}
.ico {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  display: inline-block;
  vertical-align: -0.125em;
}
/* medallion / gradient-pill icons must read white on the navy gradient */
.alert-medallion .ico,
.nmed .ico,
.nmeta .ico {
  stroke: #fff;
}

/* ---- Navy top bar ---- */
.ev-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(20px, 5vw, 64px);
  background: var(--marketplace-bar-bg, linear-gradient(180deg, #0d3b72, #06203f));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 12px rgba(0, 0, 0, 0.18);
}
.ev-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.ev-brand .bn {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 18px;
}
.ev-brand .bn small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--marketplace-bar-fg-muted, #bcd0ef);
}
.ev-topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 8px;
}
.ev-topbar-nav a {
  color: var(--marketplace-bar-fg-muted, #bcd0ef);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
}
.ev-topbar-nav a:hover {
  color: #fff;
}
.ev-topbar-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.ev-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- User / account menu — DS `.marketplace-link` trigger + `.dropdown-menu` panel ----
   Trigger uses the global DS `.marketplace-link` / `.marketplace-link-sub` / `.marketplace-link-main`
   classes (verified global in components.css — not scoped under .marketplace-bar).
   The dropdown panel is the DS `.dropdown-menu` (verbatim — it owns surface/border/shadow/
   items/danger/focus). Only the ANCHOR (position) and email sub-line are local chrome.
   All tokens resolve via the DS globals.css loaded in index.html. */
.ev-usermenu {
  position: relative;
  display: flex;
  align-items: center;
}

/* Anchor the DS dropdown below the trigger (position only — DS owns the surface) */
.ev-menu-anchor {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 30;
  min-width: 252px;
  max-width: min(320px, calc(100vw - 32px));
  transform-origin: top right;
  animation: ev-usermenu-in 0.14s ease-out;
}
[dir='rtl'] .ev-menu-anchor {
  transform-origin: top left;
}
@keyframes ev-usermenu-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Email sub-line inside the dropdown label — muted, caption-sized.
   The DS `.dropdown-menu-label` forces uppercase + letter-spacing; reset both so the
   email address reads correctly (lowercase, normal tracking, normal weight). */
.ev-account-email {
  overflow: hidden;
  font-size: var(--text-size-caption, 12px);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-tertiary);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dropdown-menu-item svg {
  flex: none;
  opacity: 0.85;
}

/* Loading skeleton — never flash a fake name before identity resolves */
.ev-skel {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12) 25%,
    rgba(255, 255, 255, 0.24) 37%,
    rgba(255, 255, 255, 0.12) 63%
  );
  background-size: 400% 100%;
  animation: ev-skel-shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}
.ev-skel-line {
  display: block;
  width: 96px;
  height: 10px;
}
@keyframes ev-skel-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ev-menu-anchor,
  .ev-skel {
    animation: none;
    transition: none;
  }
}

/* ---- Hero (big landing + compact inner variant) ---- */
.ev-hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-gradient);
  padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 64px) clamp(56px, 8vw, 96px);
}
.ev-hero.ev-hero-compact {
  padding: clamp(28px, 4vw, 44px) clamp(20px, 5vw, 64px) clamp(40px, 5vw, 60px);
}
.ev-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 140% at 85% -10%, rgba(255, 255, 255, 0.16), transparent 55%);
}
.ev-hero-inner {
  position: relative;
  max-width: 1180px;
  margin-inline: auto;
}
.ev-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 14px;
  font-size: 13px;
  flex-wrap: wrap;
}
.ev-crumbs a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}
.ev-crumbs a:hover {
  color: #fff;
}
.ev-crumbs .sep {
  color: rgba(255, 255, 255, 0.4);
}
.ev-crumbs .cur {
  color: #fff;
  font-weight: 600;
}
.ev-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--hero-pill-bg);
  color: var(--hero-pill-label-color);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.ev-hero h1 {
  color: var(--text-inverse);
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 16px 0 10px;
  max-width: 22ch;
}
.ev-hero.ev-hero-compact h1 {
  font-size: clamp(22px, 3vw, 34px);
  margin: 12px 0 8px;
}
.ev-hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 60ch;
  margin: 0;
}
.ev-hero-stats {
  display: flex;
  gap: 28px;
  margin-block-start: 24px;
  flex-wrap: wrap;
}
.ev-hero-stat .n {
  color: var(--text-inverse);
  font-size: 24px;
  font-weight: 700;
}
.ev-hero-stat .l {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ev-hero-actions {
  display: flex;
  gap: 10px;
  margin-block-start: 22px;
  flex-wrap: wrap;
}

/* ---- Content wrap ---- */
.ev-wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding: 0 clamp(20px, 5vw, 64px) 64px;
}

/* ---- Compact transactional page header (inner pages — NO hero) ---- */
.ev-pagehead {
  padding-block: 24px 4px;
}
.ev-crumbs2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-block-end: 12px;
  flex-wrap: wrap;
}
.ev-crumbs2 a {
  color: var(--text-tertiary);
  text-decoration: none;
}
.ev-crumbs2 a:hover {
  color: var(--text-link);
}
.ev-crumbs2 .sep {
  color: var(--border-default);
}
.ev-crumbs2 .cur {
  color: var(--text-secondary);
  font-weight: 600;
}
.ev-pagehead-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ev-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.15;
}
.ev-sub {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 5px 0 0;
}
.ev-pagehead-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Timezone / info notice (overlaps hero) ---- */
.ev-note {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 13.5px;
  margin-block-start: -32px;
  position: relative;
  box-shadow: var(--timeline-card-shadow);
}
.ev-note .nmed {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hero-gradient);
  color: #fff;
}
.ev-note .nmeta {
  margin-inline-start: auto;
  background: var(--hero-gradient);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---- Section head + eyebrow ---- */
.ev-sectionhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-block: 32px 18px;
  flex-wrap: wrap;
}
.ev-sectionhead h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
}
.ev-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-link);
  font-weight: 700;
  margin: 0 0 4px;
}

/* ---- Filters row (wraps DS .input / .select) ---- */
.ev-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.ev-search {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.ev-search .ico {
  position: absolute;
  inset-inline-start: 14px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}
.ev-search input {
  width: 100%;
  padding-inline-start: 42px;
}

/* ---- Card grid (holds DS .event-card / .service-tile) ---- */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.ev-grid .event-card,
.ev-grid .service-tile {
  text-decoration: none;
  color: inherit;
}

/* ---- Blocked event card: no organiser portal rep assigned → services unavailable ---- */
.event-card.is-blocked {
  cursor: not-allowed;
  opacity: 0.82;
}
.event-card.is-blocked:hover {
  transform: none;
  box-shadow: var(--timeline-card-shadow);
}
.event-card-blocked-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-subtle, var(--bg-card));
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
}
.event-card-blocked-note .ico {
  flex: 0 0 auto;
  margin-block-start: 1px;
}

/* ---- Generic surface panel for page content (token-only) ---- */
.ev-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  box-shadow: var(--timeline-card-shadow);
  padding: clamp(18px, 3vw, 28px);
  margin-block-start: 22px;
}
.ev-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 16px;
  flex-wrap: wrap;
}
.ev-panel-head h2 {
  font-size: 18px;
  margin: 0;
  color: var(--text-primary);
}
.ev-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-block-start: 20px;
}
.ev-spacer {
  flex: 1 1 auto;
}

/* ---- Navy footer ---- */
.ev-footer {
  background: var(--marketplace-bar-bg, linear-gradient(180deg, #0d3b72, #06203f));
  color: var(--marketplace-bar-fg-muted, #bcd0ef);
  padding: 24px clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-block-start: 40px;
}
.ev-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.ev-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-block-start: 28px;
}

/* ---- Theme switcher (mockup chrome) ---- */
.ev-themes {
  position: fixed;
  inset-inline-end: 20px;
  inset-block-end: 20px;
  z-index: 60;
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.18));
}

/* ---- Overflow safety ---- */
.ev-brand .bn {
  white-space: nowrap;
}
.ev-title,
.ev-sub,
.ev-panel-head h2 {
  overflow-wrap: anywhere;
  min-width: 0;
}
/* tables scroll horizontally on narrow screens instead of clipping */
.ev-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ev-table-scroll .data-table {
  min-width: 640px;
}

/* ---- Mobile / responsive ---- */
@media (max-width: 860px) {
  .ev-topbar {
    padding-inline: var(--space-4);
    gap: var(--space-3);
  }
  .ev-brand .bn {
    font-size: 16px;
  }
  .ev-brand .bn small {
    display: none;
  }
  /* Hide the "Hello, {name}" sub line on narrow screens — keeps the bar clean */
  .ev-usermenu .marketplace-link-sub {
    display: none;
  }
  .ev-topbar-nav {
    gap: 2px;
    margin-inline-start: 0;
  }
  .ev-topbar-nav a {
    padding: 6px 9px;
    font-size: 13px;
  }
  .ev-hero {
    padding-block: clamp(28px, 8vw, 44px) clamp(40px, 10vw, 64px);
  }
  .ev-hero h1 {
    font-size: clamp(24px, 7vw, 34px);
  }
  .ev-hero-stats {
    gap: 18px;
  }
  .ev-pagehead {
    padding-block: 18px 4px;
  }
  .ev-title {
    font-size: 22px;
  }
  .ev-pagehead-row {
    gap: 10px;
  }
  .ev-pagehead-actions {
    width: 100%;
  }
  .ev-themes {
    inset-inline-end: 10px;
    inset-block-end: 10px;
  }
}
