/* Talkoot day boxes (spec/04-design/days.md): "laatikoiksi josta isompi teksti avautuu kun hiiren vie päälle.
   Aluksi näkyy vain päivämäärä ja otsikko". Linked only by pages with a days block, after site.css.
   A box with text is a native <details>: click, tap, Enter or Space open it everywhere; days.js adds open on hover. */

.band > .days { max-width: var(--w-wide); }
.band > * + .days,
.band > .days + * { margin-top: clamp(1.5rem, 3vw, 2rem); }

.days {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* a long word may not widen the column past a 320px screen (200% text) */
  gap: 12px;
  margin-block: 0; /* side margins stay the band's auto: centred */
  padding: 0;
  list-style: none;
  align-items: start; /* an open box grows alone; its neighbours keep their height */
}

@media (min-width: 640px) {
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .days { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

.day__box,
.day--plain .day__head {
  border: 1px solid var(--taupe);
  border-radius: var(--radius);
  background: var(--card-bg);
}

.day__box { transition: border-color 0.2s, box-shadow 0.2s; }
.day__box:hover,
.day__box[open] { border-color: var(--red); }
.day__box[open] { box-shadow: var(--shadow-soft); }

.day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  margin: 0;
  padding: 16px 18px;
  border-radius: calc(var(--radius) - 1px);
  line-height: 1.35;
}

summary.day__head {
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}

summary.day__head::-webkit-details-marker { display: none; }

.day__line { display: block; min-width: 0; }

.day__date {
  display: block;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.005em;
  color: var(--red); /* 6.8:1 on cream, 8.6:1 on paper */
}

.day__title {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  font-weight: 600;
}

/* Plus → minus icon, as on the accordions (aria-hidden). */
.day__icon {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--taupe);
  border-radius: 50%;
  transition: border-color 0.2s;
}

.day__icon::before,
.day__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 1px;
  background: var(--red);
  transition: transform 0.3s var(--ease);
}

.day__icon::after { transform: rotate(90deg); }
.day__box[open] > summary .day__icon::after { transform: rotate(0deg); }
.day__box:hover .day__icon { border-color: var(--red); }

.day__body {
  padding: 0 18px 20px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.day__body::before {
  content: '';
  display: block;
  height: 1px;
  margin-bottom: 14px;
  background: var(--hairline);
}

.day__body p + p,
.day__body .list + p { margin-top: 0.75em; }
.day__body p + .list { margin-top: 0.35em; }
.day__body .list li + li { margin-top: 0.2em; }

@media print {
  .day__box,
  .day--plain .day__head { break-inside: avoid; background: none; border-color: #999; box-shadow: none; }
  .day__date { color: #000; }
  .day__icon { display: none; }
}

@media (forced-colors: active) {
  .day__icon::before,
  .day__icon::after { background: CanvasText; }
}
