:root {
  color-scheme: light;
  --page: #f8e7bf;
  --surface: #f4dca8;
  --surface-muted: #edd39f;
  --text: #3a2b20;
  --muted: #725d43;
  --border: #d7ad6d;
  --border-soft: #ddbf8b;
  --border-strong: #a97a3f;
  --accent: #7d7d5a;
  --accent-soft: #e6deb5;
  --calendar-cell: #f7dfad;
  --obligatory: #e7d79d;
  --minor-religious: #d7dfb8;
  --secular-observance: #d9c9a3;
  --today-outline: #8f5b22;
  --main-observance-marker: #7d3f2b;
  --warning: #8f5b22;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 25px;
  line-height: 1.55;
}

a {
  color: #6d6f3f;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 500;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 500;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}

.wrap {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 42px 0 26px;
  border-bottom: 1px solid var(--border);
}

.site-footer {
  margin-top: 46px;
  padding: 24px 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.lede,
.today-line,
.muted {
  color: var(--muted);
}

.lede {
  max-width: 940px;
  margin-bottom: 0.65rem;
  font-size: 1.05rem;
}

.today-line {
  margin-bottom: 0;
}

.calendar-note {
  max-width: 760px;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.calendar-layout {
  padding-top: 24px;
}

.year-note {
  margin-bottom: 28px;
}

.year-note p {
  margin-bottom: 0;
}

.section-heading {
  margin: 34px 0 14px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  position: relative;
  width: 1.05em;
  height: 1.05em;
  border: 1px solid var(--border-strong);
}

.legend-today {
  background: var(--calendar-cell);
  outline: 2px solid var(--today-outline);
  outline-offset: -3px;
}

.legend-obligatory {
  background: var(--obligatory);
}

.legend-minor-religious {
  background: var(--minor-religious);
}

.legend-secular {
  background: var(--secular-observance);
}

.legend-main-observance {
  background: var(--calendar-cell);
}

.legend-main-observance::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 0;
  height: 0;
  border-top: 10px solid var(--main-observance-marker);
  border-left: 10px solid transparent;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.month-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.month-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.month-card h3 {
  margin-bottom: 0;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.weekday-heading {
  padding: 4px 2px 6px;
  color: #5b3a1c;
  min-width: 0;
  overflow: hidden;
  font-size: 0.94rem;
  line-height: 1;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.day {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  color: #514940;
  background: var(--calendar-cell);
  border: 1px solid #e1bd7e;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
}

.empty-day-cell {
  min-height: 58px;
  background: var(--border-soft);
  border-color: var(--border);
  opacity: 0.45;
  pointer-events: none;
}

button.day {
  cursor: help;
}

.day.obligatory {
  background: var(--obligatory);
  border-color: #c8b56f;
  font-weight: 600;
}

.day.minor-religious {
  background: var(--minor-religious);
  border-color: #bab37d;
  font-weight: 600;
}

.day.secular-observance {
  background: var(--secular-observance);
  border-color: #aba98f;
  font-weight: 600;
}

.day.marker-day {
  text-decoration: underline dotted rgba(114, 93, 67, 0.55);
  text-underline-offset: 0.18em;
}

.day.today {
  outline: 2px solid var(--today-outline);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 1px rgba(143, 91, 34, 0.28);
  color: #352619;
  font-weight: 700;
}

.day.main-observance::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 0;
  height: 0;
  border-top: 13px solid var(--main-observance-marker);
  border-left: 13px solid transparent;
}

.gregorian-day {
  color: #5b3a1c;
  font-size: 0.68rem;
  line-height: 1;
}

.event-type-label {
  color: #5d513c;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.main-label {
  color: #70402d;
}

.festival-popover {
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  display: block;
  width: min(220px, 78vw);
  padding: 9px 10px;
  color: var(--text);
  background: var(--calendar-cell);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 18px rgba(76, 52, 27, 0.16);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  visibility: hidden;
}

.festival-popover strong,
.festival-popover span {
  display: block;
}

.festival-popover strong {
  margin-bottom: 3px;
}

.festival-popover-event + .festival-popover-event {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.festival-popover.is-visible {
  opacity: 1;
  visibility: visible;
}

.festival-list {
  display: grid;
  gap: 8px;
}

.festival-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 8px 0 12px;
}

.festival-card p {
  margin-bottom: 0.2rem;
}

.subscribe {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.96rem;
}

.subscribe h2 {
  color: var(--text);
}

.feed-link {
  overflow-wrap: anywhere;
}

.source-link {
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.simple-page {
  display: grid;
  align-content: center;
  width: min(720px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
}

.error {
  padding: 14px;
  color: #6f3f34;
  background: #eadcda;
  border: 1px solid #d2bbb7;
}

@media (max-width: 760px) {
  body {
    font-size: 20px;
  }

  .site-header {
    padding-top: 32px;
  }

  .month-grid {
    grid-template-columns: 1fr;
  }

  .festival-card {
    grid-template-columns: 1fr;
  }

}
