/* Public dictionary (/dicionario/*).
 *
 * Loaded alongside styles.css, which owns the reset, the fonts, the custom
 * properties and .lede/.cta-primary. This file only adds what the generated
 * pages need. It lives in the marketing IMAGE, not in the generated volume:
 * the server generates content, this repo owns presentation, so a design
 * change is a reviewable diff rather than a database-driven rebuild.
 */

.dict-word,
.dict-hub,
.dict-letter,
.dict-about {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

.dict-crumbs {
  font-size: 0.875rem;
  color: var(--subtext);
  margin-bottom: 1.25rem;
}

.dict-crumbs a {
  color: var(--subtext);
}

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

.dict-word h1,
.dict-hub h1,
.dict-letter h1,
.dict-about h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.dict-definition {
  font-size: 1.175rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

/* Links have to look like links here.
 *
 * styles.css sets a global `a { color: inherit; text-decoration: none }`,
 * which suits the marketing page — every link there is a button, a nav item or
 * a card, recognisable from its own shape. These pages are the opposite: their
 * links sit inside sentences ("Veja também ogro, de onde esta palavra
 * deriva."), where inheriting the paragraph's own colour with no underline
 * leaves nothing at all to click.
 *
 * `--text` rather than `--accent`: the accent is #c8102e, which against the
 * #0a0a0c background lands near 3:1 — under the 4.5:1 that text this size
 * needs. Going BRIGHTER than the surrounding `--subtext` prose separates the
 * link on two axes at once (weight of colour, plus the underline) and keeps
 * the contrast comfortable. The accent is used for hover, where it only has to
 * register as a change.
 */
.dict-origin a,
.dict-lemma a,
.dict-twin a,
.dict-more a,
.dict-pages a,
.dict-about p a,
.dict-about li a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* A word list is a different case: the links are the whole content, arranged
 * as a list, so their being links is clear from the layout — WCAG's "do not
 * rely on colour alone" is about a link buried in a block of text. A full
 * underline on every entry would just be noise across 500 words, so the
 * underline is drawn in the border colour and only lights up on hover. */
.dict-family li a,
.dict-list li a {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

.dict-origin a:hover,
.dict-lemma a:hover,
.dict-twin a:hover,
.dict-more a:hover,
.dict-pages a:hover,
.dict-about p a:hover,
.dict-about li a:hover,
.dict-family li a:hover,
.dict-list li a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

/* The provenance line. Quiet, but never hidden: it is on every page by
 * design, and it is the whole reason the "sobre as definições" page exists. */
.dict-origin {
  font-size: 0.875rem;
  color: var(--subtext);
  border-left: 3px solid var(--border-strong);
  padding-left: 0.875rem;
  margin: 0 0 2rem;
}

.dict-lemma,
.dict-twin {
  font-size: 0.9375rem;
  color: var(--subtext);
  margin: 0 0 1rem;
}

.dict-family {
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.dict-family h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.dict-family ul,
.dict-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.dict-family li span {
  color: var(--subtext);
  font-size: 0.8125rem;
}

.dict-list {
  gap: 0.625rem 1.25rem;
  margin-top: 1.5rem;
}

.dict-more {
  font-size: 0.8125rem;
  color: var(--subtext);
  margin: 0.75rem 0 0;
}

/* The letter grid on the hub. auto-fill so it reflows on a phone without a
 * media query — the whole site has to work at 320px. */
.dict-letters {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.625rem;
}

.dict-letters a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.375rem;
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  text-decoration: none;
  color: var(--text);
}

/* Scoped through the anchor to match `.dict-family li span`'s specificity —
 * an equally specific selector that comes later wins cleanly, where a less
 * specific one placed after is a cascade trap. */
.dict-letters a strong {
  font-size: 1.125rem;
}

.dict-letters a span {
  font-size: 0.75rem;
  color: var(--subtext);
}

/* After the element rules above: a more specific selector placed before a less
 * specific one is a cascade trap even when it happens to work today. */
.dict-letters a:hover {
  border-color: var(--accent);
}

.dict-pages {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.9375rem;
  color: var(--subtext);
}

.dict-cta {
  margin: 2.5rem 0 0;
}

.dict-about h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

.dict-about li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.dict-footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--subtext);
}

.dict-footer a {
  color: var(--subtext);
}

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