html,
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.head {
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  background-color: #f0f0f0;
  border: 2px solid #ccc;
}

h1 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
    Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 400%;
}

.buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.button {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  background-color: #f0f0f0;
  border-radius: 5px;
  border: 2px solid black;
  color: black;
  padding: 10px 20px;
  margin: 10px;
  cursor: pointer;
  font-size: 16px;
  width: 200px;
  text-align: center;
  box-sizing: border-box;
}

.button:hover {
  background-color: #e0e0e0;
}

.file-input {
  display: none;
}

.editor {
  margin: 20px auto;
  text-align: center;
}

.json-editor {
  width: 600px;
  max-width: 80%;
  height: 300px;
  padding: 10px;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  font-family: monospace;
  background-color: #f9f9f9;
}

.json-editor:focus {
  border-color: #007bff;
  outline: none;
}

.kalendar {
  width: 100%;
  display: table;
  border-collapse: collapse;
}

@media screen {
  .kalendar {
    max-width: 297mm;
    margin: 0 auto;
  }
}

.sheet {
  display: table-row;
  page-break-after: always;
}

.sheet:last-child {
  page-break-after: auto;
}

.strana {
  display: table-cell;
  background-color: white;
  font-family: system-ui;
  box-sizing: border-box;
  vertical-align: top;
  width: 50%;
  height: 39cm;
  padding: 20mm 10mm 0 10mm;
}

.strana:first-child {
  border-right: 0.5px dotted #b4b4b4;
}

.uvodna {
  text-align: center;
  vertical-align: middle;
  font-size: 400%;
  font-weight: bold;
}

.fotka {
  position: relative;
  display: inline-block;
}

.fotka img {
  aspect-ratio: 4/3;
  object-fit: cover;
  max-width: 13cm;
  width: 100%;
  border-radius: 1mm;
  cursor: pointer;
}

.reset-button {
  position: absolute;
  top: 5px;
  right: 5px;
  color: white;
  background-color: rgba(221, 221, 221, 0.485);
  border: none;
  border-radius: 30%;
  width: 25px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

.tyzden_info {
  font-size: 0.5cm;
  color: white;
  font-weight: bold;
  letter-spacing: 0.3mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.3cm;
  margin-bottom: 0.3cm;
  padding-top: 4.5mm;
  border-top: 0.6mm dashed #b4b4b4;
  text-align: center;
}

.tyzden_info .mesiacARok {
  background-color: #051650;
  padding: 0.3mm 10mm 0.6mm 10mm;
  border-radius: 1mm;
  min-width: 5.5cm;
}

.tyzden_info .cisloTyzdna {
  background-color: #051650;
  padding: 0.3mm 2mm 0.6mm 2mm;
  border-radius: 1mm;
  min-width: 3cm;
}

.poznamky {
  margin-top: 3mm;
  border-top: 0.6mm dashed #b4b4b4;
}

.poznamky img {
  width: 6mm;
  margin: 1.5mm;
  opacity: 0.5;
}

.den {
  display: grid;
  grid-template-columns: 12% calc(88%);
  height: 2.6cm;
}

.vikend .info {
  box-shadow: 0 1mm 0 0 #00b050;
  border-top: 1mm solid #00b050;
  border-right: 1mm solid #00b050;
  background-color: #e2efda;
}

.vikend .datum {
  background-color: #00b050;
  border-top: 1mm solid white;
}

.datum {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0070c0;
  border-top: 1mm solid white;
  font-size: 230%;
  font-family: system-ui;
  font-weight: bold;
  color: white;
  text-align: center;
}

.info {
  border-top: 1mm solid rgb(38, 74, 194);
  border-right: 1mm solid rgb(38, 74, 194);
  font-size: 65%;
  line-height: 4mm;
  overflow: hidden;
  display: grid;
  grid-template-columns: 22% 68% 10%;
  grid-template-rows: 23% 52% 25%;
  max-width: 100%;
}

.menoDna {
  color: #313131;
  padding-top: 0.24rem;
  padding-left: 0.2rem;
  font-size: 172%;
  font-weight: 700;
}

.denVRoku {
  grid-column: 3;
  text-align: right;
  font-weight: bold;
  color: #313131;
  padding-right: 1mm;
}

.meniny {
  padding-left: 0.4em;
  font-size: 145%;
  font-weight: 350;
  font-style: italic;
  grid-row: 2;
  grid-column: 1;
}

.fazyMesiaca {
  grid-row: 3;
  grid-column: 2;
  margin: 0 0mm 0.5mm 0;
  padding: 0 0mm 0 1.5mm;
  height: 1rem;
  border-radius: 1mm;
  font-size: 120%;
  align-self: center;
  justify-self: right;
}

.slnko {
  display: grid;
  grid-row: 2/4;
  grid-column: 3;
  justify-self: right;
  align-self: self-end;
  text-align: right;
  height: min-content;
  width: min-content;
  padding: 1mm;
  margin: 0 0.5mm 0.5mm 0;
  border-radius: 1mm;
  color: #000000;
  font-weight: 500;
  line-height: 4mm;
  font-size: 110%;
  background-image: linear-gradient(180deg, #c21d00 -10%, #fffb00 35% 70%, #0a2000 120%);
}

.prazdniny {
  grid-row: 3;
  grid-column: 1/3;
  background-color: rgb(1, 168, 1);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 1.5mm;
  border-radius: 1mm;
  margin: 0.5mm 0 0.5mm 0.5mm;
  max-width: 100%;
  width: max-content;
  box-sizing: border-box;
  clear: right;
}

.prazdniny:empty {
  display: none;
}

.naseSviatky {
  grid-row: 1/3;
  grid-column: 2;
}

.naseSviatky > * {
  padding: 0.8mm 1.5mm;
  border-radius: 1mm;
  margin-top: 0.5mm;
  max-width: min(7.1cm, 100%);
  width: max-content;
  display: block;
  clear: right;
  box-sizing: border-box;
}

.naseSviatky > *:empty {
  display: none;
}

.statneSviatky {
  background-color: #e21414;
  color: white;
}

.vyrociaSvadby {
  background-color: #0070c0;
  color: white;
}

.umrtia {
  background-color: #313131;
  color: white;
}

.narodeninyMeniny {
  background-color: #fff200;
  color: #313131;
}

.medzDni {
  background-color: #d89400;
  color: white;
}

.slnovraty {
  background-color: #8d8d8d;
  color: white;
}

@page {
  size: 297mm 420mm;
  margin: 0;
}

@media print {
  .head {
    display: none;
  }
}

@media screen and (max-width: 700px) {
  .kalendar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sheet {
    display: contents;
  }

  .strana {
    display: block;
    width: 100%;
    min-width: 0;
    margin-bottom: 8mm;
    border-bottom: 3px solid #051650;
  }

  .strana:first-child {
    border-right: none;
  }

  .tyzden_info .mesiacARok,
  .tyzden_info .cisloTyzdna {
    min-width: 0;
  }
}
