/* Usage Dictionary—desk reference shell
   Paper/cream + deep ink + deep teal accent
   Mobile-first */

:root {
  --paper: #f4f0e6;
  --paper-raised: #faf7f0;
  --ink: #1a1c1e;
  --ink-muted: #4a4e54;
  --ink-faint: #6e737a;
  --rule: #d4cfc3;
  --rule-strong: #b8b2a4;
  --teal: #0d5c63;
  --teal-deep: #094850;
  --teal-soft: #e6f0f1;
  --accent: var(--teal);
  --accent-hover: var(--teal-deep);
  --focus: #0d5c63;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max: 42rem;
  --max-wide: 56rem;
  --radius: 0.375rem;
  --shadow: 0 1px 2px rgba(26, 28, 30, 0.06);
  --site-header-h: 4rem;
  /* Mobile letter strip wraps to ~3 rows (~12rem); undershoot hides headings under sticky nav on first hash paint. JS overwrites with measured height. */
  --letter-nav-h: 12rem;
  --sticky-stack-h: calc(var(--site-header-h) + var(--letter-nav-h));
  --sticky-scroll-pad: 0.5rem;
}

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

html {
  font-size: 106.25%; /* ~17px base for mobile reading */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--sticky-stack-h) + var(--sticky-scroll-pad));
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/*——Site chrome——*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
}

.site-header__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--accent);
}

.wordmark__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin-right: 0.15rem;
  border-radius: 0.2rem;
  background: var(--teal);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.25rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.home-link:hover,
.home-link[aria-current="page"] {
  color: var(--accent);
}

.home-link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.22em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.22em;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1.75rem 1.15rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-raised);
  padding: 1.25rem 1.15rem 1.75rem;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.site-footer__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
}

.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer__social {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  align-self: center;
  margin: -10px;
}

.site-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: #000000; /* X and TikTok marks: official black on light backgrounds */
}

/* No hover recolor: YouTube, X, and TikTok brand rules forbid changing logo colors. */
.site-footer .site-footer__social a:hover,
.site-footer .site-footer__social a:focus-visible {
  color: #000000;
}

.site-footer__social a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-footer__icon {
  display: block;
  width: 24px;
  height: 24px;
}

/*——Typography——*/
.page-title {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lede {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--ink-muted);
  max-width: 36rem;
}

.section-label {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.placeholder-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  vertical-align: middle;
}

/*——Search——*/
.search-hero {
  max-width: var(--max);
  margin: 0.5rem auto 2.25rem;
  text-align: center;
}

.search-hero .page-title {
  margin-bottom: 0.65rem;
}

.search-hero .lede {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.35rem;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

@media (min-width: 480px) {
  .search-form {
    flex-direction: row;
    align-items: stretch;
  }
}

.search-form__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-form__input {
  flex: 1;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  box-shadow: var(--shadow);
}

.search-form__input::placeholder {
  color: var(--ink-faint);
}

.search-form__input:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 92, 99, 0.18);
}

.search-form__submit {
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  background: var(--teal);
  color: #f7faf9;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.search-form__submit:hover {
  background: var(--teal-deep);
}

.search-form--inline {
  max-width: none;
  margin: 0 0 1.5rem;
}

/*——Letter strip / browse——*/
.letter-nav {
  position: sticky;
  top: var(--site-header-h);
  z-index: 40;
  margin: 0 0 2rem;
  padding: 0.55rem 0 0.65rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.letter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.letter-strip a,
.letter-strip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.letter-strip a:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

.letter-strip span.is-empty {
  opacity: 0.4;
  cursor: default;
}

.letter-strip a[aria-current="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #f7faf9;
}

.browse-cta {
  text-align: center;
  margin-bottom: 2.5rem;
}

.browse-cta a {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
}

/*——Headword lists——*/
.headword-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 640px) {
  .headword-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.headword-block {
  margin: 0;
}

.headword-block__letter {
  margin: 0 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--teal);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1;
  color: var(--ink);
  scroll-margin-top: calc(var(--sticky-stack-h) + var(--sticky-scroll-pad));
}

.headword-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.headword-list li {
  border-bottom: 1px solid var(--rule);
}

.headword-list a {
  display: block;
  padding: 0.55rem 0.15rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.02rem;
}

.headword-list a:hover {
  color: var(--accent);
  background: rgba(13, 92, 99, 0.04);
}

.headword-list .alt {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/*——Home sample links——*/
.sample-entries {
  max-width: var(--max);
  margin: 0 auto;
}

.sample-entries .headword-list a {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.positioning {
  max-width: var(--max);
  margin: 0 auto 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

.positioning p {
  margin: 0.85rem 0 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

/*——Search results——*/
.results-meta {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.results-meta strong {
  color: var(--ink);
  font-weight: 650;
}

.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.result-list li {
  border-bottom: 1px solid var(--rule);
}

.result-list a {
  display: block;
  padding: 1rem 0.15rem;
  text-decoration: none;
  color: inherit;
}

.result-list a:hover .result-list__headword {
  color: var(--accent);
}

.result-list__headword {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--ink);
}

.result-list__snippet {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.result-list__mark,
mark.result-list__mark {
  padding: 0 0.1em;
  border-radius: 0.15em;
  background: #ffe566;
  background-color: #ffe566;
  color: var(--ink);
  font-weight: 700;
}

.empty-state {
  padding: 1.5rem 0;
  color: var(--ink-muted);
}

.empty-state p {
  margin: 0 0 0.75rem;
}

/*——Entry page——*/
.entry {
  max-width: var(--max);
  margin: 0 auto;
}

.entry__headword {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 6vw, 2.6rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.entry__variants {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink-muted);
  font-style: italic;
}

.entry__ruling {
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--paper-raised);
  font-size: 1.08rem;
  line-height: 1.55;
}

.entry__ruling p {
  margin: 0;
}

.entry__ruling p + p {
  margin-top: 0.75rem;
}

.entry__examples {
  margin: 0 0 1.25rem;
}

.entry__examples h2 {
  margin: 0 0 0.65rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.example {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(26, 28, 30, 0.03);
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}

.example:last-child {
  margin-bottom: 0;
}

.example__label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

/*——Example guidance labels——*/
.example__label--use {
  color: #0d5c63;
}

.example__label--use::before {
  content: "✓ ";
  font-weight: 700;
}

.example__label--avoid {
  color: #8b2e1f;
}

.example__label--avoid::before {
  content: "✕ ";
  font-weight: 700;
}

.example__label--prefer {
  color: var(--ink-faint);
}

.entry__asterisk {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.entry__asterisk::before {
  content: "* ";
  color: var(--teal);
  font-weight: 700;
}

.entry-nav {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.entry-nav a {
  font-weight: 500;
}

/*——Utility——*/
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  html {
    font-size: 112.5%; /* 18px desktop */
  }

  .site-main {
    padding: 2.25rem 1.5rem 3.5rem;
  }

  .site-header__inner,
  .site-footer__inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Optical balance: X's square mark fills its full 24px box and reads larger than the
   YouTube and TikTok marks; scale it down so the three look equal. */
.site-footer__social a[href*="x.com"] .site-footer__icon {
  transform: scale(0.85);
}

/*——Contents, breadcrumbs, browse by subject——*/
.breadcrumb {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted, #555);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.25rem;
  color: var(--muted, #555);
}
.breadcrumb a {
  font-weight: 500;
}
.section-count {
  white-space: nowrap;
}
.subject-browse {
  margin-top: 2.5rem;
}
.subject-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0 1.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.subject-list li {
  border-bottom: 1px solid var(--rule);
}
.subject-list a {
  display: block;
  padding: 0.55rem 0;
  font-weight: 500;
  text-decoration: none;
}

/* Contents: compact table of contents */
.toc { list-style: none; margin: 0 0 2rem; padding: 0; border-top: 1px solid var(--rule-strong); max-width: var(--max); }
.toc__item { border-bottom: 1px solid var(--rule); }
.toc__row { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.375rem 0.25rem; font-family: var(--serif); font-size: 1.0625rem; font-weight: 600; color: var(--ink); }
.toc__link { text-decoration: none; }
.toc__link:hover, .toc__summary:hover .toc__row { color: var(--accent); }
.toc__count { margin-left: auto; font-family: var(--sans); font-size: 0.875rem; font-weight: 400; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.toc__summary { list-style: none; cursor: pointer; }
.toc__summary::-webkit-details-marker { display: none; }
.toc__summary .toc__row::after { content: ""; width: 0.5rem; height: 0.5rem; margin: 0 0.25rem 0.2rem 0; border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint); transform: rotate(45deg); transition: transform 0.15s; flex: none; }
.toc__details[open] > .toc__summary .toc__row::after { transform: rotate(-135deg); margin-bottom: -0.2rem; }
.toc__link::after { content: ""; width: 0.5rem; flex: none; margin-right: 0.25rem; }
.toc__subs { list-style: none; margin: 0 0 0.5rem; padding: 0 0 0 1rem; }
.toc__subs a { display: flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.toc__subs a:hover { text-decoration: underline; }

/*——Punctuation: "Also covers" cross-listed entries——*/
.also-covers {
  margin-top: 1.5rem;
  padding-top: 1rem;
  padding-left: 1rem;
  border-top: 1px solid var(--rule);
}
.also-covers__heading {
  margin: 0 0 0.6rem;
  font-family: var(--sans, inherit);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.also-covers .headword-list a {
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.also-covers .headword-list {
  border-left: 2px solid var(--rule-strong);
  padding-left: 0.75rem;
}
@media (max-width: 480px) {
  .also-covers { padding-left: 0.6rem; }
  .also-covers .headword-list { padding-left: 0.6rem; }
}
