/* =========================================================
   The Calendar, page-specific
   Reuses base.css for nav, footer, buttons, type, cards.
   Locks the editorial palette per the v3 brief.
   ========================================================= */

/* ---- editorial palette lock for this page ----
   These are FALLBACKS only. The shared theme switcher writes
   inline body styles which override these (same specificity but
   inline beats class). So Calendar tracks whatever scheme is set
   site-wide. */
body.calendar-page {
  --serif:   "Fraunces", "GT Sectra", Georgia, serif;
  --sans:    "Schibsted Grotesk", Helvetica, Arial, sans-serif;
  --serif-opsz: 48;
  --serif-wght: 400;
  --img-filter: contrast(1.04) saturate(0.92) brightness(0.97) sepia(0.06);
  --img-tint:   linear-gradient(180deg, rgba(22,20,15,.04), rgba(22,20,15,.18));
}

/* ---- page header ---- */
.cal-hero {
  padding: 152px 0 clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--hair);
}
.cal-hero__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 96px);
  align-items: end;
}
@media (max-width: 880px) {
  .cal-hero { padding-top: 120px; }
  .cal-hero__inner { grid-template-columns: 1fr; gap: 28px; }
}
.cal-hero__title {
  font-size: clamp(48px, 7.2vw, 116px);
  font-variation-settings: "opsz" 144;
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.028em;
  margin: 0;
}
.cal-hero__title em {
  font-style: italic; font-weight: 300; color: var(--deep);
}
.cal-hero__sub {
  margin-top: 18px;
  font-family: var(--serif);
  font-variation-settings: "opsz" 36;
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -0.012em;
  line-height: 1.18;
  color: var(--ink);
  max-width: 22ch;
}
.cal-hero__lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 38ch;
  margin: 0;
}

/* ---- filter bar ---- */
.cal-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bone) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.cal-bar__inner {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 2fr auto;
  gap: clamp(16px, 2vw, 28px);
  align-items: center;
  padding: 16px 0;
}
@media (max-width: 1080px) {
  .cal-bar__inner { grid-template-columns: 1fr; gap: 14px; }
}

/* search */
.cal-search {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  transition: border-color .2s ease, background-color .2s ease;
}
.cal-search:focus-within {
  border-color: var(--ink);
  background: transparent;
}
.cal-search svg { flex: 0 0 16px; color: var(--ink-3); }
.cal-search input {
  flex: 1 1 auto;
  background: transparent; border: 0; outline: 0;
  font: inherit; font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  padding: 2px 0;
  min-width: 0;
}
.cal-search input::placeholder { color: var(--ink-3); }

/* filter rows */
.cal-filters {
  display: flex; align-items: center; gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cal-filters::-webkit-scrollbar { display: none; }
.cal-filters__group {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.cal-filters__label {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
  flex-shrink: 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip:hover { color: var(--ink); border-color: rgba(22,20,15,.22); }
.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip.is-on:hover { color: #fff; }

/* view toggle */
.cal-views {
  display: inline-flex;
  padding: 4px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  flex-shrink: 0;
}
.cal-views__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  transition: background-color .2s ease, color .2s ease;
}
.cal-views__btn:hover { color: var(--ink); }
.cal-views__btn.is-on {
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(22,20,15,.04), 0 1px 8px rgba(22,20,15,.06);
}
.cal-views__btn svg { width: 14px; height: 14px; opacity: .8; }

/* results meta */
.cal-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 28px 0 24px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
}
.cal-meta__count em { font-style: normal; color: var(--ink); font-weight: 500; }
.cal-meta__clear {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.cal-meta__clear:hover { color: var(--accent); }

/* ---- views container ---- */
.view { display: none; padding-bottom: clamp(72px, 10vw, 120px); }
.view.is-on { display: block; }

/* =========================================================
   GRID view (priority)
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 3.4vw, 56px) clamp(20px, 2.4vw, 36px);
}
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.evt {
  position: relative;
  display: flex; flex-direction: column;
  background: transparent;
  border-radius: var(--r);
  overflow: hidden;
  isolation: isolate;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.evt:hover { transform: translateY(-3px); }
.evt__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r);
  background: #2a2520;
}
.evt__img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: var(--img-filter);
  transform: scale(1.02);
  transition: transform 1s cubic-bezier(.2,.7,.2,1);
}
.evt:hover .evt__img { transform: scale(1.08); }
.evt__media::after {
  content: ""; position: absolute; inset: 0;
  background: var(--img-tint);
  pointer-events: none;
}
.evt__tag {
  position: absolute; top: 14px; left: 14px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone);
  padding: 6px 10px;
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  backdrop-filter: blur(6px);
  border-radius: var(--r);
}
.evt__month {
  position: absolute; top: 14px; right: 14px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone);
}

.evt__body {
  padding: 22px 4px 0;
}
.evt__name {
  font-family: var(--serif);
  font-variation-settings: "opsz" 48;
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.05;
  color: var(--ink);
}
.evt__where {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.evt__where span { color: var(--ink-3); }
.evt__desc {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 38ch;
}
.evt__foot {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.evt__cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color .2s ease, border-color .2s ease;
}
.evt__cta:hover { color: var(--accent); border-bottom-color: var(--accent); }
.evt__vibes {
  display: inline-flex; gap: 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* empty state */
.cal-empty {
  text-align: center;
  padding: clamp(40px, 6vw, 80px) 20px;
  border: 1px dashed var(--hair);
  border-radius: var(--r);
}
.cal-empty__title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 48;
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
}
.cal-empty__body { margin-top: 10px; color: var(--ink-2); font-size: 14px; }

/* =========================================================
   TIMELINE view
   ========================================================= */
.timeline {
  display: flex; flex-direction: column;
  gap: 0;
}
.timeline__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  padding: clamp(28px, 4vw, 48px) 0;
  border-top: 1px solid var(--hair);
}
.timeline__row:last-child { border-bottom: 1px solid var(--hair); }
@media (max-width: 720px) {
  .timeline__row { grid-template-columns: 1fr; gap: 14px; }
}
.timeline__month {
  position: sticky;
  top: 110px;
  align-self: start;
}
.timeline__month-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.timeline__month-name {
  margin-top: 6px;
  font-family: var(--serif);
  font-variation-settings: "opsz" 96;
  font-weight: 300;
  font-size: clamp(40px, 4.4vw, 64px);
  letter-spacing: -0.022em;
  color: var(--ink);
  line-height: 1;
}
.timeline__month-season {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.timeline__events {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 2.4vw, 36px);
}
@media (max-width: 980px) { .timeline__events { grid-template-columns: 1fr; } }

.tl-evt {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: start;
  cursor: pointer;
}
@media (max-width: 480px) {
  .tl-evt { grid-template-columns: 96px 1fr; gap: 14px; }
}
.tl-evt__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--r);
  background: #2a2520;
}
.tl-evt__img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: var(--img-filter);
  transition: transform 1s ease;
}
.tl-evt:hover .tl-evt__img { transform: scale(1.06); }
.tl-evt__body { padding-top: 2px; }
.tl-evt__tag {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3);
}
.tl-evt__name {
  font-family: var(--serif);
  font-variation-settings: "opsz" 36;
  font-weight: 400;
  font-size: clamp(20px, 1.8vw, 24px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-top: 6px;
  color: var(--ink);
}
.tl-evt__where { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.tl-evt__when { margin-top: 8px; font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; }

.timeline__row--empty .timeline__events {
  display: flex; align-items: center;
  color: var(--ink-3); font-size: 13px;
  font-style: italic;
  min-height: 60px;
}

/* =========================================================
   MAP view
   ========================================================= */
.map {
  padding-top: 8px;
}
.map__head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 24px;
}
.map__head h3 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 36;
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -0.01em;
}
.map__hint {
  font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em;
}

.map__wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  background: var(--bone-2);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--hair);
}

.map__svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.map__land { fill: rgba(22,20,15,.10); stroke: rgba(22,20,15,.16); stroke-width: 0.6; }
.map__graticule { stroke: rgba(22,20,15,.06); stroke-width: 0.4; fill: none; }

/* ---- Leaflet host + brand overrides ---- */
.map__leaflet {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: var(--bone-2);
  z-index: 1;
}
.leaflet-container {
  font-family: var(--sans);
  background: var(--bone-2);
}
.leaflet-tile-pane {
  filter: contrast(.96) saturate(.82);
}
.leaflet-control-attribution {
  font-size: 10px;
  background: color-mix(in srgb, var(--bone) 88%, transparent);
  color: var(--ink-3);
  padding: 2px 8px;
}
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-control-zoom { border: 1px solid var(--hair) !important; box-shadow: 0 4px 14px rgba(22,20,15,.08) !important; }
.leaflet-control-zoom a {
  background: var(--bone) !important;
  color: var(--ink) !important;
  border-bottom-color: var(--hair) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--bone-2) !important;
  color: var(--ink) !important;
}

/* ---- custom divIcon pin (Leaflet markers) ---- */
.ll-pin {
  background: transparent !important;
  border: none !important;
  position: relative;
}
.ll-pin .ll-pin__dot {
  position: absolute; left: 0; top: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bone);
  box-shadow: 0 4px 14px rgba(22,20,15,.22);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ll-pin .ll-pin__pulse {
  position: absolute; left: 0; top: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .35;
  animation: pinpulse 2.6s infinite ease-out;
  pointer-events: none;
}
.ll-pin:hover .ll-pin__dot,
.ll-pin.is-active .ll-pin__dot { transform: scale(1.22); box-shadow: 0 6px 20px rgba(22,20,15,.32); }

/* ---- card centred above map when Leaflet is active ---- */
.map-card.is-floating {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%);
  z-index: 600;
}

/* ---- fallback if Leaflet fails to load ---- */
.map__fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--ink-2); padding: 24px; text-align: center;
}

.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 2;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--sans);
  --pin-size: 14px;
}
.pin__dot {
  width: var(--pin-size); height: var(--pin-size);
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bone);
  box-shadow: 0 4px 14px rgba(22,20,15,.18);
  transition: transform .2s ease;
}
.pin::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--accent);
  margin-top: -2px;
}
.pin:hover .pin__dot, .pin.is-active .pin__dot { transform: scale(1.18); }
.pin.is-active { z-index: 4; }
.pin.is-active .pin__dot { box-shadow: 0 4px 18px rgba(22,20,15,.28); }

.pin__pulse {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--pin-size); height: var(--pin-size);
  margin-left: calc(var(--pin-size) / -2);
  border-radius: 50%;
  background: var(--accent);
  opacity: .35;
  animation: pinpulse 2.6s infinite ease-out;
  pointer-events: none;
}
@keyframes pinpulse {
  0% { transform: scale(1); opacity: .35; }
  70% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.map-card {
  position: absolute;
  z-index: 5;
  width: 280px;
  background: var(--bone);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(22,20,15,.18);
  transform: translate(-50%, calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.map-card.is-on {
  opacity: 1;
  pointer-events: auto;
}
.map-card__img {
  aspect-ratio: 4 / 2.5;
  background-size: cover; background-position: center;
  filter: var(--img-filter);
}
.map-card__body { padding: 14px 16px 16px; }
.map-card__tag { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.map-card__name { margin-top: 4px; font-family: var(--serif); font-variation-settings:"opsz" 36; font-size: 20px; font-weight: 400; letter-spacing: -0.01em; color: var(--ink); line-height: 1.1; }
.map-card__where { margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.map-card__when { margin-top: 8px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.map-card__cta { display: inline-flex; gap: 6px; margin-top: 12px; font-size: 12px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.map-card__cta:hover { color: var(--accent); border-bottom-color: var(--accent); }

.map-list {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 24px;
  font-size: 13px;
}
@media (max-width: 880px) { .map-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .map-list { grid-template-columns: 1fr; } }
.map-list__item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
  cursor: pointer;
  color: var(--ink-2);
  transition: color .2s ease;
}
.map-list__item:hover, .map-list__item.is-on { color: var(--ink); }
.map-list__num { font-size: 11px; letter-spacing: 0.08em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.map-list__name { font-family: var(--serif); font-variation-settings:"opsz" 36; font-weight: 400; font-size: 16px; color: var(--ink); letter-spacing: -0.005em; }
.map-list__where { font-size: 11px; letter-spacing: 0.04em; color: var(--ink-3); }

/* =========================================================
   "Don't see your moment?" block
   ========================================================= */
.miss {
  padding: clamp(80px, 12vw, 140px) 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.miss__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 96px);
  align-items: end;
}
@media (max-width: 880px) { .miss__inner { grid-template-columns: 1fr; gap: 32px; } }
.miss__title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 96;
  font-weight: 300;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0;
  max-width: 14ch;
}
.miss__title em { font-style: italic; color: var(--deep); }
.miss__copy { font-size: 17px; color: var(--ink); line-height: 1.6; margin: 0 0 24px; max-width: 44ch; }
.miss__copy .muted { color: var(--ink-2); }
.miss__ctas {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}

/* =========================================================
   reveal motion (kept restrained)
   ========================================================= */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .evt__img, .tl-evt__img, .map-card__img { transition: none !important; }
}

/* show theme switcher on this page */
