:root {
  --jidelnicek-text: #243447;
  --jidelnicek-muted: #586b7c;
  --jidelnicek-paper: #fffefa;
  --jidelnicek-line: #dce5eb;
}

.jidelnicek {
  position: relative;
  max-width: 980px;
  margin: 2rem auto;
  padding: 2rem 2rem 1.5rem 2.5rem;
  color: var(--jidelnicek-text);
  background: var(--jidelnicek-paper);
  border: 2px solid var(--jidelnicek-line);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(29, 41, 50, .08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jidelnicek::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 -2px;
  width: 13px;
  background: var(--jidelnicek-barva);
  border-radius: 22px 0 0 22px;
}

.jidelnicek__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 .25rem 1.25rem;
  border-bottom: 3px dotted var(--jidelnicek-barva);
}

.jidelnicek__logo {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  object-fit: contain;
}

.jidelnicek__title {
  margin: 0 0 .2rem;
  color: var(--jidelnicek-barva);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.jidelnicek__school-name {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.jidelnicek__header .jidelnicek__period {
  margin: .35rem 0 0;
  color: var(--jidelnicek-muted);
  font-size: .95rem;
}

.jidelnicek__days {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 1.25rem;
}

.jidelnicek__day {
  min-width: 0;
  padding: .65rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--jidelnicek-line);
  border-radius: 0;
}

.jidelnicek__day:nth-child(2) {
  background: transparent;
}

.jidelnicek__day:nth-child(3) {
  background: transparent;
}

.jidelnicek__day:nth-child(4) {
  background: transparent;
}

.jidelnicek__day:nth-child(5) {
  background: transparent;
}

.jidelnicek__day-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .3rem;
  color: var(--jidelnicek-barva);
  font-size: 1.1rem;
  line-height: 1.2;
}

.jidelnicek__day-date {
  color: var(--jidelnicek-muted);
  font-size: .9em;
  font-weight: 600;
}

.jidelnicek__meals {
  display: grid;
  gap: .1rem;
}

.jidelnicek__meal {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: .4rem;
  align-items: start;
}

.jidelnicek__meal-title,
.jidelnicek__meal-content,
.jidelnicek__legacy-allergens {
  margin: 0;
}

.jidelnicek__meal-title {
  margin: 0;
  color: var(--jidelnicek-text);
  font-size: .88rem;
  line-height: 1.35;
}

.jidelnicek__meal-content,
.jidelnicek__legacy-allergens {
  font-size: .92rem;
  line-height: 1.35;
}

.jidelnicek__meal .jidelnicek__allergens,
.jidelnicek__legacy-allergens {
  color: var(--jidelnicek-muted);
  font-size: inherit;
}

.jidelnicek__meal-content {
  margin: 0;
}

.jidelnicek__day-title::before {
  display: none;
}

.jidelnicek__day dl {
  margin: 0;
}

.jidelnicek__day dt {
  margin-top: .75rem;
  color: var(--jidelnicek-muted);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.2;
}

.jidelnicek__day dt:first-child {
  margin-top: 0;
}

.jidelnicek__day dd {
  margin: .25rem 0 0;
  font-size: .95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.jidelnicek__footer {
  margin-top: 1rem;
  padding: .8rem 1rem 0;
  color: var(--jidelnicek-muted);
  border-top: 2px dotted var(--jidelnicek-line);
  font-size: .9rem;
}

.jidelnicek__empty {
  margin: 0;
  padding: 1rem;
  color: var(--jidelnicek-muted);
  background: #f1f7ff;
  border-radius: 12px;
  font-weight: 600;
}

.jidelnicek__days {
  counter-reset: jidelnicek-day;
}

.jidelnicek__day {
  counter-increment: jidelnicek-day;
}

.jidelnicek-shortcode .jidelnicek__header {
  position: static;
  background: transparent;
  color: var(--jidelnicek-text);
  text-align: left;
  text-transform: none;
  box-shadow: none;
}

.jidelnicek-shortcode .jidelnicek__school-name,
.jidelnicek-shortcode .jidelnicek__title,
.jidelnicek-shortcode .jidelnicek__period {
  display: block;
  padding: 0;
  background: transparent;
  text-align: left;
  text-transform: none;
  box-shadow: none;
}

.jidelnicek-shortcode .jidelnicek__title {
  text-transform: uppercase;
}

.jidelnicek-shortcode .jidelnicek__footer {
  position: static;
  display: block;
  background: transparent;
  color: var(--jidelnicek-muted);
  text-align: left;
  text-transform: none;
  box-shadow: none;
}

@media (max-width: 720px) {
  .jidelnicek {
    margin: 1rem 0;
    padding: 1.25rem 1rem 1rem 1.5rem;
  }

  .jidelnicek::before {
    width: 9px;
  }

  .jidelnicek__days {
    padding-top: .75rem;
  }

  .jidelnicek__day {
    padding: .65rem 0;
  }

  .jidelnicek__meal {
    grid-template-columns: 90px minmax(0, 1fr);
  }
}

@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {

  html,
  body {
    margin: 0;
    padding: 0;
  }

  body.jidelnicek-print {
    color: #243447;
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .jidelnicek-print main {
    width: 100%;
  }

  .jidelnicek {
    box-sizing: border-box;
    max-width: none;
    margin: 0;
    padding: 0 0 0 8mm;
    font-size: 14.52pt;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .jidelnicek::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4mm;
    background-color: var(--jidelnicek-barva);
    border-radius: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .jidelnicek__header {
    gap: 6mm;
    min-height: 24mm;
    padding: 0 0 5mm;
    border-bottom-width: 1mm;
  }

  .jidelnicek__logo {
    width: 22mm;
    height: 22mm;
  }

  .jidelnicek__title {
    font-size: 10.89pt;
  }

  .jidelnicek__school-name {
    font-size: 23.1pt;
  }

  .jidelnicek__header .jidelnicek__period {
    font-size: 13.31pt;
  }

  .jidelnicek__days {
    gap: 3mm;
    padding-top: 4mm;
  }

  .jidelnicek__day {
    padding: 3mm 4mm;
    border-radius: 3mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .jidelnicek__day-title {
    gap: 2mm;
    margin-bottom: 2mm;
    font-size: 14.52pt;
  }

  .jidelnicek__day-title::before {
    width: 6mm;
    height: 6mm;
    font-size: 9.9pt;
  }

  .jidelnicek__day-date {
    font-size: 9.68pt;
  }

  .jidelnicek__meals {
    gap: .5mm;
  }

  .jidelnicek__meal {
    grid-template-columns: 22mm minmax(0, 1fr);
    gap: 1mm;
  }

  .jidelnicek__meal-title {
    font-size: 10.56pt;
  }

  .jidelnicek__meal-content,
  .jidelnicek__legacy-allergens {
    font-size: 10.89pt;
    line-height: 1.2;
  }

  .jidelnicek__meal .jidelnicek__allergens,
  .jidelnicek__legacy-allergens {
    font-size: 8.47pt;
  }

  .jidelnicek__day dt {
    margin-top: 1.5mm;
    font-size: 9.075pt;
  }

  .jidelnicek__day dd {
    margin-top: .5mm;
    font-size: 11.495pt;
    line-height: 1.3;
  }

  .jidelnicek__footer {
    margin-top: 4mm;
    padding: 3mm 0 0;
    font-size: 10.89pt;
  }

  .jidelnicek__empty {
    padding: 3mm;
  }

  .jidelnicek-ms .jidelnicek__days {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 2mm;
  }

  .jidelnicek-ms .jidelnicek__day {
    padding: 1.5mm 2mm;
    border-bottom: .2mm solid #dce5eb;
    border-radius: 0;
  }

  .jidelnicek-ms .jidelnicek__day-title {
    margin-bottom: 1mm;
    font-size: 12.1pt;
  }

  .jidelnicek-ms .jidelnicek__day-title::before {
    display: none;
  }

  .jidelnicek-ms .jidelnicek__meals {
    gap: 0;
  }

  .jidelnicek-ms .jidelnicek__meal {
    grid-template-columns: 25mm minmax(0, 1fr);
    gap: 1mm;
    padding: .7mm 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .jidelnicek-ms .jidelnicek__meal-title {
    font-size: 9.9pt;
  }

  .jidelnicek-ms .jidelnicek__meal-content {
    font-size: 9.68pt;
    line-height: 1.1;
  }

  .jidelnicek-ms .jidelnicek__meal .jidelnicek__allergens,
  .jidelnicek-ms .jidelnicek__legacy-allergens {
    margin-top: .3mm;
    font-size: 7.865pt;
    line-height: 1.1;
  }
}
