/* Single-Area OSPF: the lesson's own figures.
   Loads after /slides/slides.css, ../ccna-net.css, ../sites.css and ../company.css. */

.sv-fig { justify-content: flex-start; gap: 14px; }
@media (min-width: 861px) { .sv-side .sv-body { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); } }

/* The sections' colours. */
[data-sec="intro"] { --sec: #334155; }
[data-sec="ls"] { --sec: #0f766e; }
[data-sec="nbr"] { --sec: #b45309; }
[data-sec="dr"] { --sec: #1d8102; }
[data-sec="routes"] { --sec: #0a5a8a; }
[data-sec="verify"] { --sec: #7c3aed; }
[data-sec="v3"] { --sec: #0e7490; }
[data-sec="lab"] { --sec: #be123c; }

/* Terminals: ⟦…⟧ marks the part to look at (term() from ../campus.js). */
.term { font-size: 12px; }
.term mark { background: #5c4a12; color: #ffe08a; border-radius: 2px; }
.two-terms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.two-terms small { display: block; color: var(--sv-ink2); margin-bottom: 3px; font-size: 13px; }
.net.nw.small { max-height: 280px; }

/* SVG words. */
.gname { font: 700 14px system-ui, sans-serif; fill: var(--sv-ink); }
.gname.small { font-size: 12px; }
.gsub { font: 12px system-ui, sans-serif; fill: var(--sv-ink2); }
.gc { font: 700 12.5px var(--mono); fill: #0a5a8a; paint-order: stroke; stroke: var(--sv-bg); stroke-width: 4px; }

/* Link-state in three steps. */
.ls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ls-card { background: #fff; border: 1px solid var(--sv-line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 200px; }
.ls-h { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 14px; }
.ls-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sec, #0f766e); color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.mini { border-collapse: collapse; font-size: 12.5px; }
.mini th { text-align: left; color: var(--sv-ink2); font-weight: 600; padding: 2px 6px; }
.mini td { padding: 2px 6px; border-top: 1px solid #eef0f3; font-family: var(--mono); font-size: 12px; }
.ls-same { font: 700 13px system-ui, sans-serif; color: #0f766e; text-align: center; }
.mini-rt { margin: 0; font: 12px/1.5 var(--mono); }

/* SPF: the graph and the tree. */
.spf { display: flex; flex-direction: column; gap: 10px; }
.graph { width: 100%; max-height: 330px; }
.ge { stroke: #c3cad2; stroke-width: 2.5; }
.ge.tree { stroke: #0f766e; stroke-width: 4; }
.gn { fill: #fff; stroke: #0a5a8a; stroke-width: 2.5; }
.gn.root { fill: #0a5a8a; }
.gn.root + text { fill: #fff; }
.gtot { font: 700 13px var(--mono); fill: #0f766e; }
.graph .gsub { font: 700 13px var(--mono); fill: #0f766e; }
.gn.gnet { stroke: #94a3b8; stroke-width: 1.5; }

/* The router ID's three sources. */
.rid { display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.rid-step { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 6px 12px; }
.rid-step small { display: block; color: var(--sv-ink2); font-size: 12.5px; }
.rid-step code { font-size: 14px; }
.rid-step.won { border: 2.5px solid #1d8102; }
.rid-step.won code { color: #1d8102; font-weight: 700; }
.rid-step.skip, .rid-step.later { opacity: .7; }

/* The network statement's wildcard, bit by bit. */
.bits td { font: 13px var(--mono); text-align: center; padding: 4px 5px; }
.bits td.w { background: #fff4d6; }
.bits td:last-child { font-family: system-ui, sans-serif; text-align: left; }
.bits .dimc { color: var(--sv-ink2); font-family: system-ui, sans-serif; text-align: left; }

/* A Hello packet. */
.hello-pkt { background: #fff; border: 2px solid #d97706; border-radius: 10px; padding: 8px 10px; }
.hp-head { font-weight: 700; color: #b45309; font-size: 13.5px; margin-bottom: 6px; }
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; }
.hf { border: 1px solid var(--sv-line); border-radius: 6px; padding: 3px 8px; }
.hf small { display: block; color: var(--sv-ink2); font-size: 11.5px; }
.hf code { font-size: 12.5px; }
.hf.must { background: #fff4d6; border-color: #e8a33d; }
.hp-key { margin-top: 6px; font-size: 12.5px; color: var(--sv-ink2); display: flex; gap: 6px; align-items: center; }
.must-key { width: 14px; height: 14px; background: #fff4d6; border: 1px solid #e8a33d; border-radius: 3px; }
.he { font-size: 13.5px; }

/* The neighbor state machine. */
.ladder { width: 100%; max-height: 420px; }
.st { stroke-width: 2; }
.st-h { fill: #fff7ed; stroke: #d97706; }
.st-x { fill: #f5f3ff; stroke: #7c3aed; }
.st-f { fill: #ecfdf5; stroke: #1d8102; stroke-width: 3; }
.stn { font: 700 14px system-ui, sans-serif; fill: var(--sv-ink); }
.st-arr { stroke: #8a96a3; stroke-width: 2; fill: none; }
.st-lead { stroke: #c3cad2; stroke-width: 1; stroke-dasharray: 2 3; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack small { display: block; color: var(--sv-ink2); margin-bottom: 3px; font-size: 13px; }
.st-why { font: 12.5px system-ui, sans-serif; fill: var(--sv-ink2); }
.br { fill: none; stroke-width: 2; }
.br.h { stroke: #d97706; } .br.x { stroke: #7c3aed; }
.brl { font: 700 12.5px system-ui, sans-serif; }
.brl.h { fill: #b45309; } .brl.x { fill: #7c3aed; }
.stop-n { font: 600 12px system-ui, sans-serif; fill: var(--no); }

/* DR/BDR: adjacencies on one segment. */
.pairs { width: 100%; max-height: 320px; }
.bus { stroke: #0a7bbd; stroke-width: 5; stroke-linecap: round; }
.bus-drop { stroke: #8a96a3; stroke-width: 2.5; }
.pairs .d-rt { fill: #0a5a8a; }
.pairs .d-arrows { stroke: #fff; stroke-width: 2; fill: none; }
.adj { fill: none; stroke-width: 3; }
.adj.full { stroke: #1d8102; }
.adj.two { stroke: #9ca3af; stroke-dasharray: 6 5; }
.rl { font: 800 12px system-ui, sans-serif; }
.r-dr { fill: #1d8102; color: #1d8102; } .r-bdr { fill: #0a7bbd; color: #0a7bbd; } .r-oth { fill: #6b7280; color: #6b7280; }
.rl-t { font-weight: 800; font-size: 13px; }
.pa td { text-align: center; }

/* The election that does not preempt: a timeline. */
.timeline { width: 100%; max-height: 260px; }
.tl { stroke-width: 1.5; }
.tl.wait { fill: #f3f4f6; stroke: #9ca3af; }
.tl.dr { fill: #dcfce7; stroke: #1d8102; }
.tl.bdr { fill: #e0f2fe; stroke: #0a7bbd; }
.tl-t { font: 700 12px system-ui, sans-serif; fill: var(--sv-ink); }
.tl-ev { stroke: #b45309; stroke-width: 1.5; stroke-dasharray: 4 3; }
.tl-evt { font: 600 11.5px system-ui, sans-serif; fill: #92400e; }
.tl-ax { stroke: #9ca3af; stroke-width: 1.5; }
.timeline .stopm circle { fill: #fff; stroke: var(--no); stroke-width: 2.5; }
.timeline .stopm path { stroke: var(--no); stroke-width: 3; stroke-linecap: round; }

/* Cost. */
.formula { background: #fff; border: 2px solid #0a5a8a; border-radius: 10px; padding: 10px 16px; font-size: 18px; width: fit-content; }
.co { font-size: 13.5px; }
.co td b { font-family: var(--mono); }

@media (max-width: 1100px) { .two-terms { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .tbl { display: block; overflow-x: auto; max-width: 100%; }
  .ls { flex-direction: column; align-items: stretch; }
  .ls .arr.big { transform: rotate(90deg); align-self: center; }
}
