/* The Solar Story programme calendar: season columns, twelve months, and the
 * Luminaries schedule. Ported from the 2027 calendar draft and re-struck in the
 * site's light palette - the draft was dark-themed with its own type.
 *
 * The event colours are the draft's own light-mode set, kept as they were: they
 * are a designed sequence, and the fills have to stay distinguishable from each
 * other at the size of a single calendar cell. */
.solar-cal {
  --cal-gold: var(--gold);
  --cal-gold-hi: var(--gold-dark);
  --cal-dim: #7a663d;
  --cal-rule: rgba(148, 113, 4, .32);
  --cal-hair: rgba(148, 113, 4, .12);
  --cal-shade: rgba(148, 113, 4, .10);
  --cal-cell: rgba(148, 113, 4, .05);

  --f-live: #f9d3a2;  --f-workshop: #eeeaa0; --f-dream: #d3ccf5; --f-council: #b2e2d7;
  --f-craft: #f8c4ba; --f-tea: #b9d6f4;      --f-writing: #d0e7ad; --f-mvp: #eec2e2;

  border: 1px solid var(--cal-rule);
  background: #fffdf7;
}

/* Wrapping, because four tab labels do not fit on one line on a small phone
   and would otherwise push the whole page sideways. */
.solar-cal .views { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--cal-rule); }
.solar-cal .views button {
  flex: 1;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--cal-hair);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cal-dim);
  padding: 12px 6px;
  cursor: pointer;
  letter-spacing: .03em;
}
.solar-cal .views button:last-child { border-right: 0; }
.solar-cal .views button:hover { color: var(--ink); }
.solar-cal .views button[aria-selected="true"] { color: var(--cal-gold-hi); background: var(--cal-shade); }
.solar-cal .views button:focus-visible { outline: 2px solid var(--cal-gold); outline-offset: -2px; }

.solar-cal .panel { display: none; }
.solar-cal .panel.on { display: block; }

.solar-cal h2, .solar-cal h3 { font-family: var(--font-head); font-weight: 400; margin: 0; }
.solar-cal ul { list-style: none; margin: 0; padding: 0; }
.solar-cal .d { color: var(--cal-gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.solar-cal em { font-style: italic; color: var(--cal-dim); }

/* Season columns */
.solar-cal .seasons { display: grid; grid-template-columns: repeat(4, 1fr); }
.solar-cal .season { padding: 16px 16px 14px; border-right: 1px solid var(--cal-rule); }
.solar-cal .season:last-child { border-right: 0; }
.solar-cal .season h2 { font-size: 1.5rem; color: var(--cal-gold-hi); line-height: 1; }
.solar-cal .season h2 span {
  display: block;
  font-family: var(--font-body);
  font-size: .8rem;
  color: var(--cal-dim);
  margin-top: 5px;
  letter-spacing: .07em;
}
.solar-cal .season ul { margin-top: 12px; }
.solar-cal .season li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  font-size: .85rem;
  line-height: 1.35;
  padding: 3px 0;
  border-bottom: 1px solid var(--cal-hair);
}
.solar-cal .season li:last-child { border-bottom: 0; }
.solar-cal li.stage .n, .solar-cal li.stage .d { color: var(--cal-gold-hi); }
.solar-cal .mark { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.solar-cal .mark.fill { background: var(--f); }
.solar-cal .mark.open { background: var(--f); box-shadow: inset 0 0 0 1px var(--mk); }

/* Twelve months */
.solar-cal .months { display: grid; grid-template-columns: repeat(3, 1fr); }
.solar-cal .mo { padding: 14px 16px 16px; border-right: 1px solid var(--cal-hair); border-bottom: 1px solid var(--cal-hair); }
.solar-cal .mo:nth-child(3n) { border-right: 0; }
.solar-cal .mo h3 { font-size: 1.3rem; color: var(--cal-gold-hi); line-height: 1; margin-bottom: 8px; }
.solar-cal .dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: .7rem; color: var(--cal-dim); text-align: center; margin-bottom: 3px; }
.solar-cal .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
/* `min-width: 0` matters: `aspect-ratio` transfers a cell's resolved height
   back as its minimum width, which pinned a month block at ~327px however
   narrow its container was, and pushed the whole page sideways at 320px. */
.solar-cal .cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 3px;
  background: var(--cal-cell);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 10px;
  font-size: .8rem;
  color: var(--cal-dim);
}
.solar-cal .cell.pad { background: none; }
.solar-cal .cell.ev { color: var(--ink); }
.solar-cal .cell.stageday { box-shadow: inset 0 0 0 1.5px var(--cal-gold); color: var(--cal-gold-hi); padding-top: 20px; }
.solar-cal .cell.stageday .top {
  white-space: normal;
  font-family: var(--font-head);
  font-style: italic;
  font-size: .68rem;
  line-height: 1.08;
  padding: 0 3px;
  color: var(--cal-gold-hi);
}
.solar-cal .cell .top {
  position: absolute;
  top: 2px; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .66rem;
  line-height: 1;
  color: var(--cal-gold);
  white-space: nowrap;
}
.solar-cal .mn { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.solar-cal .mn.new { background: var(--cal-gold); }
.solar-cal .mn.full { border: 1.3px solid var(--ink); background: none; }

/* The month picker and the per-month diary belong to the phone treatment
   below; on a wide screen every month is on show at once and neither is used. */
.solar-cal .months-nav,
.solar-cal .molist { display: none; }

.solar-cal .swatch { display: inline-block; width: 13px; height: 13px; border-radius: 3px; border: .5px solid var(--cal-rule); flex: none; }
.solar-cal .swatch.stage { background: none; box-shadow: inset 0 0 0 1.5px var(--cal-gold); border: 0; }
.solar-cal .legend2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--cal-rule);
  font-size: .85rem;
  color: var(--cal-dim);
}
.solar-cal .legend2 span { display: flex; align-items: center; gap: 6px; }

/* Pull-outs, used by both the all-member and Luminaries panels */
.solar-cal .pullouts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--cal-rule); }
.solar-cal .po { padding: 14px 16px 13px; border-right: 1px solid var(--cal-rule); }
.solar-cal .po:last-child { border-right: 0; }
.solar-cal .po .hd { display: flex; align-items: center; gap: 9px; }
.solar-cal .po h3 { font-size: 1.25rem; color: var(--cal-gold-hi); line-height: 1; }
.solar-cal .po .sub { display: block; font-size: .78rem; color: var(--cal-dim); margin-top: 5px; letter-spacing: .05em; line-height: 1.4; }
.solar-cal .po ul { margin-top: 10px; column-gap: 20px; }
.solar-cal .po li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 9px;
  font-size: .84rem;
  line-height: 1.4;
  padding: 3px 0;
  border-bottom: 1px solid var(--cal-hair);
  break-inside: avoid;
  align-items: center;
}
.solar-cal .po li .d { background: var(--po, var(--cal-cell)); color: var(--ink); border-radius: 3px; padding: 2px 0; text-align: center; }
.solar-cal .po.stages li .d { background: none; box-shadow: inset 0 0 0 1.5px var(--cal-gold); color: var(--cal-gold-hi); }
.solar-cal .po.two ul { columns: 2; }
.solar-cal .lumgrid { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--cal-rule); }
.solar-cal .lumgrid .po { border-bottom: 0; }
.solar-cal .lumhead { padding: 16px 16px 12px; }
.solar-cal .lumhead h2 { font-size: 1.8rem; color: var(--cal-gold-hi); }
.solar-cal .lumhead p { font-size: .9rem; color: var(--cal-dim); margin-top: 6px; line-height: 1.55; }
.solar-cal .lvchip {
  display: inline-block;
  background: var(--f-live);
  color: var(--ink);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: .72rem;
  font-style: normal;
  white-space: nowrap;
}
.solar-cal .sp { font-weight: 600; color: var(--cal-gold-hi); }
.solar-cal .spnote { font-size: .75rem; color: var(--cal-dim); }

@media (max-width: 900px) {
  .solar-cal .seasons, .solar-cal .months { grid-template-columns: repeat(2, 1fr); }
  .solar-cal .pullouts, .solar-cal .lumgrid { grid-template-columns: 1fr; }
  .solar-cal .po { border-right: 0; border-bottom: 1px solid var(--cal-rule); }
  .solar-cal .po.two ul { columns: 1; }
}
@media (max-width: 560px) {
  .solar-cal .seasons { grid-template-columns: 1fr; }
  .solar-cal .season { border-right: 0; }
}

/* The twelve months on a phone.
 *
 * Stacking all twelve grids ran to ~3,800px of scrolling, and the colour fills
 * could only be read through a `title` tooltip, which a touch screen never
 * shows. So below 720px the view becomes a month picker, one month at full
 * width, and that month's diary underneath - the diary is what decodes the
 * colours without a pointer. Every month stays in the DOM, so print and wide
 * screens are untouched. */
@media (max-width: 720px) {
  .solar-cal .months { display: block; }
  .solar-cal .mo {
    display: none;
    border: 0;
    max-width: 420px;
    margin: 0 auto;
  }
  .solar-cal .mo.on { display: block; }

  /* A stage name does not fit in a cell this size - "The Quest-ion" broke
     across two lines mid-word - and it no longer has to: the gold ring marks
     the day and the diary below names the stage in full. */
  .solar-cal .cell.stageday .top { display: none; }
  .solar-cal .cell.stageday { padding-top: 10px; }

  .solar-cal .months-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    padding: 14px 16px 2px;
  }
  .solar-cal .months-nav button {
    position: relative;
    min-height: 46px;
    padding: 10px 0 16px;
    background: var(--cal-cell);
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: .9rem;
    color: var(--cal-dim);
    cursor: pointer;
  }
  .solar-cal .months-nav button[aria-pressed="true"] {
    background: var(--cal-shade);
    border-color: var(--cal-gold);
    color: var(--cal-gold-hi);
  }
  /* A gold dot marks the months in which one of the eight stages opens, so the
     spine of the year is visible from the picker alone. */
  .solar-cal .months-nav button.has-stage::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 7px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--cal-gold);
  }
  .solar-cal .months-nav button:focus-visible { outline: 2px solid var(--cal-gold); outline-offset: 1px; }

  .solar-cal .molist {
    display: block;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--cal-rule);
  }
  .solar-cal .molist li {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 9px;
    font-size: .88rem;
    line-height: 1.4;
    padding: 5px 0;
    border-bottom: 1px solid var(--cal-hair);
  }
  .solar-cal .molist li:last-child { border-bottom: 0; }
  /* The moon discs carry no margin of their own - inside a cell they are
     spaced by flex gap - so the diary has to give them one. */
  .solar-cal .molist .n > .mn { margin-right: 5px; }
  .solar-cal .molist li.stage .d, .solar-cal .molist li.stage .n { color: var(--cal-gold-hi); }
}

@media print {
  .solar-cal .views,
  .solar-cal .months-nav,
  .solar-cal .molist { display: none !important; }
  .solar-cal .months { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; }
  .solar-cal .mo { display: block !important; max-width: none; }
  .solar-cal .panel { display: none !important; }
  .solar-cal .panel.on { display: block !important; }
  .solar-cal * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* The two-line key under the title: seasons vs stages */
.cal-key { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0 0; }
.cal-key div { padding: 16px 18px; border-top: 3px solid var(--gold); background: var(--paper-alt); border-radius: 8px; }
.cal-key dt { font-family: var(--font-head); font-size: 1.5rem; line-height: 1.1; margin-bottom: 4px; }
.cal-key dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 560px) { .cal-key { grid-template-columns: 1fr; } }
.wheel-head { margin-bottom: 32px; }
.wheel-head h2 { margin: 0; }
.wheel-head p { margin: 4px 0 0; }
