@import url('https://fonts.bunny.net/css?family=inter:300|oswald:300,400');

@media print {
  @page {
    margin: 0;
  }

  #ui_info {
    display: none;
  }
}

:root {
  --bg-page: #f4e3d2;
  --table-height: calc(50vw);

  --border-color: #000;
  --border-width: .175vmin;

  --text-color: #000;
  --muted-text-color: #000000;

  --highlight-color: #99a55e;
  --highlight-text-color: #99a55e;

  --moon-muted-text-color: #666;
}

html {
  font-family: 'Oswald', sans-serif;
}

html,
body {
  background-color: var(--bg-page);
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  padding: 5px;
  box-sizing: border-box;
  display: grid;
  align-items: center;
}

#page {
  padding: 1rem clamp(25px, 1rem, 100px);
  box-sizing: border-box;
  height: auto;
  width: 100%;
  aspect-ratio: 2 / 1;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

th {
  text-transform: uppercase;
  border-bottom: var(--border-width) solid var(--border-color);
  border-right: var(--border-width) solid var(--border-color);
  font-size: 2.1vmin;
  font-weight: 400;
  color: var(--highlight-text-color);
  vertical-align: bottom;
  padding: 0;
  text-align: left;;
}

td {
  border-bottom: var(--border-width) solid var(--border-color);
  border-right: var(--border-width) solid var(--border-color);
  padding: 0;
  transition: background-color 0.15s ease;
}

/* Interactivity */
td:not(.empty-day), th, .year-label {
  -webkit-user-select: none;
  user-select: none;
}

#ui_tbody>tr:first-child>td {
  border-top: var(--border-width) solid var(--border-color);
}

/* DAY CELL STYLING */

#ui_table td {
  height: calc(100vw / 24);
}

.cell_box {
  display: grid;
  height: 100%;
  grid-template-rows: 15% 70% 15%;
}

.mark_box {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  position: relative;
}

.mark_box_inner {
  width: 11%;
  padding-right: 5%;
  padding-top: 5%;
}

.mark_box_inner svg {
  width: 100%;
  height: 100%;
  display: block;   /* removes inline baseline gap */
}

.mark_box_inner svg path {
  stroke: var(--highlight-color);
  fill: var(--highlight-color);
  stroke: none;
}

.day_box {
  display: flex;
  justify-content: space-between;
  align-self: end;
  padding-inline: 3%;
}

.weekend .cell_box .day_box {
  /* background-color: var(--bg-page); */
}

.cell_text {
  display: flex;
  justify-content: center;
  align-items: center;
}

.day_icon {
  display: inline-block;
  width: 30%;
  vertical-align: middle;
}

.day_icon svg {
  width: 100%;
  height: 100%;
  display: block;
  color: var(--highlight-color)
}

.day_icon path {
  fill: var(--highlight-color);
}

.weekend-highlight .day_icon path {
  fill: var(--bg-page);
}

.cell-editor {
  width: calc(100% - 4px);
  height: 100%;
  box-sizing: border-box;
  resize: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  padding: 2px;
}

/* Empty day cells (e.g. Feb 29–31): preserve grid, hide borders */
.empty-day {
  border-top: 1px solid transparent;
  border-right: 1px solid transparent;
  pointer-events: none;
}

.date,
.day {
  display: inline-block;
  width: 50%;
  vertical-align: text-bottom;
  font-size: .8vmin;
  font-weight: 300;
  color: var(--text-color);
}

.date {
  text-align: end;
}

.day {
  text-align: start;
}

.weekend-highlight {
  background: var(--highlight-color);
}

p {
  margin: 0 0 .5em 0;
  text-align: center;
}

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

}

#ui_info {
  font-family: 'Inter', sans-serif;
  position: absolute;
  top: 0;
  left: 0;
  margin: 5em 2em;
  width: calc(100% - 6em);
  background: var(--highlight-color);
  color: var(--text-color);
  padding: 1em 1em .5em 1em;
  font-size: 2vmax;
  border-radius: .2em;
}

#ui_info p {
  text-align: left;
  margin: 0 0 1em 0;
  line-height: 135%;
}

#ui_info a {
  color: inherit;
}

/* Year header styling */
#ui_year {
  width: 100%;
}

#ui_year .year-label {
  display: inline-block;
  width: 100%;
  text-align: end;
  font-size: 5vmin;
  color: var(--highlight-text-color);
}

/* Moon phase styles */
.moon-container {
  display: block;
  text-align: center;
  margin-top: 0.2em;
}

.moon-inline {
  margin-left: 0.2em;
}

.moon-symbol {
  font-size: 1.1em;
}

.moon-name {
  font-size: 0.7em;
  color: var(--muted-text-color);
  text-transform: none;
}

.moon-phase {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

.moon-phase svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Passed days styling (Recessed Pop Art) */
.passed-day {
  position: relative;
  box-shadow: inset 3px 3px 0px 0px #ccc;
  background-color: #f4f4f4;
  /* Slightly darker to emphasize depth */
}

/* Current day styling (Protruded Pop Art) */
.current-day {
  background-color: var(--bg-page);
  box-shadow: 3px 3px 0px 0px #000;
  border: 1px solid #000 !important;
  /* Force override of standard cell borders */
  transform: translate(-3px, -3px);
  position: relative;
  z-index: 10;
}

/* Ensure current day text is visible if background is dark, though highlight-1 is light */
/* .current-day .date, .current-day .day { } */
