/* ============================================================
   Model page — TAU-Israel iGEM 2026 wiki
   ------------------------------------------------------------
   Loaded only by wiki/pages/model.html (extra_head), on top of
   static/style.css. It carries what the page does not get from the
   shared components: figures, the inline-SVG drawing
   language, status chips, spec strips, tables, code blocks and
   the section lead.

   What is here is only what the Model page needs:

     .model-route  the illustrated, linked six-stage overview
     .md-eq      a display equation
   ============================================================ */

/* Illustrated overview: a continuous route rather than six cards. */
.model-route {
  margin: 1.8rem 0;
  padding: 1.5rem 2rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 24px 10px 24px 10px;
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--paper-edge);
  color: var(--ink);
}

.model-route__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--paper-edge);
}

.model-route__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.model-route .model-route__heading p {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0.3rem 0 0;
}

.model-route__hint {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--ink-2);
}

.model-route__stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "genes triggers switches" "output assembly circuits";
  gap: 2rem 1.25rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.model-route__stage { position: relative; min-width: 0; margin: 0; }
.model-route__stage--1 { grid-area: genes; }
.model-route__stage--2 { grid-area: triggers; }
.model-route__stage--3 { grid-area: switches; }
.model-route__stage--4 { grid-area: circuits; }
.model-route__stage--5 { grid-area: assembly; }
.model-route__stage--6 { grid-area: output; }

.model-route__stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 83px;
  right: -1.6rem;
  width: 2rem;
  height: 10px;
  background: var(--paper-edge);
  border-block: 2px solid var(--ink);
}

.model-route__stage::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
  top: 84px;
  right: -1.4rem;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  transform: rotate(45deg);
}

.model-route__stage--3::after {
  right: -1.1rem;
  width: 1.25rem;
  height: calc(100% + 2rem);
  border: 3px solid var(--ink);
  border-left: 0;
  border-radius: 0 20px 20px 0;
  background: none;
}
.model-route__stage--3::before {
  right: -1.3rem;
  top: calc(100% + 1rem);
  transform: rotate(135deg);
}
.model-route__stage--4::after,
.model-route__stage--5::after { left: -1.6rem; right: auto; }
.model-route__stage--4::before,
.model-route__stage--5::before { left: -1.4rem; right: auto; transform: rotate(-135deg); }
.model-route__stage--6::before,
.model-route__stage--6::after { display: none; }

.model-route .model-route__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 0.35rem 0.3rem 0.75rem;
  border-radius: 14px;
  text-align: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 400;
  transition: background 160ms ease;
}

.model-route__drawing { position: relative; display: block; width: 100%; max-width: 240px; }
.model-route__art { display: block; width: 100%; height: 160px; overflow: visible; transition: transform 160ms ease; }
.model-route__shadow { fill: var(--paper-sink); }
.model-route__blue { fill: var(--pipe-blue-soft); }
.model-route__paper { fill: var(--paper); }
.model-route__edge { fill: var(--paper-edge); }
.model-route__paper-line { stroke: var(--paper); }
.model-route__signal { stroke: var(--cernal-red); }
.model-route__signal-fill { fill: var(--cernal-red-soft); }
.model-route__window { fill: var(--cernal-red-soft); fill-opacity: 0.55; }
.model-route__number {
  position: absolute;
  top: 0.4rem;
  left: 0.25rem;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}
.model-route__title { font-family: var(--font-display); font-size: 1.04rem; font-weight: 700; line-height: 1.35; }
.model-route__jump { display: inline-block; color: var(--pipe-blue-deep); }
.model-route__description { margin-top: 0.45rem; font-size: 0.85rem; line-height: 1.5; color: var(--ink-2); }
.model-route__note { margin-top: 0.5rem; font-size: 0.75rem; line-height: 1.5; color: var(--ink-2); font-style: italic; }
.model-route .model-route__link:hover { background: var(--paper-sink); color: var(--ink); text-decoration: none; }
.model-route__link:hover .model-route__art { transform: translateY(-4px) rotate(-2deg); }
.model-route__link:hover .model-route__title { text-decoration: underline; text-underline-offset: 4px; }
.model-route .model-route__link:focus-visible { outline: 3px solid var(--pipe-blue-deep); outline-offset: 3px; background: var(--paper-sink); }
.model-route .model-route__caption { max-width: none; margin: 1rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--paper-edge); font-size: 0.75rem; color: var(--ink-2); }

@media (max-width: 767.98px) {
  .model-route { padding: 1.2rem 1rem 1rem; }
  .model-route__heading { align-items: start; flex-direction: column; gap: 0.5rem; }
  .model-route__stages { grid-template-columns: 1fr; grid-template-areas: "genes" "triggers" "switches" "circuits" "assembly" "output"; gap: 1.7rem; }
  .model-route .model-route__link { display: grid; grid-template-columns: 115px 1fr; align-content: center; column-gap: 0.75rem; text-align: left; padding: 0.4rem 0; }
  .model-route__drawing { grid-column: 1; grid-row: 1 / span 3; }
  .model-route__art { height: 110px; }
  .model-route__title, .model-route__description, .model-route__note { grid-column: 2; }
  .model-route__number { top: 0; left: 0; width: 1.5rem; height: 1.5rem; }
  .model-route__stage:nth-child(n)::after { top: calc(100% + 0.2rem); left: 53px; right: auto; height: 1.3rem; width: 9px; border: 0; border-inline: 2px solid var(--ink); border-radius: 0; background: var(--paper-edge); }
  .model-route__stage:nth-child(n)::before { top: calc(100% + 0.8rem); left: 53px; right: auto; transform: rotate(135deg); }
  .model-route__stage--6:nth-child(n)::before, .model-route__stage--6:nth-child(n)::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .model-route__art, .model-route .model-route__link { transition: none; }
  .model-route__link:hover .model-route__art { transform: none; }
}

/* ------------------------------------------------------------
   Display equation
   ------------------------------------------------------------
   style.css styles inline <code> as a red-on-sink token, which is
   right for an identifier in a sentence and wrong for a formula
   on its own line.
   ------------------------------------------------------------ */
.md-eq {
  margin: 1.1rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--paper-edge);
  border-left: 0.4rem solid var(--acc-violet);
  border-radius: var(--radius-sm);
  background: var(--paper-sink);
  text-align: center;
}

.md-eq code,
.md-eq b {
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
}

.md-eq__note {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ------------------------------------------------------------
   Shared bits
   ------------------------------------------------------------ */
#wikiMain h3 {
  margin-top: 2.25rem;
}

#wikiMain h4:not(.accordion-header) {
  font-size: 1.1rem;
  margin-top: 1.75rem;
}

/* Output cassette and an independently scaled view of its logic switch. */
.construct-map {
  --construct-promoter: var(--pipe-blue-deep);
  --construct-switch: var(--acc-violet);
  --construct-payload: var(--acc-green);
  --construct-terminator: var(--acc-gold);
}

.construct-map__drawing {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.construct-map__drawing text {
  fill: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 14px;
}

.construct-map__drawing .construct-map__label { fill: var(--ink); font-weight: 700; }
.construct-map__drawing .construct-map__on-fill { fill: var(--paper); font-weight: 600; }
.construct-map__promoter { fill: var(--construct-promoter); }
.construct-map__switch { fill: var(--construct-switch); }
.construct-map__payload { fill: var(--construct-payload); }
.construct-map__terminator { fill: var(--construct-terminator); }
.construct-map__stem { fill: var(--acc-violet-soft); }
.construct-map__loop { fill: var(--acc-gold-soft); }
.construct-map__neutral { fill: var(--paper-sink); }
.construct-map__start { fill: var(--construct-switch); }
.construct-map__guide { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.construct-map__guide--zoom { stroke-dasharray: 4 5; opacity: 0.65; }
.construct-map .overflow-x-auto:focus-visible { outline: 2px solid var(--construct-switch); outline-offset: 3px; }

.construct-map__features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.75rem 0 0;
}

.construct-map__feature { border-left: 4px solid; padding-left: 0.9rem; }
.construct-map__feature--promoter { border-color: var(--construct-promoter); }
.construct-map__feature--switch { border-color: var(--construct-switch); }
.construct-map__feature--payload { border-color: var(--construct-payload); }
.construct-map__feature--terminator { border-color: var(--construct-terminator); }
.construct-map__feature dt { color: var(--ink); }
.construct-map__feature dd { margin: 0.35rem 0 0; color: var(--ink-2); font-size: 0.9rem; }

@media (max-width: 575.98px) {
  .construct-map__features { grid-template-columns: 1fr; }
}

/* Gate designs: a persistent selector and a generous reading panel. */
.gate-explorer {
  margin: 1.5rem 0 2rem;
  border: 2px solid var(--ink);
  border-radius: 20px 8px 20px 8px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--paper-edge);
}
.gate-explorer__intro { padding: 1.5rem; border-top: 6px solid var(--pipe-blue-deep); }
#wikiMain .gate-explorer__intro h3 { margin: 0.4rem 0 0.8rem; font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.gate-explorer__intro p:last-child { margin-bottom: 0; }
.gate-explorer__note { font-size: 0.85rem; color: var(--ink-2); }
.gate-explorer__layout { border-top: 1px solid var(--paper-edge); }
.gate-explorer__selectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; padding: 0.8rem; background: var(--paper-sink); border-bottom: 1px solid var(--paper-edge); scroll-margin-top: 6rem; }
.gate-explorer .gate-explorer__selector {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) 1rem;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 0.65rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 400;
}
.gate-explorer__selector strong { display: block; font-size: 0.95rem; line-height: 1.4; }
.gate-explorer__selector small { display: block; margin-top: 0.3rem; font-size: 0.75rem; color: var(--ink-2); }
.gate-explorer__number { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); }
.gate-explorer .gate-explorer__selector:hover { background: var(--paper); text-decoration: none; }
.gate-explorer .gate-explorer__selector[aria-selected="true"] { background: var(--paper); border-color: var(--pipe-blue-deep); box-shadow: inset 4px 0 0 var(--pipe-blue-deep); }
.gate-explorer__selector[aria-selected="true"] .gate-explorer__number,
.gate-explorer__arrow { color: var(--pipe-blue-deep); }
.gate-explorer__selector:focus-visible,
.gate-explorer__panel:focus-visible { outline: 3px solid var(--pipe-blue-deep); outline-offset: -3px; }
.gate-explorer__panel { padding: 1.5rem; min-width: 0; scroll-margin-top: 6rem; }
.gate-explorer__panels { min-width: 0; }
.gate-explorer__panel[hidden] { display: none; }
.gate-explorer__panel + .gate-explorer__panel { border-top: 1px solid var(--paper-edge); }
.gate-explorer__eyebrow { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-2); }
#wikiMain .gate-explorer__panel h4 { margin: 0.5rem 0 0.75rem; font-size: clamp(1.3rem, 2vw, 1.65rem); }
.gate-explorer__status { display: inline-block; font-size: 0.75rem; padding: 0.3rem 0.6rem; border: 1px solid var(--paper-edge); border-radius: 4px; color: var(--ink-2); }
.gate-explorer__content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem; }
.gate-explorer__content > div { border-top: 2px solid var(--paper-edge); padding-top: 0.85rem; }
#wikiMain .gate-explorer__content h5 { font-size: 1rem; margin: 0 0 0.5rem; }
.gate-explorer__content p { font-size: 0.85rem; color: var(--ink-2); margin: 0; }
@media (max-width: 767.98px) {
  .gate-explorer__layout { grid-template-columns: 1fr; }
  .gate-explorer__selectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; border-right: 0; border-bottom: 1px solid var(--paper-edge); }
  .gate-explorer .gate-explorer__selector { grid-template-columns: 1.3rem minmax(0, 1fr); padding: 0.75rem 0.5rem; margin: 0; }
  .gate-explorer__arrow { display: none; }
  .gate-explorer__intro, .gate-explorer__panel { padding: 1.2rem; }
}
@media (max-width: 420px) {
  .gate-explorer__selector strong { font-size: 0.85rem; }
  .gate-explorer__selector small { font-size: 0.7rem; }
  .gate-explorer__content { grid-template-columns: 1fr; }
}

/* Audit bar: split widths and neutral (non-alert) colours. */
.page-model .results-audit__found { flex: 0 0 9.2%; }
.page-model .results-audit__missed { flex: 0 0 90.8%; background: var(--ink-3); }
.page-model .results-audit__key--found { background: var(--pipe-blue-deep); }
.page-model .results-audit__key--missed { background: var(--ink-3); }

/* Content shared with no style.css equivalent: a mono label above a block, and
   automatic step numbers for the shared numbered pipeline (the numerals are drawn
   by CSS so the markup carries no extra text). */
.model-kicker {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.model-steps {
  counter-reset: model-step;
}

.model-steps .pipeline-num::before {
  counter-increment: model-step;
  content: counter(model-step, decimal-leading-zero);
}

.model-steps .pipeline-body p {
  margin: 0.35rem 0 0;
}
