/* Simos Camp — weekly camp calendar (js/ui/calendar.js).  Class prefix `cal-`.
 * Mobile-first: "now & next" card, week bar, filters, a 7-day strip and the selected day's agenda.
 * ≥ 900 px: the whole week as 7 columns (the strip hides). Uses the base.css variables (dark mode included). */

/* the sheet must never grow wider than the screen because of the 7-column grids / nowrap chips inside it */
.ui-sheet.cal-sheet { min-width: 0; }
.cal { display: flex; flex-direction: column; gap: 12px; min-width: 0; contain: inline-size; font-family: var(--font); color: var(--ink); }
.cal button { font-family: var(--font); }

/* ------------------------------------------------------------------ now & next */
.cal-now {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius); padding: 10px 12px 12px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%), linear-gradient(140deg, #45d3d1, var(--sea) 78%);
  border: 3px solid var(--turq-dark); box-shadow: 0 4px 0 #157186; text-shadow: 0 1px 0 rgba(21, 90, 110, .45);
  animation: cal-in .38s var(--ease-soft) backwards;
}
.cal-now::after { /* a little wave line along the bottom */
  content: ''; position: absolute; left: -10px; right: -10px; bottom: -6px; height: 16px; pointer-events: none;
  background: radial-gradient(circle at 10px -2px, transparent 9px, rgba(255, 255, 255, .22) 10px, transparent 12px) 0 0 / 22px 16px repeat-x;
}
.cal-now-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.cal-now-clock { font-weight: 700; font-size: 19px; letter-spacing: .3px; }
.cal-now-day { font-weight: 700; font-size: 13px; padding: 1px 9px; border-radius: 999px; background: rgba(255, 255, 255, .25); }
.cal-now-wk { margin-left: auto; font-size: 12px; opacity: .9; }
.cal-now-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.cal-now-row {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 7px 8px 7px 7px; border-radius: 15px; cursor: pointer;
  background: rgba(255, 255, 255, .17); border: 2px solid rgba(255, 255, 255, .28); transition: transform .15s ease, background .15s ease;
}
.cal-now-row:hover { background: rgba(255, 255, 255, .24); }
.cal-now-row:active { transform: scale(.98); }
.cal-now-row:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cal-now-ico {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; line-height: 1; text-shadow: none;
  background: radial-gradient(circle at 38% 30%, #fff, #fcf5e3 65%, #f0dcb2); border: 2px solid rgba(21, 113, 134, .55); box-shadow: 0 2px 0 rgba(21, 113, 134, .45);
}
.cal-now-live .cal-now-ico { animation: cal-bob 2.4s ease-in-out infinite; }
.cal-now-main { flex: 1 1 auto; min-width: 0; }
.cal-now-tag { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .3px; opacity: .95; }
.cal-now-title { font-weight: 700; font-size: 17px; line-height: 1.15; }
.cal-now-sub { font-size: 12.5px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-now-btn.sc-btn.small { flex: none; min-width: 44px; min-height: 40px; }
.cal-now-btn.sc-btn.white { width: 44px; padding: 0; border-radius: 50%; font-size: 18px; }
.cal-now-quiet { font-size: 14px; padding: 8px 2px 2px; opacity: .95; }
.cal-now-bdays { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.cal-now-bd-t { font-weight: 700; font-size: 13px; }
.cal-now-bd-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-bd {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; cursor: pointer; min-height: 36px;
  background: #fff; color: #a42c58; font-weight: 700; font-size: 13px; text-shadow: none; border: 2px solid #ffb3cb; box-shadow: 0 2px 0 rgba(179, 51, 95, .35);
}
.cal-bd:active { transform: scale(.96); }

/* ------------------------------------------------------------------ week bar & filters */
.cal-wkbar { display: flex; align-items: center; gap: 10px; }
.cal-wk-btn.sc-btn.small { flex: none; width: 44px; min-height: 40px; padding: 0 0 3px; font-size: 26px; line-height: 1; border-radius: 50%; }
.cal-wk-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.cal-wk-mid b { font-size: 18px; }
.cal-wk-mid span { font-size: 12.5px; color: var(--ink-soft); }

.cal-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 4px; -webkit-overflow-scrolling: touch; }
.cal-filters::-webkit-scrollbar { display: none; }
.cal-filter {
  flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 13px 4px 10px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-soft); background: var(--paper); border: 2px dashed var(--sand-dark);
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.cal-filter:active { transform: scale(.95); }
.cal-filter span { font-size: 16px; filter: grayscale(.7); opacity: .7; transition: filter .18s ease, opacity .18s ease; }
.cal-filter.on { border-style: solid; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .18); box-shadow: 0 3px 0 rgba(0, 0, 0, .14); }
.cal-filter.on span { filter: none; opacity: 1; }
.cal-filter.cal-f-event.on { background: linear-gradient(180deg, #ffbd73, var(--orange)); border-color: #d97a1f; }
.cal-filter.cal-f-workshop.on { background: linear-gradient(180deg, #c0adff, var(--purple)); border-color: #7d62e0; }
.cal-filter.cal-f-birthday.on { background: linear-gradient(180deg, #ffa3c2, var(--pink)); border-color: #d9487a; }

/* ------------------------------------------------------------------ day strip (phones) */
.cal-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dbtn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 60px;
  padding: 5px 0 5px; border-radius: 15px; cursor: pointer; color: var(--ink); background: var(--paper); border: 2px solid var(--sand-dark);
  box-shadow: 0 2px 0 var(--sand-dark); transition: transform .15s var(--ease-spring), background .15s ease;
}
.cal-dbtn:active { transform: translateY(2px); box-shadow: none; }
.cal-dbtn-l { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); }
.cal-dbtn b { font-size: 19px; line-height: 1; }
.cal-dots { display: flex; gap: 3px; height: 7px; margin-top: 2px; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; }
.cal-dot-event { background: var(--orange); }
.cal-dot-workshop { background: var(--purple); }
.cal-dot-birthday { background: var(--pink); }
.cal-dbtn.past { opacity: .66; }
.cal-dbtn.today { border-color: var(--turq); }
.cal-dbtn.today .cal-dbtn-l { color: var(--turq-dark); }
.cal-dbtn.sel {
  color: #fff; border-color: var(--turq-dark); background: linear-gradient(180deg, #5fdad8, var(--turq)); box-shadow: 0 3px 0 #157186;
  transform: translateY(-2px); opacity: 1; text-shadow: 0 1px 0 rgba(21, 113, 134, .6);
}
.cal-dbtn.sel .cal-dbtn-l { color: #fff; }
.cal-dbtn.sel .cal-dots i { box-shadow: 0 0 0 1.5px #fff; }

/* ------------------------------------------------------------------ the week / a day */
.cal-day { display: none; }
.cal-day.sel { display: block; animation: cal-in .28s var(--ease-soft) backwards; }
.cal-day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; }
.cal-day-head b { font-size: 18px; }
.cal-day-head span { font-size: 13px; color: var(--ink-soft); }
.cal-day-list { display: flex; flex-direction: column; gap: 8px; }
.cal-day-empty {
  padding: 16px 12px; text-align: center; font-size: 14px; color: var(--ink-soft); border-radius: 16px; border: 2px dashed var(--sand-dark);
}

/* ------------------------------------------------------------------ event cards */
.cal-ev {
  --k: var(--orange); --kbg: rgba(255, 159, 67, .16);
  position: relative; display: grid; grid-template-columns: 46px 44px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  min-height: 64px; padding: 8px 9px 8px 7px; border-radius: 16px; cursor: pointer;
  background: var(--paper); border: 2px solid var(--sand-dark); border-left: 6px solid var(--k); box-shadow: 0 3px 0 rgba(122, 81, 50, .16);
  transition: transform .14s ease, box-shadow .14s ease;
  animation: cal-in .32s var(--ease-soft) backwards;
}
.cal-ev:nth-child(2) { animation-delay: .03s; } .cal-ev:nth-child(3) { animation-delay: .06s; } .cal-ev:nth-child(4) { animation-delay: .09s; }
.cal-ev:nth-child(5) { animation-delay: .12s; } .cal-ev:nth-child(n+6) { animation-delay: .15s; }
.cal-ev:hover { box-shadow: 0 4px 0 rgba(122, 81, 50, .22); }
.cal-ev:active { transform: scale(.98); }
.cal-ev:focus-visible { outline: 3px solid var(--turq); outline-offset: 2px; }
.cal-k-workshop { --k: var(--purple); --kbg: rgba(165, 139, 255, .18); }
.cal-k-birthday { --k: var(--pink); --kbg: rgba(255, 127, 168, .18); background: linear-gradient(100deg, var(--kbg), rgba(255, 255, 255, 0) 60%), var(--paper); }
.cal-ev-time { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.cal-ev-time b { font-size: 15px; }
.cal-ev-time span { font-size: 12px; color: var(--ink-soft); }
.cal-ev-time.cal-allday b { font-size: 18px; }
.cal-ev-ico {
  position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 23px; line-height: 1;
  background: var(--kbg); border: 2px solid var(--k);
}
.cal-ev-face { background: none; border: 0; }
.cal-ev-face .sc-face { width: 42px !important; height: 42px !important; }
.cal-hat { position: absolute; top: -9px; right: -7px; font-size: 17px; font-style: normal; transform: rotate(14deg); }
.cal-ev-main { min-width: 0; }
.cal-ev-title { font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.cal-ev-place { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.cal-ev-chips:empty { display: none; }
.cal-ev-act.sc-btn.small { min-height: 40px; }
.cal-ev-act.cal-go { width: 42px; padding: 0; border-radius: 50%; font-size: 18px; }
.cal-ev-act.cal-join { padding: 4px 14px; }

.cal-s-past { opacity: .58; box-shadow: none; }
.cal-s-past .cal-ev-ico { filter: grayscale(.5); }
.cal-s-soon { border-color: var(--yellow); border-left-color: var(--k); }
.cal-s-live { border-color: var(--red); border-left-color: var(--k); box-shadow: 0 0 0 3px rgba(255, 90, 90, .18), 0 3px 0 rgba(122, 81, 50, .16); }
.cal-s-live .cal-ev-ico { animation: cal-bob 2.4s ease-in-out infinite; }
.cal-is-req { border-color: var(--pink); }
.cal-own .cal-ev-title { color: var(--heart); }

/* a day's birthdays: one compact row of faces */
.cal-bdrow {
  display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 15px;
  background: rgba(255, 127, 168, .13); border: 2px dashed rgba(255, 127, 168, .75); animation: cal-in .3s var(--ease-soft) backwards;
}
.cal-bdrow-ico { flex: none; font-size: 20px; line-height: 1; animation: cal-bob 2.8s ease-in-out infinite; }
.cal-bdrow-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.cal-bdchip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; max-width: 100%; padding: 2px 10px 2px 3px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--heart); background: var(--paper); border: 1.5px solid rgba(255, 127, 168, .8);
  transition: transform .12s ease;
}
.cal-bdchip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bdchip .sc-face { flex: none; }
.cal-bdchip:active { transform: scale(.95); }
.cal-bdchip:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.cal-bdchip.own { background: linear-gradient(180deg, #ffe3ee, #ffd0e0); color: #a42c58; }

/* chips */
.cal-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.5;
  background: var(--sand); color: var(--ink); border: 1.5px solid var(--sand-dark); white-space: nowrap;
}
.cal-chip.cal-live { background: #ffe1e1; color: #9b2424; border-color: var(--red); }
.cal-chip.cal-st-soon { background: #fff3c9; color: #7a5600; border-color: #f0bf2e; }
.cal-chip.cal-st-allday { background: #ffe3ee; color: #a42c58; border-color: var(--pink); }
.cal-chip.cal-st-past { opacity: .85; }
.cal-chip.cal-req { background: #ffe3ee; color: #a42c58; border-color: var(--pink); }
.cal-chip.cal-done { background: #dff6e6; color: #226b3a; border-color: var(--green); }
.cal-chip.cal-mg { background: #dcf7f5; color: #16707e; border-color: var(--turq); }
.cal-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 90, 90, .6); animation: cal-ping 1.6s ease-out infinite; }
.cal-now .cal-dot { background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); animation-name: cal-ping-w; }

/* ------------------------------------------------------------------ birthdays coming up & footer */
.cal-sec-title { font-weight: 700; font-size: 16px; margin: 4px 2px 8px; }
.cal-bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cal-bd-up {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 10px 5px 5px; border-radius: 16px; cursor: pointer;
  background: var(--paper); border: 2px solid var(--sand-dark); transition: transform .14s ease;
}
.cal-bd-up:active { transform: scale(.97); }
.cal-bd-up.own { border-color: var(--pink); }
.cal-bd-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.cal-bd-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bd-main span { font-size: 12px; color: var(--ink-soft); }
.cal-face-fb { display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--pink); border-radius: 50%; }
.cal-foot { font-size: 12.5px; color: var(--ink-soft); text-align: center; padding: 2px 8px 4px; line-height: 1.4; }

/* ------------------------------------------------------------------ event details (inside ui.choice) */
.cal-dt { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.cal-dt-when { display: flex; flex-wrap: wrap; gap: 5px; }
.cal-dt-when > span:not(.cal-chip) {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--sand); border: 1.5px solid var(--sand-dark);
}
.cal-dt-when .cal-chip { font-size: 12.5px; padding: 2px 10px; }
.cal-dt-desc { font-size: 15px; line-height: 1.4; }
.cal-dt-tip { font-size: 13.5px; line-height: 1.35; padding: 7px 11px; border-radius: 12px; background: rgba(46, 196, 198, .14); border: 1.5px solid rgba(46, 196, 198, .5); }

/* ------------------------------------------------------------------ wide screens: the whole week at a glance */
@media (min-width: 900px) {
  .cal { gap: 12px; }
  .cal-now-rows { flex-direction: row; flex-wrap: wrap; }
  .cal-now-row { flex: 1 1 260px; }
  .cal-strip { display: none; }
  .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; align-items: stretch; }
  .cal-day, .cal-day.sel {
    display: block; animation: none; min-width: 0; padding: 6px 5px 8px; border-radius: 16px;
    background: rgba(255, 255, 255, .28); border: 2px solid var(--sand-dark);
  }
  .cal-day.past { opacity: .8; }
  .cal-day.today { border-color: var(--turq); background: rgba(46, 196, 198, .1); box-shadow: 0 0 0 2px rgba(46, 196, 198, .25); }
  .cal-day-head { flex-direction: column; align-items: center; gap: 0; margin: 0 0 6px; text-align: center; line-height: 1.15; }
  .cal-day-head b { font-size: 15px; }
  .cal-day-head span { font-size: 11.5px; }
  .cal-day.today .cal-day-head b { color: var(--turq-dark); }
  .cal-day-list { gap: 6px; }
  .cal-day-empty { padding: 12px 6px; font-size: 12.5px; }
  .cal-ev {
    grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: 'ico time' 'main main' 'act act';
    gap: 3px 6px; min-height: 0; padding: 6px 6px 7px; border-left-width: 2px; border-top: 5px solid var(--k); border-radius: 13px;
  }
  .cal-ev-ico { grid-area: ico; width: 30px; height: 30px; font-size: 16px; border-width: 1.5px; }
  .cal-ev-face .sc-face { width: 30px !important; height: 30px !important; }
  .cal-hat { top: -8px; right: -8px; font-size: 13px; }
  .cal-ev-time { grid-area: time; flex-direction: row; align-items: baseline; justify-self: start; gap: 2px; }
  .cal-ev-time b { font-size: 13px; }
  .cal-ev-time span { font-size: 11px; }
  .cal-ev-time:not(.cal-allday) span::before { content: '–'; }
  .cal-ev-time.cal-allday b { font-size: 12px; display: none; }
  .cal-ev-main { grid-area: main; }
  .cal-ev-title { font-size: 13px; }
  .cal-ev-place { font-size: 11px; white-space: normal; }
  .cal-ev-chips { margin-top: 2px; }
  .cal-chip { font-size: 10.5px; padding: 0 6px; }
  .cal-ev-act { grid-area: act; }
  .cal-ev-act.cal-go { display: none; }
  .cal-ev-act.cal-join.sc-btn.small { min-height: 32px; width: 100%; margin-top: 3px; font-size: 13px; }
  .cal-bd-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .cal-bdrow { flex-direction: column; align-items: stretch; gap: 4px; padding: 4px; border-radius: 12px; }
  .cal-bdrow-ico { align-self: center; font-size: 16px; }
  .cal-bdrow-list { flex-direction: column; gap: 4px; }
  .cal-bdchip { min-height: 28px; font-size: 11.5px; padding: 2px 7px 2px 2px; }
  .cal-bdchip .sc-face { width: 22px !important; height: 22px !important; }
}

/* ------------------------------------------------------------------ motion */
@keyframes cal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cal-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes cal-ping { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 90, .6); } 80%, 100% { box-shadow: 0 0 0 7px rgba(255, 90, 90, 0); } }
@keyframes cal-ping-w { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 80%, 100% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) {
  .cal-now, .cal-ev, .cal-day.sel, .cal-now-live .cal-now-ico, .cal-s-live .cal-ev-ico, .cal-dot, .cal-bdrow, .cal-bdrow-ico { animation: none !important; }
}
