/* ============================================================
   Bio · Jaume Orejuela
   Estils propis de la pàgina Bio. Beu de les variables de styles.css
   (paleta blanc / tinta / grisos, Inter + Cormorant). L'únic color
   de la pàgina és el vermell del fil, al mapa.
   ============================================================ */

:root {
  --bio-fil: #B3202B;
  --bio-ample-notes: 300px;
}

.bio-main { max-width: var(--ample-max); margin: 0 auto; padding: 0 var(--marge) var(--vert); }
.bio-main > section { padding-top: clamp(3rem, 7vh, 5.5rem); }
.bio-main > section + section { border-top: 1px solid var(--linia-suau); margin-top: clamp(3rem, 7vh, 5.5rem); }

/* Etiqueta de secció (mono, majúscules) i títol (serif) */
.bio-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--tinta-suau);
  margin-bottom: 1.2rem;
}
.bio-h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}
.bio-intro {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--tinta-suau);
  max-width: var(--ample-text);
  margin-bottom: 2.5rem;
}

/* Capçalera de la Bio ======================================== */
.bio-hero { padding-top: clamp(2.5rem, 6vh, 4.5rem); }
.bio-hero .page-title { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 0.6rem; }
.bio-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--tinta-suau);
  margin-bottom: 2.4rem;
}
.bio-lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.55;
  max-width: 820px;
  margin-bottom: 2.2rem;
}
.bio-hint {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  max-width: var(--ample-text);
  padding: 1.1rem 0;
  border-top: 1px solid var(--linia);
  border-bottom: 1px solid var(--linia);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--tinta-suau);
}
.bio-hint .bio-hint-mark {
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--tinta);
}

/* Referències § ============================================== */
.ref {
  display: inline;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--mar-cel);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.ref:hover { opacity: 1; color: inherit; border-bottom-color: var(--tinta); }
.ref:focus-visible { outline: none; box-shadow: 0 2px 0 0 var(--tinta); }
.ref .ref-mark {
  font-family: var(--serif);
  font-style: normal;
  font-size: 0.75em;
  line-height: 0;
  vertical-align: super;
  margin-inline-start: 0.15em;
  color: var(--tinta);
  transition: color 0.2s;
}
.ref.found { border-bottom-style: dotted; border-bottom-color: var(--arena); }
.ref.found .ref-mark { color: var(--mar-cel); }
.ref[aria-expanded="true"] { border-bottom-color: var(--tinta); border-bottom-width: 2px; }
.ref.flash { animation: refFlash 1.4s ease; }
@keyframes refFlash {
  0% { background: var(--crema); }
  30% { background: var(--arena); }
  100% { background: transparent; }
}

/* Notes desplegades ========================================== */
.notes { display: block; }
.notes:empty { display: none; }
.nota {
  position: relative;
  margin: 1rem 0 1.6rem;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-inline-start: 1px solid var(--tinta);
  animation: notaIn 0.35s ease;
}
html[dir="rtl"] .nota { padding: 0.2rem 1.25rem 0.2rem 0; }
@keyframes notaIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.nota-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.45rem;
}
.nota-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--tinta);
}
.nota-title::before { content: '§ '; font-family: var(--serif); font-size: 1rem; letter-spacing: 0; }
.nota-close {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tinta-suau);
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.nota-close:hover { color: var(--tinta); border-bottom-color: currentColor; }
.nota-body {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--tinta);
}
.nota-body a { border-bottom: 1px solid var(--mar-cel); }
.nota-body a:hover { border-bottom-color: var(--tinta); opacity: 1; }
.nota-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
  padding: 0;
  text-align: start;
}
.nota-doc img {
  width: 64px;
  height: 84px;
  object-fit: cover;
  background: var(--crema-fosca);
  border: 1px solid var(--linia);
}
.nota-doc span {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tinta-suau);
  border-bottom: 1px solid transparent;
}
.nota-doc:hover span { color: var(--tinta); border-bottom-color: currentColor; }

/* La biografia (prosa + notes al marge) ===================== */
.bio-par { display: grid; grid-template-columns: minmax(0, var(--ample-text)); gap: 0 3.5rem; margin-bottom: 1.6rem; }
.bio-par > p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.08rem, 1.5vw, 1.2rem);
  line-height: 1.75;
  color: var(--tinta);
}
.bio-par > p em { font-style: italic; }
@media (min-width: 1100px) {
  .bio-par { grid-template-columns: minmax(0, var(--ample-text)) var(--bio-ample-notes); }
  .bio-par .notes { grid-column: 2; grid-row: 1; }
  .bio-par .nota { margin: 0 0 1.4rem; }
  .bio-par .nota-body { font-size: 0.95rem; }
}

/* Cronologia ================================================= */
.tl { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--linia); max-width: 980px; }
.tl-row {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--linia-suau);
  align-items: baseline;
}
.tl-row.secondary { display: none; }
.tl.expanded .tl-row.secondary { display: grid; }
.tl-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tinta);
}
.tl-row.secondary .tl-year { color: var(--tinta-suau); }
.tl-text {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.6;
}
.tl-text .notes .nota { margin: 0.9rem 0 0.4rem; }
.bio-toggle {
  display: inline-block;
  padding: 0;
  border-bottom: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tinta-suau);
  transition: color 0.2s;
}
.bio-toggle:hover { color: var(--tinta); }
@media (max-width: 700px) {
  .tl-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* Veus ======================================================= */
.veus { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2.5rem 3.5rem; max-width: 1200px; }
.veu { margin: 0; padding-top: 1.2rem; border-top: 1px solid var(--linia); }
.veu p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.55;
  margin-bottom: 0.9rem;
}
.veu p { quotes: '«' '»'; }
.veu p::before { content: open-quote; }
.veu p::after { content: close-quote; }
:lang(en) .veu p, :lang(nl) .veu p, :lang(zh-Hans) .veu p, :lang(ko) .veu p { quotes: '\201C' '\201D'; }
:lang(de) .veu p, :lang(pl) .veu p, :lang(da) .veu p { quotes: '\201E' '\201C'; }
:lang(sv) .veu p { quotes: '\201D' '\201D'; }
:lang(ja) .veu p { quotes: '\300C' '\300D'; }
:lang(fr) .veu p { quotes: '\AB\A0' '\A0\BB'; }
.veu footer {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tinta-suau);
  line-height: 1.7;
}
.veu footer strong { font-weight: 500; color: var(--tinta); display: block; }
.veus-note { margin-top: 2rem; font-family: var(--mono); font-size: 0.66rem; color: var(--terra); letter-spacing: 0.08em; }

/* L'arxiu ==================================================== */
.arx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2rem 1.4rem;
}
.arx-item { display: block; width: 100%; padding: 0; text-align: start; position: relative; }
.arx-fig {
  aspect-ratio: 3 / 4;
  background: var(--crema-fosca);
  overflow: hidden;
  margin-bottom: 0.7rem;
  border: 1px solid var(--linia-suau);
  position: relative;
}
.arx-fig img { width: 100%; height: 100%; object-fit: contain; padding: 5%; transition: transform 0.5s, opacity 0.3s; }
.arx-item:hover .arx-fig img { transform: scale(1.03); }
.arx-item.found .arx-fig::after {
  content: '§';
  position: absolute;
  top: 0.4rem;
  inset-inline-end: 0.5rem;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1;
  color: var(--tinta);
  background: var(--crema);
  padding: 0.15rem 0.35rem;
}
.arx-t { font-family: var(--mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--tinta-suau); line-height: 1.5; }
.arx-c { font-family: var(--serif); font-size: 0.9rem; line-height: 1.4; color: var(--tinta); margin-top: 0.2rem; }
@media (max-width: 540px) { .arx-grid { grid-template-columns: repeat(2, 1fr); gap: 1.4rem 1rem; } }

/* Visor de documents ========================================= */
.bio-lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26, 26, 26, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: none;
  flex-direction: column;
  color: var(--crema);
}
.bio-lb.open { display: flex; }
.bio-lb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem var(--marge);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.65);
}
.bio-lb-close { width: 40px; height: 40px; position: relative; border: 1px solid rgba(255,255,255,0.3); transition: border-color 0.2s; }
.bio-lb-close:hover { border-color: var(--crema); }
.bio-lb-close::before, .bio-lb-close::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 1px; background: var(--crema); margin-left: -8px; }
.bio-lb-close::before { transform: rotate(45deg); }
.bio-lb-close::after { transform: rotate(-45deg); }
.bio-lb-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0 var(--marge) 1.5rem;
}
.bio-lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.bio-lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 60px rgba(0,0,0,0.45); animation: lbFade 0.35s ease; }
@keyframes lbFade { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.bio-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  color: var(--crema); border: 1px solid rgba(255,255,255,0.25); font-family: var(--serif); font-size: 1.4rem;
  background: rgba(26,26,26,0.3); transition: all 0.2s;
}
.bio-lb-nav:hover { border-color: var(--crema); background: rgba(255,255,255,0.08); }
.bio-lb-prev { left: 0; }
.bio-lb-next { right: 0; }
.bio-lb-info { max-height: 34vh; overflow-y: auto; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1rem; max-width: 820px; }
.bio-lb-info .lb-t { font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255,255,255,0.6); margin-bottom: 0.3rem; }
.bio-lb-info .lb-c { font-family: var(--serif); font-style: italic; font-size: 1.05rem; margin-bottom: 0.9rem; }
.bio-lb-info .lb-nt { font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--crema); margin-bottom: 0.35rem; }
.bio-lb-info .lb-nt::before { content: '§ '; font-family: var(--serif); font-size: 1rem; letter-spacing: 0; }
.bio-lb-info .lb-nb { font-family: var(--serif); font-weight: 300; font-size: 1rem; line-height: 1.6; color: rgba(255,255,255,0.9); }
.bio-lb-info .lb-nb a { border-bottom: 1px solid rgba(255,255,255,0.4); }
@media (min-width: 1000px) {
  .bio-lb-body { grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr); gap: 2.5rem; }
  .bio-lb-info { max-height: none; border-top: 0; border-inline-start: 1px solid rgba(255,255,255,0.12); padding: 0.5rem 0 0.5rem 2rem; align-self: center; }
  html[dir="rtl"] .bio-lb-info { padding: 0.5rem 2rem 0.5rem 0; }
}
@media (max-width: 700px) {
  .bio-lb-nav { width: 40px; height: 40px; }
}

/* El mapa ==================================================== */
.bio-map-wrap { position: relative; border: 1px solid var(--linia); background: var(--crema-fosca); }
.bio-map { width: 100%; height: clamp(380px, 62vh, 640px); }
.bio-map-legend {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem;
  margin-top: 1rem;
  font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--tinta-suau);
}
.bio-map-legend .fil::before { content: ''; display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--bio-fil); vertical-align: middle; margin-inline-end: 0.5rem; }
.bio-map-legend .map-views { margin-inline-start: auto; display: inline-flex; gap: 1.2rem; }
.bio-map-legend .map-view { color: var(--mar-cel); border-bottom-color: transparent; }
.bio-map-legend .map-view.is-on, .bio-map-legend .map-view:hover { color: var(--tinta); border-bottom-color: currentColor; }
.bio-map-legend .lloc::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tinta); vertical-align: middle; margin-inline-end: 0.5rem; }
.bio-marker { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--tinta); border: 2px solid var(--crema); box-shadow: 0 0 0 1px var(--tinta); cursor: pointer; box-sizing: border-box; }
.bio-marker.home { width: 16px; height: 16px; background: var(--bio-fil); box-shadow: 0 0 0 1px var(--bio-fil); }
.bio-marker-wrap { background: none; border: 0; }
.bio-map .leaflet-popup-content-wrapper { border-radius: 0; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.bio-map .leaflet-popup-content {
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--tinta);
  margin: 0.9rem 1.1rem;
}
.bio-map .leaflet-popup-content strong { font-family: var(--mono); font-weight: 500; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; display: block; margin-bottom: 0.3rem; color: var(--tinta); }
.bio-map .leaflet-control-attribution { font-family: var(--mono); font-size: 0.6rem; }
.bio-map .leaflet-bar a { border-radius: 0; }
.map-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem 2rem; }
.map-list li { font-family: var(--serif); font-size: 0.95rem; line-height: 1.5; border-top: 1px solid var(--linia-suau); padding-top: 0.5rem; }
.map-list li strong { font-family: var(--mono); font-weight: 500; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; display: block; }
.map-fils { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; }
.map-fils li { font-family: var(--serif); font-size: 1rem; }
.map-fils li .ref { font-style: italic; }

/* Trajectòria (CV) =========================================== */
.cv-group { border-top: 1px solid var(--linia); }
.cv-group:last-of-type { border-bottom: 1px solid var(--linia); }
.cv-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  text-align: start;
}
.cv-head h3 { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; letter-spacing: -0.01em; }
.cv-head span { font-family: var(--mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--tinta-suau); white-space: nowrap; }
.cv-head:hover h3 { opacity: 0.6; }
.cv-body { display: none; padding-bottom: 1.5rem; }
.cv-group.open .cv-body { display: block; }
.cv-body .bio-list { border-top: 0; margin-bottom: 0; }
.cv-body .bio-entry { grid-template-columns: 7rem 1fr; }
.cv-body .bio-year { font-family: var(--mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tinta-suau); }
.cv-body .bio-desc { font-size: 0.98rem; }
@media (max-width: 860px) { .cv-body .bio-entry { grid-template-columns: 1fr; gap: 0.25rem; } }

/* Avui ======================================================= */
.avui p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.08rem, 1.5vw, 1.2rem);
  line-height: 1.75;
  max-width: var(--ample-text);
  margin-bottom: 1.4rem;
}
.avui-ctas { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

/* Comptador de notes (fix a baix a la dreta) ================ */
.bio-counter {
  position: fixed;
  inset-inline-end: 1.2rem;
  bottom: 1.2rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  background: var(--crema);
  border: 1px solid var(--tinta);
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tinta);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transition: background 0.25s, color 0.25s, transform 0.25s;
  cursor: pointer;
}
.bio-counter .mark { font-family: var(--serif); font-size: 1rem; line-height: 1; }
.bio-counter .short { display: none; }
@media (max-width: 600px) {
  .bio-counter { inset-inline-end: 0.8rem; bottom: 0.8rem; padding: 0.5rem 0.7rem; }
  .bio-counter .txt { display: none; }
  .bio-counter .short { display: inline; }
}
.bio-counter:hover { transform: translateY(-2px); }
.bio-counter.complete { background: var(--tinta); color: var(--crema); }
.bio-counter.bump { animation: bump 0.4s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* Nota final (totes trobades) ================================ */
.bio-final { display: none; }
.bio-final.show { display: block; }
.bio-final p { font-family: var(--serif); font-weight: 300; font-size: 1.15rem; line-height: 1.7; max-width: var(--ample-text); }
.bio-final p a { border-bottom: 1px solid var(--mar-cel); }

/* Accessibilitat ============================================= */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .nota, .bio-lb-stage img, .ref.flash, .bio-counter.bump { animation: none !important; }
}
