/* Current strategic context and lineage. */

#context > section {
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

#context {
  min-width: 0px;
  align-self: start;
  position: sticky;
  top: calc(var(--shell-height) + 20px);
  padding: 0px;
  display: block;
  background: rgba(255, 252, 247, 0.93);
  border: 1px solid rgb(221, 216, 202);
  border-radius: var(--product-radius);
  overflow: hidden;
  box-shadow: var(--product-shadow);
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.context-cover {
  padding: 24px 22px 20px;
  background: linear-gradient(130deg, rgb(242, 237, 223), rgb(250, 247, 237));
  border-bottom: 1px solid rgb(223, 216, 199);
}

.context-cover .eyebrow {
  font-size: 10px;
  color: rgb(121, 96, 58);
}

.context-cover h3 {
  font: 500 25px / 1.2 var(--font-display);
  margin: 10px 0px;
}

.context-cover > p:last-child {
  font-size: 11px;
  color: rgb(96, 104, 93);
  margin: 0px;
  overflow-wrap: anywhere;
}

/* One hairline gives «Lo que ya decidiste» its own section break below the market section. */
.context-details {
  margin: 0px;
  border: 0px;
  border-top: 1px solid rgb(228, 223, 210);
  padding: 16px 20px 12px;
}

.context-details > summary {
  font-size: 12px;
}

.context-details > summary {
  flex-wrap: wrap;
  row-gap: 2px;
}

.context-count {
  order: 1;
  flex-basis: 100%;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.context-lineage {
  list-style: none;
  margin: 12px 0px 0px;
  padding: 0px;
}

.context-lineage li {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  padding: 0px 0px 22px;
}

.context-lineage li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 22px;
  bottom: 3px;
  width: 1px;
  background: rgb(213, 216, 204);
}

.context-lineage li:last-child::before {
  display: none;
}

.context-number {
  font-size: 10px;
  line-height: 20px;
  color: rgb(88, 98, 78);
  font-variant-numeric: tabular-nums;
}

.context-lineage strong {
  font-size: 11px;
}

.context-lineage p {
  font-size: 12px;
  line-height: 1.55;
  margin: 5px 0px;
}

.context-version {
  display: block;
  font-size: 10px;
  color: rgb(106, 113, 101);
  margin-top: 7px;
}

/* The Decision currently in view: continuity between the canvas and persistent memory. */
.context-lineage li[aria-current] strong {
  color: var(--bp-brand-emerald);
}

.context-lineage li[aria-current] .context-number {
  color: var(--bp-brand-emerald);
  font-weight: 700;
}

.context-lineage li[aria-current]::after {
  content: "";
  position: absolute;
  left: -20px;
  top: 0px;
  bottom: 14px;
  border-left: 2px solid var(--bp-brand-emerald);
}

.context-lineage .badge {
  margin-top: 6px;
}

.context-updated {
  margin: 0px 20px;
  padding: 16px 0px;
  border-top: 1px solid rgb(226, 222, 212);
  font-size: 10px;
  color: rgb(107, 113, 100);
}

.context-updated strong {
  font-weight: 500;
  color: rgb(70, 81, 63);
}

.context-note {
  margin: 0px;
  padding: 16px 20px;
  background: rgb(240, 241, 232);
  font-size: 10px;
  color: rgb(95, 103, 89);
}


/* BRANDOPOLIS: strategic memory owns a distinct visual rail */

.context-rail {
  position: relative;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid rgba(201,174,130,.28);
  border-radius: 22px;
  background:
    linear-gradient(
      155deg,
      rgba(241,234,216,.80),
      rgba(249,246,238,.70) 48%,
      rgba(232,239,228,.55)
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 14px 38px rgba(71,61,42,.05);
  overflow: hidden;
}

.context-rail::before {
  content: "";
  position: absolute;
  top: -8px;
  right: -24px;
  width: 190px;
  height: 150px;
  background:
    url('/brand/web/brand-building-mark.webp')
    center / contain no-repeat;
  opacity: .075;
  filter: blur(.25px);
  pointer-events: none;
}

.context-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,.10),
      transparent 180px
    );
  pointer-events: none;
}

.context-rail > #context {
  position: sticky;
  top: calc(var(--shell-height) + 20px);
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,252,247,.90);
}

/* BRANDOPOLIS: strengthen the strategic memory rail without overpowering content. */

.context-rail {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(176,147,96,.28);
  border-radius: 24px;
  background:
    linear-gradient(
      180deg,
      rgba(236,228,208,.94) 0%,
      rgba(245,240,228,.92) 42%,
      rgba(228,236,224,.88) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 16px 42px rgba(80,64,38,.07);
}

.context-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background:
    linear-gradient(
      90deg,
      rgba(167,135,82,.07),
      transparent 18%,
      transparent 82%,
      rgba(7,61,45,.05)
    );
  pointer-events: none;
}

.context-rail > #context {
  position: relative;
  z-index: 1;
  background: rgba(255,252,247,.94);
  border-color: rgba(180,166,137,.42);
  box-shadow:
    0 8px 24px rgba(68,54,31,.04),
    inset 0 1px 0 rgba(255,255,255,.9);
}

/* Construction motif belongs inside the memory cover, not behind the whole card. */
.context-cover {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      135deg,
      rgba(239,232,214,.96),
      rgba(249,246,236,.95)
    );
}

.context-cover::after {
  content: "";
  position: absolute;
  top: -18px;
  right: -22px;
  width: 148px;
  height: 168px;
  background:
    url('/brand/web/brand-building-mark.webp')
    center / contain no-repeat;
  opacity: .07;
  filter: blur(.15px);
  pointer-events: none;
}

.context-cover > * {
  position: relative;
  z-index: 1;
}

/* BRANDOPOLIS: final memory-rail differentiation and compact vertical rhythm. */

.context-rail {
  position: relative;
  padding: 8px;
  border: 1px solid rgba(154,126,79,.34);
  border-radius: 24px;
  background:
    linear-gradient(
      180deg,
      rgba(221,213,190,.98) 0%,
      rgba(231,226,207,.97) 38%,
      rgba(214,226,211,.96) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    inset 10px 0 28px rgba(143,116,68,.035),
    0 18px 44px rgba(68,54,31,.075);
}

.context-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background:
    linear-gradient(
      90deg,
      rgba(151,119,66,.10) 0%,
      transparent 20%,
      transparent 78%,
      rgba(7,61,45,.07) 100%
    );
  pointer-events: none;
}

.context-rail > #context {
  position: sticky;
  top: calc(var(--shell-height) + 12px);
  margin: 0;
  align-self: start;
  z-index: 1;
  background: rgba(255,252,247,.96);
  border-color: rgba(167,148,112,.48);
  box-shadow:
    0 8px 24px rgba(68,54,31,.045),
    inset 0 1px 0 rgba(255,255,255,.9);
}

/* Keep the construction motif inside the memory cover. */
.context-cover {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      135deg,
      rgba(232,223,201,.98),
      rgba(246,241,229,.97)
    );
}

.context-cover::after {
  content: "";
  position: absolute;
  top: -14px;
  right: -18px;
  width: 138px;
  height: 154px;
  background:
    url('/brand/web/brand-building-mark.webp')
    center / contain no-repeat;
  opacity: .07;
  filter: blur(.15px);
  pointer-events: none;
}

.context-cover > * {
  position: relative;
  z-index: 1;
}

/* BRANDOPOLIS: perceptible construction watermark without competing with copy. */

.context-cover {
  position: relative;
  overflow: hidden;
}

.context-cover::after {
  content: "";
  position: absolute;
  top: -8px;
  right: -12px;
  width: 118px;
  height: 138px;

  background:
    url('/brand/web/brand-building-mark.webp')
    center / contain no-repeat;

  opacity: .13;

  /* Keep the visual concentrated on the right edge. */
  -webkit-mask-image:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(0,0,0,.18) 24%,
      rgba(0,0,0,.78) 54%,
      #000 100%
    );

  mask-image:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(0,0,0,.18) 24%,
      rgba(0,0,0,.78) 54%,
      #000 100%
    );

  filter: blur(.08px);
  pointer-events: none;
}

.context-cover > * {
  position: relative;
  z-index: 2;
}

/* BRANDOPOLIS: make the memory-construction watermark clearly perceptible. */

.context-cover::after {
  top: -2px;
  right: -4px;
  width: 172px;
  height: 178px;
  opacity: .22;
  filter: blur(.05px);

  -webkit-mask-image:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(0,0,0,.08) 14%,
      rgba(0,0,0,.48) 34%,
      rgba(0,0,0,.88) 62%,
      #000 100%
    );

  mask-image:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(0,0,0,.08) 14%,
      rgba(0,0,0,.48) 34%,
      rgba(0,0,0,.88) 62%,
      #000 100%
    );

  z-index: 0;
}

.context-cover > * {
  position: relative;
  z-index: 2;
}

/* BRANDOPOLIS: remove decorative watermark from strategic memory. */
.context-cover::after {
  display: none !important;
}

/* Market context: strategic preparation, shown above the decisions and deliberately outside their
   count. Research informs the four decisions; it is never a fifth one. */
.context-market {
  margin: 0;
  padding: 16px 20px 14px;
}

/* Shared label for the panel's sections, so «Contexto del mercado» and «Lo que ya decidiste» read as
   siblings one level below «Contexto vigente». Deliberately quieter than the cover eyebrow: the
   emerald there marks the panel heading, these are neutral. */
.context-section {
  display: block;
  margin: 0 0 7px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 9.5px;
  font-weight: 700;
  color: rgb(96, 104, 93);
}

/* The section's main item. Subordinate to the 25px panel heading, dominant within its section. */
.context-market-title {
  margin: 0;
  font: 600 14px / 1.35 var(--font-sans);
  color: var(--text-primary);
}

.context-market-status {
  margin: 6px 0 0;
}

.context-market-status .badge {
  font-size: 10px;
}

.context-market .hint {
  margin: 7px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
}
