/* Every rule is scoped to #hm-root so nothing leaks into the theme.
   Tokens from the Herval Hub design system (@herval/react-core). */
#hm-root {
  --background: #ffffff;
  --foreground: #242424;
  --card: #ffffff;
  --primary: #cd1719;
  --primary-hover: #a31214;
  --primary-on-dark: #ff5a5c;
  --muted: #f7f7f7;
  --muted-foreground: #737373;
  --secondary: #f2f2f2;
  --secondary-foreground: #343434;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --graphite: #2b2b2b;
  --viewer: #171717;
  --text-body: #525252;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-xl: 14px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.10), 0 1px 2px -1px rgba(0,0,0,.10);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -2px rgba(0,0,0,.10);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -4px rgba(0,0,0,.10);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --bar-h: 0px;   /* filter bar height, set by the script */
  --hm-top: 0px;  /* height of the site's sticky header, set by the script */
  --hm-hero-extra: 100px; /* extra top space in the hero; shortcode attribute espaco_topo */
  color-scheme: light;
  display: block;
  width: 100%;
  background: var(--background);
  color: var(--foreground);
  font: 400 14px/1.5 var(--sans);
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

/* Neutralise theme defaults (Hello Elementor / Elementor kit). The id keeps
   these above the theme's class rules; component rules below add a class and win. */
#hm-root *, #hm-root *::before, #hm-root *::after { box-sizing: border-box; }
#hm-root button {
  background: none; border: 0; border-radius: 0; box-shadow: none; color: inherit; font: inherit;
  letter-spacing: inherit; line-height: inherit; margin: 0; padding: 0; text-align: inherit;
  text-decoration: none; text-transform: none; white-space: normal; min-height: 0; width: auto;
}
#hm-root button:hover, #hm-root button:focus { background-color: transparent; color: inherit; text-decoration: none; }
#hm-root h1, #hm-root h2, #hm-root h3, #hm-root p, #hm-root dl, #hm-root dd, #hm-root ol, #hm-root figure {
  margin: 0; padding: 0; font-family: var(--sans); color: inherit; text-transform: none; letter-spacing: inherit;
}
#hm-root input, #hm-root select { font: inherit; color: inherit; margin: 0; letter-spacing: normal; line-height: normal; }
#hm-root a { text-decoration: none; }
#hm-root img { display: block; max-width: none; height: auto; border: 0; box-shadow: none; border-radius: 0; }
#hm-root svg { display: inline-block; vertical-align: middle; }
#hm-root ::selection { background: var(--primary); color: #fff; }
#hm-root :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#hm-root [hidden] { display: none !important; }
#hm-root .wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
#hm-root .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hero */
/* --hm-hero-extra: room for the site's transparent menu, which overlaps the hero */
#hm-root .hero { background: var(--graphite); color: #fff; padding: calc(80px + var(--hm-hero-extra)) 0 88px; overflow: hidden; }
#hm-root .hero .wrap { display: flex; flex-direction: column; gap: 56px; }
#hm-root .hero-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; }
#hm-root .hero-copy > div { display: flex; flex-direction: column; gap: 24px; }
#hm-root .hero .eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-on-dark); margin: 0; }
#hm-root .hero h1 { margin: 0; font-size: clamp(40px, 6vw, 64px); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; color: #fff; }
#hm-root .hero .lead { margin: 0; font-size: 18px; line-height: 1.6; color: #d4d4d4; max-width: 46ch; }
#hm-root .stats { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 24px 40px; }
#hm-root .stats div { display: flex; flex-direction: column-reverse; gap: 6px; }
#hm-root .stats dt { font-size: 13px; font-weight: 400; color: #a3a3a3; }
#hm-root .stats dd { margin: 0; font-size: 36px; line-height: 1; font-weight: 700; letter-spacing: -.02em; color: #fff; }
#hm-root .pill {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 24px; border-radius: var(--radius-full);
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; width: fit-content; transition: background .15s var(--ease);
}
#hm-root .pill:hover, #hm-root .pill:focus { background: var(--primary-hover); color: #fff; }

/* Photo cut with the shape of the Herval logo (269×93) */
#hm-root .hero-photo { margin: 0; position: relative; }
#hm-root .hero-photo .blob-accent {
  position: absolute; inset: 0; width: 100%; height: auto; overflow: visible;
  transform: translate(1.5%, 9%) rotate(-2deg); transform-origin: 30% 50%;
}
#hm-root .hero-photo .blob-accent path { fill: var(--primary); }
#hm-root .hero-photo .blob { position: relative; aspect-ratio: 269 / 93; clip-path: url(#hm-herval-shape); background: #3a3a3a; }
#hm-root .hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
#hm-root .hero-photo figcaption { position: relative; margin-top: 32px; font-size: 13px; color: #a3a3a3; }
#hm-root .hero-photo figcaption strong { color: #fff; font-weight: 600; }
#hm-root .clip-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Timeline */
#hm-root .timeline { padding: 72px 0 40px; background: var(--background); }
#hm-root .timeline .wrap { display: flex; flex-direction: column; gap: 28px; }
#hm-root .timeline h2 { margin: 0 0 8px; font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; color: var(--foreground); }
#hm-root .timeline h2 span { color: var(--primary); }
#hm-root .timeline .lead { margin: 0; font-size: 15px; color: var(--muted-foreground); }
#hm-root .periods { display: flex; flex-wrap: wrap; gap: 8px; }
#hm-root .chip {
  height: 40px; padding: 0 18px; border-radius: var(--radius-full); border: 1px solid var(--border); background: #fff;
  color: #363636; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  white-space: nowrap; transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
#hm-root .chip:hover, #hm-root .chip:focus { border-color: #a3a3a3; background: #fff; color: #363636; }
#hm-root .chip .c { font-size: 12px; color: var(--muted-foreground); }
#hm-root .chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
#hm-root .chip[aria-pressed="true"] .c { color: #fff; opacity: .8; }
#hm-root .bars { display: flex; align-items: flex-end; gap: 3px; height: 128px; border-bottom: 2px solid var(--graphite); }
#hm-root .bars button {
  flex: 1; height: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: flex-end; min-width: 0; position: relative;
}
#hm-root .bars button span { width: 100%; border-radius: 3px 3px 0 0; transition: background .15s var(--ease), height .3s var(--ease); }
#hm-root .bars button:hover span { opacity: .75; }
#hm-root .bars button[disabled] { cursor: default; }
#hm-root .bars button:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--graphite); color: #fff; font-size: 12px; font-weight: 500; padding: 6px 8px; border-radius: var(--radius-sm);
  white-space: nowrap; z-index: 2;
}
#hm-root .ticks { position: relative; height: 24px; font-size: 11px; color: var(--muted-foreground); }
#hm-root .ticks span { position: absolute; top: 8px; transform: translateX(-50%); }

/* Filter bar */
#hm-root .filterbar { position: sticky; top: var(--hm-top); z-index: 10; background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
#hm-root .filterbar .wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
#hm-root .search { flex: 1 1 200px; position: relative; display: block; margin: 0; }
#hm-root .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
#hm-root .input, #hm-root select {
  height: 36px; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: #fff; color: var(--foreground);
  font-size: 14px; outline: none; box-shadow: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
#hm-root .input { width: 100%; padding: 0 12px 0 36px; }
#hm-root .input::placeholder { color: var(--muted-foreground); opacity: 1; }
#hm-root .input:focus-visible, #hm-root select:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 50%, transparent); outline: none; }
#hm-root select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding: 0 32px 0 12px; width: auto; max-width: 170px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
#hm-root select.on { border-color: var(--primary); color: var(--primary); }
#hm-root .filters select:last-child { max-width: 210px; }
#hm-root .filters { display: flex; flex-wrap: wrap; gap: 12px; }
#hm-root .tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }
#hm-root .count { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; }
#hm-root .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; height: 36px; padding: 0 16px;
  border-radius: var(--radius-md); border: 1px solid transparent; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--foreground);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
#hm-root .btn:active:not(:disabled) { transform: translateY(.5px); }
#hm-root .btn:disabled { opacity: .5; cursor: default; }
#hm-root .btn-sm { height: 32px; padding: 0 12px; }
#hm-root .btn-ghost, #hm-root .btn-ghost:focus { background: transparent; color: var(--foreground); }
#hm-root .btn-ghost:hover:not(:disabled) { background: var(--muted); color: var(--foreground); }
#hm-root .btn-outline, #hm-root .btn-outline:focus { background: #fff; border-color: var(--border); box-shadow: var(--shadow-xs); color: var(--foreground); }
#hm-root .btn-outline:hover:not(:disabled) { background: var(--muted); color: var(--foreground); }
#hm-root .btn-icon { width: 36px; padding: 0; }
#hm-root .toggle-filters { display: none; }

/* Year sections */
#hm-root .list-area { background: var(--muted); padding: 8px 0 96px; }
#hm-root .year {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: 40px 0;
  border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--hm-top) + var(--bar-h) + 8px);
}
#hm-root .year-label .in { position: sticky; top: calc(var(--hm-top) + var(--bar-h) + 24px); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
#hm-root .year-label .y { font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -.04em; color: var(--primary); }
#hm-root .year-label .n { font-size: 13px; color: var(--muted-foreground); }
#hm-root .badge {
  display: inline-flex; align-items: center; width: fit-content; white-space: nowrap; border: 1px solid transparent;
  border-radius: var(--radius-full); padding: 2px 8px; font-size: 12px; font-weight: 500; line-height: 16px;
}
#hm-root .badge-outline { border-color: var(--border); color: var(--foreground); background: transparent; }
#hm-root .badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
#hm-root .entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
#hm-root .entries > li { margin: 0; padding: 0; list-style: none; }
#hm-root .card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start;
  width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: 24px; cursor: pointer; color: var(--foreground);
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease);
}
#hm-root .card:hover, #hm-root .card:focus { background: var(--card); color: var(--foreground); }
#hm-root .card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
#hm-root .card-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#hm-root .no { font-family: var(--mono); font-size: 12px; color: var(--muted-foreground); }
#hm-root .card h3 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; color: var(--foreground); transition: color .15s var(--ease); }
#hm-root .card:hover h3 { color: var(--primary); }
#hm-root .byline { font-size: 13px; line-height: 1.4; color: var(--muted-foreground); }
#hm-root .card h3 + .byline { margin-top: -4px; }
/* Card without a headline: the story's own words lead */
#hm-root .excerpt.excerpt-lead { font-size: 16px; line-height: 1.6; color: var(--foreground); -webkit-line-clamp: 4; }
#hm-root .info-body .byline { font-size: 14px; margin-top: -12px; }
#hm-root .tags { display: flex; flex-wrap: wrap; gap: 6px; }
#hm-root .excerpt {
  margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-body);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#hm-root .more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--primary); margin-top: 4px; }
#hm-root .card-media { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#hm-root .strip { display: flex; gap: 6px; height: 148px; overflow: hidden; border-radius: var(--radius-md); }
#hm-root .strip img { height: 100%; width: auto; flex: none; object-fit: cover; border-radius: var(--radius-md); background: var(--border); }
#hm-root .doc-strip {
  align-items: center; gap: 12px; padding: 0 20px; background: var(--secondary); border: 1px dashed var(--border-strong);
  color: var(--text-body); font-size: 14px; font-weight: 500;
}
#hm-root .doc-strip svg { flex: none; color: var(--primary); }
#hm-root .stage-doc { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; color: #d4d4d4; font-size: 15px; max-width: 360px; }
#hm-root .stage-doc svg { color: var(--primary-on-dark); }
#hm-root .docs { display: flex; flex-direction: column; gap: 8px; }
#hm-root .docs h3 { margin: 0 0 4px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .06em; }
#hm-root .doc-link, #hm-root .doc-link:focus {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--foreground); font-size: 14px; font-weight: 500; text-decoration: none; background: #fff;
}
#hm-root .doc-link svg { flex: none; color: var(--primary); }
#hm-root .doc-link:hover { border-color: var(--primary); color: var(--primary); }
#hm-root .strip-meta { font-size: 12px; color: var(--muted-foreground); }
#hm-root .empty { padding: 96px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
#hm-root .empty strong { font-size: 20px; font-weight: 600; }
#hm-root .empty span { color: var(--muted-foreground); }

/* Story dialog */
#hm-root dialog {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: #fff; color: var(--foreground); font: 400 14px/1.5 var(--sans);
}
#hm-root dialog::backdrop { background: rgba(0,0,0,.5); }
#hm-root .dossie { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr); height: 100%; }
#hm-root .viewer { background: var(--viewer); display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
#hm-root .stage { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 40px 80px; }
#hm-root .stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
#hm-root .nav-photo {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.4); color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .15s var(--ease);
}
#hm-root .nav-photo:focus { background: rgba(0,0,0,.4); color: #fff; }
#hm-root .nav-photo:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
#hm-root .nav-photo.prev { left: 20px; } #hm-root .nav-photo.next { right: 20px; }
#hm-root .photo-count { position: absolute; top: 20px; left: 24px; font-family: var(--mono); font-size: 12px; color: #a3a3a3; }
#hm-root .thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 24px 20px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
#hm-root .thumbs button { flex: none; height: 64px; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; opacity: .55; border-radius: var(--radius-sm); overflow: hidden; transition: opacity .15s var(--ease); }
#hm-root .thumbs button:hover { opacity: .9; }
#hm-root .thumbs button[aria-current="true"] { opacity: 1; border-color: #fff; }
#hm-root .thumbs img { height: 100%; width: auto; }
#hm-root .info { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); }
#hm-root .info-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border); }
#hm-root .info-body { padding: 32px 28px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 20px; }
#hm-root .big-year { font-size: 80px; line-height: .9; font-weight: 700; letter-spacing: -.05em; color: var(--primary); }
#hm-root .info-body h2 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; color: var(--foreground); }
#hm-root .facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 20px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 14px; }
#hm-root .facts dt { font-size: 12px; font-weight: 500; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
#hm-root .facts dd { margin: 0; }
#hm-root .story { display: flex; flex-direction: column; gap: 14px; }
#hm-root .story p { margin: 0; font-size: 15px; line-height: 1.7; color: #262626; }
#hm-root .story .none { color: var(--muted-foreground); font-style: italic; }
#hm-root .source, #hm-root .source:focus { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; }
#hm-root .source:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 4px; }
#hm-root .info-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }
#hm-root .info-foot .btn { width: 100%; min-width: 0; }
#hm-root .info-foot .btn span { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1000px) {
  #hm-root .hero .wrap { gap: 40px; }
  #hm-root .hero-copy { grid-template-columns: minmax(0, 1fr); }
  #hm-root .year { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 28px 0; }
  #hm-root .year-label .in { position: static; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; }
  #hm-root .year-label .y { font-size: 44px; }
  #hm-root .card { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px; }
  #hm-root .strip { height: 112px; }
  #hm-root .dossie { grid-template-columns: minmax(0, 1fr); grid-template-rows: 50vh minmax(0, 1fr); }
  #hm-root .info { border-left: 0; }
  #hm-root .stage { padding: 16px 64px; }
  #hm-root .big-year { font-size: 64px; }
}
@media (max-width: 640px) {
  #hm-root .wrap { padding: 0 16px; }
  #hm-root .hero { padding: calc(48px + var(--hm-hero-extra)) 0 56px; }
  #hm-root .hero-photo figcaption { margin-top: 20px; }
  #hm-root .stats { gap: 20px 28px; }
  #hm-root .stats dd { font-size: 28px; }
  #hm-root .timeline { padding-top: 48px; }
  #hm-root .timeline h2 { font-size: 28px; }
  #hm-root .bars { height: 96px; gap: 2px; }
  #hm-root .toggle-filters { display: inline-flex; }
  #hm-root .filters { display: none; width: 100%; }
  #hm-root .filters.open { display: grid; grid-template-columns: 1fr 1fr; }
  #hm-root .filters select, #hm-root .filters select:last-child { max-width: none; width: 100%; }
  #hm-root .tools { margin-left: 0; width: 100%; justify-content: space-between; }
  #hm-root .card h3 { font-size: 19px; }
  #hm-root .dossie { grid-template-rows: 44vh minmax(0, 1fr); }
  #hm-root .stage { padding: 12px; }
  #hm-root .nav-photo { width: 40px; height: 40px; }
  #hm-root .nav-photo.prev { left: 8px; } #hm-root .nav-photo.next { right: 8px; }
  #hm-root .thumbs { padding: 8px 12px 12px; }
  #hm-root .thumbs button { height: 48px; }
  #hm-root .info-top, #hm-root .info-body { padding-left: 18px; padding-right: 18px; }
  #hm-root .info-foot { padding: 12px 18px; }
}
@media (prefers-reduced-motion: reduce) { #hm-root * { transition: none !important; } }
