/* Sabbatical story (layer 1) and technical archive (layer 2).
   Built by Website/Sabbatical/tools/build_timeline.py. Uses tokens.css + base.css; no new colors or fonts. */

.sab-nav{display:flex;flex-wrap:wrap;gap:8px 24px;align-items:baseline;padding-top:16px}
.sab-nav .back-link{margin-top:0;margin-right:auto}
.sab-nav a[aria-current="page"]{color:var(--color-accent);text-decoration:none;font-weight:var(--weight-bold)}
.sab-head{display:grid;gap:16px;padding:64px 0 32px;max-width:830px}
.sab-head h1{font-size:56px;line-height:1.08;letter-spacing:-.04em;width:min(1040px,calc(100vw - 2*var(--page-gutter)));text-wrap:balance}
.sab-head .sab-sub{margin:-4px 0 0;font-size:40px;line-height:1.12;letter-spacing:-.035em;font-weight:var(--weight-normal);color:var(--color-secondary);width:min(1040px,calc(100vw - 2*var(--page-gutter)));text-wrap:balance}
.sab-head .sab-note{max-width:60ch;margin:0 0 20px;padding:12px 16px;border-left:3px solid var(--color-accent);background:var(--color-media);font-size:var(--text-body);line-height:28px}
.sab-head .lede{font-size:20px;line-height:28px;max-width:60ch;color:var(--color-secondary)}

/* ---------- story ---------- */
.sab-story{max-width:720px;padding-bottom:var(--space-16)}
.sab-story h3{font-size:var(--text-section);line-height:32px;border-top:var(--stroke-width,1px) solid var(--color-divider,#000);padding-top:16px;margin:64px 0 24px}
.sab-story .sab-head{padding-bottom:72px}
.sab-story .stages + h3{margin-top:128px}
.sab-story h4{font-size:var(--text-subtitle);line-height:32px;margin:40px 0 12px}
.sab-story p{font-size:var(--text-body);line-height:28px;margin:0 0 20px}
.sab-story ul,.sab-story ol{font-size:var(--text-body);line-height:28px;padding-left:22px;margin:0 0 20px}
.sab-story li{margin:6px 0}
.sab-story em{font-style:italic}
.sab-story code{font-family:ui-monospace,Consolas,monospace;font-size:.85em;background:var(--color-media);padding:1px 5px}

/* media inside the reading column can widen to the page */
.sab-story .gallery{display:grid;gap:var(--grid-gap);margin:32px 0 0;width:min(1040px,calc(100vw - 2*var(--page-gutter)))}
.sab-story .gallery.n1{grid-template-columns:1fr}
.sab-story .gallery.n2{grid-template-columns:1fr 1fr}
.sab-story .gallery.n3,.sab-story .gallery.n4{grid-template-columns:repeat(3,1fr)}
.sab-story .gallery img,.sab-story .gallery video{width:100%;height:auto;background:var(--color-media);cursor:zoom-in}
.sab-story .gallery img[style*="max-height"]{width:auto;margin:0}
.sab-story p.caption{font-size:var(--text-small);line-height:24px;color:var(--color-secondary);margin:12px 0 32px}
.sab-story p.caption em{font-style:normal}
.sab-story p.more a,.sab-chapter p.more a{font-size:var(--text-small);line-height:24px;margin-right:8px}
.sab-story p.more a::after,.sab-chapter p.more a::after{content:""}

/* crawl / walk / run overview */
.stages{display:grid;grid-template-columns:repeat(var(--n),1fr);align-items:end;gap:var(--grid-gap);margin:8px 0 64px;padding-bottom:16px;width:min(1040px,calc(100vw - 2*var(--page-gutter)))}
.st{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:var(--color-ink);margin-bottom:calc(var(--i) * 44px)}
.st:hover{color:var(--color-ink)}
.st-verb{font-size:48px;line-height:1;letter-spacing:-.04em;font-weight:var(--weight-bold)}
.st-verb span{background:linear-gradient(180deg,transparent 62%,var(--color-highlight) 62%,var(--color-highlight) 92%,transparent 92%)}
.st-pic{display:block;aspect-ratio:4/3;overflow:hidden;background:var(--color-media);margin:12px 0 8px}
.st-pic img,.st-pic video{width:100%;height:100%;object-fit:cover;transition:transform var(--motion-duration) ease}
@media(hover:hover){.st:hover .st-pic img,.st:hover .st-pic video{transform:scale(var(--image-hover-scale))}}
.st-name{font-size:var(--text-subtitle);line-height:32px;font-weight:var(--weight-bold)}
.st-when,.st-line{font-size:var(--text-small);line-height:20px;color:var(--color-secondary)}

/* cycle: one frame at a time, snap changes */
.cycle{position:relative;cursor:pointer;background:var(--color-media)}
/* all frames share one grid cell, so the box keeps the tallest frame's height and the page never jumps */
.sab-story .gallery.cycle{grid-template-columns:1fr;align-items:center}
.sab-story .gallery.cycle img{grid-area:1/1}
.cycle img[hidden]{display:block!important;visibility:hidden}
.cycle-label{position:absolute;right:12px;bottom:12px;font-size:var(--text-small);line-height:20px;background:var(--color-ink);color:var(--color-page);padding:2px 8px}

/* carousel: same pattern as the Orion page (chevrons either side of a rounded fixed 16:9 viewport, since these clips are wide) */
.carousel{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:start;gap:12px;margin:32px 0 0;width:min(1040px,calc(100vw - 2*var(--page-gutter)))}
.carousel-viewport{grid-column:2;grid-row:1;min-width:0}
.carousel>.prev{grid-column:1}.carousel>.next{grid-column:3}
.carousel figure{margin:0}
.carousel figure[hidden]{display:none!important}
.carousel figure video,.carousel figure img{display:block;width:100%;aspect-ratio:16/9;height:auto;object-fit:contain;border-radius:16px;background:transparent}
.carousel .slide-cap{min-height:48px;font-size:var(--text-small);line-height:24px;color:var(--color-secondary);margin:12px 0 0}
.carousel .slide-cap em{font-style:normal}
.carousel>button{grid-row:1;align-self:center;margin-bottom:60px;display:grid;place-items:center;width:48px;height:64px;padding:8px;border:0;background:transparent;color:var(--color-ink);cursor:pointer}
.carousel>button svg{width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.carousel>button:hover{color:var(--color-accent)}
@media(max-width:700px){.carousel{grid-template-columns:32px minmax(0,1fr) 32px;gap:4px}.carousel>button{width:32px;padding:0}}

/* embedded Instagram post */
.sab-story .gallery.ig{display:flex!important;justify-content:flex-start}
.gallery.ig iframe{width:440px;max-width:100%;height:560px;border:0;background:var(--color-media)}

/* embedded interactive demo */
.sab-story .gallery.demo{grid-template-columns:minmax(0,1fr)}
.gallery.demo iframe{display:block;width:100%;min-width:0;height:850px;border:0;border-radius:16px;background:#080b12}
.gallery.demo iframe:fullscreen{width:100vw;height:100vh;border-radius:0}
.gallery.demo iframe:-webkit-full-screen{width:100vw;height:100vh;border-radius:0}
.gallery.demo .demo-fs{justify-self:start;padding:0;border:0;background:none;font:inherit;font-size:var(--text-small);color:var(--color-ink);text-decoration:underline;text-underline-offset:4px;cursor:pointer}
.gallery.demo .demo-fs:hover{color:var(--color-accent)}

.sab-foot{display:flex;gap:24px;flex-wrap:wrap;border-top:var(--stroke-width,1px) solid var(--color-divider,#000);padding-top:32px;margin-top:64px}

/* ---------- technical archive ---------- */
.sab-archive{display:grid;grid-template-columns:minmax(0,4fr) minmax(0,8fr);gap:48px;padding-bottom:var(--space-16)}
.sab-archive>div,.sab-archive>section,.sab-archive>main{min-width:0;max-width:760px}
.sab-toc{position:sticky;top:24px;align-self:start;max-height:calc(100vh - 48px);overflow:auto;display:grid;gap:2px}
.sab-toc a{display:flex;gap:12px;padding:6px 0;text-decoration:none;font-size:var(--text-small);line-height:20px;color:var(--color-secondary)}
.sab-toc a span{min-width:32px;color:var(--color-rule)}
.sab-toc a:hover,.sab-toc a.on{color:var(--color-accent)}
.sab-chapter{border-top:var(--stroke-width,1px) solid var(--color-divider,#000);padding:24px 0 48px;scroll-margin-top:24px;min-width:0}
.sab-chapter .chead{display:flex;gap:16px;font-size:var(--text-small);color:var(--color-secondary)}
.sab-chapter h2{font-size:var(--text-section);line-height:32px;margin:8px 0 20px}
.sab-chapter h3{font-size:var(--text-small);line-height:24px;letter-spacing:.08em;text-transform:uppercase;color:var(--color-accent);margin:28px 0 8px}
.sab-chapter p,.sab-chapter li{font-size:var(--text-body);line-height:28px;max-width:65ch}
.sab-chapter p{margin:0 0 16px}
.sab-chapter ul,.sab-chapter ol{padding-left:22px;margin:0 0 16px}
.sab-chapter li{margin:4px 0}
.sab-chapter code{font-family:ui-monospace,Consolas,monospace;font-size:.8em;background:var(--color-media);padding:1px 5px;overflow-wrap:anywhere}
.sab-chapter table{border-collapse:collapse;font-size:var(--text-small);line-height:20px;margin:12px 0 20px;display:block;overflow-x:auto;max-width:100%}
.sab-chapter th{text-align:left;font-weight:var(--weight-bold);border-bottom:var(--stroke-width,1px) solid var(--color-ink)}
.sab-chapter td,.sab-chapter th{padding:8px 16px 8px 0;vertical-align:top}
.sab-chapter td{border-bottom:var(--stroke-width,1px) solid var(--color-divider,#000)}
.sab-chapter pre{max-width:100%;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--text-small);line-height:20px;background:var(--color-media);padding:12px 16px}
.sab-chapter pre code{background:none;padding:0;font-size:1em}
.sab-chapter td{min-width:10ch;max-width:48ch}
.sab-chapter blockquote{border-left:3px solid var(--color-accent);margin:12px 0;padding:2px 16px;color:var(--color-secondary)}
.sab-chapter .lab{display:flex;flex-wrap:wrap;gap:8px 16px;border-top:var(--stroke-width,1px) solid var(--color-divider,#000);margin-top:24px;padding-top:16px;font-size:var(--text-small)}
.sab-chapter .lab .lbl{color:var(--color-secondary);width:100%}
.sab-chapter .edit{font-size:var(--text-small);margin-top:12px}
.sab-chapter .edit a{color:var(--color-secondary)}

/* lightbox */
#lb{position:fixed;inset:0;background:rgb(23 25 22 / 88%);display:none;align-items:center;justify-content:center;z-index:20;cursor:zoom-out;padding:24px}
#lb.on{display:flex}
#lb img{max-width:100%;max-height:100%;background:var(--color-media)}

@media(max-width:700px){
 .sab-head h1{font-size:44px}
 .sab-head .sab-sub{font-size:31px}
 .sab-archive{grid-template-columns:1fr;gap:24px}
 .sab-toc{position:static;max-height:none}
 .stages{gap:12px}.st{margin-bottom:calc(var(--i) * 22px)}.st-verb{font-size:32px}.st-name{font-size:18px;line-height:24px}
 .sab-story .gallery.n2{grid-template-columns:1fr}
 .sab-story .gallery.n3,.sab-story .gallery.n4{grid-template-columns:1fr 1fr}
}

/* read-time tag at the top of the story */
.read-time{display:inline-block;width:max-content;font-size:var(--text-small);font-weight:var(--weight-bold);line-height:20px;color:var(--color-accent);border:1px solid var(--color-accent);border-radius:999px;padding:2px 12px;margin-top:-4px}
