/* Lunaire Word of the Day — the shared editorial shell, recut as one glossary bookplate. */

.word-page .wash-a {
  top: 210px;
  right: -15vw;
}

.word-page .wash-b {
  top: 920px;
  left: -18vw;
}

.word-main {
  width: 100%;
}

.word-search-row {
  position: relative;
  /* Center the control in the existing divider-to-artwork gap without moving the entry. */
  top: 24px;
  z-index: 5;
  display: flex;
  width: min(calc(100% - 64px), 960px);
  margin: 4px auto 0;
  justify-content: flex-end;
}

.word-search-toggle {
  display: inline-flex;
  min-height: 38px;
  padding: 4px 13px 4px 9px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(107, 131, 166, 0.4);
  border-radius: 999px;
  background: rgba(252, 250, 245, 0.88);
  color: var(--midnight-ink);
  cursor: pointer;
  font: 400 0.67rem/1.3 var(--font-body);
  letter-spacing: 0.07em;
}

.word-search-toggle:hover {
  border-color: var(--washed-indigo);
  background: var(--paper-ivory);
}

.word-search-toggle[aria-expanded="true"] {
  border-color: rgba(183, 146, 95, 0.58);
  background: var(--powder-blue);
}

.word-search-toggle img {
  width: 42px;
  height: 30px;
  flex: none;
}

.word-search {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  box-sizing: border-box;
  width: min(344px, calc(100vw - 34px));
  padding: 16px;
  border: 1px solid rgba(183, 146, 95, 0.58);
  border-radius: 2px;
  background: var(--powder-blue);
  box-shadow: 0 12px 30px rgba(31, 42, 68, 0.14);
  text-align: left;
}

.word-search-heading {
  display: flex;
  margin-bottom: 10px;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.word-search label,
.word-today,
.word-search-retry {
  color: var(--midnight-ink);
  font: 600 0.67rem/1.5 var(--font-body);
  letter-spacing: 0.09em;
}

.word-search input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid rgba(107, 131, 166, 0.46);
  border-radius: 9px;
  background: var(--paper-ivory);
  color: var(--midnight-ink);
  font: 400 0.82rem/1.5 var(--font-body);
}

.word-search input::placeholder { color: var(--ink-dim); }

.word-today,
.word-search-retry {
  padding: 8px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.word-search-status {
  min-height: 1.3em;
  margin: 7px 0 0;
  color: var(--midnight-ink);
  font: 400 0.62rem/1.3 var(--font-body);
}

.word-search-results {
  position: static;
  box-sizing: border-box;
  max-height: 260px;
  margin: 4px 0 0;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid rgba(183, 146, 95, 0.32);
  border-radius: 2px;
  background: transparent;
  list-style: none;
}

.word-search-results button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--midnight-ink);
  cursor: pointer;
  font: 400 0.76rem/1.4 var(--font-body);
  text-align: left;
}

.word-search-results button:hover,
.word-search-results button:focus-visible {
  background: rgba(250, 247, 241, 0.72);
}

.word-stage.has-error .word-bookplate { display: none; }

.word-stage {
  width: min(calc(100% - 64px), var(--page-width));
  margin: 0 auto;
  padding-top: 0;
  text-align: center;
  animation: word-arrival 560ms ease both;
}

.word-stage:focus {
  outline: none;
}

@keyframes word-arrival {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-label,
.example-status {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  line-height: 1.5;
  text-transform: uppercase;
}

.word-bookplate {
  position: relative;
  width: min(100%, 960px);
  margin: 0 auto;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.word-stage.is-loading .word-bookplate::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg, transparent 32%, rgba(220, 234, 244, 0.22) 48%, transparent 64%);
  content: "";
  pointer-events: none;
  transform: translateX(-100%);
  animation: word-wash-loading 2.4s ease-in-out infinite;
}

@keyframes word-wash-loading {
  0%, 30% { transform: translateX(-100%); }
  78%, 100% { transform: translateX(100%); }
}

.word-bookplate::before {
  content: none;
}

.term-hero {
  position: relative;
  display: flex;
  min-height: 176px;
  padding: 22px 72px 24px;
  gap: 28px;
  align-items: center;
  justify-content: start;
  text-align: left;
}

.term-hero::after {
  position: absolute;
  top: 34px;
  right: 44px;
  color: rgba(183, 146, 95, 0.7);
  content: "✦  ·";
  font-size: 0.56rem;
  letter-spacing: 0.45em;
}

.term-heading {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: auto;
  max-width: 700px;
  flex: 0 1 auto;
}

.term-medallion {
  position: relative;
  display: grid;
  width: 88px;
  height: 88px;
  margin: 0;
  flex: 0 0 88px;
  place-items: center;
  transform: translateY(4px);
}

.term-medallion img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.88;
}

.term-glyph {
  position: relative;
  z-index: 1;
  color: var(--nav-indigo);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
}

.term-hero h1 {
  display: inline-block;
  width: auto;
  max-width: 700px;
  margin: 0;
  color: var(--nav-indigo);
  font-family: var(--font-display);
  font-size: clamp(3.65rem, 7vw, 5.15rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
  text-wrap: balance;
}

.word-stage[data-term-length="long"] .term-hero h1 {
  font-size: clamp(3.3rem, 6vw, 4.7rem);
  line-height: 0.95;
}

.word-stage[data-term-length="very-long"] .term-hero h1 {
  font-size: clamp(3rem, 5.4vw, 4.25rem);
  line-height: 0.98;
}

.entry-rule {
  display: flex;
  width: calc(100% - 96px);
  margin: 0 auto;
  gap: 13px;
  align-items: center;
  color: var(--gold-deep);
  font-size: 0.48rem;
  opacity: 0.72;
}

.entry-rule::before,
.entry-rule::after {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(183, 146, 95, 0.64));
  content: "";
  flex: 1;
}

.entry-rule::after {
  transform: scaleX(-1);
}

.word-details {
  display: grid;
  padding: 48px 62px 54px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 38px 46px;
  text-align: left;
}

.definition-panel {
  padding-top: 48px;
}

.definition-panel,
.example-column,
.example-panel,
.signify-panel {
  min-width: 0;
}

.section-label {
  margin: 0 0 15px;
  color: var(--washed-indigo);
  font-size: 0.63rem;
}

.definition-copy,
.example-copy {
  margin: 0;
  color: var(--midnight-ink);
  font-size: 0.88rem;
  line-height: 1.84;
}

.example-panel {
  position: relative;
  isolation: isolate;
  align-self: start;
  display: flex;
  margin-top: 0;
  min-height: 330px;
  padding: 46px 48px 42px;
  flex-direction: column;
  justify-content: flex-start;
}

.example-panel::before {
  position: absolute;
  inset: -7px;
  z-index: -1;
  background: url("/img/performance/ui/example-panel-marble-deep-v1.webp?h=2d166f8da0ffa153") center / 100% 100% no-repeat;
  content: "";
  filter: saturate(0.9);
  pointer-events: none;
}

.example-panel > * {
  position: relative;
  z-index: 1;
}

.example-topline {
  display: block;
  margin-bottom: 18px;
}

.example-topline .section-label {
  margin: 0;
}

.example-status {
  display: inline-flex;
  margin: 0;
  gap: 7px;
  align-items: center;
  color: var(--ink-dim);
  font-size: 0.52rem;
  letter-spacing: 0.09em;
  text-align: left;
}

.example-topline .example-status {
  margin-top: 5px;
}

.example-status::before {
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  flex: 0 0 auto;
}

.example-status[data-relation="today"] {
  color: rgba(53, 98, 88, 0.88);
}

.example-status[data-relation="past"],
.example-status[data-relation="future"] {
  color: var(--gold-deep);
}

.sky-link {
  display: inline-flex;
  margin-top: 20px;
  color: var(--washed-indigo);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  gap: 9px;
  align-items: center;
  text-decoration: none;
  text-transform: uppercase;
}

.sky-link::after {
  color: var(--gold-deep);
  content: "→";
  font-size: 0.88rem;
  transition: transform 180ms ease;
}

.sky-link:hover::after {
  transform: translateX(3px);
}

.signify-panel {
  position: relative;
  display: block;
  grid-column: 1 / -1;
  max-width: 760px;
  margin: 22px auto 0;
  padding: 42px 22px 2px;
  border-top: 1px solid rgba(107, 131, 166, 0.14);
  text-align: center;
}

.signify-panel::before {
  position: absolute;
  top: -0.42rem;
  left: 50%;
  padding: 0 14px;
  background: var(--paper-ivory);
  color: var(--gold-deep);
  content: "✦";
  font-size: 0.58rem;
  transform: translateX(-50%);
}

.signify-copy {
  margin: 0;
  color: var(--washed-indigo);
  font-family: var(--font-display);
  font-size: clamp(1.62rem, 3.15vw, 2.15rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.22;
  text-wrap: balance;
}

.rotation-note {
  padding: 19px 42px 22px;
  border-top: 1px solid rgba(107, 131, 166, 0.14);
  background: transparent;
}

.rotation-note p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-transform: uppercase;
}

.word-error,
.word-noscript {
  width: min(100%, 720px);
  margin: 28px auto 0;
  padding: 16px 18px;
  border: 1px solid rgba(180, 103, 122, 0.24);
  border-radius: 11px;
  background: rgba(246, 215, 213, 0.24);
  color: var(--rose);
  font-size: 0.76rem;
  line-height: 1.6;
}

.word-error p {
  margin: 0;
}

.word-error button {
  margin-top: 12px;
  padding: 9px 13px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  background: var(--paper-ivory);
  color: var(--midnight-ink);
  cursor: pointer;
  font: 600 0.64rem/1.3 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.word-live-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.word-stage.is-loading .word-bookplate {
  cursor: progress;
}

.word-stage.is-loading .term-glyph,
.word-stage.is-loading h1,
.word-stage.is-loading .definition-copy,
.word-stage.is-loading .example-copy,
.word-stage.is-loading .signify-copy {
  opacity: 0.58;
}

.word-stage:not(.is-loading) .term-glyph,
.word-stage:not(.is-loading) h1,
.word-stage:not(.is-loading) .definition-copy,
.word-stage:not(.is-loading) .example-copy,
.word-stage:not(.is-loading) .signify-copy {
  transition: opacity 220ms ease;
}

.sky-link:focus-visible,
.word-error button:focus-visible,
.word-search input:focus-visible,
.word-search-toggle:focus-visible,
.word-today:focus-visible,
.word-search-retry:focus-visible,
.word-search-results button:focus-visible {
  outline: 2px solid var(--midnight-ink);
  outline-offset: 4px;
}

@media (max-width: 700px) {
  .word-search-row {
    width: min(calc(100% - 34px), 960px);
    margin-top: 2px;
  }

  .word-search-heading { align-items: flex-start; }

  .word-stage {
    width: min(calc(100% - 34px), var(--page-width));
    padding-top: 0;
  }

  .word-bookplate {
    border-radius: 0;
  }

  .word-bookplate::before {
    content: none;
  }

  .term-hero {
    display: flex;
    min-height: 0;
    padding: 38px 27px 36px;
    flex-direction: column-reverse;
    gap: 19px;
    text-align: center;
  }

  .term-hero::after {
    top: 23px;
    right: 25px;
  }

  .term-medallion {
    width: 76px;
    height: 76px;
  }

  .term-glyph {
    font-size: 1.72rem;
  }

  .term-hero h1 {
    font-size: clamp(3.05rem, 15.5vw, 4.35rem);
    line-height: 0.93;
  }

  .word-stage[data-term-length="long"] .term-hero h1,
  .word-stage[data-term-length="very-long"] .term-hero h1 {
    font-size: clamp(2.72rem, 13.5vw, 4rem);
    line-height: 0.96;
  }

  .entry-rule {
    width: calc(100% - 54px);
  }

  .word-details {
    display: block;
    padding: 34px 27px 37px;
  }

  .definition-panel,
  .example-column,
  .example-panel,
  .signify-panel {
    margin-top: 0;
  }

  .definition-panel {
    padding-top: 0;
  }

  .example-column {
    margin-top: 32px;
  }

  .example-panel {
    margin-top: 0;
    min-height: 330px;
    padding: 46px 42px 42px;
  }

  .signify-panel {
    display: block;
    margin-top: 38px;
    padding: 39px 0 0;
    text-align: center;
  }

  .definition-copy,
  .example-copy {
    font-size: 0.82rem;
    line-height: 1.76;
  }

  .signify-copy {
    font-size: 1.72rem;
  }

  .rotation-note {
    padding: 17px 28px 20px;
  }
}

@media (max-width: 420px) {
  .word-search-heading { flex-direction: column; gap: 2px; }

  .example-status {
    margin-top: 5px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .word-stage { animation: none; }
  .word-stage.is-loading .word-bookplate::after { animation: none; }
  .sky-link::after,
  .word-stage:not(.is-loading) .term-glyph,
  .word-stage:not(.is-loading) h1,
  .word-stage:not(.is-loading) .definition-copy,
  .word-stage:not(.is-loading) .example-copy,
  .word-stage:not(.is-loading) .signify-copy { transition-duration: 1ms; }
}
