/* ============================================================
   Crossword — daily marketing puzzle
   ============================================================ */

.crossword-page {
  --cw-cell-size: clamp(48px, 12vw, 72px);
  --cw-cell-gap: 2px;
  --cw-cell-bg: var(--canvas);
  --cw-cell-black: var(--ink);
  --cw-cell-focus: #E0E6FF;    /* soft signal tint for current-word cells */
  --cw-cell-active: #C7D2FF;   /* stronger tint for the single active cell */
  --cw-cell-wrong: #FFE1E1;
  --cw-cell-hint:  #E4F7EA;
}

/* ---- Grid ---- */
.crossword-play {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  grid-template-columns: min-content 1fr;
  align-items: start;
  padding-bottom: clamp(48px, 6vw, 96px);
}

@media (max-width: 860px) {
  .crossword-play { grid-template-columns: 1fr; }
}

.crossword-play__grid-col { display: flex; flex-direction: column; gap: 20px; }

.crossword-board {
  display: grid;
  grid-template-columns: repeat(5, var(--cw-cell-size));
  grid-template-rows: repeat(5, var(--cw-cell-size));
  gap: var(--cw-cell-gap);
  padding: var(--cw-cell-gap);
  background: var(--ink);
  border-radius: 6px;
  user-select: none;
  width: max-content;
  touch-action: manipulation;
}

.cw-cell {
  position: relative;
  background: var(--cw-cell-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: calc(var(--cw-cell-size) * 0.55);
  color: var(--ink);
  transition: background-color 120ms var(--ease-standard);
  outline: none;
}
.cw-cell--black { background: var(--ink); cursor: default; }
.cw-cell.is-word { background: var(--cw-cell-focus); }
.cw-cell.is-active { background: var(--cw-cell-active); }
.cw-cell.is-wrong { background: var(--cw-cell-wrong); }
.cw-cell.is-hint  { background: var(--cw-cell-hint); }
.cw-cell:focus-visible { box-shadow: inset 0 0 0 2px var(--signal); }

.cw-cell__num {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--graphite);
  line-height: 1;
  pointer-events: none;
}
.cw-cell__letter { line-height: 1; }
.cw-cell.is-revealed .cw-cell__letter { color: var(--signal); }

/* ---- Toolbar ---- */
.crossword-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crossword-toolbar__timer {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--graphite);
}
.crossword-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crossword-toolbar__actions .btn {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.crossword-toolbar__status {
  min-height: 20px;
  font-size: 14px;
  color: var(--graphite);
}
.crossword-toolbar__status.is-solved {
  color: var(--positive);
  font-weight: 500;
}

/* -------------------- Share panel (revealed on solve) -------------------- */
.crossword-share {
  margin-top: 4px;
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--paper);
  animation: cw-share-in 400ms var(--ease-reveal) both;
}
@keyframes cw-share-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.crossword-share__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.crossword-share__badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--positive);
}
.crossword-share__time {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--graphite);
}
.crossword-share__msg {
  margin: 8px 0 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.crossword-share__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crossword-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms var(--ease-standard),
              border-color 120ms var(--ease-standard),
              color 120ms var(--ease-standard),
              transform 120ms var(--ease-standard);
}
.crossword-share__btn svg { flex: 0 0 auto; }
.crossword-share__btn:hover {
  transform: translateY(-1px);
  border-color: var(--wire-stroke);
}
.crossword-share__btn--x:hover      { background: #000; color: #fff; border-color: #000; }
.crossword-share__btn--li:hover     { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.crossword-share__btn--fb:hover     { background: #1877F2; color: #fff; border-color: #1877F2; }
.crossword-share__btn--copy.is-copied {
  background: var(--positive); color: #fff; border-color: var(--positive);
}

/* Fallback for .btn--ghost — the design system may not define one everywhere. */
.btn.btn--ghost {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 120ms var(--ease-standard), border-color 120ms var(--ease-standard);
}
.btn.btn--ghost:hover { background: var(--paper); border-color: var(--wire-stroke); }
.btn.btn--ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Clues ---- */
.crossword-play__clues-col { min-width: 0; }

.crossword-current {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.4;
  min-height: 56px;
}
.crossword-current__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal);
  font-weight: 500;
  flex-shrink: 0;
}
.crossword-current__clue { color: var(--ink); }

.crossword-clues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 640px) {
  .crossword-clues { grid-template-columns: 1fr; gap: 24px; }
}

.crossword-clues__head {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--graphite);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}
.crossword-clues__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.crossword-clue {
  display: flex;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  transition: background 100ms;
}
.crossword-clue:hover { background: var(--paper); }
.crossword-clue.is-active { background: var(--cw-cell-focus); }
.crossword-clue.is-solved { color: var(--graphite); text-decoration: line-through; text-decoration-color: var(--wire-stroke); }
.crossword-clue__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  min-width: 20px;
  flex-shrink: 0;
  padding-top: 2px;
}
.crossword-clue__text { color: var(--ink); }
.crossword-clue.is-solved .crossword-clue__text { color: var(--graphite); }

/* ---- Prev / archive / next nav ---- */
.crossword-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 24px 0 clamp(48px, 8vw, 96px);
  border-top: 1px solid var(--hairline);
  margin-top: 40px;
}
.crossword-nav > div:first-child  { text-align: left; }
.crossword-nav > div:nth-child(2) { text-align: center; }
.crossword-nav > div:last-child   { text-align: right; }
.crossword-nav__link {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms;
}
.crossword-nav__link:hover { border-bottom-color: var(--ink); }

/* ---- Archive grid ---- */
.crossword-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.crossword-archive-card {
  display: block;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: background 120ms var(--ease-standard);
}
.crossword-archive-card:hover { background: var(--cw-cell-focus); }
.crossword-archive-card__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  margin-bottom: 4px;
}
.crossword-archive-card__theme {
  font-size: 14px;
  font-weight: 500;
}

/* ---- Solved overlay note ---- */
.crossword-solved-note {
  padding: 12px 16px;
  background: var(--cw-cell-hint);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
  margin-top: 12px;
}

/* ============================================================
   Playground hub — /crossword/ landing page
   ============================================================ */

/* ---- Hero CTA ---- */
.cw-hub-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}
.cw-hub-cta__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--graphite);
}

/* ---- Calendar ---- */
.cw-cal { max-width: 620px; }

.cw-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.cw-cal__title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cw-cal__nav { display: flex; gap: 8px; }
.cw-cal__navbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  transition: background 120ms var(--ease-standard), border-color 120ms var(--ease-standard);
}
.cw-cal__navbtn:hover { background: var(--paper); border-color: var(--wire-stroke); }
.cw-cal__navbtn.is-disabled { opacity: 0.35; pointer-events: none; }

.cw-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cw-cal__dow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--graphite);
  text-align: center;
  padding-bottom: 6px;
}

.cw-cal__cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  padding: 6px;
  overflow: hidden;
}
.cw-cal__cell--blank { background: transparent; }
.cw-cal__cell--empty {
  background: var(--paper);
  opacity: 0.5;
}
.cw-cal__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  line-height: 1;
}

/* A day with a puzzle is a link. */
a.cw-cal__day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--cw-cell-focus);
  color: var(--ink);
  text-decoration: none;
  transition: background 120ms var(--ease-standard), transform 120ms var(--ease-standard);
}
a.cw-cal__day .cw-cal__num { color: var(--signal); font-weight: 500; }
a.cw-cal__day:hover { background: var(--cw-cell-active); transform: translateY(-1px); }
.cw-cal__theme {
  font-size: 11px;
  line-height: 1.2;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cw-cal__today {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--signal);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.3;
}
.cw-cal__cell.is-today { box-shadow: inset 0 0 0 2px var(--signal); }

.cw-cal__foot {
  margin-top: 18px;
  font-size: 14px;
  color: var(--graphite);
}
.cw-cal__foot a { color: var(--signal); text-decoration: none; }
.cw-cal__foot a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .cw-cal__theme { display: none; }
  .cw-cal__cell { padding: 5px; }
}

/* ---- Content columns ---- */
.cw-hub-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
}
@media (max-width: 760px) {
  .cw-hub-cols { grid-template-columns: 1fr; gap: 40px; }
}
.cw-hub-p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--graphite);
  margin: 0 0 16px;
  max-width: 560px;
}
.cw-hub-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cw-hub-list li {
  font-size: 16px;
  line-height: 1.5;
  color: var(--graphite);
  padding-left: 18px;
  position: relative;
}
.cw-hub-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--signal);
}
.cw-hub-list strong { color: var(--ink); font-weight: 600; }
