/* Bio bay moon calendar (js/moon-calendar.js)
   A night panel that sizes to its container, so it works full width or in a side column.
   Dark nights glow aqua, moonlit nights take the moon's ivory. Colors follow the site tokens when present. */
.mooncal {
  --mc-ink: var(--ink, #06222e);
  --mc-deep: var(--deep, #0c3340);
  --mc-glow: var(--glow, #5cf2d6);
  --mc-moon: var(--moon, #f3e9c8);
  --mc-action: var(--sunset, #ff8a4c);
  --mc-text: #e6f4f1;
  --mc-muted: #a3c4c6;
  --mc-line: rgba(230, 244, 241, .16);
  /* night levels: one set of colors for the day cells and the legend, so they always match */
  --mc-c4: rgba(92, 242, 214, .36);
  --mc-c3: rgba(92, 242, 214, .16);
  --mc-c2: rgba(243, 233, 200, .14);
  --mc-c1: rgba(243, 233, 200, .34);
  container-type: inline-size;
  background: radial-gradient(120% 70% at 50% 112%, rgba(92, 242, 214, .16), transparent 62%), var(--mc-ink);
  color: var(--mc-text);
  border-radius: 20px;
  padding: 20px 14px;
  font: inherit;
  line-height: 1.45;
  text-align: left;
}
.mooncal *, .mooncal *::before, .mooncal *::after { box-sizing: border-box; }
.mooncal p, .mooncal ul, .mooncal h3 { margin: 0; padding: 0; }
.mooncal ul { list-style: none; }
.mooncal button, .mooncal input { font: inherit; color: inherit; }
.mooncal :focus-visible { outline: 2px solid var(--mc-glow); outline-offset: 2px; }

/* Trip dates */
.mc-q { font-weight: 700; font-size: 1.125rem; margin-bottom: 10px; }
.mc-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mc-field { display: block; min-width: 0; }
.mc-field span { display: block; font-size: .8125rem; color: var(--mc-muted); margin-bottom: 4px; }
.mc-field input {
  display: block; width: 100%; min-width: 0; min-height: 46px; padding: 0 10px;
  font-size: 16px;   /* below 16px iPhones zoom the page on focus */
  background: var(--mc-deep); border: 1px solid var(--mc-line); border-radius: 12px; color-scheme: dark;
}
.mc-tripout:not(:empty) { margin-top: 14px; }
.mc-best { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.mc-best-level { font-weight: 400; font-size: .875rem; color: var(--mc-muted); display: inline-flex; align-items: center; gap: 6px; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mc-chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-weight: 700;
  background: rgba(92, 242, 214, .16); border: 1px solid rgba(92, 242, 214, .5);
}
.mc-hint { font-size: .875rem; color: var(--mc-muted); margin-top: 8px; }

/* Month grid */
.mc-body { margin-top: 20px; }
.mc-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-month { font-weight: 700; font-size: 1.125rem; }
.mc-arrow {
  width: 46px; height: 46px; border-radius: 50%; background: none; border: 1px solid var(--mc-line); cursor: pointer;
  display: grid; place-items: center;
}
.mc-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mc-arrow:disabled { opacity: .3; cursor: default; }
.mc-grid { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.mc-grid th { font-size: .75rem; font-weight: 500; color: var(--mc-muted); padding: 4px 0; }
.mc-grid abbr { text-decoration: none; }
.mc-grid td { padding: 0; }
.mc-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 100%; min-height: 58px; padding: 4px 0 6px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; font-variant-numeric: tabular-nums;
}
.mc-num { font-size: .8125rem; line-height: 1; font-weight: 500; }
.mc-moon { width: 20px; height: 20px; display: block; flex: none; }
.mc-moon-dark { fill: rgba(230, 244, 241, .13); }
.mc-moon-lit { fill: var(--mc-moon); }
.mc-day.mc-l4 { background: var(--mc-c4); box-shadow: 0 0 14px rgba(92, 242, 214, .22); }
.mc-day.mc-l3 { background: var(--mc-c3); }
.mc-day.mc-l2 { background: var(--mc-c2); }
.mc-day.mc-l1 { background: var(--mc-c1); }
.mc-day:disabled { opacity: .32; cursor: default; box-shadow: none; }
.mc-day.is-today .mc-num { background: var(--mc-text); color: var(--mc-ink); border-radius: 999px; padding: 2px 6px; font-weight: 700; }
.mc-day.is-trip::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 2px; height: 3px; border-radius: 2px; background: var(--mc-text); }
.mc-day.is-sel { box-shadow: inset 0 0 0 2px #fff, 0 0 14px rgba(92, 242, 214, .22); }
.mc-dia { width: 7px; height: 7px; background: #fff; transform: rotate(45deg); display: inline-block; flex: none; }
.mc-day .mc-dia { position: absolute; top: 5px; right: 5px; }

.mc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .8125rem; color: var(--mc-muted); }
.mc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.mc-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.mc-sw { box-shadow: inset 0 0 0 1px rgba(230, 244, 241, .28); }
.mc-sw.mc-l4 { background: var(--mc-c4); box-shadow: inset 0 0 0 1px rgba(92, 242, 214, .6), 0 0 8px rgba(92, 242, 214, .4); }
.mc-sw.mc-l3 { background: var(--mc-c3); }
.mc-sw.mc-l2 { background: var(--mc-c2); }
.mc-sw.mc-l1 { background: var(--mc-c1); }

/* Selected night */
.mc-detail { margin-top: 18px; background: var(--mc-deep); border-radius: 16px; padding: 16px 14px; }
.mc-date { font: inherit; font-weight: 700; font-size: 1.25rem; line-height: 1.2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mc-tonight { font-size: .75rem; font-weight: 700; background: var(--mc-text); color: var(--mc-ink); border-radius: 999px; padding: 3px 9px; }
.mc-level { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 700; }
.mc-sky { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; color: var(--mc-muted); font-size: .9375rem; }
.mc-sky .mc-moon { width: 26px; height: 26px; margin-top: 1px; }
.mooncal .mc-link {
  margin-top: 10px; min-height: 44px; padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--mc-glow); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-align: left;
}
.mc-tours { margin-top: 12px; }
.mc-tour { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--mc-line); }
.mc-tour-name { font-size: 1rem; }
.mc-tour-name strong { display: block; font-size: 1.0625rem; }
.mc-tour-name a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.mc-tour-meta { font-size: .875rem; color: var(--mc-muted); margin-top: 2px; }
.mc-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--mc-action); color: var(--mc-ink); font-weight: 700; text-decoration: none; text-align: center;
  border: 0; cursor: pointer; white-space: nowrap;
}
.mc-btn-quiet { background: none; color: var(--mc-text); border: 1px solid var(--mc-line); }

.mc-how { margin-top: 16px; font-size: .875rem; color: var(--mc-muted); }
.mc-how summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--mc-text); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.mc-how summary::-webkit-details-marker { display: none; }
.mc-how p { margin-top: 4px; max-width: 68ch; }

/* Wide container: calendar and the selected night side by side */
@container (min-width: 700px) {
  .mc-trip { display: grid; grid-template-columns: auto minmax(0, 340px) minmax(0, 1fr); align-items: end; gap: 6px 20px; }
  .mc-q { margin-bottom: 12px; }
  .mc-tripout:not(:empty) { margin-top: 0; }
  .mc-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .mc-detail { margin-top: 0; padding: 20px; }
  .mc-day { min-height: 64px; }
  .mc-tour { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
@container (min-width: 700px) and (max-width: 899px) {
  .mc-tour { grid-template-columns: 1fr; }
}
@supports not (container-type: inline-size) {
  @media (min-width: 900px) {
    .mc-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
    .mc-detail { margin-top: 0; }
  }
}
@media (min-width: 760px) { .mooncal { padding: 28px; } }
