/* ScholarOS V11 · Literature-reading hero map
   One directional story: task -> paper -> insight -> later tasks. */

body[data-page="reading"] .v8-reading-map {
  box-sizing: border-box;
  min-height: 620px;
  padding: 50px 38px 34px;
}

body[data-page="reading"] .v11-reading-primary-flow {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 388px;
  grid-template-columns: calc((100% - 30px) / 4) minmax(56px,1fr) minmax(320px,350px) minmax(56px,1fr) calc((100% - 30px) / 4);
  align-items: center;
}

body[data-page="reading"] .v11-reading-primary-flow > .v8-question-node,
body[data-page="reading"] .v11-reading-primary-flow > .v8-evidence-node,
body[data-page="reading"] .v11-reading-primary-flow > .v8-answer-node {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  box-sizing: border-box;
  width: 100%;
  animation-name: v10-reading-node-in;
}

body[data-page="reading"] .v11-reading-primary-flow > .v8-question-node,
body[data-page="reading"] .v11-reading-primary-flow > .v8-answer-node {
  min-height: 210px;
  padding: 24px;
  border: 1px solid #d8e1ee;
  border-left: 2px solid var(--cap-blue);
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(43,59,94,.1);
}

body[data-page="reading"] .v11-reading-primary-flow > .v8-question-node {
  grid-column: 1;
}

body[data-page="reading"] .v11-reading-primary-flow > .v8-evidence-node {
  grid-column: 3;
  min-height: 388px;
  padding: 26px 28px;
}

body[data-page="reading"] .v11-reading-primary-flow > .v8-answer-node {
  z-index: 3;
  grid-column: 5;
}

body[data-page="reading"] .v11-reading-primary-flow .v8-question-node strong,
body[data-page="reading"] .v11-reading-primary-flow .v8-answer-node > strong {
  font-size: 15px;
  line-height: 1.5;
}

body[data-page="reading"] .v11-reading-primary-flow .v8-evidence-node h2 {
  margin-block: 23px 17px;
  font-size: 21px;
}

body[data-page="reading"] .v11-reading-primary-flow .v8-evidence-node p,
body[data-page="reading"] .v11-reading-primary-flow .v8-evidence-node blockquote,
body[data-page="reading"] .v11-reading-primary-flow .v8-answer-node p {
  font-size: 11px;
}

body[data-page="reading"] .v11-reading-link {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 14px;
  align-items: center;
  justify-items: center;
  gap: 9px;
  padding-inline: 9px;
  color: #667790;
  font-size: 9px;
  font-weight: 620;
  letter-spacing: .01em;
  text-align: center;
}

body[data-page="reading"] .v11-reading-link:nth-of-type(2) { grid-column: 2; }
body[data-page="reading"] .v11-reading-link:nth-of-type(4) { grid-column: 4; }

body[data-page="reading"] .v11-reading-link span {
  white-space: nowrap;
}

body[data-page="reading"] .v11-reading-link i {
  position: relative;
  display: block;
  width: 100%;
  height: 1px;
  border-top: 1.5px dashed #7892b8;
  animation: v11-reading-straight-link-in .72s .28s cubic-bezier(.22,1,.36,1) both;
}

body[data-page="reading"] .v11-reading-link i::after {
  position: absolute;
  top: -4px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-top: 1.4px solid #6f89b0;
  border-right: 1.4px solid #6f89b0;
  content: "";
  transform: rotate(45deg);
}

body[data-page="reading"] .v11-reading-output-link {
  position: absolute;
  z-index: 1;
  top: 100%;
  left: calc(50% - 1px);
  width: 220px;
  height: 160px;
  display: block;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

body[data-page="reading"] .v8-answer-node .v11-reading-output-link i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: auto;
  border-left: 1.5px dashed #7892b8;
  animation: v11-reading-vertical-link-in .72s .5s cubic-bezier(.22,1,.36,1) both;
}

body[data-page="reading"] .v8-answer-node .v11-reading-output-link i::after {
  position: absolute;
  right: -3px;
  bottom: 0;
  width: 7px;
  height: 7px;
  border-right: 1.4px solid #6f89b0;
  border-bottom: 1.4px solid #6f89b0;
  content: "";
  transform: rotate(45deg);
}

@media (min-width: 1001px) {
  body[data-page="reading"] .v8-answer-node .v11-reading-output-link i::after {
    display: none;
  }
}

body[data-page="reading"] .v8-answer-node .v11-reading-output-link span {
  position: absolute;
  z-index: 2;
  top: 57px;
  left: 50%;
  padding: 5px 9px;
  border: 1px solid rgba(194,207,225,.92);
  border-radius: 6px;
  background: rgba(248,251,255,.97);
  box-shadow: 0 1px 4px rgba(43,59,94,.035);
  color: #667790;
  font-size: 9px;
  font-weight: 620;
  line-height: 1.3;
  transform: translateX(-50%);
  white-space: nowrap;
}

body[data-page="reading"] .v8-context-nodes.v10-reading-destinations {
  position: relative;
  z-index: 2;
  right: auto;
  bottom: auto;
  left: auto;
  display: grid;
  width: 100% !important;
  margin-top: 50px;
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-template-rows: auto 18px auto;
  column-gap: 10px;
  row-gap: 0;
  animation: v10-reading-node-in .52s .58s cubic-bezier(.22,1,.36,1) both;
}

body[data-page="reading"] .v8-context-nodes.v10-reading-destinations small {
  box-sizing: border-box;
  height: 20px;
  grid-column: 1 / -1;
  margin: 0;
  padding-bottom: 6px;
  font-size: 10px;
  letter-spacing: .015em;
  line-height: 14px;
  text-align: center;
}

body[data-page="reading"] .v11-reading-distribution {
  position: relative;
  display: grid;
  height: 18px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4,minmax(0,1fr));
  column-gap: 10px;
}

body[data-page="reading"] .v11-reading-distribution > i {
  position: absolute;
  top: 0;
  right: calc((100% - 30px) / 8);
  left: calc((100% - 30px) / 8);
  display: block;
  height: 0;
  border-top: 1.5px dashed #7892b8;
  background: transparent;
}

body[data-page="reading"] .v11-reading-distribution > b {
  position: relative;
  display: block;
  justify-self: center;
  width: 1px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1.5px dashed #7892b8;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font: inherit;
}

body[data-page="reading"] .v11-reading-distribution > b::after {
  position: absolute;
  right: -3px;
  bottom: 0;
  width: 7px;
  height: 7px;
  border-right: 1.4px solid #6f89b0;
  border-bottom: 1.4px solid #6f89b0;
  content: "";
  transform: rotate(45deg);
}

body[data-page="reading"] .v8-context-nodes.v10-reading-destinations span {
  min-width: 0;
  padding: 13px 14px;
  border-color: #d5deea;
  background: rgba(255,255,255,.92);
  font-size: 10px;
  text-align: center;
}

/* Context continuity: one aligned reading loop, without floating curve labels. */
body[data-page="reading"] .v10-reading-handoff > header strong:only-child {
  margin-top: 0;
  line-height: 1.42;
}

@media (min-width: 1101px) {
  body[data-page="reading"] .v11-reading-context-flow {
    display: grid;
    min-height: 368px;
    padding: 40px 28px;
    grid-template-columns: minmax(0,1fr) 132px minmax(0,1fr) 132px minmax(0,1fr);
    align-items: center;
  }

  body[data-page="reading"] .v11-reading-context-flow article,
  body[data-page="reading"] .v11-reading-context-flow article.input,
  body[data-page="reading"] .v11-reading-context-flow article.core,
  body[data-page="reading"] .v11-reading-context-flow article.output {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    box-sizing: border-box;
    width: 100%;
    min-height: 248px;
    margin: 0;
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow,
  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow.input-to-paper,
  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow.paper-to-value {
    position: relative;
    z-index: 3;
    top: auto;
    right: auto;
    left: auto;
    display: block;
    width: 100%;
    height: 56px;
    min-height: 0;
    transform: none;
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow span {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    display: block;
    width: auto;
    height: 0;
    border-top: 1.5px dashed #7892b8;
    background: transparent;
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow span::after {
    position: absolute;
    top: -4px;
    right: 1px;
    bottom: auto;
    left: auto;
    width: 7px;
    height: 7px;
    border: 0;
    border-top: 1.4px solid #6f89b0;
    border-right: 1.4px solid #6f89b0;
    content: "";
    transform: rotate(45deg);
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow b {
    position: absolute;
    right: 0;
    bottom: calc(50% + 10px);
    left: 0;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #64758d;
    font-size: 9.5px;
    font-weight: 620;
    letter-spacing: .015em;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
  }
}

@media (max-width: 1100px) {
  body[data-page="reading"] .v11-reading-context-flow {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0,1fr);
    padding: 24px;
    overflow: hidden;
    border-radius: 16px;
    background: #f8fafe;
    box-shadow: 0 12px 32px rgba(43,59,94,.06);
  }

  body[data-page="reading"] .v11-reading-context-flow article,
  body[data-page="reading"] .v11-reading-context-flow article.input,
  body[data-page="reading"] .v11-reading-context-flow article.core,
  body[data-page="reading"] .v11-reading-context-flow article.output {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    box-sizing: border-box;
    width: min(560px,100%);
    min-height: 0;
    margin: 0 auto;
    border: 1px solid #d7e0eb;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(43,59,94,.055);
  }

  body[data-page="reading"] .v11-reading-context-flow article.core {
    border-top: 2px solid var(--cap-blue);
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow,
  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow.input-to-paper,
  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow.paper-to-value {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: block;
    width: min(560px,100%);
    height: 72px;
    min-height: 72px;
    margin: 0 auto;
    transform: none;
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    display: block;
    width: 0;
    height: auto;
    border-left: 1.5px dashed #7892b8;
    background: transparent;
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow span::after {
    position: absolute;
    top: auto;
    right: -3px;
    bottom: 1px;
    left: auto;
    width: 7px;
    height: 7px;
    border: 0;
    border-right: 1.4px solid #6f89b0;
    border-bottom: 1.4px solid #6f89b0;
    content: "";
    transform: rotate(45deg);
  }

  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow b {
    position: absolute;
    top: 50%;
    left: calc(50% + 16px);
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #64758d;
    font-size: 9.5px;
    font-weight: 620;
    line-height: 1.4;
    transform: translateY(-50%);
    white-space: nowrap;
  }
}

@keyframes v11-reading-straight-link-in {
  from { opacity: 0; transform: scaleX(.3); transform-origin: left center; }
  to { opacity: 1; transform: scaleX(1); transform-origin: left center; }
}

@keyframes v11-reading-vertical-link-in {
  from { opacity: 0; transform: scaleY(.25); transform-origin: top center; }
  to { opacity: 1; transform: scaleY(1); transform-origin: top center; }
}

@media (max-width: 1000px) {
  body[data-page="reading"] .v8-reading-map {
    min-height: 0 !important;
    padding: 30px 24px 26px;
  }

  body[data-page="reading"] .v11-reading-primary-flow {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0,1fr);
    justify-items: center;
  }

  body[data-page="reading"] .v11-reading-primary-flow > .v8-question-node,
  body[data-page="reading"] .v11-reading-primary-flow > .v8-evidence-node,
  body[data-page="reading"] .v11-reading-primary-flow > .v8-answer-node {
    right: auto !important;
    left: auto !important;
    width: min(560px,100%) !important;
    grid-column: 1;
  }

  body[data-page="reading"] .v11-reading-primary-flow > .v8-question-node,
  body[data-page="reading"] .v11-reading-primary-flow > .v8-answer-node {
    min-height: 0;
  }

  body[data-page="reading"] .v11-reading-primary-flow > .v8-evidence-node {
    min-height: 350px;
  }

  body[data-page="reading"] .v11-reading-link,
  body[data-page="reading"] .v11-reading-link:nth-of-type(2),
  body[data-page="reading"] .v11-reading-link:nth-of-type(4) {
    position: relative;
    display: flex;
    width: min(560px,100%);
    min-height: 72px;
    grid-column: 1;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  body[data-page="reading"] .v11-reading-link span {
    position: relative;
    z-index: 2;
    padding: 4px 9px;
    background: #f5f8fc;
  }

  body[data-page="reading"] .v11-reading-link i {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: auto;
    border-top: 0;
    border-left: 1.5px dashed #7892b8;
    animation-name: v11-reading-vertical-link-in;
  }

  body[data-page="reading"] .v11-reading-link i::after {
    top: auto;
    right: -3px;
    bottom: 1px;
    border-top: 0;
    border-right: 1.4px solid #6f89b0;
    border-bottom: 1.4px solid #6f89b0;
    transform: rotate(45deg);
  }

  body[data-page="reading"] .v11-reading-primary-flow > .v8-answer-node {
    margin-bottom: 88px;
  }

  body[data-page="reading"] .v11-reading-output-link {
    width: 240px;
    height: 72px;
  }

  body[data-page="reading"] .v8-answer-node .v11-reading-output-link span {
    top: 24px;
  }

  body[data-page="reading"] .v8-context-nodes.v10-reading-destinations {
    margin-top: 8px;
    grid-template-rows: none;
    row-gap: 8px;
  }

  body[data-page="reading"] .v11-reading-distribution { display: none; }
}

@media (max-width: 600px) {
  body[data-page="reading"] .v8-reading-map {
    padding: 20px 16px 18px;
    border-radius: 15px;
  }

  body[data-page="reading"] .v11-reading-primary-flow > .v8-question-node,
  body[data-page="reading"] .v11-reading-primary-flow > .v8-answer-node {
    padding: 20px;
  }

  body[data-page="reading"] .v11-reading-primary-flow > .v8-evidence-node {
    min-height: 0;
    padding: 24px 22px;
  }

  body[data-page="reading"] .v11-reading-primary-flow .v8-evidence-node h2 {
    font-size: 19px;
  }

  body[data-page="reading"] .v8-answer-node .v11-reading-output-link span {
    font-size: 8.5px;
  }

  body[data-page="reading"] .v8-context-nodes.v10-reading-destinations {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }

  body[data-page="reading"] .v8-context-nodes.v10-reading-destinations small {
    text-align: center;
  }

  body[data-page="reading"] .v8-context-nodes.v10-reading-destinations span {
    padding: 11px 8px;
    font-size: 9px;
  }

  body[data-page="reading"] .v11-reading-context-flow { padding: 16px; }
  body[data-page="reading"] .v11-reading-context-flow article { padding: 22px 20px; }
  body[data-page="reading"] .v11-reading-context-flow .v8-context-arrow b {
    left: calc(50% + 13px);
    font-size: 8.75px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="reading"] .v11-reading-link i,
  body[data-page="reading"] .v8-answer-node .v11-reading-output-link i {
    animation: none;
  }
}
