/* ==========================================================================
   Jedálny lístok: full-screen menu, one day at a time (js/jedalny_listok.js)
   Built on the Obsadzovník frame (requires/obsadzovnik.css): same header, cards and close button.
   ========================================================================== */

/* PDF and photo-zoom popups must open above this full-screen window */
body.jl-open #modaljedlo,
body.jl-open #kioskFoodPreviewModal {
  z-index: 100001 !important;
}

.jl-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  box-sizing: border-box;
  background: var(--obs-bg-main);
  /* Normally everything fits; on a very short screen the day scrolls */
  overflow-y: auto;
}

/* style.css centres text on generic elements; the menu reads left-aligned */
.jl-body *,
.jl-allergen-card * {
  text-align: left;
}

.jl-body .jl-closed,
.jl-body .jl-closed *,
.jl-body .jl-empty-week,
.jl-body .jl-empty-week *,
.jl-body .jl-meal-photo.is-empty,
.jl-body .jl-meal-photo.is-empty * {
  text-align: center;
}

/* One day: its title, the soup, then meal A and B side by side */
.jl-day-view {
  height: 100%;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Day name, date and DNES sit on one text baseline */
.jl-day-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 4px;
  flex-shrink: 0;
}

.jl-day-title-name {
  font-size: 26px;
  font-weight: 900;
  color: var(--obs-text-main);
}

.jl-day-title-date {
  font-size: 17px;
  font-weight: 700;
  color: var(--obs-text-muted);
}

.jl-today-badge {
  position: relative;
  top: -2px;
  background: var(--obs-green-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: var(--obs-radius-full);
}

/* Section labels: Polievka / A / B */
.jl-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--obs-text-muted);
  margin-bottom: 3px;
}

.jl-section-label i {
  color: var(--obs-green-primary);
}

/* Soup: a slim card, its lines side by side */
.jl-soup-card {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--obs-border);
  border-radius: var(--obs-radius-lg);
  box-shadow: var(--obs-shadow-sm);
}

.jl-soup-rows {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 28px;
}

.jl-soup-rows .jl-row + .jl-row {
  margin-top: 0;
}

/* One printed menu line: name with its allergens and weights */
.jl-row {
  line-height: 1.45;
}

.jl-row + .jl-row {
  margin-top: 3px;
}

.jl-row-name {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}

.jl-row.is-main .jl-row-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--obs-text-main);
}

.jl-row-meta {
  display: inline;
}

.jl-pill {
  margin-left: 5px;
  vertical-align: 1px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  padding: 1px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.jl-pill i {
  font-size: 10px;
}

.jl-pill-allergens {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.jl-pill-weights {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Meal A / B: large cards side by side. The 3:4 photo fills the card's height on the left, so
   both photos are always the same size; the dish and its sides are listed on the right. */
.jl-meals {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 14px;
}

.jl-meal-card {
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 20px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--obs-border);
  border-radius: 18px;
  box-shadow: var(--obs-shadow-sm);
}

.jl-meal-photo {
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: 3 / 4;
  max-width: 52%;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 6px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.jl-meal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  display: block;
}

.jl-meal-photo.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #eef2f7;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  cursor: default;
}

.jl-meal-photo.is-empty i {
  font-size: 30px;
  color: #cbd5e1;
}

/* Text column: "A · Menu A", the dish, then its sides; pills on their own line under each */
.jl-meal-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 6px 6px 0;
  overflow-y: auto;
}

.jl-meal-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--obs-text-muted);
}

.jl-meal-badge {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--obs-green-primary);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jl-meal-info .jl-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jl-meal-info .jl-row + .jl-row {
  margin-top: 0;
}

.jl-meal-info .jl-row-name {
  font-size: 17px;
  line-height: 1.35;
}

.jl-meal-info .jl-row.is-main .jl-row-name {
  font-size: 24px;
  line-height: 1.25;
}

.jl-meal-info .jl-row.is-main {
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.jl-meal-info .jl-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jl-meal-info .jl-pill {
  margin-left: 0;
}

/* Days without lunch: "Zatvorené", "Zatvorené (Sviatok)", "Jedáleň nevarí" */
.jl-closed {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--obs-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
  color: var(--obs-text-muted);
  font-size: 20px;
  font-weight: 800;
}

.jl-closed i {
  font-size: 44px;
  color: #f59e0b;
}

.jl-empty-week {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--obs-text-muted);
  font-size: 17px;
  font-weight: 700;
}

/* Bottom bar: day buttons, then Alergény / Zobraziť PDF */
.jl-bottom-bar {
  justify-content: flex-start;
}

.jl-day-tabs .obs-day-card-btn {
  gap: 8px;
  padding: 0 10px;
}

.jl-tab-date {
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0.7;
  white-space: nowrap;
}

.jl-tab-closed {
  color: #f59e0b;
  font-size: 13px;
}

.obs-day-card-btn.active .jl-tab-closed {
  color: #ffffff;
}

.jl-actions-card {
  padding: 5px;
  gap: 6px;
}

.jl-action-btn {
  height: 44px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: #334155;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.jl-action-btn i {
  color: var(--obs-green-primary);
  font-size: 16px;
}

.jl-action-btn:hover,
.jl-action-btn:active {
  background: var(--obs-green-light);
  color: var(--obs-green-text);
}

/* Allergen legend popup */
.jl-allergen-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.45);
  align-items: center;
  justify-content: center;
  font-family: var(--obs-font);
}

.jl-allergen-backdrop.active {
  display: flex;
}

.jl-allergen-card {
  width: min(720px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: var(--obs-shadow-modal);
  overflow: hidden;
  animation: obsSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.jl-allergen-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--obs-border);
}

.jl-allergen-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--obs-text-main);
}

.jl-allergen-head i {
  color: #ea580c;
  font-size: 18px;
}

.jl-allergen-close {
  margin-left: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #dc2626;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.jl-allergen-close i {
  display: block;
  line-height: 1;
}

.jl-allergen-list {
  list-style: none;
  margin: 0;
  padding: 10px 20px 18px;
  overflow-y: auto;
}

.jl-allergen-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14.5px;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.jl-allergen-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jl-allergen-item.is-used .jl-allergen-num {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
}

.jl-allergen-week-tag {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #c2410c;
  white-space: nowrap;
}


/* Narrower screens: the day buttons drop their dates (the day title above shows the date) */
@media (max-width: 1400px) {
  .jl-tab-date {
    display: none;
  }

  .jl-action-btn {
    padding: 0 14px;
  }
}
