/* Wedding Journal component styles.
   Every rule reads tokens from tokens.css — no literal colours live here.
   Ported from WeddingAssistant/Views/Components/SharedComponents.swift and the
   recurring compositions in Views/Home/DashboardView.swift. */

/* ---------------------------------------------------------------- root */

.wj-root {
  font-family: var(--wj-font-sans);
  color: var(--wj-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--wj-size-body);
  line-height: 1.4;
}

.wj-root *,
.wj-root *::before,
.wj-root *::after {
  box-sizing: border-box;
}

/* ------------------------------------------------------------- surfaces */

/* WarmCanvas — the app background: warm paper plus two soft radial washes. */
.wj-canvas {
  position: relative;
  background-color: var(--wj-background);
  background-image:
    radial-gradient(
      540px circle at 20% -10%,
      color-mix(in srgb, var(--wj-accent) 10%, transparent),
      transparent 70%
    ),
    radial-gradient(
      520px circle at 100% 0%,
      color-mix(in srgb, var(--wj-primary) 8%, transparent),
      transparent 70%
    );
  color: var(--wj-text-primary);
}

/* Card — the CardBackground modifier: surface fill, hairline top-edge border,
   soft warm shadow, continuous-corner radius. */
.wj-card {
  background: var(--wj-surface);
  border: 1px solid var(--wj-card-border);
  border-radius: var(--wj-radius);
  padding: var(--wj-space-m);
  box-shadow: var(--wj-shadow);
}

.wj-hairline {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--wj-hairline);
}

/* ----------------------------------------------------------- typography */

.wj-display,
.wj-screen-title,
.wj-section-title,
.wj-card-title {
  font-family: var(--wj-font-serif);
  font-weight: 600;
  color: var(--wj-text-primary);
  margin: 0;
  line-height: 1.15;
}

.wj-display {
  font-size: var(--wj-size-display);
}
.wj-screen-title {
  font-size: var(--wj-size-screen-title);
}
.wj-section-title {
  font-size: var(--wj-size-section-title);
}
.wj-card-title {
  font-size: var(--wj-size-card-title);
}

.wj-eyebrow {
  font-family: var(--wj-font-sans);
  font-size: var(--wj-size-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--wj-text-secondary);
  margin: 0;
}

.wj-meta {
  font-family: var(--wj-font-sans);
  font-size: var(--wj-size-body);
  color: var(--wj-text-secondary);
  margin: 0;
}

/* Decorative serif numerals — the countdown figure, stat values, time tiles.
   Kept at fixed sizes in the app because they're graphic, not body copy. */
.wj-numeral {
  font-family: var(--wj-font-serif);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--wj-text-primary);
  margin: 0;
  line-height: 1;
}

/* --------------------------------------------------------------- icons */

.wj-icon {
  display: inline-block;
  flex: none;
  vertical-align: -0.125em;
  color: currentColor;
}

/* ------------------------------------------------------------- buttons */

.wj-btn {
  font-family: var(--wj-font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease-out, opacity 0.12s ease-out;
}

.wj-btn:disabled {
  cursor: default;
}

/* PrimaryButtonStyle — rose gradient capsule, full width, lifted. */
.wj-btn-primary {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--wj-radius-pill);
  background: linear-gradient(to bottom, var(--wj-primary), var(--wj-primary-deep));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--wj-primary-deep) 30%, transparent);
}

.wj-btn-primary:active:not(:disabled) {
  transform: scale(0.96);
}

.wj-btn-primary:disabled {
  background: color-mix(in srgb, var(--wj-text-faint) 40%, transparent);
  box-shadow: none;
}

/* SoftButtonStyle — tinted soft capsule, tint-deep label. */
.wj-btn-soft {
  font-size: 16px;
  font-weight: 700;
  color: var(--wj-tint-deep);
  width: 100%;
  padding: 13px 24px;
  border-radius: var(--wj-radius-pill);
  background: var(--wj-tint-soft);
}

.wj-btn-soft:active:not(:disabled) {
  transform: scale(0.97);
}

/* GhostButtonStyle — bare text action, used in section headers. */
.wj-btn-ghost {
  font-size: 15px;
  font-weight: 600;
  color: var(--wj-primary-deep);
  background: none;
  padding: 0;
}

.wj-btn-ghost:active:not(:disabled) {
  opacity: 0.6;
}

.wj-btn-soft:disabled,
.wj-btn-ghost:disabled {
  opacity: 0.45;
}

/* ---------------------------------------------------------------- chip */

.wj-chip {
  font-family: var(--wj-font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--wj-radius-pill);
  cursor: pointer;
  color: var(--wj-text-secondary);
  background: var(--wj-surface);
  border: 1px solid var(--wj-hairline);
  transition: background 0.12s ease-out, color 0.12s ease-out;
}

.wj-chip--selected {
  color: var(--wj-surface);
  background: var(--wj-text-primary);
  border-color: transparent;
}

/* ---------------------------------------------------------- glyph tile */

.wj-glyph-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--wj-tint-glyph);
  background: var(--wj-tint-soft);
  border-radius: var(--wj-radius-medium);
}

.wj-glyph-tile--circle {
  border-radius: 50%;
}

/* ------------------------------------------------------------ progress */

.wj-progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.wj-progress-ring__svg {
  display: block;
  transform: rotate(-90deg);
}

.wj-progress-ring__track {
  fill: none;
  stroke: var(--wj-hairline);
}

.wj-progress-ring__fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wj-progress-ring__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wj-linear-progress {
  width: 100%;
  border-radius: var(--wj-radius-pill);
  background: var(--wj-hairline);
  overflow: hidden;
}

.wj-linear-progress__fill {
  height: 100%;
  border-radius: var(--wj-radius-pill);
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ----------------------------------------------------------- stat tile */

/* StatTile — the vertical tile: circular icon, serif value, caption label. */
.wj-stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: var(--wj-space-m) var(--wj-space-s);
  text-align: center;
  background: var(--wj-surface);
  border: 1px solid var(--wj-card-border);
  border-radius: var(--wj-radius-medium);
  box-shadow: var(--wj-shadow-sm);
}

.wj-stat-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--wj-tint-base);
  background: color-mix(in srgb, var(--wj-tint-base) 15%, transparent);
}

.wj-stat-tile__value {
  font-size: 20px;
}

.wj-stat-tile__label {
  font-size: 11px;
  color: var(--wj-text-secondary);
}

/* StatCard — the horizontal dashboard variant: glyph tile, serif value, label. */
.wj-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.wj-stat-card__value {
  font-size: 23px;
  white-space: nowrap;
}

.wj-stat-card__label {
  font-size: var(--wj-size-meta);
  color: var(--wj-text-secondary);
}

/* -------------------------------------------------------------- badges */

.wj-badge {
  font-family: var(--wj-font-sans);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--wj-radius-pill);
  white-space: nowrap;
}

/* StatusBadge — free colour, 16% wash of that colour behind it. */
.wj-status-badge {
  color: var(--wj-status-color);
  background: color-mix(in srgb, var(--wj-status-color) 16%, transparent);
}

/* AccentBadge — one of the four brand tints. */
.wj-accent-badge {
  color: var(--wj-tint-deep);
  background: var(--wj-tint-soft);
}

/* --------------------------------------------------------------- stars */

.wj-stars {
  display: inline-flex;
  align-items: center;
}

.wj-stars--interactive {
  gap: 8px;
}

.wj-stars--display {
  gap: 2px;
}

.wj-stars__star {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--wj-text-faint);
  opacity: 0.45;
}

.wj-stars--interactive .wj-stars__star {
  cursor: pointer;
}

.wj-stars__star--on {
  color: var(--wj-accent);
  opacity: 1;
}

/* ----------------------------------------------- monogram & couple photo */

.wj-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-family: var(--wj-font-serif);
  font-weight: 600;
  /* Spaced initials ("S & A") must stay on one line — without this they wrap
     and overflow the circle at every size. */
  white-space: nowrap;
  color: var(--wj-primary);
  background: var(--wj-surface);
  border: 1.5px solid var(--wj-accent);
  border-radius: 50%;
  box-shadow: var(--wj-shadow-sm);
}

.wj-couple-photo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--wj-surface-2);
  border: 1.5px solid var(--wj-accent);
  box-shadow: var(--wj-shadow-sm);
}

.wj-couple-photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wj-couple-photo__initials {
  font-family: var(--wj-font-serif);
  font-weight: 600;
  color: var(--wj-primary);
  white-space: nowrap;
}

/* ------------------------------------------------------ section header */

.wj-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--wj-space-m);
  width: 100%;
}

/* ---------------------------------------------------------- empty state */

.wj-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wj-space-m);
  width: 100%;
  padding: var(--wj-space-xl);
  text-align: center;
}

.wj-empty-state__message {
  font-size: var(--wj-size-body);
  color: var(--wj-text-secondary);
  margin: 0;
  max-width: 34ch;
}

.wj-empty-state__action {
  width: auto;
  margin-top: var(--wj-space-xs);
}

/* ------------------------------------------------------------- nav row */

/* The recurring tappable row: glyph tile, title + subtitle, trailing chevron. */
.wj-nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  background: none;
  text-align: left;
  text-decoration: none;
  color: inherit;
  font-family: var(--wj-font-sans);
  transition: transform 0.12s ease-out;
}

.wj-nav-row--interactive {
  cursor: pointer;
}

.wj-nav-row--interactive:active {
  transform: scale(0.985);
}

.wj-nav-row__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.wj-nav-row__title {
  font-size: var(--wj-size-body);
  font-weight: 600;
  color: var(--wj-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wj-nav-row__subtitle {
  font-size: var(--wj-size-meta);
  color: var(--wj-text-secondary);
}

.wj-nav-row__chevron {
  color: var(--wj-text-faint);
  flex: none;
}

/* ------------------------------------------------------ countdown hero */

.wj-countdown-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--wj-card-border);
  border-radius: var(--wj-radius-hero);
  background: linear-gradient(to bottom, var(--wj-deep) 0%, var(--wj-surface) 78%);
  box-shadow: var(--wj-shadow-lg);
}

.wj-countdown-hero__days {
  font-size: 76px;
  color: var(--wj-primary);
}

.wj-countdown-hero__clock {
  display: flex;
  gap: var(--wj-space-s);
}

.wj-countdown-hero__date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--wj-text-secondary);
}

.wj-countdown-hero__sparkle {
  position: absolute;
  color: var(--wj-accent);
  opacity: 0.5;
  top: 16px;
  left: 18px;
}

.wj-countdown-hero__sparkle--sm {
  color: var(--wj-primary);
  opacity: 0.35;
  top: 40px;
  left: auto;
  right: 22px;
}

/* TimeTile — one hrs/min/sec cell inside the hero clock. */
.wj-time-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 8px 14px;
  background: var(--wj-surface);
  border-radius: 14px;
  box-shadow: var(--wj-shadow-sm);
}

.wj-time-tile__value {
  font-size: 24px;
}

.wj-time-tile__label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--wj-text-secondary);
}

/* --------------------------------------------------- ornamental rule */

.wj-ornamental-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--wj-accent);
}

.wj-ornamental-rule__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in srgb, currentColor 50%, transparent),
    transparent
  );
}

.wj-ornamental-rule__label {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: currentColor;
}

.wj-ornamental-rule__diamond {
  width: 9px;
  height: 9px;
  background: currentColor;
  transform: rotate(45deg);
}

/* ---------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .wj-progress-ring__fill,
  .wj-linear-progress__fill,
  .wj-btn,
  .wj-chip,
  .wj-nav-row {
    transition: none;
  }
}
