/* Painting of the day (feature module). Every selector is scoped under .today-… */

:root {
  --today-wall: color-mix(in srgb, var(--ground) 90%, var(--ink));
  --today-wall-text: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --today-wall: #140A18; }
}
:root[data-theme="dark"] { --today-wall: #140A18; }

/* ---------- kicker (shared by page, archive) ---------- */
.today-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font: 700 .95rem/1.2 var(--display); }
.today-kicker a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.today-kicker a::before { content: ""; width: 22px; height: 28px; flex: none; border-radius: 999px 999px 3px 3px; background: linear-gradient(180deg, var(--salmon), var(--rose)); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--ochre) 80%, transparent); }
.today-kicker a:hover { text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; }
.today-kicker span { color: var(--muted); font-weight: 600; }

/* ---------- the wall: the painting on a quiet ground ---------- */
.today-wall {
  background: var(--today-wall);
  padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(28px, 5vw, 64px);
  display: grid; justify-items: center; gap: clamp(20px, 3vw, 36px);
}
.today-wall__head { display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 60rem; }
.today-title { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.05; max-width: 28ch; }
.today-by { font: 500 clamp(1.05rem, 1.6vw, 1.25rem)/1.35 var(--serif); font-style: italic; color: var(--muted); }

.today-canvas { margin: 0; display: grid; justify-items: center; gap: 14px; width: 100%; }
.today-canvas__frame {
  display: block; padding: 0; border: 0; background: none; cursor: zoom-in; max-width: 100%;
  border-radius: 2px;
}
.today-canvas__frame img {
  display: block; width: auto; height: auto; max-width: 100%;
  max-height: max(320px, min(calc(100svh - 340px), 1000px));
  box-shadow: 0 2px 3px color-mix(in srgb, #000 18%, transparent), 0 30px 60px -28px color-mix(in srgb, #000 60%, transparent);
  background: var(--surface);
}
.today-wall { padding-top: clamp(20px, 3vw, 36px); gap: clamp(16px, 2.4vw, 28px); }
.today-canvas__frame:focus-visible { outline-offset: 8px; }
.today-canvas__tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 22px; font: 600 .9rem/1.2 var(--display); }
.today-zoom {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border: 1.5px solid var(--rule); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer;
  font: 700 .88rem/1 var(--display);
}
.today-zoom:hover { border-color: var(--text); }
.today-canvas__museum { color: var(--muted); }

/* ---------- guide + label ---------- */
.today-body {
  max-width: var(--max); margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: clamp(32px, 6vw, 88px); align-items: start;
}
.today-guide { max-width: 40rem; }
.today-guide h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.today-guide h2 span { font: 600 .95rem/1.2 var(--display); color: var(--muted); letter-spacing: 0; }
.today-guide__note { margin-top: 16px; font-size: 1.15rem; line-height: 1.55; color: var(--muted); }
.today-prompts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: none; }
.today-prompt {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start;
  background: var(--surface); border-radius: var(--r); padding: 20px 22px;
  border-left: 3px solid var(--ochre);
}
.today-prompt[hidden] { display: none; }
.today-prompt:focus { outline: none; }
.today-prompt:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.today-prompt__n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--ground); font: 800 .95rem/1 var(--display);
}
.today-prompt p { font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.45; }
.today-prompt[data-state="past"] { background: transparent; border-left-color: var(--rule); padding-block: 12px; }
.today-prompt[data-state="past"] p { font-size: 1.02rem; color: var(--muted); }
.today-prompt[data-state="past"] .today-prompt__n { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--rule); }
.today-prompt[data-state="new"] { animation: today-in .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes today-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.today-guide__foot { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.today-guide__foot[hidden], .today-guide__done[hidden], .today-next[hidden] { display: none; }
.today-guide__count { font: 600 .9rem/1.2 var(--display); color: var(--muted); }
.today-guide__done { margin-top: 20px; font-style: italic; font-size: 1.1rem; color: var(--muted); }

.today-side { display: grid; gap: 32px; position: sticky; top: 96px; }
.today-label {
  margin: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--ochre);
  display: grid; gap: 4px; font: 500 .92rem/1.45 var(--display); color: var(--muted);
}
.today-label dd { margin: 0; }
.today-label__artist { color: var(--text); font-weight: 800; font-size: 1.02rem; }
.today-label__title { color: var(--text); }
.today-label__title cite { font-style: italic; font-family: var(--serif); font-size: 1.08rem; }
.today-label__credit { margin-top: 8px !important; font-size: .82rem; }
.today-share h2 { font: 700 .82rem/1.2 var(--display); color: var(--muted); letter-spacing: .02em; }
.today-letter .subscribe { flex-direction: column; }
.today-letter .subscribe input[type="email"] { width: 100%; flex: none; }
.today-letter .btn { width: 100%; }

/* ---------- yesterday / tomorrow ---------- */
.today-days {
  max-width: var(--max); margin: clamp(48px, 7vw, 88px) auto 0; padding: 24px var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px 24px;
  border-top: 1px solid var(--rule);
}
.today-day { display: flex; align-items: center; gap: 14px; min-height: 64px; color: var(--text); text-decoration: none; font: 700 1rem/1.25 var(--display); }
.today-day span { display: grid; gap: 3px; min-width: 0; }
.today-day small { font-weight: 600; font-size: .82rem; color: var(--muted); }
.today-day img { width: 56px; height: 64px; object-fit: cover; flex: none; border-radius: 999px 999px 4px 4px; }
.today-day--next { justify-content: flex-end; text-align: right; }
a.today-day:hover span { text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; }
.today-day--off { color: var(--muted); font-weight: 600; }
.today-days__all { font: 700 .92rem/1 var(--display); color: var(--text); text-decoration-color: var(--ochre); text-decoration-thickness: 2px; padding: 12px 4px; }
.today-related { margin-top: clamp(48px, 7vw, 80px); }

/* ---------- lightbox ---------- */
.today-lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0E0710; color: #F2EAF3;
}
.today-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.today-lightbox::backdrop { background: #0E0710; }
.today-lightbox__bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font: 600 .92rem/1.25 var(--display); }
.today-lightbox__bar p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-lightbox__bar p span { color: #CDB8D2; font-weight: 500; margin-left: .5em; }
.today-lightbox__btn {
  min-height: 40px; padding: 8px 16px; border-radius: 999px; cursor: pointer; flex: none;
  background: transparent; color: inherit; border: 1.5px solid color-mix(in srgb, #F2EAF3 35%, transparent); font: 700 .88rem/1 var(--display);
}
.today-lightbox__btn:hover { border-color: #F2EAF3; }
.today-lightbox__stage { overflow: auto; display: grid; place-items: center; padding: 8px 16px 20px; overscroll-behavior: contain; }
.today-lightbox__stage:focus-visible { outline: 3px solid var(--ochre); outline-offset: -3px; }
.today-lightbox__stage img { max-width: 100%; max-height: calc(100vh - 90px); width: auto; height: auto; cursor: zoom-in; }
.today-lightbox.is-actual .today-lightbox__stage { place-items: start; }
.today-lightbox.is-actual .today-lightbox__stage img { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }

/* ---------- empty / error state ---------- */
.today-empty { max-width: 40rem; margin: 0 auto; padding: clamp(64px, 12vw, 140px) var(--gutter); display: grid; justify-items: center; gap: 18px; text-align: center; }
.today-empty__halo { width: 96px; height: 120px; border-radius: 999px 999px 8px 8px; background: linear-gradient(180deg, var(--salmon), var(--violet)); opacity: .8; }
.today-empty h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.today-empty p { color: var(--muted); font-size: 1.1rem; }

/* ---------- archive ---------- */
.today-archive__arch { width: clamp(72px, 9vw, 120px); aspect-ratio: 4 / 5; border-radius: 999px 999px 8px 8px; background: linear-gradient(180deg, var(--ochre) 0 30%, var(--salmon) 30% 62%, var(--rose) 62%); box-shadow: inset 0 0 0 clamp(8px, 1vw, 12px) color-mix(in srgb, var(--plum) 55%, transparent); }
.today-archive { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 40px; display: grid; gap: clamp(36px, 5vw, 56px); }
.today-archive__empty { font-size: 1.15rem; color: var(--muted); }
.today-month { border-top: 1px solid var(--rule); padding-top: 22px; }
.today-month h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; margin-bottom: 22px; }
.today-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 32px 22px; }
.today-tile { display: grid; gap: 6px; color: var(--text); text-decoration: none; }
.today-tile__img { display: block; overflow: hidden; border-radius: 999px 999px var(--r) var(--r); background: var(--today-wall); margin-bottom: 6px; }
.today-tile__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.today-tile:hover .today-tile__img img { transform: scale(1.04); }
.today-tile__date { font: 600 .85rem/1.2 var(--display); color: var(--muted); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.today-tile__date strong { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.today-tile__date em { font-style: normal; background: var(--ochre); color: var(--ink); padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.today-tile__title { font: 700 1.02rem/1.2 var(--display); }
.today-tile:hover .today-tile__title { text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; }
.today-tile__by { font-size: .95rem; color: var(--muted); font-style: italic; }

/* ---------- home card (partials/today-card.php) ---------- */
.today-card {
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); gap: clamp(14px, 4cqi, 22px); align-items: center;
  background: var(--surface); border-radius: calc(var(--r) * 2); padding: 14px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent);
  max-width: 520px;
}
.today-card__frame { display: block; overflow: hidden; border-radius: 999px 999px 6px 6px; background: var(--today-wall); }
.today-card__frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.today-card:hover .today-card__frame img { transform: scale(1.04); }
.today-card__body { display: grid; gap: 6px; min-width: 0; padding-right: 6px; }
.today-card__kicker { font: 700 .82rem/1.25 var(--display); color: var(--text); display: flex; flex-wrap: wrap; gap: 2px 8px; }
.today-card__kicker span { color: var(--muted); font-weight: 600; }
.today-card__title { font-size: clamp(1.08rem, 5.4cqi, 1.55rem); font-weight: 800; line-height: 1.08; letter-spacing: -.015em; overflow-wrap: break-word; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.today-card__title a { color: var(--text); text-decoration: none; }
.today-card__title a:hover { text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; }
.today-card__by { font-size: 1rem; line-height: 1.35; font-style: italic; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.today-card__cta {
  justify-self: start; margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  color: var(--text); text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; text-underline-offset: .22em;
  font: 700 .9rem/1.2 var(--display);
}
.today-card__cta::after { content: "\2192"; transition: transform .2s ease; }
@container (min-width: 440px) {
  .today-card__cta { padding: 8px 16px; border-radius: 999px; background: var(--ochre); color: var(--ink); text-decoration: none; white-space: nowrap; }
}
.today-card__cta:hover::after { transform: translateX(3px); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .today-body { grid-template-columns: minmax(0, 1fr); }
  .today-side { position: static; }
  .today-guide { max-width: none; }
}
@media (max-width: 640px) {
  .today-wall { padding-inline: 12px; }
  .today-canvas__frame img { max-height: 70vh; }
  .today-days { grid-template-columns: 1fr 1fr; }
  .today-days__all { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .today-day img { display: none; }
  .today-prompt { padding: 16px; gap: 12px; }
  .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .today-prompt[data-state="new"] { animation: none; }
  .today-card__frame img, .today-tile__img img { transition: none; }
}
.today-wall__head .today-kicker { justify-content: center; }
@media (max-width: 640px) {
  .today-title { font-size: 1.45rem; }
  .today-by { font-size: 1rem; }
  .today-kicker { font-size: .88rem; }
}
@media (max-width: 560px) { .today-archive__arch { display: none; } }
