@font-face {
  font-family: "Univers";
  src: url("./assets/univers/UniversRegular.ttf");
}
@font-face {
  font-family: "Univers-Light";
  src: url("./assets/univers/UniversLight.ttf");
}
@font-face {
  font-family: "Univers-Condensed";
  src: url("./assets/univers/UniversCnRg.ttf");
}
@font-face {
  font-family: "Noto-Emoji";
  src: url("./assets/notoemoji/NotoEmoji-Regular.ttf");
}

html, body {
  font-family: "Univers", sans-serif;
  padding: 0;
  margin: 0;
}

:root {
  --letter-long-length: 1275px;
  --letter-short-length: 931px;
  --grid-size: 15px;
  --num-grids: 10;
  --day-grid-size: calc(var(--num-grids) * var(--grid-size));
}

@media print {
  html, body {
    width: var(--page-width);
    height: var(--page-length);
  }
  .pagebreak {
      clear: both;
      page-break-after: always;
  }
  date-form {
    display: none !important;
  }
}

:root[data-theme="rose-pine-dawn"] {
  --base: #faf4ed; 
  --overlay: #f2e9e1;
  --muted: #9893a5;
  --text: #575279;
  --alt-text: var(--base);
  --accent: #286983;
  --warn: #b4637a;
  --jan: var(--muted);
  --feb: var(--muted);
  --mar: var(--muted);
  --apr: var(--muted);
  --may: var(--muted);
  --jun: var(--muted);
  --jul: var(--muted);
  --aug: var(--muted);
  --sep: var(--muted);
  --oct: var(--muted);
  --nov: var(--muted);
  --dec: var(--muted);
}
:root[data-theme="hobonichi"] {
  --base: #f8f3ed;
  --accent: #626876;
  --overlay: #fcdcad;
  --muted: #9893a5;
  --text: #474747;
  --primary: #626876;
  --alt-text: var(--base);
  --warn: #F6403F;
  --jan: #e77e61;
  --feb: #a47351;
  --mar: #d39268;
  --apr: #f28d9d;
  --may: #b5a131;
  --jun: #9f9669;
  --jul: #8ab1ca;
  --aug: #979ebb;
  --sep: #d79277;
  --oct: #a885ad;
  --nov: #849f94;
  --dec: #f78887;
}

:root[data-theme="print"] {
  --base: #fff;
  --accent: var(--text);
  --text: #474747;
  --alt-text: #fff;
  --overlay: #ccc;
  --muted: #444;
  --warn: #222;
  --jan: var(--text);
  --feb: var(--text);
  --mar: var(--text);
  --apr: var(--text);
  --may: var(--text);
  --jun: var(--text);
  --jul: var(--text);
  --aug: var(--text);
  --sep: var(--text);
  --oct: var(--text);
  --nov: var(--text);
  --dec: var(--text);
}

body {
  background-color: var(--base);
  color: var(--text);
}

calendar-app {
  display: flex;
  align-items: center;
  flex-direction: column;
}

letter-landscape[withGrids="true"]:before
{
  content: "";
  mask-repeat: repeat;
  mask-image: url("./assets/graph.png");
  mask-size: 135px 90px;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  position: absolute;
  z-index: -1; 
  mask-position: 6px 7px;
}

a.document-link {
  text-decoration: none !important;
  outline: 0;
}

letter-landscape {
  width: var(--letter-long-length);
  height: var(--letter-short-length);
  position: relative;
  padding: var(--grid-size);

  -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
  -moz-box-sizing: border-box;    /* Firefox, other Gecko */
  box-sizing: border-box;         /* Opera/IE 8+ */
  /* don't add extra width/length with padding */
  --page-width: var(--letter-long-length);
  --page-length: var(--letter-short-length);
}
letter-landscape:before {
  width: calc(var(--letter-long-length) - var(--grid-size) * 2);
  height: calc(var(--letter-short-length) - var(--grid-size) * 2);
}

date-form {
      font-family: "Univers";
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      gap: 1em;
      font-size: 0.8em;
      margin-top: calc(var(--grid-size) * 2);
      margin-bottom: calc(var(--grid-size)*2);

div {
      display: flex;
      gap: 1em;
      flex-wrap: wrap;
      justify-content: center;
    }
    button {
      border-radius: 5px;
      padding: 0.5em 1em;
      border: none;
      background-color: var(--overlay);
      color: var(--text);
    }
    button:hover {
      opacity: 0.8;
    }
    button:disabled, button:disabled:hover {
      opacity: 0.5;
      background-color: var(--muted);
    }
    
    button.selected,  button.selected:hover {
      opacity: 0.5;
      background-color: var(--accent);
      color: var(--alt-text);
    }
    #actions {
      display: flex;
      align-items: center;
    }
    button:focus, select:focus {
      outline: 2px solid var(--accent);
    }
    input[type="checkbox"] {
      margin: 0 5px 0 0; 
      accent-color: var(--accent);
    }
    label {
      display: flex;
      align-items: center;
      gap: 0.5em;
    }
    select {
      appearance: none;
      padding: 0.5em 1em;
      border-radius: 5px;
      border: none;
      background-color: var(--overlay)
    }
    a {
      color: var(--text);
      font-weight: bold;
    }
    a:hover {
      opacity: 0.8;
    }
}

a.dynamic-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  position: relative;
  z-index: 1;
  padding: 0.5em;
  margin: -0.5em;
}

date-form {
  .months-selection {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
  }
}
