/*
  Moon Phase Calendar
  https://github.com/evoluteur/moon-phase-calendar
  (c) 2026 Olivier Giulieri
*/

:root {
  --moon-lit: #f4efdc;
  --moon-lit-edge: #d9d1b4;
  --moon-dark: #242c3a;
  --moon-rim: rgba(255, 255, 255, 0.14);
  --moon-maria: rgba(110, 106, 92, 0.3);
  --accent: #ffa500;
  --full: #ffd66b;
  --soft: rgba(255, 255, 255, 0.06);
}
html[data-theme="light"] {
  --moon-lit: #fbf6e2;
  --moon-lit-edge: #d8cfae;
  --moon-dark: #3b4558;
  --moon-rim: rgba(0, 0, 0, 0.18);
  --accent: #d97706;
  --full: #d99a00;
  --soft: rgba(0, 0, 0, 0.04);
}
html[data-theme="evol-blue"] {
  --moon-dark: #07558a;
  --moon-rim: rgba(255, 255, 255, 0.3);
  --accent: #ffd66b;
  --soft: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(0, 60, 110, 0.35);
  --card-border: rgba(255, 255, 255, 0.28);
  --card-foot: #e3f2fd;
  --card-strong: white;
}

#omg-header {
  z-index: 450;
}

/* theme picker as icons, same as the other esoterica apps */
#omg-theme-picker {
  gap: 2px;
}
#omg-theme-picker > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: currentColor;
  opacity: 0.75;
}
#omg-theme-picker > a:hover,
#omg-theme-picker > a.selected {
  opacity: 1;
}
#omg-github {
  position: absolute;
  top: 34px;
  right: 4px;
  margin-top: 12px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  opacity: 0.75;
}
#omg-github svg {
  width: 30px;
  height: 30px;
}
html[data-theme="evol-blue"] #omg-github svg {
  fill: white;
}
#omg-github:hover,
#omg-github:focus-visible {
  opacity: 1;
}

.content {
  max-width: 1080px;
}
.tagline {
  opacity: 0.85;
  margin: 0 0 24px;
  max-width: 680px;
}
.muted {
  opacity: 0.65;
}
.glyph {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", serif;
}

/* ------------------------------------------------ the moon */

.moon {
  display: block;
  overflow: visible;
  cursor: inherit;
}
.moon .moon-dark {
  fill: var(--moon-dark);
}
.moon .moon-lit {
  fill: var(--moon-lit);
}
.moon .moon-maria {
  filter: blur(0.9px);
}
.moon .moon-maria ellipse {
  fill: var(--moon-maria);
}
.moon .moon-maria .moon-tycho {
  fill: rgba(255, 255, 255, 0.55);
}
.moon .moon-rim {
  fill: none;
  stroke: var(--moon-rim);
  stroke-width: 1.5;
}
.big-moon .moon {
  filter: drop-shadow(0 0 28px rgba(255, 240, 200, 0.18));
}
html[data-theme="light"] .big-moon .moon {
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.18));
}

/* ------------------------------------------------ today / detail panel */

.today {
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 36px;
}
.moon-panel {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}
.big-moon {
  flex: 0 0 auto;
  margin: 0 auto;
}
.moon-facts {
  flex: 1 1 320px;
  min-width: 0;
}
.when {
  font-size: 0.9rem;
  opacity: 0.75;
}
.phase-name {
  font-size: 2rem;
  margin: 4px 0 2px;
  font-weight: 400;
}
.kw {
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.exact {
  margin: 10px 0 0;
}
.name-text {
  margin: 4px 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}
.ingress {
  margin: 0 0 8px;
  font-size: 0.9rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.stats > div {
  background: var(--soft);
  border-radius: 10px;
  padding: 8px 12px;
}
.stats dt {
  font-size: 0.78rem;
  opacity: 0.7;
}
.stats dd {
  margin: 2px 0 0;
  font-size: 1.1rem;
}
.next {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.next-moon {
  flex: 0 0 auto;
}
.next-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.next-date {
  font-size: 0.9rem;
}
.meanings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.meaning h4 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.meaning p {
  margin: 0 0 8px;
  line-height: 1.5;
}
.good-for {
  font-size: 0.92rem;
  opacity: 0.9;
}

/* tags: supermoon, blue moon... */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: 2px;
  color: #1a212d;
  background: #ffd66b;
  cursor: help;
}
.tag-blue {
  background: #7cc4ff;
}
.tag-micro {
  background: #b9c3d3;
}
.tag-black {
  background: #3b4558;
  color: white;
}

/* ------------------------------------------------ toolbar */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.nav,
.switches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar h2 {
  margin: 0 6px;
  min-width: 9ch;
  text-align: center;
}
.toolbar button {
  margin: 0;
  font: inherit;
  cursor: pointer;
}
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 1.5rem !important;
  line-height: 1;
}
.pill {
  padding: 6px 14px !important;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}
.seg button {
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  padding: 6px 14px !important;
  opacity: 0.7;
}
.seg button + button {
  border-left: 1px solid var(--card-border) !important;
}
.seg button.selected {
  background: var(--soft) !important;
  opacity: 1;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ------------------------------------------------ month view */

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.dow {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
  padding-bottom: 2px;
}
.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 112px;
  margin: 0 !important;
  padding: 24px 4px 8px !important;
  border-radius: 10px !important;
  border: 1px solid var(--card-border) !important;
  background: var(--card-bg) !important;
  color: inherit !important;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.12s,
    border-color 0.12s;
}
.day:hover,
.day:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent) !important;
}
.day.empty {
  background: transparent !important;
  border-color: transparent !important;
  cursor: default;
}
.dnum {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 0.85rem;
  opacity: 0.8;
}
.dsign {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 0.9rem;
  opacity: 0.6;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", serif;
}
.dphase {
  font-size: 0.75rem;
  opacity: 0.75;
  text-align: center;
  line-height: 1.2;
}
.principal .dphase {
  opacity: 1;
}
.ding {
  font-size: 0.68rem;
  opacity: 0.6;
  white-space: nowrap;
}
.day.p-full {
  border-color: var(--full) !important;
  box-shadow: 0 0 14px -4px var(--full);
}
.day.p-new {
  border-style: dashed !important;
}
.day.today .dnum {
  background: var(--accent);
  color: #1a212d;
  border-radius: 20px;
  padding: 0 7px;
  left: 4px;
  opacity: 1;
  font-weight: 600;
}

/* phases of the month */
.event-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.event {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: 0 !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  border: 1px solid var(--card-border) !important;
  background: var(--card-bg) !important;
  color: inherit !important;
  font: inherit;
  cursor: pointer;
}
.event:hover,
.event:focus-visible {
  border-color: var(--accent) !important;
}
.event .moon {
  flex: 0 0 auto;
}
.ev-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ev-name {
  font-weight: 600;
}
.ev-date,
.ev-sign {
  font-size: 0.88rem;
  opacity: 0.85;
}
.tz {
  font-size: 0.85rem;
  margin-top: 12px;
}

/* ------------------------------------------------ year view */

.year-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
}
.year-grid {
  display: grid;
  grid-template-columns: 44px repeat(31, minmax(22px, 1fr));
  gap: 3px 2px;
  min-width: 760px;
  align-items: center;
}
.yd {
  text-align: center;
  font-size: 0.66rem;
  opacity: 0.55;
}
.yl {
  font-size: 0.85rem;
}
.ym {
  margin: 0 !important;
  padding: 2px 4px !important;
  background: none !important;
  color: inherit !important;
  border: none !important;
  text-align: left;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.85;
}
.ym:hover {
  color: var(--accent) !important;
}
.yc {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 !important;
  padding: 2px 0 !important;
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  background: none !important;
  cursor: pointer;
}
.yc:hover,
.yc:focus-visible {
  background: var(--soft) !important;
  border-color: var(--card-border) !important;
}
.yc.p-full {
  border-color: var(--full) !important;
}
.yc.today {
  background: var(--soft) !important;
  border-color: var(--accent) !important;
}
.yc.empty {
  cursor: default;
}

.table-wrap {
  overflow-x: auto;
}
table.moons {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
table.moons th {
  text-align: left;
  font-weight: 600;
  opacity: 0.75;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-bottom: 1px solid var(--card-border);
}
table.moons td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
table.moons tr[data-t] {
  cursor: pointer;
}
table.moons tbody tr:hover {
  background: var(--soft);
}
table.moons .num {
  text-align: right;
}

/* ------------------------------------------------ side panel */

.detail-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s;
}
.detail-overlay.open {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.35);
}
.card-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 94vw);
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 0.3s ease;
  z-index: 500;
  padding: 50px 24px 24px !important;
  border-radius: 0 !important;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
}
.card-detail.open {
  transform: translateX(0);
}
html[data-theme="light"] .card-detail {
  background-color: #fbfbfb;
}
html[data-theme="evol-blue"] .card-detail {
  background: #0288d1 url("themes/evol-blue/spirals.png");
}
.card-detail .moon-panel {
  gap: 16px;
}
.card-detail .big-moon .moon {
  width: 160px !important;
  height: 160px !important;
}
.card-detail .phase-name {
  font-size: 1.6rem;
}
.card-detail .meanings {
  grid-template-columns: 1fr;
}
.card-detail .close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  background: none;
  color: inherit;
  opacity: 0.7;
}
.card-detail .close:hover {
  opacity: 1;
}

/* ------------------------------------------------ about */

.about {
  margin-top: 56px;
  max-width: 900px;
}
.about p {
  line-height: 1.6;
}
.about h4 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}
.about-phases,
.about-signs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px 24px;
  margin: 18px 0 30px;
}
.about-phase {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.about-phase .moon {
  flex: 0 0 auto;
  margin-top: 4px;
}
.about-phase p,
.about-sign p {
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.about-names li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.footer {
  margin-top: 100px;
}

/* ------------------------------------------------ small screens */

@media (max-width: 700px) {
  .today {
    padding: 18px 16px;
  }
  .big-moon .moon {
    width: 170px !important;
    height: 170px !important;
  }
  .phase-name {
    font-size: 1.6rem;
  }
  .month-grid {
    gap: 3px;
  }
  .day {
    min-height: 74px;
    padding: 20px 1px 4px !important;
    gap: 2px;
  }
  .day .moon {
    width: 30px !important;
    height: 30px !important;
  }
  .dnum {
    font-size: 0.75rem;
    left: 5px;
    top: 3px;
  }
  .dsign {
    font-size: 0.75rem;
    right: 4px;
    top: 3px;
  }
  .dphase {
    font-size: 0.62rem;
  }
  .dphase b {
    display: block;
  }
  .ding {
    display: none;
  }
  .dow {
    font-size: 0.7rem;
  }
}
@media (max-width: 700px) {
  #omg-header h1 {
    padding-right: 96px;
    font-size: 1.7rem;
    white-space: normal;
  }
  .tagline {
    padding-right: 30px;
  }
}
