/* ============================================================
   overrides.css — small additions on top of the Journal kit.
   Keep this file lean. The kit's site.css remains the source.
   ============================================================ */

/* Subscribe status (renders after the form when the server responds) */
.subscribe-status {
  min-height: 24px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  gap: 10px;
}
.subscribe-status .status-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.subscribe-status.confirmed { color: var(--paper); }
.subscribe-status.confirmed .status-mark {
  background: var(--accent);
  color: var(--paper);
}
.subscribe-status.err { color: var(--accent); }
.subscribe-status.err .status-mark {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.subscribe-status .status-text {
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Make sure the form button still feels editorial when it's a real <button> */
.subscribe-row button {
  cursor: pointer;
}

/* ============================================================
   La bitácora — /posts index + show
   Editorial blog surface. Echoes the home kit: hairlines,
   datelines, the chapter rhythm, the streak signature footer.
   Tokens only — no inline styles, no undefined vars.
   ============================================================ */

.bitacora {
  max-width: var(--container-prose);
  margin: 0 auto;
  padding: 148px 24px var(--sp-9);
}

/* ---- Header ------------------------------------------------ */
.bitacora-head {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 2px solid var(--rule-strong);
}
.bitacora-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--sp-3);
  font-weight: 600;
}
.bitacora-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6.5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.bitacora-title em { color: var(--accent); font-style: italic; }
.bitacora-lead {
  font-family: var(--font-body);
  font-size: var(--t-body-lg);
  line-height: 1.55;
  font-style: italic;
  color: var(--ink-2);
  max-width: 56ch;
  margin: var(--sp-5) 0 0;
}

/* ---- Entry list ------------------------------------------- */
.bitacora-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bitacora-entry {
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur-fast) var(--ease-out);
}
.bitacora-entry:hover { background: var(--paper-3); }
.bitacora-entry-link {
  display: block;
  padding: var(--sp-7) var(--sp-4);
  margin: 0 calc(var(--sp-4) * -1);
  color: inherit;
  border: 0;
  text-decoration: none;
}
.bitacora-entry-link:hover { color: inherit; }
.bitacora-entry-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: var(--sp-4);
}
.bitacora-entry-date {
  font-family: var(--font-mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
/* Issue number, tucked quietly after the date (no longer floating right). */
.bitacora-entry-num {
  font-family: var(--font-mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-weight: 500;
}
.bitacora-entry-num::before {
  content: "·";
  margin-right: 10px;
  color: var(--rule);
}
.bitacora-entry-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 var(--sp-3);
}
.bitacora-entry:hover .bitacora-entry-title { color: var(--accent-2); }
.bitacora-entry-excerpt {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}

/* ---- Tags (shared by index + show) ------------------------ */
.bitacora-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: var(--sp-4) 0 0;
}
.bitacora-entry .bitacora-tags { margin-top: var(--sp-4); }
.bitacora-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  background: transparent;
}

.bitacora-empty {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--t-body-lg);
  color: var(--ink-3);
  padding: var(--sp-7) 0;
}

/* ============================================================
   Article (show) — long-form reading
   ============================================================ */
.bitacora-article {
  max-width: var(--container-prose);
  margin: 0 auto;
  padding: 148px 24px var(--sp-8);
}
.bitacora-article-head {
  margin-bottom: var(--sp-7);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--rule);
}
.bitacora-article-date {
  font-family: var(--font-mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 var(--sp-3);
}
.bitacora-article-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

/* Long-form body */
.post-body {
  font-family: var(--font-body);
  font-size: var(--t-body-lg);
  line-height: 1.75;
  color: var(--ink);
}
.post-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 4.6em;
  float: left;
  line-height: 0.82;
  padding: 8px 12px 0 0;
  color: var(--accent);
}
.post-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: var(--sp-7) 0 var(--sp-3);
}
.post-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  margin: var(--sp-6) 0 var(--sp-2);
}
.post-body p { margin: 0 0 var(--sp-5); }
.post-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
.post-body a:hover { color: var(--accent-2); border-color: var(--accent-2); }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(168, 51, 28, 0.08);
  padding: 0.1em 0.36em;
  border-radius: 0;
}
.post-body pre {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-5);
  overflow-x: auto;
  line-height: 1.55;
  margin: var(--sp-5) 0;
  border-radius: 0;
}
.post-body pre code { background: transparent; padding: 0; color: inherit; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px var(--sp-4);
  margin: var(--sp-5) 0;
  font-style: italic;
  color: var(--ink-2);
}
.post-body ul, .post-body ol { margin: 0 0 var(--sp-5); padding-left: var(--sp-5); }
.post-body li { margin-bottom: var(--sp-2); }
/* Images & figures */
.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--sp-6) 0;
  border: 1px solid var(--hairline, rgba(20, 18, 16, 0.12));
  border-radius: 2px;
}
.post-body figure {
  margin: var(--sp-7) 0;
  text-align: center;
}
.post-body figure img { margin: 0 auto; }
.post-body figcaption {
  font-family: var(--font-mono);
  font-size: 0.78em;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: var(--sp-2);
  letter-spacing: 0.01em;
}
/* Tall phone/app screenshots: cap width so they read as a screenshot, not a billboard */
.post-body figure.post-figure--phone img {
  max-width: min(340px, 100%);
  box-shadow: 0 12px 32px rgba(20, 18, 16, 0.16);
}
.post-body hr { border: none; border-top: 1px solid var(--rule); margin: var(--sp-7) 0; }

.bitacora-article-foot {
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--rule);
}
.bitacora-back {
  font-family: var(--font-mono);
  font-size: var(--t-body-sm);
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 0;
}
.bitacora-back:hover { color: var(--accent-2); }

/* ============================================================
   Bitácora footer — deep-ink signature (echoes home footer)
   ============================================================ */
.bitacora-foot {
  background: var(--paper-deepest);
  color: var(--paper);
  border-top: 2px solid var(--ink);
  padding: var(--sp-8) 0 var(--sp-7);
}
.bitacora-foot .container-prose { max-width: var(--container-prose); }
.bitacora-foot-line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--paper);
  margin: 0 0 var(--sp-6);
  max-width: 28ch;
}
.bitacora-foot-line .accent { color: var(--accent); }
/* Mirror the home footer exactly: the default light cells read as a high-
   contrast ledger on the deep-ink paper — no recolouring, no new tones. */
.bitacora-foot-streak { margin-bottom: var(--sp-6); }
.bitacora-foot-caption {
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244,236,217,0.5);
  font-weight: 500;
}
.bitacora-foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(244,236,217,0.2);
}
.bitacora-foot-bottom a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244,236,217,0.7);
  border: 0;
  font-weight: 500;
}
.bitacora-foot-bottom a:hover { color: var(--accent); }
.bitacora-foot-sign {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244,236,217,0.5);
  font-weight: 500;
}

@media (max-width: 600px) {
  .bitacora, .bitacora-article { padding-top: 120px; }
  .bitacora-entry-link { padding: var(--sp-6) 0; margin: 0; }
  .bitacora-entry:hover { background: transparent; }
  /* A big drop cap crowds the narrow column — ease it down on phones. */
  .post-body > p:first-of-type::first-letter { font-size: 3.6em; padding: 4px 10px 0 0; }
}

/* ============================================================
   Home — mobile + micro-polish (overrides on the kit)
   ============================================================ */

/* --- The 156-week streak ledger can't fit a phone: its 1fr tracks won't
   shrink below content, forcing horizontal page overflow (which in turn
   stretched the fixed nav). Contain it in a scannable, scrollable frame and
   keep cells legible. Desktop is unaffected (the grid fits, so no scrollbar). */
.streak-section .streak-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 720px) {
  .streak-section .streak-grid { grid-auto-columns: minmax(7px, 1fr); }
}

/* --- Anchor jumps land under the fixed nav (≈56px) with no padding, and with
   no smooth-scroll the jump is imperceptible — clicking "Acompáñame" felt like
   it went nowhere. Frame the target below the nav and animate the scroll so the
   destination (e.g. the #suscribir form) reads as an arrival. Applies to every
   in-page nav anchor. Reduced-motion users keep instant scroll (see design-system.css). */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

/* --- Mobile masthead: section links collapse below 880px, but the primary
   CTA should stay reachable (the whole point is "Acompáñame"). Show just it. */
@media (max-width: 880px) {
  .nav-links { display: flex; gap: 0; }
  .nav-links a:not(.cta-primary) { display: none; }
  .nav-links .cta-primary { padding: 8px 16px; font-size: 13px; }
}

/* --- Subscribe input: restore a visible focus ring (the kit zeroed the
   outline with no replacement — a keyboard/a11y gap on the dark footer). */
.subscribe-row:focus-within { border-bottom-color: var(--accent); }
.subscribe-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* --- Flash the email field when arriving from an "Acompáñame" CTA (see
   subscribe_jump_controller.js), so the jump reads as "you landed here" even
   on touch (where we don't steal focus). Reduced-motion users skip the pulse
   via the global animation-duration override in design-system.css. */
.subscribe-row input.flash { animation: subscribe-flash 1.1s var(--ease-out); }
@keyframes subscribe-flash {
  0%, 100% { background: transparent; }
  30%      { background: rgba(168, 51, 28, 0.22); }
}

/* ============================================================
   Topic deep-dive pages (hub-and-spoke: /metodo, …)
   ============================================================ */

/* The lead section must clear the fixed nav (≈56px) like .hero does, and read
   as a page masthead. */
.topic-head {
  padding: 140px 0 48px;
  border-bottom: 1px solid var(--rule-strong);
}

/* "Ver más →" bridges from a home section to its deep-dive page, and the
   cross-links back on the topic pages. */
.section-more {
  margin-top: 40px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
}
.section-more a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  transition: color var(--dur-fast) var(--ease-out);
}
.section-more a:hover { color: var(--accent-2); }

/* ===========================================================================
   TOAST (rails-blocks) — structural motion only. Positioning + stacking are
   driven by CSS custom properties the toast controller sets per frame; the
   visual skin (cream paper, ink hairline, oxblood square mark, 0 radius) lives
   in the controller's Journal-Edition utility classes. Required by the kit.
   =========================================================================== */
/* Deterministic host placement (bottom-center). overrides.css loads before
   tailwind.css, so we win the cascade with !important rather than depend on
   Tailwind v4's translate/inset utilities, which resolve inconsistently here. */
.dx-toast-host {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 28px !important;
  transform: translateX(-50%) !important;
  translate: none !important; /* neutralize Tailwind v4 -translate-x utility (uses the `translate` prop) */
  width: 340px !important;
  max-width: 92vw !important;
  margin: 0 !important;
  padding: 0 !important;
  /* The controller promotes the host to a Popover (popover="manual"); strip the
     UA popover chrome (white canvas bg, border, padding) so only the toast shows. */
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
}
.dx-toast-host .toast-item,
.dx-toast-host .toast-item > span { max-width: 100% !important; }

.toast-item {
  position: absolute;
  left: 0;
  right: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: var(--toast-z-index, 0);
}
.toast-item[data-mounted="false"] { opacity: 0; }
.toast-item[data-mounted="false"][data-position^="top"]    { transform: translateY(-100%); }
.toast-item[data-mounted="false"][data-position^="bottom"] { transform: translateY(100%); }
.toast-item[data-mounted="true"] { opacity: 1; }
.toast-item[data-removed="true"] { opacity: 0; pointer-events: none; }
.toast-item[data-removed="true"][data-position^="top"]    { transform: translateY(-100%); }
.toast-item[data-removed="true"][data-position^="bottom"] { transform: translateY(100%); }
.toast-item[data-expanded="false"][data-visible="true"] {
  transform: translateY(calc(var(--toast-index, 0) * 8px)) scale(calc(1 - var(--toast-index, 0) * 0.05));
}
.toast-item[data-expanded="false"][data-visible="false"] {
  opacity: 0;
  transform: translateY(calc(var(--toast-index, 0) * 8px)) scale(0.9);
}
.toast-item[data-expanded="true"][data-position^="top"]    { transform: translateY(var(--toast-offset, 0)); }
.toast-item[data-expanded="true"][data-position^="bottom"] { transform: translateY(calc(var(--toast-offset, 0) * -1)); }
.toast-item[data-expanded="false"] > span {
  height: var(--front-toast-height, auto);
  overflow: hidden;
}
.toast-item[data-expanded="false"][data-front="true"] > span,
.toast-item[data-expanded="true"] > span { height: auto; overflow: visible; }
.toast-item[data-expanded="false"][data-front="false"] > span > div { opacity: 0; }
.toast-item[data-expanded="false"][data-front="true"] > span > div,
.toast-item[data-expanded="true"] > span > div { opacity: 1; }
