@font-face {
  font-family: Fraunces;
  src: url("fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 600 750;
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("fonts/work-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --ha-display-font: Fraunces, Georgia, serif;
  --ha-reading-font: "Work Sans", system-ui, sans-serif;
  --ha-chrome-font: var(--ha-reading-font);
}

.ha-story-page {
  --story-paper: #fffdf9;
  --story-ink: #292524;
  --story-quiet: #5a4840;
  --story-accent: #744122;
  --story-sand: #f3e6d3;
  --story-rule: #958277;
  --story-size: clamp(1.0625rem, 1rem + .28vw, 1.25rem);
  --story-title: clamp(2rem, 1.54rem + 2.05vw, 3.65rem);
  --story-h2: clamp(1.625rem, 1.42rem + .85vw, 2.3rem);
  --story-h3: clamp(1.25rem, 1.12rem + .45vw, 1.55rem);
  --story-meta: 1rem;
  --story-xs: .5rem;
  --story-sm: .75rem;
  --story-md: 1rem;
  --story-lg: 1.5rem;
  --story-xl: 2rem;
  --story-2xl: 3rem;
  --story-touch: 2.75rem;
  --story-gutter: clamp(1.25rem, 4vw, 3rem);
  margin: 0;
  color: var(--story-ink);
  background: var(--story-paper);
}

.story {
  box-sizing: border-box;
  inline-size: min(calc(100% - 2 * var(--story-gutter)), 68ch);
  margin-inline: auto;
  padding-block: clamp(var(--story-xl), 5vw, 4.5rem) var(--story-2xl);
  font: 400 var(--story-size)/1.65 var(--ha-reading-font);
  overflow-wrap: break-word;
}

.story *, .story *::before, .story *::after { box-sizing: border-box; }
.story :where(p, h1, h2, h3, figure, ul, ol, blockquote) { margin: 0; }
.story :where(h1, h2, h3) {
  font-family: var(--ha-display-font);
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: -.025em;
}
.story h1 { font-size: var(--story-title); font-weight: 750; line-height: 1.08; text-wrap: balance; }
.story h2 { font-size: var(--story-h2); }
.story h3 { font-size: var(--story-h3); }
.story :where(a), .ha-story-page .skip-link { color: var(--story-accent); text-underline-offset: .19em; }
.story :where(a:hover, a:active), .ha-story-page .skip-link:hover { color: var(--story-ink); }
.story :where(a, [tabindex]):focus-visible, .ha-story-page .skip-link:focus-visible {
  outline: 2px solid var(--story-accent);
  outline-offset: 3px;
}
.story ::selection { color: var(--story-ink); background: var(--story-sand); }

.ha-story-page .skip-link {
  position: absolute;
  z-index: 2;
  inset-block-start: 0;
  inset-inline-start: var(--story-md);
  min-block-size: var(--story-touch);
  padding: var(--story-sm) var(--story-md);
  transform: translateY(-175%);
  background: var(--story-paper);
  font: 600 var(--story-meta)/1.4 var(--ha-chrome-font);
}
.ha-story-page .skip-link:focus { transform: none; }

.story .hero { margin-block-end: var(--story-lg); }
.story .hero .byline { margin-block-start: var(--story-md); }
.story .byline, .story .section-link { color: var(--story-quiet); font: 400 var(--story-meta)/1.4 var(--ha-chrome-font); }
.story .byline a { font-weight: 600; }
.story .byline time { white-space: nowrap; }
.story .section-link { display: inline-flex; align-items: center; min-block-size: var(--story-touch); }
.story :where(.lede, p.answer, .answer > p) { font-size: var(--story-size); color: var(--story-ink); }
.story .answer > h2 { color: var(--story-accent); font: 600 var(--story-meta)/1.4 var(--ha-chrome-font); }
.story .reading > * + *, .story .reading section > * + * { margin-block-start: var(--story-md); }
.story .reading > :is(section, h2):not(.answer) { margin-block-start: var(--story-2xl); }
.story .reading > h3 { margin-block-start: var(--story-lg); }
.story .reading > .lead-photo { margin-block: var(--story-lg) var(--story-xl); }
.story :where(figure:not(.vis)) img { display: block; inline-size: 100%; block-size: auto; }
.story :where(ul, ol):not(.vis, .vis *) { padding-inline-start: 0; }
.story :where(ul, ol):not(.vis, .vis *) li + li { margin-block-start: var(--story-xs); }

.story .faq-item { border-block-start: 1px solid var(--story-rule); padding-block-start: var(--story-md); }
.story .faq-item h3 { color: var(--story-accent); }
.story .faq-item h3 + p { margin-block-start: var(--story-xs); }
.story .author-card {
  display: flex;
  align-items: flex-start;
  gap: var(--story-md);
  margin-block-start: var(--story-2xl);
  padding-block-start: var(--story-lg);
  border-block-start: 3px double var(--story-rule);
}
.story .author-avatar { flex: none; inline-size: 3.5rem; block-size: 3.5rem; border-radius: 50%; object-fit: cover; }
.story .author-bio { margin-block-start: var(--story-xs); }
.story .closing { margin-block-start: var(--story-xl); padding-block-start: var(--story-lg); border-block-start: 1px solid var(--story-rule); }
.story :where(.closing-label, .imprint, .author-name) { font-weight: 600; }
.story .closing p + p { margin-block-start: var(--story-sm); }

.story .vis { max-inline-size: 100%; }
.story .vis:is(.vis-table, .data-scroll), .story .vis .data-scroll {
  --table-floor: 22rem;
  max-inline-size: 100%;
  overflow-x: auto;
  border-inline-width: 0;
  container: ha-table-pair / inline-size;
}

/* Match each table floor to its cue query, including when zoom changes the rem. */
.story :is(.vis-table, .vis .data-scroll):has(> table > thead > tr:first-child > :nth-child(3)) {
  --table-floor: 28rem;
  container-name: ha-table-trio;
}
.story :is(.vis-table, .vis .data-scroll):has(> table > thead > tr:first-child > :nth-child(4)) {
  --table-floor: 34rem;
  container-name: ha-table-quartet;
}
.story :is(.vis-table, .vis .data-scroll):has(> table > thead > tr:first-child > :nth-child(5)) {
  --table-floor: 40rem;
  container-name: ha-table-wide;
}

.story .vis table {
  margin: 0;
  inline-size: 100%;
  min-inline-size: var(--table-floor);
  table-layout: fixed;
  overflow-wrap: anywhere;
}
.story .vis table tr > :first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  inline-size: min(9rem, 30vw);
  inline-size: min(9rem, 38cqi);
  padding-inline: var(--story-sm);
  box-shadow: inset -1px 0 var(--story-rule);
}
.story .vis table thead tr > :first-child { background: var(--dark, var(--story-ink)); }
.story .vis table tbody tr > :first-child { background: var(--story-paper); }
.story .vis table tbody tr:nth-child(even) > :first-child {
  background: var(--wash, var(--soft, var(--story-sand)));
}

.story :is(.vis-table, .data-scroll)::before {
  content: "";
  display: none;
  position: sticky;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: var(--story-lg);
  border-block-end: 1px solid var(--story-rule);
  background: var(--story-sand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M3 8h18M7 4 3 8l4 4m10-8 4 4-4 4' fill='none' stroke='%23744122' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right var(--story-sm) center / var(--story-lg) var(--story-md) no-repeat;
}
@container ha-table-pair (inline-size < 22rem) {
  .story :is(.vis-table, .data-scroll)::before { display: block; }
}
@container ha-table-trio (inline-size < 28rem) {
  .story :is(.vis-table, .data-scroll)::before { display: block; }
}
@container ha-table-quartet (inline-size < 34rem) {
  .story :is(.vis-table, .data-scroll)::before { display: block; }
}
@container ha-table-wide (inline-size < 40rem) {
  .story :is(.vis-table, .data-scroll)::before { display: block; }
}

/* legenda da foto do artigo: afastada da imagem e menor que o texto */
.story :where(.lead-photo, .post-figure) > figcaption { margin-block-start: var(--story-xs); color: var(--story-quiet); font: 400 .9375rem/1.45 var(--ha-reading-font); }
