/* ============================================================
   Pixveil — halloween.css
   Seasonal styling for the Halloween Tools Hub ONLY.
   Loaded exclusively on Halloween pages, so nothing here can
   affect the rest of the site. Built on the same design tokens
   as style.css, so light/dark mode keeps working.
   ============================================================ */

.hw {
  --hw-orange: #F97316;
  --hw-orange-soft: rgba(249, 115, 22, .12);
  --hw-purple: #7C3AED;
  --hw-purple-soft: rgba(124, 58, 237, .12);
  --hw-ink: #1B1033;
}
[data-theme="dark"] .hw {
  --hw-orange: #FB923C;
  --hw-orange-soft: rgba(251, 146, 60, .16);
  --hw-purple: #A78BFA;
  --hw-purple-soft: rgba(167, 139, 250, .16);
  --hw-ink: #EDF2FA;
}

/* ---------- Countdown ---------- */
.hw-countdown {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--hw-orange-soft), var(--hw-purple-soft)),
    var(--surface);
  text-align: center;
}
.hw-cd-label {
  margin: 0 0 .6rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.hw-cd-grid {
  display: flex;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.hw-cd-cell {
  min-width: 68px;
  padding: .5rem .35rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.hw-cd-num {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--hw-orange);
  font-variant-numeric: tabular-nums;
}
.hw-cd-unit {
  display: block;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Output shell ---------- */
.hw-output { display: none; margin-top: 1.25rem; }
.hw-output.show { display: block; animation: hwFade .28s ease both; }
@keyframes hwFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
}
.hw-note {
  margin: .85rem 0 0;
  font-size: .88rem;
  color: var(--text-muted);
}

/* ---------- Result cards ---------- */
.hw-card {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--hw-orange);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.hw-card-title {
  margin: 0 0 .5rem;
  font-size: 1.18rem;
  font-family: var(--font-head);
  color: var(--text);
}
.hw-card-body { margin: 0 0 .8rem; color: var(--text-muted); }

.hw-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.hw-chip {
  padding: .18rem .6rem;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--hw-purple-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.hw-rows { display: grid; gap: .1rem; }
.hw-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .1rem;
  padding: .55rem 0;
  border-top: 1px dashed var(--border);
}
.hw-row-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hw-row-value { color: var(--text); }

.hw-block { margin-bottom: 1rem; }
.hw-block-title {
  margin: 0 0 .4rem;
  font-size: 1rem;
  font-family: var(--font-head);
  color: var(--text);
}
.hw-list { margin: 0; padding-left: 1.2rem; color: var(--text); }
.hw-list li { margin-bottom: .3rem; }

.hw-safety {
  margin: .8rem 0 0;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--hw-orange-soft);
  font-size: .9rem;
  color: var(--text);
}

/* ---------- Name generator ---------- */
.hw-name-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .5rem;
}
.hw-name {
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-weight: 600;
  text-align: center;
}

/* ---------- Color matcher ---------- */
.hw-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}
.hw-swatch {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem;
  background: var(--bg);
  text-align: center;
}
.hw-swatch-chip {
  display: block;
  height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: .45rem;
}
.hw-swatch-name { display: block; font-weight: 700; font-size: .9rem; }
.hw-swatch-hex {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .8rem;
  color: var(--text-muted);
}
.hw-swatch-role {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ---------- Invitation ---------- */
.hw-invite {
  padding: 1.8rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid var(--hw-purple);
  background: var(--surface);
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.hw-invite-kicker {
  margin: 0 0 .5rem;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--hw-orange);
  font-weight: 700;
}
.hw-invite-title {
  margin: 0 0 .8rem;
  font-family: var(--font-head);
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--text);
}
.hw-invite-line { margin: 0 0 1.2rem; color: var(--text-muted); }
.hw-invite-details {
  display: grid;
  gap: .5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.1rem;
}
.hw-invite-row { display: grid; gap: .1rem; }
.hw-invite-label {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.hw-invite-value { font-size: 1.02rem; color: var(--text); font-weight: 600; }
.hw-invite-closer { margin: 0; font-style: italic; color: var(--text-muted); }

/* ---------- Bingo ---------- */
.hw-bingo {
  display: grid;
  grid-template-columns: repeat(var(--hw-bingo-cols, 5), minmax(0, 1fr));
  gap: 4px;
  margin-top: .6rem;
  max-width: 100%;
}
.hw-bingo-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .35rem;
  font-size: .78rem;
  line-height: 1.25;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
  /* Long clue text must never widen the grid on small screens. */
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
.hw-bingo-cell:hover { border-color: var(--hw-orange); }
.hw-bingo-cell:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.hw-bingo-cell.hw-marked {
  background: var(--hw-orange);
  color: #1B1033;
  font-weight: 700;
  border-color: var(--hw-orange);
}
.hw-bingo-free { font-weight: 800; letter-spacing: .08em; background: var(--hw-purple-soft); }

@media (max-width: 480px) {
  .hw-bingo-cell { font-size: .62rem; padding: .2rem; }
  .hw-cd-cell { min-width: 60px; }
  .hw-cd-num { font-size: 1.25rem; }
}

/* ---------- Hub page ---------- */
.hw-hero {
  padding: 2rem 1.25rem;
  border-radius: var(--radius);
  background:
    radial-gradient(80% 120% at 20% 0%, var(--hw-purple-soft), transparent 60%),
    linear-gradient(135deg, var(--hw-orange-soft), transparent),
    var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.hw-hero h1 { margin-top: .4rem; }
.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.hw-tool-card {
  display: block;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hw-tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--hw-orange);
}
.hw-tool-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.hw-tool-emoji { font-size: 1.8rem; line-height: 1; display: block; margin-bottom: .5rem; }
.hw-tool-card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.hw-tool-card p { margin: 0 0 .7rem; font-size: .92rem; color: var(--text-muted); }
.hw-tool-cta { font-weight: 700; color: var(--hw-orange); font-size: .9rem; }

/* ---------- Print: only the generated result ---------- */
@media print {
  .site-header,
  .site-footer,
  .mobile-drawer,
  .drawer-backdrop,
  .breadcrumbs,
  .tool-page-head,
  .tool-options,
  .hw-options,
  .hw-actions,
  .hw-countdown,
  .hw-note,
  .tool-about,
  .skip-link,
  .theme-toggle,
  .hamburger { display: none !important; }

  body { background: #fff !important; color: #000 !important; }
  .container { max-width: none; padding: 0; }
  .hw-output { display: block !important; margin: 0; }

  .hw-card,
  .hw-invite {
    box-shadow: none !important;
    border: 1px solid #999 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .hw-bingo-cell {
    border: 1.5px solid #333 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .hw-bingo-cell.hw-marked { background: #ddd !important; }
  .hw-chip { border: 1px solid #999 !important; background: #fff !important; }
  a[href]::after { content: ""; } /* don't print raw URLs */
}

/* ---------- Homepage seasonal band ---------- */
.hw-band {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--hw-orange-soft), var(--hw-purple-soft)),
    var(--surface);
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hw-band:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--hw-orange);
}
.hw-band:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.hw-band-emoji { font-size: 2rem; line-height: 1; }
.hw-band-text { display: grid; gap: .15rem; flex: 1 1 260px; }
.hw-band-text strong { font-family: var(--font-head); font-size: 1.05rem; }
.hw-band-text span { font-size: .92rem; color: var(--text-muted); }
.hw-band-cta { font-weight: 700; color: var(--hw-orange); white-space: nowrap; }

/* ---------- Stat rows inside Halloween tools ----------
   The shared .sr-value is white-space:nowrap, which is right for short
   numeric calculator results but overflows narrow screens when the value
   is a date like "Saturday, October 31, 2026". Scoped to .hw only, so the
   existing calculators are untouched. */
.hw .stat-row { flex-wrap: wrap; }
.hw .stat-row .sr-label { min-width: 0; flex: 1 1 auto; }
.hw .stat-row .sr-value {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
