/* ============================================================
     SZÍNEK ÉS ALAP BEÁLLÍTÁSOK — itt lehet a designt könnyen
     átszabni, mindent ezekre a változókra épít a naptár.
     ============================================================ */
:root {
  --bg: #eef1f0;
  /* háttér a naptár körül */
  --paper: #ffffff;
  /* naptár lapja */
  --ink: #1c2b28;
  /* fő szöveg */
  --ink-soft: #5b6b67;
  /* halványabb szöveg (pl. előző/köv. hónap napjai) */
  --line: #dde4e1;
  /* rácsvonalak, keretek */
  --accent: #2f6f5e;
  /* fő kiemelő szín (fejléc, mai nap, gombok) */
  --accent-soft: #e3efe9;
  /* fő kiemelő szín halvány háttérként */
  --amber: #c98a2b;
  /* második programjelölő szín */
  --clay: #b0563f;
  /* harmadik programjelölő szín */
  --slate: #4a6a8a;
  /* negyedik programjelölő szín */
  --radius: 10px;
  --font-display: 'myriad-pro-semibold', serif;
  --font-body: 'myriad-pro-regular', system-ui, sans-serif;
}


.cal-wrap {
  width: 100%;
}

/* --- Fejléc: hónap, évváltó gombok --- */
.cal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}

.cal-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: .2px;
}

.cal-title .year {
  color: var(--ink-soft);
  font-size: 22px;
  margin-left: 8px;
}

.cal-nav {
  display: flex;
  gap: 8px;
}

.cal-nav button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}

.cal-nav button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cal-nav button.today-btn {
  width: auto;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 17px;
}

/* --- Hét napjai fejsor --- */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 4px;
  margin-bottom: 6px;
}

.cal-weekdays span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  padding-bottom: 8px;
}

/* --- Rács --- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(108px, 1fr);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-day {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 6px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  cursor: pointer;
  transition: background .15s;
}

.cal-day:hover {
  background: #fafcfb;
}

.cal-grid .cal-day:nth-child(7n) {
  border-right: none;
}

.cal-day.other-month {
  background: #fbfbfa;
}

.cal-day.other-month .day-num {
  color: #c3cac7;
}

.day-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}

.cal-day.is-today .day-num {
  background: var(--accent);
  color: #fff;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.evt-pill {
  font-size: 11.5px;
  line-height: 1.35;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #e0e9f2;
}

.evt-pill b {
  font-weight: 600;
}

.evt-pill.c-amber {
  background: #fbf1e2;
  border-left-color: var(--amber);
}

.evt-pill.c-clay {
  background: #f7e9e4;
  border-left-color: var(--clay);
}

.evt-pill.c-slate {
  background: #e9eef3;
  border-left-color: var(--slate);
}

.evt-more {
  font-size: 11px;
  color: var(--ink-soft);
  padding-left: 6px;
  margin-top: 1px;
}

/* --- Nap részletek panel (kattintásra) --- */
.day-detail {
  margin-top: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: none;
}

.day-detail.open {
  display: block;
}

.day-detail h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  margin: 0 0 12px;
}

.detail-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.detail-row:first-of-type {
  border-top: none;
}

.detail-time {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  min-width: 52px;
}

.detail-title {
  font-size: 18px;
}

.detail-loc {
  font-size: 14px;
  color: var(--ink-soft);
}

.detail-row {
  cursor: pointer;
  border-radius: 6px;
}

.detail-row:hover {
  background: var(--accent-soft);
}

.evt-pill {
  cursor: pointer;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 26, .42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--paper);
  border-radius: var(--radius);

  width: 50%;
  padding: 24px 26px 22px;
  position: relative;
  box-shadow: 0 18px 40px rgba(20, 28, 26, .22);
  border-top: 4px solid #1991fd;
}

.modal-box.c-amber {
  border-top-color: var(--amber);
}

.modal-box.c-clay {
  border-top-color: var(--clay);
}

.modal-box.c-slate {
  border-top-color: var(--slate);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 6px;
}

.modal-close:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 10px;
  padding-right: 24px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.modal-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-desc {
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.modal-desc p {
  margin: 15px 0;
}

.modal-desc:empty {
  display: none;
}

@media (max-width:640px) {
  .cal-title {
    font-size: 24px;
  }

  .cal-grid {
    grid-auto-rows: minmax(74px, 1fr);
  }

  .evt-pill {
    font-size: 10px;
    padding: 1px 4px;
  }

  .day-num {
    font-size: 13px;
    width: 22px;
    height: 22px;
  }

  .cal-weekdays span {
    font-size: 10px;
  }
  .modal-desc {
    max-height: 50vh;
  }
  .modal-box {
    max-width: 90%;
    width: 90%;
  }
  .cal-weekdays-wrapper {
    overflow-x: scroll;
  }
  .cal-weekdays-wrapper .cal-weekdays,
  .cal-weekdays-wrapper .cal-grid {
    min-width: 640px;
  }
  .modal-title {
    font-size: 24px;
    line-height: 27px;
  }
}