/* ============================================================
   Massafra Estate 2026 — stylesheet
   Palette derived from the official poster
   ============================================================ */
:root {
  --green:    #5A9E2E;
  --green-dk: #4a8525;
  --navy:     #15406B;
  --navy-dk:  #0f2f50;
  --gold:     #ECA91D;
  --cream:    #F6F1E2;
  --cream-dk: #efe7d0;
  --lavender: #D2D9EC;
  --ink:      #1c2433;

  /* category colours */
  --cat-musica:  #15406B;
  --cat-sport:   #5A9E2E;
  --cat-danza:   #E0567B;
  --cat-teatro:  #7A5BA6;
  --cat-cinema:  #ECA91D;
  --cat-feste:   #E2643B;
  --cat-altro:   #2E8B8B;

  --radius: 0;
  --radius-sm: 0;
  --shadow: 0 10px 30px -12px rgba(21, 64, 107, .25);
  --shadow-lg: 0 24px 60px -20px rgba(21, 64, 107, .35);
  --maxw: 1180px;
  --pad-x: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font-display: 'Jost', system-ui, sans-serif;
  --font-script:  'Style Script', cursive;
  --font-body:    'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
img[src*=".svg"] {
  image-rendering: auto;
}

:focus-visible {
  outline: 3px solid rgba(236, 169, 29, .95);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 1100;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* shared brand lockup (nav + footer) */
.nav__brand-green  { font-family: var(--font-display); font-weight: 900; color: var(--green); letter-spacing: -.02em; }
.nav__brand-script { font-family: var(--font-script); color: var(--navy); }
.nav__brand-year   { font-family: var(--font-display); font-weight: 800; color: var(--navy); }

/* ============ NAV ============ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .3s var(--ease), box-shadow .3s var(--ease), padding .3s var(--ease);
}
.nav.is-scrolled {
  background: rgba(246, 241, 226, .85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(21,64,107,.08);
  padding-top: 10px; padding-bottom: 10px;
}
.nav__brand {
  display: inline-flex; align-items: center;
  text-decoration: none; line-height: 1;
}
.nav__logo {
  display: block;
  width: clamp(180px, 22vw, 270px);
  height: auto;
}
.nav__brand-script { font-size: 1.15em; }
.nav__links { display: flex; gap: clamp(14px, 2.5vw, 30px); }
.nav__links a {
  text-decoration: none; font-weight: 600; font-size: 15px; color: var(--navy);
  position: relative; padding: 4px 0;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--gold); transition: width .25s var(--ease);
}
.nav__links a:hover::after { width: 100%; }

/* hamburger button (mobile only) */
.nav__burger {
  display: none; width: 44px; height: 44px; padding: 0; border: 0; cursor: pointer;
  background: transparent; flex-direction: column; justify-content: center; gap: 5px; z-index: 1001;
}
.nav__burger span {
  display: block; width: 25px; height: 2.5px; margin: 0 auto; border-radius: 3px;
  background: var(--navy); transition: transform .3s var(--ease), opacity .2s;
}
.nav__burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* full-screen mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 900; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px;
  background: var(--cream);
  /* visibility delayed on close (stays visible through the fade-out), but flips
     to visible immediately on open so the menu is focusable on the next frame. */
  opacity: 0; visibility: hidden; transition: opacity .32s var(--ease), visibility 0s linear .32s;
}
.mobile-menu::before {
  content: ''; position: absolute; inset: -20%;
  background: repeating-linear-gradient(-38deg, var(--cream) 0 78px, var(--lavender) 78px 156px);
  opacity: .5;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transition: opacity .32s var(--ease), visibility 0s; }
.mobile-menu__links { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mobile-menu__links a {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 11vw, 52px);
  color: var(--navy); text-decoration: none; padding: 10px 24px; line-height: 1.1;
  opacity: 0; transform: translateY(16px); transition: color .2s, opacity .4s var(--ease), transform .4s var(--ease);
}
.mobile-menu.is-open .mobile-menu__links a { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(1) { transition-delay: .08s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(2) { transition-delay: .14s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(3) { transition-delay: .2s; }
.mobile-menu__links a:active { color: var(--green); }
.mobile-menu__foot {
  position: relative; font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; font-size: 13px; color: var(--gold); margin: 0;
}
body.menu-open { overflow: hidden; }

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  background: var(--cream);
  padding: 90px 20px 0;
}
.hero__stripes {
  position: absolute; inset: -20%;
  background: repeating-linear-gradient(
    -38deg,
    var(--cream) 0, var(--cream) 78px,
    var(--lavender) 78px, var(--lavender) 156px
  );
  opacity: .55;
}
.hero__content {
  position: relative;
  z-index: 2;
  width: min(900px, 100%);
  top: clamp(-70px, -7vh, -36px);
}
.hero__crest-lockup {
  display: block;
  width: min(14vw, 74px);
  height: auto;
  margin: 0 auto 20px;
}
.hero__lockup { margin: 0; line-height: 1; }
.hero__logo {
  display: block;
  width: min(50vw, 320px);
  height: auto;
  margin: 0 auto;
}
.hero__tagline {
  display: block;
  width: min(40vw, 240px);
  height: auto;
  margin: 24px auto 44px;
}
.hero__cta {
  display: inline-block; text-decoration: none;
  background: #48831d; color: #fff; font-weight: 700;
  padding: 15px 34px; border-radius: 100px; font-size: 16px;
  /* Stacked blur-less navy steps build a solid extrusion whose sides connect
     the corners, echoing the event cards' 3D block rather than a gapped offset. */
  box-shadow:
    -1px 1px 0 var(--navy), -2px 2px 0 var(--navy), -3px 3px 0 var(--navy),
    -4px 4px 0 var(--navy), -5px 5px 0 var(--navy), -6px 6px 0 var(--navy);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.hero__cta:hover {
  transform: translate(2px, -3px);
  box-shadow:
    -1px 1px 0 var(--navy), -2px 2px 0 var(--navy), -3px 3px 0 var(--navy),
    -4px 4px 0 var(--navy), -5px 5px 0 var(--navy), -6px 6px 0 var(--navy),
    -7px 7px 0 var(--navy), -8px 8px 0 var(--navy);
}

.hero__illustration {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  /* Keep height >= the skyline's natural ratio (~24vw for a 1503x361 image)
     so object-fit: cover only ever trims the sides, never the top of the dome.
     The floor keeps the dome prominent on narrow/mobile screens. */
  height: max(180px, 25vw);
  overflow: hidden;
  pointer-events: none;
}
.hero__illustration img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.hero__scroll {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 26px; height: 42px; border: 2px solid var(--navy); border-radius: 14px;
}
.hero__scroll span {
  position: absolute; top: 8px; left: 50%; margin-left: -2px; width: 4px; height: 8px;
  background: var(--navy); border-radius: 2px; animation: scroll 1.6s infinite;
}
@keyframes scroll { 0%{opacity:0;transform:translateY(0)} 40%{opacity:1} 80%,100%{opacity:0;transform:translateY(14px)} }

/* ============ STATS ============ */
.stats {
  background: var(--navy); color: #fff;
  padding: 32px var(--pad-x);
}
.stats__inner {
  max-width: 1320px;
  margin: 0 auto;
  box-sizing: border-box;
  display: grid; grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 54px);
  padding-inline: var(--pad-x);
}
.stats__copy {
  max-width: 700px;
}
.stats__copy h2 {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.02;
  letter-spacing: 0;
}
.stats__copy p {
  margin: 0;
  color: #d8e1f0;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.5;
}
.stats__copy strong {
  color: #fff;
  font-weight: 800;
}
.stats__item {
  min-width: 180px;
  text-align: center;
}
.stats__item b {
  display: block; font-family: var(--font-display); font-size: clamp(44px, 5vw, 68px);
  color: var(--gold); line-height: 1;
}
.stats__item span { font-size: clamp(11px, 1.6vw, 14px); text-transform: uppercase; letter-spacing: .12em; opacity: .85; }

/* ============ SECTIONS ============ */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(48px, 8vw, 90px) var(--pad-x); }
#eventi { max-width: min(1320px, 100%); }
.section--map { max-width: none; background: var(--cream-dk); }
.section--map .section__head { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section__head { margin-bottom: 34px; }
.section__title {
  font-family: var(--font-display); font-weight: 900; color: var(--navy);
  font-size: clamp(30px, 5vw, 52px); margin: 0 0 8px; letter-spacing: -.02em;
}
.section__sub { color: #54607a; font-size: clamp(15px, 2vw, 18px); margin: 0; }

/* ============ FILTERS ============ */
.mobile-filterbar,
.filters-backdrop,
.filters__sheet-head,
.filters__sheet-actions { display: none; }

.filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.filters__primary { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--lavender); border-radius: 100px; padding: 4px; gap: 2px; }
.seg__btn { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: var(--navy); padding: 9px 18px; border-radius: 100px; cursor: pointer; transition: background .2s, color .2s; }
.seg__btn:hover { color: var(--green-dk); }
.seg__btn.is-active { background: var(--navy); color: #fff; }
.seg__btn.is-active:hover { color: #fff; }
.filters__search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 240px;
  background: #fff; border: 1.5px solid var(--lavender); border-radius: 100px;
  padding: 4px 18px; color: var(--navy); max-width: 460px;
  transition: border-color .2s, box-shadow .2s;
}
.filters__search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(236,169,29,.18); }
.filters__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; padding: 12px 0; color: var(--ink); }

/* category chips: one horizontally-scrollable row */
.chip-scroller {
  display: flex; gap: 9px; overflow-x: auto;
  margin-inline: calc(-1 * var(--pad-x));
  padding: 2px var(--pad-x) 6px;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--pad-x);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chip-scroller::-webkit-scrollbar { display: none; }
.chip-scroller .chip { flex: 0 0 auto; scroll-snap-align: start; }
.chip {
  border: 1.5px solid var(--lavender); background: #fff; color: var(--navy);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  padding: 8px 16px; border-radius: 100px; line-height: 1;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s;
}
.chip:hover { transform: translateY(-2px); }
.chip__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--gold)); }
.chip.is-active { color: #fff; border-color: transparent; background: var(--c, var(--navy)); }
/* Gold (Cinema) needs dark text for AA contrast, mirroring .card__tag[data-c="Cinema"]. */
.chip.is-active[data-cat="Cinema"] { color: var(--navy-dk); }
.chip.is-active .chip__dot { background: rgba(255,255,255,.9); }
.chip.is-active[data-cat="Cinema"] .chip__dot { background: rgba(15,47,80,.85); }
.filters__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters__select {
  font: inherit; font-weight: 600; color: var(--navy); background: #fff;
  border: 1.5px solid var(--lavender); border-radius: 100px;
  padding: 11px 38px 11px 16px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2315406B' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.filters__select:focus { outline: none; border-color: var(--gold); }
.filters__reset {
  font: inherit; font-weight: 600; font-size: 14px; color: var(--navy); background: var(--cream-dk);
  border: 0; cursor: pointer; padding: 11px 16px; border-radius: 100px;
  transition: background .2s, color .2s;
}
.filters__reset:hover { background: var(--gold); color: var(--navy-dk); }
.filters__apply {
  width: 100%;
  border: 0;
  border-radius: 100px;
  background: var(--gold);
  color: var(--navy-dk);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 15px 22px;
}
.results-count { color: #54607a; font-size: 14px; font-weight: 600; margin: 0 0 18px; }

/* ============ EVENTS GRID ============ */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 28px; align-items: start; }
.month-sep {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px;
  margin: 22px 0 2px;
}
.month-sep:first-child { margin-top: 0; }
.month-sep span {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: .14em; color: var(--green); font-size: 14px; white-space: nowrap;
}
.month-sep::after { content: ''; flex: 1; height: 2px; background: var(--lavender); border-radius: 2px; }

.card {
  --depth-x: -8px;
  --depth-y: 8px;
  position: relative; background: #fff; border-radius: var(--radius);
  padding: 0; box-shadow: none;
  display: block; overflow: visible;
  border: 0;
  isolation: isolate;
  transition: transform .22s var(--ease);
  opacity: 0; transform: translateY(14px);
  animation: rise .5s var(--ease) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card:hover {
  transform: translateY(-3px);
}
.card:hover .card__surface {
  transform: translate(2px, -2px);
}
.card__surface {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 22px 22px 20px 26px;
  border: 1px solid rgba(21,64,107,.06);
  border-radius: inherit;
  background: #fff;
  overflow: hidden;
  transition: transform .22s var(--ease), border-color .2s;
}
.card::before,
.card::after {
  content: '';
  position: absolute;
  pointer-events: none;
  transition: transform .22s var(--ease), inset .22s var(--ease);
}
.card::before {
  left: var(--depth-x);
  top: 0;
  right: 0;
  bottom: calc(-1 * var(--depth-y));
  z-index: 0;
  border-radius: inherit;
  background: var(--c);
  clip-path: polygon(
    calc(-1 * var(--depth-x)) 0,
    100% 0,
    100% calc(100% - var(--depth-y)),
    calc(100% + var(--depth-x)) 100%,
    0 100%,
    0 var(--depth-y)
  );
}
.card::after { content: none; }

.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card__date {
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  background: var(--cream); border-radius: var(--radius-sm); padding: 8px 12px; min-width: 56px;
}
.card__day   { font-family: var(--font-display); font-weight: 600; font-size: 27px; color: var(--navy); }
.card__month { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--green); margin-top: 3px; }
.card__wd    { font-size: 11px; color: #9aa3b4; margin-top: 2px; text-transform: capitalize; }
.card__tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; background: var(--c); padding: 6px 11px; border-radius: 100px; white-space: nowrap;
}
.card__tag[data-c="Cinema"] { color: var(--navy-dk); }
.card__badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.card__when { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 100px; white-space: nowrap; }
.card__when--today { background: var(--gold); color: var(--navy-dk); }
.card__when--next  { background: var(--green); color: #fff; }
.card__when--soon  { background: #fff; color: var(--green-dk); border: 1.5px solid var(--green); }
.card__when--past  { background: #e7e9ef; color: #8a93a6; }

.card--past  { opacity: .6; filter: saturate(.5); }
.card--past:hover { opacity: .9; }
.card__title { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--navy); margin: 2px 0 0; line-height: 1.2; }
.card__org { font-size: 13.5px; color: #6a748a; margin-top: -4px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 5px; padding-top: 0; font-size: 13.5px; color: #54607a; }
.card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.card__meta svg { flex: none; color: var(--gold); }
.card__loc-btn {
  background: none; border: 0; font: inherit; color: var(--navy); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 0; text-align: left;
}
.card__loc-btn:hover { color: var(--green-dk); text-decoration: underline; }
.card__loc-btn[disabled] { color: #54607a; cursor: default; text-decoration: none; }
.card__cal {
  align-self: flex-start; margin-top: 0;
  box-sizing: border-box;
  flex: 1 1 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--cream); color: var(--navy); border: 1.5px solid var(--lavender);
  font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer;
  height: 38px;
  padding: 9px 12px; border-radius: 100px;
  white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease);
}
.card__cal svg { color: var(--green-dk); transition: color .2s; }
.card__cal:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-dk); transform: translateY(-2px); }
.card__cal:hover svg { color: var(--navy-dk); }
.card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  min-width: 0;
}
.card__details {
  align-self: flex-start; flex: 0 0 auto;
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--navy); color: #fff; border: 1.5px solid var(--navy);
  font: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer;
  height: 38px;
  padding: 9px 12px; border-radius: 100px;
  white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease);
}
.card__details:hover { background: var(--green-dk); border-color: var(--green-dk); transform: translateY(-2px); }

.no-results { text-align: center; color: #8a93a6; padding: 40px 0; font-size: 17px; }
.status-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border-radius: var(--radius);
  background: #fff;
  color: #54607a;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
}

/* ============ MAP ============ */
.map { height: min(560px, 70vh); width: 100%; border-radius: 0; }
.map-status {
  max-width: var(--maxw);
  margin: 14px auto 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.7);
  color: var(--navy);
  font-weight: 700;
}
.map.is-unavailable {
  display: grid;
  place-items: center;
  min-height: 280px;
  height: min(420px, 55vh);
  background: rgba(255,255,255,.55);
}
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--font-body); }
.leaflet-container:after {
  font-family: var(--font-body);
  font-size: clamp(17px, 4vw, 22px);
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  padding: 24px;
  color: #fff;
  background: rgba(21, 64, 107, .72);
  backdrop-filter: blur(2px);
}
.pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 2.5px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.pin b { display: none; }
.popup__title { font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: 15px; }
.popup__venue { font-weight: 700; color: var(--green-dk); margin-bottom: 6px; }
.popup__list {
  max-height: 188px; overflow-y: auto; margin: 0 -4px;
  touch-action: pan-y; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.popup__ev {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font-size: 13px; text-align: left; padding: 7px 4px;
  border: 0; border-top: 1px solid #eee; background: none; cursor: pointer;
  color: inherit; font-family: inherit; border-radius: 6px; transition: background .12s;
}
.popup__ev:hover, .popup__ev:focus-visible { background: var(--lavender); outline: none; }
.popup__ev:focus-visible { box-shadow: inset 0 0 0 2px var(--navy); }
.popup__ev-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }
.popup__ev-txt { flex: 1 1 auto; line-height: 1.3; }
.popup__ev b { color: var(--navy); }
.popup__ev-go { flex: 0 0 auto; display: inline-flex; color: var(--navy); opacity: .35; transition: opacity .12s, transform .12s; }
.popup__ev:hover .popup__ev-go, .popup__ev:focus-visible .popup__ev-go { opacity: 1; transform: translateX(2px); }
.popup__actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.popup__filter {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  background: var(--navy); color: #fff; transition: background .12s;
}
.popup__filter:hover, .popup__filter:focus-visible { background: var(--navy-dk); outline: none; }
.popup__filter svg { opacity: .85; }
/* Scoped under .leaflet-popup-content to beat Leaflet's own link colour (.leaflet-container a). */
.leaflet-popup-content .popup__maps { font-weight: 700; color: var(--navy); text-decoration: underline; font-size: 12.5px; }
.popup__maps:hover { text-decoration: underline; }

/* ============ EVENT MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 47, 80, .42);
  backdrop-filter: blur(5px);
}
.modal-backdrop:not([hidden]) { display: block; }
.event-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1210;
  width: min(620px, calc(100vw - 32px));
  max-height: min(82svh, 720px);
  overflow-y: auto;
  transform: translate(-50%, calc(-50% + 18px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  border-radius: 24px;
  background: var(--cream);
  color: var(--ink);
  padding: 26px;
  box-shadow: 0 30px 90px -24px rgba(15,47,80,.55);
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility 0s .24s;
}
.event-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility 0s;
}
.event-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.event-modal__date {
  color: var(--green-dk);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
  padding-right: 52px;
}
.event-modal__tag {
  display: inline-flex;
  margin-top: 14px;
  border-radius: 100px;
  background: var(--c, var(--navy));
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 11px;
  padding: 6px 11px;
}
.event-modal__title {
  margin: 14px 0 6px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1;
}
.event-modal__org { margin: 0; color: #68758b; font-weight: 700; }
.event-modal__details {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 18px;
  margin: 22px 0;
}
.event-modal__details dt {
  color: #68758b;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.event-modal__details dd { margin: 0; color: var(--navy); font-weight: 700; }
.event-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.event-modal__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1.5px solid var(--lavender);
  border-radius: 100px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 16px;
  text-decoration: none;
}
.event-modal__action--primary { background: var(--gold); border-color: var(--gold); color: var(--navy-dk); }
.event-modal__action:hover { border-color: var(--gold); }
.event-modal__status { margin: 12px 0 0; color: var(--green-dk); font-weight: 700; }
.event-modal__copy-field {
  width: 100%;
  margin-top: 10px;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
}
body.modal-open { overflow: hidden; }

/* ============ FOOTER ============ */
.footer {
  min-height: 100svh; background: var(--navy); color: #e8edf6;
  display: flex; flex-direction: column;
  padding: clamp(40px, 6vw, 70px) var(--pad-x) 26px;
}
.footer__main {
  flex: 1; max-width: var(--maxw); width: 100%; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 22px; padding: 30px 0;
}
.footer__crest {
  width: clamp(130px, 20vw, 190px); height: auto; display: block;
}
.footer__logo {
  display: block;
  width: min(76vw, 460px);
  height: auto;
}
.footer__tag { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: clamp(13px, 2vw, 16px); color: var(--gold); margin: -10px 0 0; }
.footer__cols { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(30px, 8vw, 90px); margin-top: 18px; }
.footer__col h3 { font-family: var(--font-display); font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 0 0 10px; }
.footer__col p { margin: 0; line-height: 1.6; color: #c4cee0; font-size: 15px; }
.footer__col a { color: #fff; font-weight: 600; }
.footer__legal { max-width: var(--maxw); width: 100%; margin: 0 auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: #a9b6cd; text-align: center; }

/* ============ RESPONSIVE ============ */
@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .mobile-filterbar {
    position: sticky;
    top: 64px;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -12px calc(-1 * var(--pad-x)) 10px;
    padding: 10px var(--pad-x) 12px;
    border: 0;
    border-radius: 0;
    background: var(--cream);
    backdrop-filter: none;
    box-shadow: none;
  }
  .mobile-filterbar::before { content: none; }
  .mobile-filterbar__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-filterbar__count {
    color: var(--navy);
    font-weight: 800;
    font-size: 14px;
    line-height: 1.1;
  }
  .mobile-filterbar__context {
    color: #68758b;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 48vw;
  }
  .mobile-filterbar__btn {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    border: 0;
    border-radius: 100px;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 10px 15px;
  }
  .mobile-filterbar__badge {
    min-width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy-dk);
    font-size: 11px;
    line-height: 1;
  }
  .mobile-filterbar__badge[hidden] { display: none !important; }
  .filters-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 47, 80, .36);
    backdrop-filter: blur(4px);
  }
  .filters-backdrop:not([hidden]) { display: block; }
  .filters {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    max-height: min(82svh, 680px);
    overflow-y: auto;
    margin: 0;
    padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    background: var(--cream);
    box-shadow: 0 -24px 70px -28px rgba(15,47,80,.55);
    transform: translateY(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .32s var(--ease), visibility 0s .32s;
  }
  .filters.is-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .32s var(--ease), visibility 0s;
  }
  .filters__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 4px;
  }
  .filters__sheet-head h3 {
    margin: 0;
    color: var(--navy);
    font-family: var(--font-display);
    font-size: 25px;
    line-height: 1;
  }
  .filters__close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--navy);
    cursor: pointer;
    font: inherit;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
  }
  .filters__sheet-actions {
    display: block;
    position: sticky;
    bottom: calc(-18px - env(safe-area-inset-bottom));
    margin: 6px -20px calc(-18px - env(safe-area-inset-bottom));
    padding: 12px 20px calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(246,241,226,0), var(--cream) 18px);
  }
  .stats { padding: 30px var(--pad-x); }
  .stats__inner { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .stats__copy { max-width: 520px; margin: 0 auto; }
  .stats__item { min-width: 0; }
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }

  .filters__primary { flex-direction: column; align-items: stretch; }
  .filters__search { flex: 0 0 auto; max-width: none; }
  .seg { width: 100%; }
  .seg__btn { flex: 1; text-align: center; padding: 11px 6px; }
  .filters__row .filters__select { flex: 1 1 0; min-width: 0; }
  .filters__reset { flex: 1 1 100%; order: 3; }
  .results-count { display: none; }
  .month-sep {
    position: sticky;
    top: 128px;
    z-index: 50;
    margin: 12px 0 8px;
    padding: 8px 0;
    background: var(--cream);
  }
  .month-sep::before {
    content: '';
    position: absolute;
    inset: 0 calc(-1 * var(--pad-x));
    z-index: -1;
    background: rgba(246, 241, 226, .92);
    backdrop-filter: blur(10px);
  }
  body.filters-open { overflow: hidden; }
  .event-modal {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: min(86svh, 720px);
    border-radius: 26px 26px 0 0;
    padding: 24px 20px calc(22px + env(safe-area-inset-bottom));
    transform: translateY(105%);
  }
  .event-modal.is-open { transform: translateY(0); }
  .event-modal__details { grid-template-columns: 1fr; gap: 5px; }
  .event-modal__details dd { margin-bottom: 8px; }
  .event-modal__actions { flex-direction: column; }
  .event-modal__action { width: 100%; }
}
@media (max-width: 430px) {
  .nav__logo { width: 165px; }
  .nav__links { gap: 13px; }
  .nav__links a { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .card,
  .card:hover,
  .card__cal:hover,
  .card__details:hover {
    opacity: 1;
    transform: none !important;
  }
}
