/* Calendar-specific styles. Shared shell/navigation/sections live in /css/reach/. */
.calendar-heading {
  margin-bottom: 2.5rem;
}

.calendar-title {
  margin: 0 0 1rem;
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 500;
  line-height: .94;
  letter-spacing: -.055em;
}

.calendar-intro {
  max-width: 720px;
  color: var(--theme-text-muted);
  font-size: clamp(1.05rem, 1.35vw, 1.28rem);
  line-height: 1.75;
}

.events-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.event-card {
  display: flex;
  width: 100%;
  min-height: 360px;
  overflow: hidden;
  border-radius: var(--theme-radius-lg);
  scroll-margin-top: calc(var(--reach-nav-height, 0px) + 2rem);
}

.event-photo-wrap {
  position: relative;
  flex: 0 0 38%;
  width: 38%;
  max-width: 420px;
  overflow: hidden;
  background: var(--theme-surface-soft);
}

.event-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.event-date-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  min-width: 64px;
  padding: .65rem .75rem;
  border-radius: .85rem;
  background: color-mix(in srgb, var(--theme-surface) 92%, transparent);
  box-shadow: var(--theme-shadow-sm);
  color: var(--theme-text);
  text-align: center;
  backdrop-filter: blur(8px);
}

.event-date-badge strong,
.event-date-badge span {
  display: block;
}

.event-date-badge strong {
  font-size: 1.55rem;
  line-height: 1;
}

.event-date-badge span {
  margin-top: .18rem;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.event-body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
  padding: 2rem;
}

.event-name {
  margin-bottom: 1rem;
}

.event-details {
  color: var(--theme-text-muted);
  line-height: 1.72;
}

.event-details p:last-child,
.event-popup-copy p:last-child {
  margin-bottom: 0;
}

.event-meta {
  display: grid;
  gap: .8rem;
  margin-top: 1.25rem;
}

.event-meta-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  color: var(--theme-text);
}

.event-meta-row i {
  width: 1.25rem;
  margin-top: .08rem;
  color: var(--theme-text-soft);
}

.event-meta-row small {
  display: block;
  color: var(--theme-text-soft);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.event-actions {
  margin-top: auto;
  padding-top: 1.5rem;
}

.empty-calendar {
  padding: 4rem 1rem;
  border: 1px dashed var(--theme-border);
  border-radius: 1.2rem;
  color: var(--theme-text-muted);
  text-align: center;
}

@media (max-width: 991.98px) {
  .event-card {
    flex-direction: column;
    min-height: 0;
  }

  .event-photo-wrap {
    flex: none;
    width: 100%;
    max-width: none;
  }

  .event-photo {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .event-body {
    padding: 1.4rem;
  }
}

@media (max-width: 575.98px) {
  .calendar-title {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }
}

/* Shared project agendas are shown inline with the public event information. */
.event-details h3 {
  font-size: 1.05rem;
  margin: 1.3rem 0 .5rem;
  color: var(--theme-text)
}

.event-details [data-comm-block="agenda"] {
  margin: 0 0 1.25rem !important;
  padding: .25rem 0 .25rem 1rem !important;
  border-left: 2px solid var(--theme-border)
}

.event-details [data-comm-list="agenda"] {
  padding-left: 1rem !important
}

.event-details [data-comm-list="agenda"] li {
  padding: .2rem 0
}

/* Date and location match the email metadata. */
.event-meta-row {
  font: 600 18px/1.5 Arial, sans-serif;
  gap: 6px
}

.event-meta-row>img {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 3px
}

.event-meta-row a {
  color: inherit;
  text-decoration: none
}

.event-meta-row a:hover {
  text-decoration: underline
}

/* Public calendar icons follow the active theme, including live mode changes.
   SVG currentColor avoids hard-coded PNG colors and brightness filters. */
.event-meta .event-meta-row > .event-meta-icon {
  display: block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  flex: none;
  margin-top: 3px;
  color: var(--theme-text-soft, var(--theme-text));
  stroke: currentColor;
}

/* Shared banner layout: one column on small screens, two event cards on desktop. */
.events-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start
}

.event-card {
  display: block;
  min-height: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none
}

.event-heading {
  text-align: center;
  padding: 0 8px 24px
}

.event-organization {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--theme-text-muted)
}

.event-name {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 750;
  margin: 0
}

.event-surface {
  background: #f9fbfd;
  background: color-mix(in srgb, var(--theme-surface, #fff) 97.5%, #1673b1 2.5%);
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  overflow: hidden
}

.event-photo-wrap {
  width: 100%;
  max-width: none;
  min-height: 0;
  overflow: hidden;
  background: transparent
}

.event-photo {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 32/9;
  object-fit: cover
}

.event-no-photo:has(.event-date-badge) {
  height: 104px
}

.event-no-photo:not(:has(.event-date-badge)) {
  display: none
}

.event-date-badge {
  top: 14px;
  left: 14px;
  padding: 10px 14px;
  border-radius: 13px;
  min-width: 0;
  background: var(--theme-surface, #fff);
  color: var(--theme-text);
  box-shadow: 0 2px 10px #0002
}

.event-date-badge strong {
  font: 700 30px/1.1 Arial, sans-serif
}

.event-date-badge span {
  font: 12px/1.2 Arial, sans-serif;
  letter-spacing: 0;
  margin-top: 4px
}

.event-body {
  padding: 32px;
  display: block;
  font: 16px/1.6 Arial, sans-serif
}

.event-meta {
  margin: 0 0 24px;
  gap: 16px
}

.event-meta-row strong,
.event-meta-row span {
  display: block
}

.event-details {
  color: var(--theme-text);
  line-height: 1.6
}

.event-actions {
  margin: 24px 0 0;
  padding: 0
}

.event-actions .btn {
  background: #087b91;
  border-color: #087b91;
  color: #fff;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 600;
  text-decoration: none
}

@media(min-width:992px) {
  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:575.98px) {
  .event-body {
    padding: 24px
  }

  .event-name {
    font-size: 28px
  }
}

/* Keep event names in navigation/metadata without repeating them above banners. */
.event-heading[hidden] {
  display: none !important
}

/* The saved banner is already cropped to 1280 × 360, matching email. */
.event-photo-wrap>.event-photo {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 32/9;
  object-fit: cover;
  object-position: center
}

/* Email cards use a 640px maximum banner width (640 × 180 at desktop size). */
.events-grid>.event-card {
  width: 100%;
  max-width: 640px;
  justify-self: center
}

/* A translucent surface lets the banner show through; text stays opaque. */
.event-date-badge {
  background: color-mix(in srgb, var(--theme-surface, #fff) 80%, transparent);
  backdrop-filter: blur(0px);
  /* -webkit-backdrop-filter: blur(3px) */
}

.event-body>.event-name {
  margin: 0 0 22px;
  font: 750 32px/1.2 Arial, sans-serif
}

@media(max-width:575.98px) {
  .event-body>.event-name {
    font-size: 28px
  }
}

/* Masonry event cards: two independent vertical stacks on desktop.
   Column layout avoids equal-height grid rows and fills vertical gaps. */
.events-grid {
  display: block;
  columns: 1;
  column-gap: 32px;
}

.events-grid>.event-card {
  display: inline-block;
  vertical-align: top;
  width: 100%;
  max-width: 640px;
  margin: 0 0 32px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

@media (min-width:992px) {
  .events-grid {
    columns: 2;
  }
}

@media (max-width:991.98px) {
  .events-grid {
    columns: 1;
  }
}

/* Keep masonry at two columns on all desktop widths. */
@media (min-width:1200px) {
  .events-grid {
    columns: 2;
    column-gap: 32px;
  }

  .events-grid>.event-card {
    margin-bottom: 32px;
  }
}

/* Global event typography, excluding event titles and explicit rich-text overrides. */
/* Shared global typography: metadata and rich text are independently configured. */
.calendar-section .event-meta {
  font-size: var(--reach-event-meta-size, 12pt);
  font-weight: var(--reach-event-meta-weight, 400)
}

.calendar-section .event-details {
  font-size: var(--reach-event-body-size, 12pt);
  font-weight: var(--reach-event-body-weight, 400)
}

.calendar-section .event-meta :is(strong, span, a) {
  font-size: inherit;
  font-weight: inherit
}


/* Apply site-wide metadata typography directly to the rendered date/time and location rows.
   The metadata wrapper previously inherited font sizes from theme rules on descendants. */
.calendar-section .event-meta-row,
.calendar-section .event-meta-row>div,
.calendar-section .event-meta-row>div :is(strong, span, a) {
  font-size: var(--reach-event-meta-size, 12pt);
  font-weight: var(--reach-event-meta-weight, 400);
}


/* Global defaults belong on the description container. Descendants inherit them
   naturally, leaving saved editor markup (<strong>, <em>, inline font styles)
   free to override. Do not use font-weight:inherit !important on descendants. */
.calendar-section .event-details {
  font-size: var(--reach-event-body-size, 12pt);
  font-weight: var(--reach-event-body-weight, 400);
}

.calendar-section .event-details :is(p, div, ul, ol, li, blockquote) {
  font-size: inherit;
  font-weight: inherit;
}

.calendar-section .event-details :is(strong, b) {
  font-weight: 700;
}

.calendar-section .event-details :is(em, i) {
  font-style: italic;
}

/* The editor's inline styles have higher specificity than these defaults. */

.event-website-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  font-size: 20px;
  color: var(--theme-text-soft, var(--theme-text))
}

.event-meta-row a {
  overflow-wrap: anywhere;
}

/* Website sits directly below the address in the event metadata. */
.event-meta .event-website-row {
  align-items: flex-start;
  margin-top: 8px
}

.event-meta .event-website-row .event-website-icon {
  flex: none;
  color: var(--theme-text-soft, var(--theme-text))
}

.event-meta .event-website-row a {
  font-weight: inherit;
  overflow-wrap: anywhere
}
/* Keep the event date badge exclusively in the upper-left of the image. */
.event-photo-wrap > .event-date-badge { position:absolute; top:14px; left:14px; right:auto; bottom:auto; z-index:2; }
.event-body .event-date-badge { display:none !important; }

/* Badge is anchored to the image, never the content/title. */
.event-card .event-photo-wrap { position: relative; }
.event-card .event-photo-wrap > .event-date-badge { position:absolute !important; top:14px !important; left:14px !important; right:auto !important; bottom:auto !important; z-index:3; }
.event-card .event-body .event-date-badge { display:none !important; }

/* Date badge belongs to the top-right of the event content, beside its title. */
.event-card .event-photo-wrap > .event-date-badge {display:none!important}
.event-card .event-body .event-title-row {display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:22px}
.event-card .event-body .event-title-row > .event-name {flex:1;min-width:0;margin:0}
.event-card .event-body .event-title-row > .event-date-badge {display:block!important;position:static!important;inset:auto!important;flex-shrink:0;margin:0;background:#414141;color:#fff;box-shadow:none}
@media(prefers-color-scheme:dark){.event-card .event-body .event-title-row > .event-date-badge {background:#e8e8e8;color:#202124}}
.event-no-photo {display:none!important}

/* Final title-row badge contrast: light is charcoal, dark is pale gray. */
@media (prefers-color-scheme: light) {
  .event-card .event-body .event-title-row > .event-date-badge {background:#414141 !important;color:#ffffff !important;}
}
@media (prefers-color-scheme: dark) {
  .event-card .event-body .event-title-row > .event-date-badge {background:#e8e8e8 !important;color:#202124 !important;}
}

/* Badge contrast follows the website theme tokens, not the device preference.
   --theme-text is dark on light surfaces and light on dark surfaces. */
.event-card .event-body .event-title-row > .event-date-badge {
  background: var(--theme-text, #222222) !important;
  color: var(--theme-surface, #ffffff) !important;
}

/* Optional project subtitle: smaller than the main title, sharing its heading column. */
.event-card .event-body .event-title-row > .event-heading {flex:1;min-width:0}
.event-card .event-body .event-title-row .event-heading > .event-name {margin:0}
.event-card .event-body .event-title-row .event-subtitle {
  margin:.45rem 0 0;font-size:clamp(1rem, 1.4vw, 1.2rem);
  line-height:1.4;font-weight:500;color:var(--theme-text);
  overflow-wrap:anywhere;
}

/* Event card titles and subtitles stay left-aligned. The centered page heading
   (.event-heading) must not affect the event-heading column inside cards. */
.event-card .event-body .event-title-row > .event-heading {
  text-align: left;
  padding: 0;
}
.event-card .event-body .event-title-row .event-name,
.event-card .event-body .event-title-row .event-subtitle {
  text-align: left;
}

/* No subtitle means no reserved subtitle row or vertical whitespace.
   Date/location follow the title with the same compact spacing. */
.event-card .event-body .event-title-row.no-subtitle {
  margin-bottom: 12px;
}
.event-card .event-body .event-title-row.has-subtitle {
  margin-bottom: 12px;
}
.event-card .event-body .event-title-row.no-subtitle .event-subtitle {
  display: none;
  margin: 0;
  padding: 0;
}

/* 2026-11-11: Keep the badge out of the heading's document flow.
   Without this, its height creates a false subtitle-sized gap. */
.event-card .event-body .event-title-row {
  display: block !important;
  position: relative !important;
  padding-right: 62px !important;
  margin-bottom: 10px !important;
  min-height: 0 !important;
}
.event-card .event-body .event-title-row > .event-heading {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  text-align: left !important;
}
.event-card .event-body .event-title-row > .event-date-badge {
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  margin: 0 !important;
}
.event-card .event-body .event-title-row .event-subtitle {
  font-weight: 700 !important;
  text-align: left !important;
}
.event-card .event-body .event-title-row.no-subtitle .event-subtitle { display: none !important; }

/* Shared event design: values come from /calendar/event_style.json. */
.event-card .event-surface { background:var(--comm-event-card,var(--theme-surface)) !important; }
.event-card .event-body { color:var(--comm-event-text,var(--theme-text)); }
.event-card .event-details { color:var(--comm-event-text,var(--theme-text)); }
.event-card .event-meta-row { gap:var(--comm-event-icon-gap,12px); }
.event-card .event-meta-row > .event-meta-icon { width:var(--comm-event-icon-width,22px);height:var(--comm-event-icon-width,22px);flex:0 0 var(--comm-event-icon-width,22px); }
.event-card .event-meta-row > div { min-width:0; }
.event-card .event-meta-row > div :is(strong,span) { display:block; }
.event-card .event-details { border-top:1px solid var(--comm-event-divider,var(--theme-border,#303c48));padding-top:var(--comm-event-divider-margin,24px);margin-top:var(--comm-event-divider-margin,24px); }
.event-card .event-details [data-comm-block="section-divider"] { display:none!important; }

/* Balance metadata-to-divider and divider-to-description using shared spacing. */
.event-card .event-meta { margin-bottom:0 !important; }

/* Keep event foreground, surface and badge on the SAME active theme palette.
   These values are populated from the shared event_style.json. */
.event-card .event-surface { background-color:var(--comm-event-card,var(--theme-surface)) !important; }
.event-card .event-body,
.event-card .event-body .event-heading .event-name,
.event-card .event-body .event-heading .event-subtitle,
.event-card .event-body .event-meta,
.event-card .event-body .event-meta-row,
.event-card .event-body .event-meta-row :is(strong,span,a),
.event-card .event-body .event-details,
.event-card .event-body .event-details p {
  color:var(--comm-event-text,var(--theme-text)) !important;
}
.event-card .event-body .event-title-row > .event-date-badge {
  background:var(--comm-event-badge,var(--theme-text)) !important;
  color:var(--comm-event-badge-text,var(--theme-surface)) !important;
}

/* One divider owns both sides of the metadata/content gap. Optional lists
   contribute no empty placeholder or reserved vertical space. */
.event-card .event-details { margin-top:var(--comm-event-divider-margin,24px) !important; padding-top:var(--comm-event-divider-margin,24px) !important; }
.event-card .event-details > :first-child { margin-top:0 !important; }
.event-card .event-details > :last-child { margin-bottom:0 !important; }
.event-card .event-details :is(ul,ol):empty,
.event-card .event-details :is(p,h2,h3,blockquote):empty { display:none !important; margin:0 !important; padding:0 !important; }
