/* ═══════════════════════════════════════════════════════════════
   CUE — Custom-day sticker
   Three-state page: sign-in → picker → preview. Shares chrome with
   shop.html / apply.css; everything specific lives here.
   ═══════════════════════════════════════════════════════════════ */

.day-body { background: var(--cream); }

.day-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--bleed) clamp(3rem, 8vw, 5rem);
  position: relative;
}

/* ───── State container baseline ───── */
.day-state {
  min-height: 40vh;
}

.day-state__line {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--ink-quiet);
  text-align: center;
  margin: clamp(3rem, 8vw, 5rem) 0 0.4rem;
}

.day-state__detail {
  text-align: center;
  color: var(--ink-quiet);
  font-size: 0.95rem;
}

.day-state__note {
  min-height: 1.4em;
  margin: 0.8rem 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-quiet);
  text-align: center;
}

.day-state__note[data-state="error"] { color: #b94a3a; }

.day-state--error { padding-top: clamp(3rem, 8vw, 5rem); }

/* ───── Sign-in ───── */

#state-signin {
  max-width: 36rem;
  margin: 0 auto;
  text-align: left;
}

.day-signin {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 1.4rem;
  padding: 0.85em 1.6em;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s var(--ease-soft),
              transform 0.18s var(--ease-soft);
}

.day-signin:hover { background: var(--plum); transform: translateY(-1px); }
.day-signin:active { transform: translateY(0); }

.day-signin[disabled],
.day-signin[aria-busy="true"] {
  opacity: 0.65;
  cursor: progress;
}

/* ───── Email + magic link form ───── */

.day-signin-form { margin-top: 1.4rem; max-width: 28rem; }

.day-signin-form__label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.day-signin-form__row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.day-signin-form__input {
  flex: 1;
  min-width: 0;
  padding: 0.7em 0.95em;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.18s var(--ease-soft);
}

.day-signin-form__input:focus { border-color: var(--plum); }
.day-signin-form__input::placeholder { color: var(--ink-faint); }

.day-signin--inline {
  margin-top: 0;
  white-space: nowrap;
  padding: 0.7em 1.2em;
}

.day-link--inline {
  display: inline;
  align-self: baseline;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
  font-size: inherit;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  color: var(--plum);
}

/* The Apple glyph. Drawn in CSS so it tints with the button color. */
.day-signin__glyph {
  width: 14px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 17'><path d='M11.65 9.04c-.02-2.13 1.74-3.16 1.82-3.21-.99-1.45-2.54-1.65-3.09-1.67-1.31-.13-2.56.77-3.23.77-.67 0-1.69-.75-2.78-.73-1.43.02-2.75.83-3.49 2.11-1.5 2.6-.38 6.43 1.07 8.54.71 1.03 1.55 2.19 2.65 2.15 1.07-.04 1.48-.69 2.77-.69 1.29 0 1.66.69 2.79.67 1.15-.02 1.88-1.05 2.58-2.09.82-1.19 1.15-2.35 1.17-2.42-.03-.01-2.24-.86-2.26-3.42zM9.39 2.85C9.99 2.13 10.39 1.13 10.28 0 9.31.04 8.13.65 7.52 1.37c-.54.64-1.02 1.66-.89 2.77 1.08.08 2.18-.55 2.76-1.29z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 17'><path d='M11.65 9.04c-.02-2.13 1.74-3.16 1.82-3.21-.99-1.45-2.54-1.65-3.09-1.67-1.31-.13-2.56.77-3.23.77-.67 0-1.69-.75-2.78-.73-1.43.02-2.75.83-3.49 2.11-1.5 2.6-.38 6.43 1.07 8.54.71 1.03 1.55 2.19 2.65 2.15 1.07-.04 1.48-.69 2.77-.69 1.29 0 1.66.69 2.79.67 1.15-.02 1.88-1.05 2.58-2.09.82-1.19 1.15-2.35 1.17-2.42-.03-.01-2.24-.86-2.26-3.42zM9.39 2.85C9.99 2.13 10.39 1.13 10.28 0 9.31.04 8.13.65 7.52 1.37c-.54.64-1.02 1.66-.89 2.77 1.08.08 2.18-.55 2.76-1.29z'/></svg>") center/contain no-repeat;
}

/* ───── Picker ───── */

.day-picker__head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }

.day-picker__title { margin-bottom: 0.6rem; }

.day-picker__lede { max-width: 36ch; }

.day-months {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
}

.day-month__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.day-month__name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 500;
  color: var(--ink);
}

.day-month__year {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Calendar-ish grid: each cell is square-ish, day number above thumbnail. */
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(0.4rem, 1vw, 0.7rem);
}

.day-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--cream-deep);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease-soft),
              border-color 0.18s var(--ease-soft),
              box-shadow 0.18s var(--ease-soft);
  padding: 0;
}

.day-cell:hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  box-shadow: 0 6px 14px rgba(34, 23, 26, 0.10);
}

.day-cell--empty {
  cursor: default;
  background: transparent;
  border: 1px dashed var(--rule);
}

.day-cell--empty:hover {
  transform: none;
  border-color: var(--rule);
  box-shadow: none;
}

.day-cell__num {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(245, 240, 230, 0.85);
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
}

.day-cell--empty .day-cell__num {
  background: transparent;
  color: var(--ink-faint);
}

.day-cell__art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--cream-edge);
}

.day-cell__art--placeholder {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--plum) 100%);
}

/* ───── Preview layout ───── */

.day-preview__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding: clamp(1rem, 3vw, 2rem) 0;
}

@media (max-width: 820px) {
  .day-preview__layout {
    grid-template-columns: 1fr;
  }
}

/* Mount: cream backdrop card behind the sticker, paper-grid faint behind
   like the shop specimen cards. Padding is intentionally tight (just
   enough breathing room) so the sticker fills the box rather than
   floating in a sea of cream. */
.day-preview__mount {
  position: relative;
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: clamp(1rem, 2vw, 1.6rem);
  display: grid;
  place-items: center;
  overflow: hidden;
  /* Stable height for the column so the sticker has a real container to
     size against (rather than collapsing to its own intrinsic height). */
  min-height: clamp(420px, 60vh, 620px);
}

.day-preview__mount::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(34, 23, 26, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34, 23, 26, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%);
}

/* ───── The sticker itself ─────
   This element is captured by html-to-image as the print asset. Its
   visible bounds ARE the kiss-cut path, so anything outside (mount,
   grid) is decorative and lives on .day-preview__mount instead.

   Print baseline: 560 × 700 px (4:5). At 300 DPI that's a 4.7" × 5.83"
   image, well above the 3" sticker's 2.6" print area — Printify
   downsamples without artifacts. */

.day-sticker {
  /* Size to fill the mount: width fits the column up to a sensible cap,
     and the 4:5 aspect-ratio computes the matching height. The mount's
     min-height guarantees there's vertical space; place-items:center
     keeps the sticker centered regardless. */
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 4 / 5;
  background: var(--cream);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(34, 23, 26, 0.18);
  padding: 6% 6% 8%;
  display: flex;
  flex-direction: column;
  gap: 4.5%;
  font-family: var(--serif);
  color: var(--ink);
}

.day-sticker__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1;
}

.day-sticker__rule {
  flex: 1;
  height: 1px;
  /* `--accent-soft` / `--accent` are set per-entry by daysticker.js
     after the album cover loads (extractAccentColor). The fallback
     rust matches the reference design for entries with no extractable
     accent (placeholder art, taint failures, missing albums). */
  background: var(--accent-soft, rgba(180, 80, 80, 0.4));
}

.day-sticker__ornament {
  color: var(--accent, rgba(180, 80, 80, 0.7));
  font-size: 0.75em;
  line-height: 1;
  transform: translateY(-1px);
}

.day-sticker__date {
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
}

.day-sticker__art {
  flex: 1;
  background: #18120F;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.day-sticker__art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.day-sticker__art-fallback {
  font-family: var(--display);
  font-size: 3rem;
  color: var(--cream-deep);
  opacity: 0.55;
}

.day-sticker__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1;
  letter-spacing: -0.015em;
  text-align: center;
  color: var(--ink);
  /* Long titles wrap to a second line rather than overflow the sticker. */
  word-break: break-word;
}

.day-sticker__artist {
  margin: 0.2em 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  color: var(--ink-quiet);
}

/* ───── Editor sidebar ───── */

.day-editor {
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.day-editor__title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
}

.day-editor__hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-quiet);
  line-height: 1.5;
}

.day-editor__list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-direction: column;
}

.day-editor__list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--rule);
}

.day-editor__list li > span:first-child { color: var(--ink-faint); }
.day-editor__list li > span:last-child {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  text-align: right;
  font-style: italic;
}

.day-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding: 0.9em 1.3em;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s var(--ease-soft),
              transform 0.18s var(--ease-soft);
}

.day-cta:hover { background: var(--plum); transform: translateY(-1px); }
.day-cta:active { transform: translateY(0); }

.day-cta[disabled],
.day-cta[aria-busy="true"] {
  opacity: 0.65;
  cursor: progress;
}

.day-cta__price {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
  font-feature-settings: "onum" 1, "lnum" 0;
}

.day-link {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  background: none;
  transition: color 0.18s var(--ease-soft);
}

.day-link:hover { color: var(--plum); }
