/* ── Forgotten Realms Calendar ───────────────────────────────────────────────── */

.cal-wrap { max-width: 860px; margin: 0 auto; }

/* Player calendar tab — wrap gets a card background */
#tab-calendar .cal-wrap {
  background: var(--bg2);
  border: 1px solid var(--a33);
  border-radius: 6px;
  padding: 16px 18px 18px;
}

/* Selected day (player calendar day click) */
.cal-day-cell.cal-selected {
  background: rgba(200,160,74,.22) !important;
  border-color: var(--ac);
  box-shadow: inset 0 0 0 1px var(--ac);
}
.cal-day-cell.cal-selected .cal-day-num { color: var(--ac); font-weight: bold; }

/* Current date banner */
.cal-today-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--a22);
  border: 1px solid var(--a44);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-today-label { font-size: 10px; color: var(--txd); text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }
.cal-today-date  { font-size: 13px; color: var(--ac); font-weight: bold; flex: 1; min-width: 0; }
.cal-today-year  { font-size: 10px; color: var(--txd); flex: 1; min-width: 0; font-style: italic; }

/* Navigation row */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cal-nav-btn {
  background: var(--bg3);
  border: 1px solid var(--a55);
  color: var(--tx);
  cursor: pointer;
  padding: 5px 13px;
  border-radius: 3px;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.cal-nav-btn:hover { background: var(--a33); border-color: var(--ac); }
.cal-nav-title    { flex: 1; text-align: center; }
.cal-nav-month    { font-size: 18px; font-weight: bold; color: var(--ac); display: block; }
.cal-nav-subtitle { font-size: 11px; color: var(--txd); display: block; margin-top: 2px; }

/* Month tenday grid */
.cal-grid { width: 100%; border-collapse: collapse; margin-bottom: 16px; table-layout: fixed; background: var(--bg2); border: 1px solid var(--a33); border-radius: 4px; }
.cal-tenday-lbl {
  font-size: 9px;
  color: var(--txd);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 6px 7px;
  width: 76px;
  vertical-align: middle;
  border-right: 1px solid var(--a33);
  white-space: nowrap;
  background: var(--a22);
}
.cal-grid tbody tr:nth-child(even) .cal-tenday-lbl { background: var(--a33); }
.cal-day-cell {
  text-align: center;
  padding: 5px 2px 4px;
  border: 1px solid var(--a22);
  cursor: pointer;
  vertical-align: top;
  min-height: 42px;
  transition: background .1s;
  background: var(--bg3);
}
.cal-day-cell:hover { background: var(--a33); }

/* Alternating tenday row shading */
.cal-grid tbody tr:nth-child(even) .cal-day-cell { background: var(--a22); }
.cal-grid tbody tr:nth-child(even) .cal-day-cell:hover { background: var(--a33); }
.cal-day-cell.cal-is-today {
  background: rgba(200,160,74,.1);
  border-color: var(--ac);
  box-shadow: inset 0 0 0 1px var(--ac);
}
.cal-day-num { font-size: 11px; color: var(--txd); display: block; line-height: 1.8; }
.cal-is-today .cal-day-num { color: var(--ac); font-weight: bold; }

/* Dot markers on calendar cells */
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; padding: 0 2px; }
.cal-dot   { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.cal-dot.pub  { background: #5a9; }
.cal-dot.priv { background: #c55; }

/* Festival day row */
.cal-festival-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(200,160,74,.05);
  border: 1px solid var(--a44);
  border-radius: 4px;
  padding: 11px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background .1s;
}
.cal-festival-row:hover       { background: rgba(200,160,74,.11); }
.cal-festival-row.cal-is-today { border-color: var(--ac); background: rgba(200,160,74,.15); }
.cal-fest-icon  { font-size: 18px; flex-shrink: 0; }
.cal-fest-name  { font-size: 15px; font-weight: bold; color: var(--ac); flex: 1; }
.cal-fest-mark  { font-size: 10px; color: var(--ac); font-style: italic; }

/* Events list */
.cal-events-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--a33);
  margin-bottom: 8px;
}
.cal-events-title { font-size: 11px; color: var(--ac); text-transform: uppercase; letter-spacing: .6px; font-weight: bold; }
.cal-event-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--a33);
  border-radius: 4px;
  margin-bottom: 5px;
}
.cal-event-info  { flex: 1; min-width: 0; }
.cal-event-title { font-size: 13px; color: var(--tx); font-weight: bold; }
.cal-event-date  { font-size: 10px; color: var(--txd); margin-top: 1px; }
.cal-event-desc  { font-size: 11px; color: var(--txd); margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.cal-event-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 2px;
}
.cal-event-badge.pub  { background: rgba(90,170,120,.18); color: #5a9; border: 1px solid rgba(90,170,120,.35); }
.cal-event-badge.priv { background: rgba(200,80,80,.15);  color: #c55; border: 1px solid rgba(200,80,80,.3);  }
.cal-event-actions { display: flex; gap: 4px; flex-shrink: 0; align-items: flex-start; padding-top: 2px; }
.cal-event-author { font-size: 10px; color: var(--a); margin-top: 2px; font-style: italic; }

/* Event media attachments (image/audio/video) */
.cal-media-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cal-media-thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--a33); cursor: zoom-in;
}
.cal-media-audio { height: 30px; max-width: 220px; }
.cal-media-video { max-width: 220px; max-height: 140px; border-radius: 4px; border: 1px solid var(--a33); }

/* Pending media chips inside the journal modal */
.cal-media-pending { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cal-media-chip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 4px; border: 1px solid var(--a33);
  background: var(--bg3); overflow: hidden;
}
.cal-media-chip img { width: 100%; height: 100%; object-fit: cover; }
.cal-media-chip-icon { font-size: 20px; }
.cal-media-chip button {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; border: none; background: #c44; color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer; padding: 0;
}

.cal-empty { font-size: 12px; color: var(--txd); padding: 6px 0; }

/* Modal overlay */
.cal-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-modal-box {
  background: var(--bg2);
  border: 1px solid var(--a44);
  border-radius: 6px;
  padding: 22px 20px 18px;
  width: 440px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}
.cal-modal-title { font-size: 14px; font-weight: bold; color: var(--ac); margin-bottom: 16px; }
.cal-form-row { margin-bottom: 11px; }
.cal-form-row label { display: block; font-size: 10px; color: var(--ac); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.cal-form-row input,
.cal-form-row textarea,
.cal-form-row select {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg3);
  border: 1px solid var(--a55);
  color: var(--tx);
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
}
.cal-form-row textarea { resize: vertical; min-height: 60px; }
.cal-form-inline { display: flex; gap: 8px; }
.cal-form-inline > .cal-form-row { flex: 1; margin-bottom: 0; }
.cal-form-row.cal-form-inline { margin-bottom: 11px; }
.cal-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
}
.cal-toggle-row label { font-size: 12px; color: var(--tx); cursor: pointer; user-select: none; }
.cal-modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
