/* ═══════════════════════════════════════════════════════════════════════
   El mundo visual PÚBLICO de Brân.

   Hereda la identidad de bran.djinnfoundry.com (papel de periódico frío,
   tinta de cuervo, la brasa que tacha y el fluorescente que subraya,
   Bricolage Grotesque + Manrope) porque el corpus se sirve desde ese
   mismo dominio y un visitante no debería notar la costura. Los tokens
   son los de `marketing/src/styles/global.css`, no una aproximación.

   Se sirve aparte de la hoja de la aplicación de staff a propósito: son
   dos mundos distintos (la marca y la herramienta) y mezclarlos
   obligaría a que un cambio en la app moviera la marca. Las fuentes sí
   son una sola copia: /corpus/brand.css, que el layout enlaza antes.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --font-display: "Bricolage Grotesque Variable", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Manrope Variable", "Helvetica Neue", Arial, sans-serif;

  --ink: #16171b;
  --ink-hover: #2b2d34;
  --ink-soft: #55585f;
  --ink-faint: #85878c;
  --paper: #eeeee9;
  --paper-raised: #f8f8f4;
  --paper-deep: #e2e2da;
  --line: #d3d3cb;
  --line-strong: #b4b4ab;
  --ember: #e4461b;
  --ember-deep: #b5360f;
  --ember-soft: #f7d8cb;
  --marker: #efe15c;
  --marker-hover: #f6ea7c;
  --night: #121317;
  --on-night: #ecece6;
  --on-night-soft: #a4a5a3;
  --white: #fbfbf8;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Las superficies que no dibujé pero que también son el diseño. */
::selection {
  background: var(--marker);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--ember);
}

/* ── Estructura ─────────────────────────────────────────────────────── */

.shell {
  width: min(74ch, calc(100% - 48px));
  margin-inline: auto;
}

.shell--wide {
  width: min(1100px, calc(100% - 48px));
}

.site-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.site-head__inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand__tag {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

main {
  padding-block: 64px 104px;
}

/* ── Cabecera de página ─────────────────────────────────────────────── */

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
  text-wrap: balance;
  color: var(--ink);
}

.page-lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 62ch;
}

.page-lede strong {
  color: var(--ink);
  font-weight: 700;
}

/* ── Filtros ────────────────────────────────────────────────────────── */

.filters {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.filters__label {
  flex: 0 0 100%;
  margin-bottom: 2px;
  color: var(--ember-deep);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.chip:hover {
  border-color: var(--ink);
  background: var(--white);
}

.chip__n {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.chip[aria-current="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.chip[aria-current="true"] .chip__n {
  color: var(--on-night-soft);
}

/* El resto de territorios se pliega: cincuenta insignias antes del
   contenido son ruido, no navegación. */
.more {
  border: 0;
  padding: 0;
  margin: 0;
}

.more > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  padding: 4px 0;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.more > summary::-webkit-details-marker {
  display: none;
}

.more > summary:hover {
  text-decoration-color: var(--ember);
}

.more__body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

/* ── El índice de convocatorias ─────────────────────────────────────── */

.index {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
  border-top: 1px solid var(--line-strong);
}

.entry {
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}

.entry__funder {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.entry__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: pretty;
}

/* El fluorescente de la marca: lo que encaja se subraya. Aquí, lo que
   se está a punto de abrir. */
.entry__title a {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 80% / 0 60%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-size 320ms var(--ease-out);
}

.entry__title a:hover {
  background-size: 100% 60%;
}

.entry__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.entry__fact {
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
}

.entry__fact b {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.entry__seal {
  color: var(--ember-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ── La ficha ───────────────────────────────────────────────────────── */

.doc-head {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 32px;
  margin-bottom: 6px;
}

.doc-funder {
  margin: 0 0 14px;
  color: var(--ember-deep);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 52px 0 8px;
  color: var(--ink);
}

.section-note {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* Un hecho leído del boletín, con la frase de la que sale. Es lo único
   que este producto tiene y ningún agregador puede dar, así que es lo
   que se lleva el peso visual de la página: el valor va subrayado con
   el fluorescente, como en la landing lo que sí te toca. */
.fact {
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}

.fact:first-of-type {
  border-top: 1px solid var(--line);
}

.fact__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.fact__name {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.fact__value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  padding: 0 3px;
  background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 80% / 100% 60%;
}

.quote {
  margin: 16px 0 0;
  padding: 16px 20px 18px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink);
}

.quote::before {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ember);
  margin-bottom: 12px;
}

/* ── Fuente oficial y llamada ───────────────────────────────────────── */

.source {
  margin-top: 44px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-raised);
}

.source a {
  color: var(--ember-deep);
  font-weight: 600;
  word-break: break-word;
  font-size: 0.94rem;
}

.cta {
  margin-top: 40px;
  padding: 32px;
  border-radius: 12px;
  background: var(--night);
  color: var(--on-night);
  box-shadow: 0 30px 60px -40px rgb(22 23 27 / 35%);
}

.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: -0.035em;
}

.cta p {
  margin: 0 0 24px;
  color: var(--on-night-soft);
  max-width: 54ch;
}

/* Botón principal: tinta sobre papel; sobre la noche, fluorescente. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    background-color 200ms var(--ease-out),
    transform 200ms var(--ease-out);
}

.button:hover {
  background: var(--ink-hover);
}

.button:active {
  transform: scale(0.97);
}

.cta .button {
  background: var(--marker);
  color: var(--ink);
}

.cta .button:hover {
  background: var(--marker-hover);
}

/* ── Paginación y pie ───────────────────────────────────────────────── */

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

.pager a {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.pager__count {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.site-foot {
  padding: 40px 0 56px;
  background: var(--night);
  color: var(--on-night-soft);
  border-top: 1px solid rgb(236 236 230 / 12%);
  font-size: 0.9rem;
}

.site-foot .brand {
  margin-bottom: 20px;
  color: var(--on-night);
}

.site-foot .brand img {
  filter: brightness(0) invert(0.92);
}

.site-foot p {
  margin: 0 0 10px;
  max-width: 68ch;
}

.site-foot strong {
  color: var(--on-night);
}

.site-foot a {
  color: var(--on-night);
  text-decoration-color: rgb(236 236 230 / 35%);
}

.site-foot a:hover {
  text-decoration-color: var(--marker);
}

.site-foot :focus-visible {
  outline-color: var(--marker);
}

.empty {
  margin: 48px 0;
  padding: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--ink-soft);
  text-align: center;
}

@media (max-width: 640px) {
  .shell,
  .shell--wide {
    width: calc(100% - 32px);
  }

  main {
    padding-block: 40px 64px;
  }

  .fact__head {
    flex-direction: column;
    gap: 6px;
  }

  .fact__value {
    font-size: 1.35rem;
  }

  .cta {
    padding: 26px 22px;
  }

  .brand__tag {
    display: none;
  }
}

/* Los títulos oficiales vienen a menudo en caja alta. No se reescriben
   (eso destrozaría los nombres propios y este producto se sostiene sobre
   no distorsionar la fuente) así que se tipografían: cuerpo más
   contenido, interletraje abierto y peso normal, que es lo que hace
   legible un bloque en mayúsculas. */
.entry__title.is-caps,
.doc-title.is-caps {
  font-size: 1.06rem;
  letter-spacing: 0.015em;
  line-height: 1.45;
  font-weight: 500;
}

.doc-title.is-caps {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.35;
}
