/* Kōan Sessions calendar — design tokens per spec/README.md */

@font-face {
  font-family: "Gilroy";
  src: url("/fonts/Gilroy-Medium.woff2") format("woff2"), url("/fonts/Gilroy-Medium.otf") format("opentype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Gilroy";
  src: url("/fonts/Gilroy-SemiBold.woff2") format("woff2"), url("/fonts/Gilroy-SemiBold.otf") format("opentype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Gilroy";
  src: url("/fonts/Gilroy-Bold.woff2") format("woff2"), url("/fonts/Gilroy-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Gilroy";
  src: url("/fonts/Gilroy-ExtraBold.woff2") format("woff2"), url("/fonts/Gilroy-ExtraBold.otf") format("opentype");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  --black: #000000;
  --white: #FFFFFF;
  --grey-200: #E6E6E6;
  --grey-text: #808080;
  --grey-text-soft: #666666;
  --grey-disabled: #B0B0B0;
  --near-white: #FAFAFA;
  --hover-grey: #F7F7F7;
  --violet: #7D00FF;
  --orange: #FF5400;
  --moss: #00AB46;
  --font: "Gilroy", "Manrope", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--black);
}

body {
  font-family: var(--font);
  overflow-x: hidden;
}

button, input, textarea, select { font-family: inherit; }

/* Every button here is a layout element (grid cell, chip, row), not a chrome button — the
   native appearance (3D bevel on unset sides, shadow, platform font) must not show through.
   Each button class below still sets its own border/background/padding as needed. */
button {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}

/* One focus ring, everywhere — spec: "never the browser default". :focus-visible already
   limits this to keyboard/programmatic focus, not mouse clicks, so no extra suppression needed.
   tabindex="0" only (not [tabindex] generally) — a tabindex="-1" dialog container is focused
   purely to move screen-reader/keyboard focus into it, never meant to look focused itself. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

.modal-panel:focus { outline: none; }

a { color: inherit; }

.koan-app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 32px 56px;
}

/* Header */

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--black);
  padding-bottom: 26px;
}

.site-header__left {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  margin: 0;
}

.site-header h1 {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0;
}

.intro {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  text-wrap: pretty;
  margin: 0;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
}

.swatch--violet { background: var(--violet); }
.swatch--moss { background: var(--moss); }
.swatch--orange { background: var(--orange); }

.legend-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Controls row: month tabs + level filter */

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.month-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.month-tab {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 150ms ease;
  cursor: pointer;
  min-height: 44px;
}

.month-tab:hover { border-color: var(--black); }

.month-tab.is-active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.level-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.level-filter__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-text);
}

.level-chip {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 150ms ease;
  cursor: pointer;
}

.level-chip:hover { border-color: var(--black); }

.level-chip.is-active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* Body layout */

.calendar-body {
  display: flex;
  gap: 34px;
  margin-top: 28px;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Calendar grid */

.calendar {
  flex: 1 1 520px;
  min-width: 320px;
}

.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar__weekday {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--grey-text);
  padding: 0 0 10px 2px;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(78px, auto);
  border-left: 1px solid var(--grey-200);
  border-top: 1px solid var(--grey-200);
}

.calendar-cell {
  border-right: 1px solid var(--grey-200);
  border-bottom: 1px solid var(--grey-200);
  background: var(--white);
  padding: 6px 2px;
  text-align: left;
  font-family: inherit;
  min-height: 44px;
}

.calendar-cell--blank,
.calendar-cell--weekend {
  background: var(--near-white);
}

.calendar-cell__day-number {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  display: block;
}

.calendar-cell--weekend .calendar-cell__day-number {
  color: var(--grey-disabled);
}

.calendar-cell--event {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  transition: background 150ms ease;
}

.calendar-cell--event:hover {
  background: var(--hover-grey);
}

.calendar-cell--event .calendar-cell__day-number {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-cell--session .calendar-cell__day-number { background: var(--violet); }
.calendar-cell--workshop .calendar-cell__day-number { background: var(--moss); }
.calendar-cell--deadline .calendar-cell__day-number { background: var(--orange); }

.calendar-cell__tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pin-icon { flex: none; }

.calendar-cell--session .calendar-cell__tag { color: var(--violet); }
.calendar-cell--workshop .calendar-cell__tag { color: var(--moss); }
.calendar-cell--deadline .calendar-cell__tag { color: var(--orange); }

.calendar-cell--past.calendar-cell--event .calendar-cell__day-number {
  background: var(--grey-disabled);
  color: var(--white);
}
.calendar-cell--past .calendar-cell__tag { color: var(--grey-text); }
.calendar-cell--past .calendar-cell__day-number:not([style]) { color: var(--grey-disabled); }

.calendar-cell--dimmed { opacity: 0.35; }

/* Side list */

.side-list {
  flex: 1 1 320px;
  min-width: 280px;
}

.side-list__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-text);
  margin: 0 0 12px;
}

.side-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  width: 100%;
  text-align: left;
  background: var(--white);
  font-family: inherit;
  margin-bottom: 10px;
}

.side-row:hover {
  border-color: var(--black);
  background: var(--hover-grey);
}

.side-row__chip {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-row--session .side-row__chip { background: var(--violet); }
.side-row--workshop .side-row__chip { background: var(--moss); }
.side-row--deadline .side-row__chip { background: var(--orange); }
.side-row--past .side-row__chip { background: var(--grey-disabled); }

.side-row__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.side-row__title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.18;
}

.side-row__meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-text);
}

/* Pill + location share a row so location reads as "here's where that workshop tag means",
   not as an unrelated line floating against the card as a whole. */
.side-row__pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.side-row__location {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 260px;
}

.side-row__location-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-text);
}

.side-row--past .side-row__location-text { color: var(--grey-disabled); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--black);
  color: var(--black);
  border-radius: 4px;
  padding: 3px 7px;
  width: fit-content;
}

.side-row--workshop .pill { border-color: var(--moss); color: var(--moss); }
.side-row--deadline .pill { border-color: var(--orange); color: var(--orange); }
.side-row--past .pill { border-color: var(--grey-disabled); color: var(--grey-disabled); }
.side-row--past.side-row--has-recording .pill { border-color: var(--violet); color: var(--violet); }

.side-row--past .side-row__title,
.side-row--past .side-row__meta {
  color: var(--grey-disabled);
}

.side-list__empty {
  border: 1px dashed var(--grey-200);
  border-radius: 4px;
  padding: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-text);
}

/* Shown until events.json resolves, so a slow connection sees this instead of an empty-looking
   grid and side list. boot() hides it and reveals the real content in the same tick. */
.calendar-loading {
  margin: 40px 0;
  padding: 40px 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--grey-text);
}

/* Footer */

.site-footer {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--grey-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer__note {
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-text-soft);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer__brand img {
  height: 26px;
  display: block;
}

.site-footer__brand span {
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-text-soft);
}

/* Modal */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  opacity: 0;
  transition: opacity 160ms ease;
}

.modal-overlay.is-open {
  opacity: 1;
}

.modal-overlay[hidden] { display: none; }

.modal-panel {
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--white);
  border-radius: 4px;
  position: relative;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.modal-overlay.is-open .modal-panel {
  opacity: 1;
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  color: var(--black);
  cursor: pointer;
  transition: color 150ms ease;
}

.modal-close:hover { color: var(--violet); }

.modal-panel--video .modal-close {
  top: 12px;
  right: 12px;
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.modal-panel--video .modal-close:hover { color: var(--orange); }

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px;
  padding-right: 44px;
}

/* Video hero — full-width, above everything else, edge to edge in the panel. */

.modal-video {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #141018;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.modal-video__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-video__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.35) 100%);
}

.modal-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}

.modal-video:hover .modal-video__play { background: var(--orange); }

.modal-video__tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
}

.modal-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.modal-eyebrow--session { color: var(--violet); }
.modal-eyebrow--workshop { color: var(--moss); }
.modal-eyebrow--deadline { color: var(--orange); }
.modal-eyebrow--success { color: var(--moss); }

.modal-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.06;
  margin: 0;
}

.modal-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--grey-200);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 4px;
}

.modal-pill--format {
  background: var(--black);
  color: var(--white);
}

.modal-pill--workshop {
  background: var(--moss);
  color: var(--white);
}

.modal-pill--level {
  background: var(--white);
  border: 1px solid var(--black);
}

.modal-pill--price {
  background: var(--black);
  color: var(--white);
}

.modal-pill--past {
  background: var(--white);
  border: 1px solid var(--grey-disabled);
  color: var(--grey-text);
}

.modal-body-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body-copy {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  text-wrap: pretty;
  margin: 0;
}

.modal-body-list {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
  padding-left: 22px;
}

.modal-body-list li + li { margin-top: 4px; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--violet);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 15px 24px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: background 150ms ease;
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
}

.btn-primary:hover { background: var(--orange); }

.modal-actions__note {
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-text-soft);
}

/* Inline WebinarGeek registration form */

.reg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reg-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-text);
}

.reg-input {
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--black);
  background: var(--white);
}

.reg-input:focus-visible { border-color: var(--black); }

.reg-form .btn-primary { align-self: flex-start; }

.reg-status {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.reg-status--error { color: var(--orange); }
.reg-status--error a { color: var(--orange); text-decoration: underline; }
.reg-status--success { color: var(--moss); font-size: 17px; }

.modal-past-note {
  font-size: 15px;
  font-weight: 600;
  color: var(--grey-text);
  margin: 0;
}

.booking-confirmed {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px 0 8px;
}

.booking-confirmed__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--moss);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.booking-confirmed__heading {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.booking-confirmed__note {
  font-size: 16px;
  font-weight: 500;
  color: var(--grey-text-soft);
  margin: 0;
  max-width: 340px;
}

.modal-utility {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--grey-200);
  padding-top: 16px;
}

.utility-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--violet);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 150ms ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.utility-link:hover { color: var(--orange); }

.cal-menu-wrap { position: relative; }

.cal-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  z-index: 5;
}

.cal-menu[hidden] { display: none; }

.cal-menu__item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
}

.cal-menu__item:hover { background: var(--near-white); color: var(--violet); }

/* Fallback (JS-disabled / fetch-failure) state */

.fallback-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fallback-list li {
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  padding: 16px;
  font-size: 15px;
}

.fallback-contact {
  margin-top: 20px;
  font-size: 14px;
}

[hidden] { display: none !important; }

/* Responsive */

@media (max-width: 880px) {
  .calendar-body { flex-direction: column; }
  .calendar, .side-list { flex: 1 1 auto; width: 100%; min-width: 0; }
}

@media (max-width: 520px) {
  .calendar__grid { grid-auto-rows: minmax(56px, auto); }
  .calendar-cell--event .calendar-cell__tag { display: none; }
  .site-header h1 { font-size: 38px; }
  .koan-app { padding: 32px 18px 40px; }
  .modal-content { padding: 28px; padding-right: 32px; }
  .modal-close { top: 24px; right: 24px; }
  .modal-panel--video .modal-close { top: 12px; right: 12px; }
}
