/* DNS Deep Dive: doodle layout (batch 1 of the Core Learning doodle rollout, 11/19).
   Shared picture rules live in css/shared/bb-cl-doodle.css; this file only places the DNS pictures.
   New in-module doodles: dns-hosts-phonebook, dns-hierarchy-three-stops, dns-postcard-envelope, dns-ttl-egg-timer
   (data-doodle-id on each figure; harvest list codex-queue/reports/doodle-harvest-1119.jsonl). */

/* doodle text sits in its own unfiltered group so labels stay crisp */
.cl-dd .dd-t text{stroke:none}

/* side pictures: the drawing gets a little more room than the callouts */
.bb-poster.w2d.cl-dd.cl-dd--side{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}

/* HOSTS.TXT picture inside the explainer card */
.bb-explainer .bb-poster.w2d.cl-dd{margin:16px 0 12px}

/* the three stops: wide picture on top, one callout column per layer underneath */
.dns-dd-tree .cl-dd-fig svg{max-height:none}
.dns-dd-layers{margin-top:10px}
.dns-dd-layers>div{display:flex;flex-direction:column;gap:8px;min-width:0}
:root body .intel-section .intel-content .dns-dd-layers h3{margin:0;font-size:22px!important;line-height:1.2!important}

/* the ripped phone book is wide; keep it one-screen */
.dns-dd-book .cl-dd-fig svg{max-height:min(560px,calc(100vh - 150px))}

/* spacing check 11/19: the datacenter photo was capped at 900px with 150px empty each side; run it full width as a banner */
:root body .intel-section .intel-content .dossier-visual{max-width:none;height:340px;margin:24px 0}
.dossier-visual img{object-fit:cover;object-position:center 40%}

/* record full names under the phone book */
.dns-dd-names-h{margin:14px 0 6px}
.dns-dd-names{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.dns-dd-names .bb-tag b{margin-right:4px}

@media (max-width:760px){
  .bb-poster.w2d.cl-dd.cl-dd--side{grid-template-columns:minmax(0,1fr)}
  .dns-dd-layers{grid-template-columns:minmax(0,1fr)!important}
  :root body .intel-section .intel-content .dossier-visual{height:220px}
  /* wide drawings scroll inside their own frame on phones instead of shrinking the labels to nothing */
  .dns-dd-tree .cl-dd-fig,.dns-dd-book .cl-dd-fig{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .dns-dd-tree .cl-dd-fig svg{min-width:720px}
  .dns-dd-book .cl-dd-fig svg{min-width:640px}
}

/* ANIM START */
/* step player tokens (shared pattern, written per module): step 0 = the static drawing, tokens hidden */
.cl-dd-animzone{min-width:0;display:flex;flex-direction:column;gap:6px}
.cl-dd-animzone>.bba-bar{align-self:flex-start}
.cl-dd-animzone>figure{width:100%;align-self:stretch}
.cl-dd-animzone .bba-cap{font-size:16px}
.cl-dd .dda-tok{opacity:0;transform:translate(var(--x1,0),var(--y1,0));pointer-events:none}
.cl-dd .dda-tok text{stroke:none}
@keyframes ddaGo{0%{opacity:0;transform:translate(var(--x0),var(--y0))}15%{opacity:1;transform:translate(var(--x0),var(--y0))}100%{opacity:1;transform:translate(var(--x1),var(--y1))}}
@keyframes ddaGoFade{0%{opacity:0;transform:translate(var(--x0),var(--y0))}12%{opacity:1;transform:translate(var(--x0),var(--y0))}80%{opacity:1;transform:translate(var(--x1),var(--y1))}100%{opacity:0;transform:translate(var(--x1),var(--y1))}}
@keyframes ddaPop{0%{opacity:0;transform:translate(var(--x1),var(--y1)) scale(.6)}100%{opacity:1;transform:translate(var(--x1),var(--y1)) scale(1)}}
@media (prefers-reduced-motion:reduce){.cl-dd .bba-fig .dda-tok{animation-duration:1ms!important;animation-delay:0s!important}}
@media print{.cl-dd .dda-tok{display:none}}
/* dns-recursive-iterative: step tokens */
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r1{--x0:122px;--y0:140px;--x1:226px;--y1:140px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="1"] .r1{animation:ddaGo .95s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r2{--x0:270px;--y0:74px;--x1:270px;--y1:74px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="2"] .r2{animation:ddaPop .5s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r3q{--x0:316px;--y0:112px;--x1:464px;--y1:46px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="3"] .r3q{animation:ddaGoFade .95s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r3a{--x0:464px;--y0:68px;--x1:330px;--y1:120px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="3"] .r3a{animation:ddaGo .95s ease-in-out 0.9s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r4q{--x0:316px;--y0:146px;--x1:464px;--y1:146px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="4"] .r4q{animation:ddaGoFade .95s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r4a{--x0:464px;--y0:164px;--x1:330px;--y1:164px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="4"] .r4a{animation:ddaGo .95s ease-in-out 0.9s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r5q{--x0:316px;--y0:180px;--x1:464px;--y1:244px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="5"] .r5q{animation:ddaGoFade .95s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r5a{--x0:464px;--y0:266px;--x1:330px;--y1:210px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="5"] .r5a{animation:ddaGo .95s ease-in-out 0.9s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r6a{--x0:224px;--y0:192px;--x1:124px;--y1:192px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="6"] .r6a{animation:ddaGo .95s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-recursive-iterative"] .r6c{--x0:270px;--y0:74px;--x1:270px;--y1:74px}
.bba-fig[data-doodle-id="dns-recursive-iterative"][data-anim-step="6"] .r6c{animation:ddaPop .5s ease-in-out 0s both}
/* dns-ttl-egg-timer: step tokens */
.bba-fig[data-doodle-id="dns-ttl-egg-timer"] .t1{--x0:334px;--y0:150px;--x1:334px;--y1:150px}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="1"] .t1{animation:ddaPop .5s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="2"] .t1,.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="3"] .t1{opacity:1}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"] .t2{--x0:66px;--y0:150px;--x1:66px;--y1:150px}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="2"] .t2{animation:ddaPop .5s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="3"] .t2,.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="4"] .t2,.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="5"] .t2{opacity:1}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"] .t3{--x0:382px;--y0:168px;--x1:600px;--y1:150px}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="3"] .t3{animation:ddaGo .95s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"] .t4d{--x0:428px;--y0:150px;--x1:428px;--y1:150px}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="4"] .t4d{animation:ddaPop .5s ease-in-out 0s both}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"] .t4{--x0:112px;--y0:150px;--x1:334px;--y1:150px}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="4"] .t4{animation:ddaGo .95s ease-in-out 0.4s both}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="5"] .t4{opacity:1}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"] .t5{--x0:382px;--y0:168px;--x1:600px;--y1:150px}
.bba-fig[data-doodle-id="dns-ttl-egg-timer"][data-anim-step="5"] .t5{animation:ddaGo .95s ease-in-out 0.2s both}
/* ANIM END */

/* ==== spacing sweep 11/20 (QA pass before Brett review) ==== */
/* a 2-up card grid with an odd count left the last card alone with ~600px empty beside it: it runs full width */
@media (min-width:1100px){.intel-content .intel-sub-grid>:last-child:nth-child(odd):not(:first-child){grid-column:1/-1!important}}
/* DNS CLI: the terminal was a fixed 350px box, ~265px empty until a command runs. It now starts short and grows (scrolls past 350px). */
#cliOutput.cli-terminal{height:auto;min-height:150px;max-height:350px}

/* visual fix 11/21 (N08-N11): side doodles are already one column on phones, but their 600-680 wide drawings
   shrank labels to ~5px. They now keep a readable width and pan sideways inside their own frame (step player follows x). */
@media (max-width:760px){
  .cl-dd-fig:is([data-doodle-id="dns-hosts-phonebook"],[data-doodle-id="dns-recursive-iterative"],[data-doodle-id="dns-postcard-envelope"],[data-doodle-id="dns-ttl-egg-timer"]){overflow-x:auto;-webkit-overflow-scrolling:touch}
  .cl-dd-fig[data-doodle-id="dns-hosts-phonebook"] svg{min-width:560px}
  .cl-dd-fig[data-doodle-id="dns-recursive-iterative"] svg{min-width:520px}
  .cl-dd-fig[data-doodle-id="dns-postcard-envelope"] svg{min-width:620px}
  .cl-dd-fig[data-doodle-id="dns-ttl-egg-timer"] svg{min-width:640px}
}
