| 1 | /* links.css: the Links panel, the map, the week strip and the month |
| 2 | * (level-up spec §4.3, §4.4). Docs' inspector recipe: glass, a rim, a |
| 3 | * soft shadow, much fainter in dark. Calma: only icons carry colour, |
| 4 | * and on the map only "here" does. |
| 5 | */ |
| 6 | |
| 7 | /* ── The panel: from 64rem it floats at the inline end, under the bar. |
| 8 | Between 800px and 64rem it is not drawn and the page's foot holds the |
| 9 | same lists; below 800px it is a sheet with a peek line. ── */ |
| 10 | aside[mapa-links] { |
| 11 | --mapa-panel-w: 312px; |
| 12 | box-sizing: border-box; |
| 13 | position: fixed; |
| 14 | z-index: 20; |
| 15 | inset-block-start: calc(var(--mapa-bar-h) + 12px); |
| 16 | inset-inline-end: 12px; |
| 17 | inline-size: var(--mapa-panel-w); |
| 18 | max-block-size: calc(100dvh - var(--mapa-bar-h) - 24px); |
| 19 | overflow: auto; |
| 20 | overscroll-behavior: contain; |
| 21 | border: 1px solid transparent; |
| 22 | border-radius: 14px; |
| 23 | background: |
| 24 | linear-gradient(light-dark(rgb(255 255 255 / 0.92), rgb(32 35 43 / 0.92)) 0 0) padding-box, |
| 25 | linear-gradient(var(--rst-line) 0 0) border-box; |
| 26 | -webkit-backdrop-filter: blur(14px) saturate(1.3); |
| 27 | backdrop-filter: blur(14px) saturate(1.3); |
| 28 | box-shadow: |
| 29 | inset 0 1px 0 light-dark(rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.06)), |
| 30 | 0 2px 4px rgb(23 32 60 / 0.06), |
| 31 | 0 10px 20px -8px light-dark(rgb(23 32 60 / 0.18), rgb(0 0 0 / 0.5)), |
| 32 | 0 28px 56px -20px light-dark(rgb(23 32 60 / 0.28), rgb(0 0 0 / 0.7)); |
| 33 | font-size: 13px; |
| 34 | } |
| 35 | aside[mapa-links][hidden] { display: none; } |
| 36 | /* The panel is a child of the page's stack but fixed over it: its place |
| 37 | is its insets, never the stack's step (a margin moves a fixed box). */ |
| 38 | [mapa-doc][rst-stack] > aside[mapa-links] { margin-block: 0; } |
| 39 | [mapa-links-body] { display: grid; gap: var(--rst-sp-4); padding: var(--rst-sp-3) var(--rst-sp-3) var(--rst-sp-4); } |
| 40 | [mapa-links-body] > section + section { padding-block-start: var(--rst-sp-4); border-block-start: 1px solid var(--rst-line); } |
| 41 | aside[mapa-links] h2 { |
| 42 | display: flex; |
| 43 | align-items: baseline; |
| 44 | gap: var(--rst-sp-1); |
| 45 | margin: 0 0 var(--rst-sp-2); |
| 46 | color: var(--rst-text-muted); |
| 47 | font: 650 11px/14px var(--rst-font); |
| 48 | } |
| 49 | aside[mapa-links] h2 small, |
| 50 | [mapa-foot-refs] h2 small { font-size: 11px; font-variant-numeric: tabular-nums; } |
| 51 | [mapa-peek] { display: none; } |
| 52 | [mapa-peek][hidden] { display: none !important; } |
| 53 | |
| 54 | /* The page column moves left only when the panel needs the room |
| 55 | (Docs' sheet-centring rule): the box shifts, it is never padded. It |
| 56 | is centred while there is room, then slides left to clear the panel |
| 57 | (312px, 12px in, a 16px gap: 340px), then narrows from 42rem to |
| 58 | 36rem. Percentages are of the main column, so the sidebar's width is |
| 59 | already taken out. Narrower than that, the panel is not drawn and |
| 60 | its lists are at the page's foot (H1 of Fable's Phase 1 review): main |
| 61 | needs 36rem + 96px + 340px = 1012px, which is a 1236px window with |
| 62 | the sidebar open and 1068px with the rail. */ |
| 63 | @media (min-width: 64rem) { |
| 64 | [mapa-app][data-links="open"] [mapa-doc] { |
| 65 | --mapa-box: max(calc(36rem + 96px), |
| 66 | min(calc(42rem + 96px), calc(100% - 340px))); |
| 67 | max-inline-size: var(--mapa-box); |
| 68 | /* spacing-allow: the column's place, centred until the panel needs the room (the arithmetic above) */ |
| 69 | margin-inline-start: max(0px, min(calc((100% - var(--mapa-box)) / 2), |
| 70 | calc(100% - var(--mapa-box) - 340px))); |
| 71 | margin-inline-end: auto; |
| 72 | } |
| 73 | [mapa-app][data-links="open"] [mapa-foot-refs] { display: none; } |
| 74 | } |
| 75 | @media (max-width: 63.99rem) { |
| 76 | aside[mapa-links] { display: none; } |
| 77 | } |
| 78 | @media (min-width: 64rem) and (max-width: 77.24rem) { |
| 79 | [mapa-app][data-side="open"] aside[mapa-links] { display: none; } |
| 80 | [mapa-app][data-side="open"][data-links="open"] [mapa-foot-refs] { display: flex; } |
| 81 | [mapa-app][data-side="open"][data-links="open"] [mapa-doc] { max-inline-size: calc(42rem + 96px); margin-inline: auto; } |
| 82 | } |
| 83 | @media (min-width: 64rem) and (max-width: 66.74rem) { |
| 84 | [mapa-app][data-side="rail"] aside[mapa-links], |
| 85 | [mapa-app]:not([data-side]) aside[mapa-links] { display: none; } |
| 86 | [mapa-app]:not([data-side="open"])[data-links="open"] [mapa-foot-refs] { display: flex; } |
| 87 | [mapa-app]:not([data-side="open"])[data-links="open"] [mapa-doc] { max-inline-size: calc(42rem + 96px); margin-inline: auto; } |
| 88 | } |
| 89 | |
| 90 | /* ── References: Linked from, Mentioned. ── */ |
| 91 | ul[mapa-refs] { display: grid; gap: var(--rst-sp-1); margin: 0; padding: 0; list-style: none; } |
| 92 | ul[mapa-refs] > li { padding: var(--rst-sp-2); margin-inline: calc(-1 * var(--rst-sp-2)); border-radius: 10px; } |
| 93 | ul[mapa-refs] > li:hover { background: var(--rst-surface-2); } |
| 94 | [mapa-ref-src] { |
| 95 | display: flex; |
| 96 | align-items: center; |
| 97 | gap: var(--rst-sp-2); |
| 98 | color: var(--rst-text); |
| 99 | font-size: 13px; |
| 100 | font-weight: 650; |
| 101 | text-decoration: none; |
| 102 | } |
| 103 | [mapa-ref-src] > svg { inline-size: 14px; block-size: 14px; color: var(--rst-accent); flex: none; } |
| 104 | [mapa-ref-src]:hover > span:first-of-type { text-decoration: underline; } |
| 105 | [mapa-only-you] { |
| 106 | display: inline-flex; |
| 107 | align-items: center; |
| 108 | gap: var(--rst-sp-1); |
| 109 | margin-inline-start: auto; |
| 110 | color: var(--rst-text-muted); |
| 111 | font-size: 11.5px; |
| 112 | font-weight: 600; |
| 113 | } |
| 114 | [mapa-only-you] > svg { inline-size: 12px; block-size: 12px; } |
| 115 | [mapa-ref-ctx] { |
| 116 | margin-block-start: var(--rst-sp-1); |
| 117 | /* spacing-allow: the context lines up with the source's title, past its 14px icon and the 8px gap */ |
| 118 | padding-inline-start: 22px; |
| 119 | color: var(--rst-text-muted); |
| 120 | font-size: 12.5px; |
| 121 | line-height: 1.5; |
| 122 | } |
| 123 | [mapa-ref-ctx] > :is(p, ul, ol, blockquote, h2, h3, h4, h5, h6, pre) { margin: 0; font-size: inherit; } |
| 124 | [mapa-ref-ctx] form { margin-block-start: var(--rst-sp-2); } |
| 125 | |
| 126 | /* ── Chips in Links out. ── */ |
| 127 | p[mapa-chips] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); margin: 0; } |
| 128 | a[mapa-chip] { |
| 129 | display: inline-flex; |
| 130 | align-items: center; |
| 131 | gap: var(--rst-sp-1); |
| 132 | padding: 1px var(--rst-sp-2); /* spacing-allow: the chip's pill hugs its line of text, 1px above and below */ |
| 133 | border-radius: 6px; |
| 134 | background: var(--rst-surface-2); |
| 135 | color: var(--rst-text); |
| 136 | font-weight: 550; |
| 137 | text-decoration: none; |
| 138 | } |
| 139 | a[mapa-chip] > svg { inline-size: 13px; block-size: 13px; color: var(--rst-accent); } |
| 140 | a[mapa-chip]:hover { background: var(--rst-accent-soft); } |
| 141 | a[mapa-chip="pending"] { background: none; outline: 1px dashed var(--rst-line-strong); outline-offset: -1px; color: var(--rst-text-muted); } |
| 142 | a[mapa-chip="pending"] > svg { color: var(--rst-text-muted); } |
| 143 | |
| 144 | /* ── The map. Edges drawn three ways so colour never carries the |
| 145 | difference: solid linked, dashed not written, dotted mentioned. ── */ |
| 146 | svg[mapa-map] { display: block; inline-size: 100%; block-size: auto; overflow: visible; } |
| 147 | [mapa-map-edge] { stroke: var(--rst-line-strong); stroke-width: 1.25; } |
| 148 | [mapa-map-edge="pending"] { stroke-dasharray: 4 3; } |
| 149 | [mapa-map-edge="mentioned"] { stroke-dasharray: 1 3; stroke-linecap: round; stroke-width: 1.5; } |
| 150 | [mapa-map-node] { fill: var(--rst-surface); stroke: var(--rst-text-muted); stroke-width: 1.5; } |
| 151 | [mapa-map-node="pending"] { stroke-dasharray: 2 2; } |
| 152 | [mapa-map-node="here"] { |
| 153 | fill: var(--rst-accent); |
| 154 | stroke: color-mix(in oklab, var(--rst-accent) 28%, transparent); |
| 155 | stroke-width: 6; |
| 156 | paint-order: stroke; |
| 157 | } |
| 158 | svg[mapa-map] text { |
| 159 | fill: var(--rst-text-muted); |
| 160 | font: 500 10.5px var(--rst-font); |
| 161 | paint-order: stroke; |
| 162 | stroke: light-dark(#ffffff, #20232b); |
| 163 | stroke-width: 4px; |
| 164 | stroke-linejoin: round; |
| 165 | } |
| 166 | svg[mapa-map] text[mapa-map-here] { fill: var(--rst-text); font-weight: 700; font-size: 12px; } |
| 167 | svg[mapa-map] a { text-decoration: none; } |
| 168 | svg[mapa-map] a:hover text { fill: var(--rst-text); } |
| 169 | p[mapa-map-key] { display: flex; gap: var(--rst-sp-3); margin: var(--rst-sp-1) 0 0; color: var(--rst-text-muted); font-size: 11px; } |
| 170 | p[mapa-map-key] span { display: inline-flex; align-items: center; gap: var(--rst-sp-1); } |
| 171 | p[mapa-map-key] span::before { content: ""; inline-size: 14px; border-block-start: 1.5px solid var(--rst-line-strong); } |
| 172 | [mapa-k="pending"]::before { border-block-start-style: dashed !important; } |
| 173 | [mapa-k="mentioned"]::before { border-block-start-style: dotted !important; border-block-start-width: 2px !important; } |
| 174 | |
| 175 | /* ── The week strip. ── */ |
| 176 | [mapa-week] { display: flex; align-items: center; gap: var(--rst-sp-1); } |
| 177 | ol[mapa-week-days] { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; gap: 2px; /* spacing-allow: seven days across the panel's 286px, 2px apart */ margin: 0; padding: 0; list-style: none; } |
| 178 | ol[mapa-week-days] a { |
| 179 | position: relative; |
| 180 | display: grid; |
| 181 | justify-items: center; |
| 182 | gap: 2px; /* spacing-allow: the weekday's letter sits on its date as one glyph pair */ |
| 183 | padding: var(--rst-sp-1) 0 var(--rst-sp-2); |
| 184 | border-radius: 9px; |
| 185 | color: var(--rst-text); |
| 186 | font-weight: 650; |
| 187 | font-variant-numeric: tabular-nums; |
| 188 | text-decoration: none; |
| 189 | } |
| 190 | ol[mapa-week-days] abbr { color: var(--rst-text-muted); font-size: 10.5px; font-weight: 600; text-decoration: none; } |
| 191 | ol[mapa-week-days] a:hover { background: var(--rst-surface-2); } |
| 192 | :is(ol[mapa-week-days], table[mapa-month-grid]) a[mapa-wrote]::after { |
| 193 | content: ""; |
| 194 | position: absolute; |
| 195 | inset-block-end: 3px; |
| 196 | inset-inline-start: calc(50% - 2px); |
| 197 | inline-size: 4px; |
| 198 | block-size: 4px; |
| 199 | border-radius: 50%; |
| 200 | background: var(--rst-text-muted); |
| 201 | } |
| 202 | :is(ol[mapa-week-days], table[mapa-month-grid]) a[mapa-today] { box-shadow: inset 0 0 0 1.5px var(--rst-accent); } |
| 203 | :is(ol[mapa-week-days], table[mapa-month-grid]) a[aria-current] { background: var(--rst-accent); color: var(--rst-on-accent, #fff); box-shadow: none; } |
| 204 | :is(ol[mapa-week-days], table[mapa-month-grid]) a[aria-current] abbr { color: inherit; opacity: 0.8; } |
| 205 | :is(ol[mapa-week-days], table[mapa-month-grid]) a[aria-current]::after { background: var(--rst-on-accent, #fff); } |
| 206 | /* The strip's key: what the fill, the ring and the dot mean, quiet |
| 207 | as the month's foot. Each mark is drawn as on a day. */ |
| 208 | p[mapa-week-key] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-1) var(--rst-sp-3); margin: var(--rst-sp-2) 0 0; color: var(--rst-text-muted); font-size: 11px; line-height: 16px; } |
| 209 | p[mapa-week-key] > span { display: inline-flex; align-items: center; gap: var(--rst-sp-1); } |
| 210 | p[mapa-week-key] > span::before { content: ""; flex: none; inline-size: 10px; block-size: 10px; border-radius: 3px; } |
| 211 | p[mapa-week-key] > [mapa-k="shown"]::before { background: var(--rst-accent); } |
| 212 | p[mapa-week-key] > [mapa-k="today"]::before { box-shadow: inset 0 0 0 1.5px var(--rst-accent); } |
| 213 | p[mapa-week-key] > [mapa-k="wrote"]::before { inline-size: 4px; block-size: 4px; margin-inline: 3px; /* spacing-allow: the 4px dot centred in the 10px mark the others take */ border-radius: 50%; background: var(--rst-text-muted); } |
| 214 | [mapa-icon-link] { |
| 215 | display: inline-grid; |
| 216 | place-items: center; |
| 217 | inline-size: 26px; |
| 218 | block-size: 26px; |
| 219 | border-radius: 7px; |
| 220 | color: var(--rst-text-muted); |
| 221 | } |
| 222 | [mapa-icon-link]:hover { background: var(--rst-surface-2); color: var(--rst-text); } |
| 223 | [mapa-icon-link] > svg { inline-size: 15px; block-size: 15px; } |
| 224 | |
| 225 | /* ── The month: the day pill's middle opens it. ── */ |
| 226 | details[mapa-calendar] { position: relative; } |
| 227 | details[mapa-calendar] > summary { list-style: none; cursor: pointer; } |
| 228 | details[mapa-calendar] > summary::-webkit-details-marker { display: none; } |
| 229 | [mapa-day-now] { |
| 230 | display: inline-flex; |
| 231 | align-items: center; |
| 232 | gap: var(--rst-sp-1); |
| 233 | block-size: 26px; |
| 234 | padding-inline: var(--rst-sp-2); |
| 235 | border-radius: 999px; |
| 236 | color: var(--rst-text); |
| 237 | font-size: 13px; |
| 238 | font-weight: 600; |
| 239 | } |
| 240 | [mapa-day-now]:hover, details[mapa-calendar][open] > [mapa-day-now] { background: var(--rst-surface-2); } |
| 241 | [mapa-day-now] > svg { inline-size: 15px; block-size: 15px; } |
| 242 | [mapa-month] { |
| 243 | position: absolute; |
| 244 | z-index: 40; |
| 245 | inset-block-start: calc(100% + 8px); |
| 246 | inset-inline-end: -40px; |
| 247 | inline-size: 256px; |
| 248 | padding: var(--rst-sp-3); |
| 249 | border: 1px solid var(--rst-line); |
| 250 | border-radius: 12px; |
| 251 | background: var(--rst-surface); |
| 252 | box-shadow: 0 18px 40px -16px rgb(23 32 60 / 0.35); |
| 253 | font-size: 12.5px; |
| 254 | } |
| 255 | [mapa-month-head] { display: flex; align-items: center; gap: var(--rst-sp-1); padding: 0 0 var(--rst-sp-2) var(--rst-sp-2); } |
| 256 | [mapa-month-head] strong { flex: 1; font-size: 13.5px; font-weight: 650; } |
| 257 | table[mapa-month-grid] { inline-size: 100%; border-collapse: collapse; text-align: center; } |
| 258 | table[mapa-month-grid] th { padding-block: var(--rst-sp-1); color: var(--rst-text-muted); font-size: 11px; font-weight: 600; } |
| 259 | table[mapa-month-grid] td { padding: 1px; /* spacing-allow: a hairline between days, as the week strip's */ } |
| 260 | table[mapa-month-grid] a { |
| 261 | position: relative; |
| 262 | display: grid; |
| 263 | place-items: center; |
| 264 | block-size: 30px; |
| 265 | border-radius: 8px; |
| 266 | color: var(--rst-text); |
| 267 | font-variant-numeric: tabular-nums; |
| 268 | text-decoration: none; |
| 269 | } |
| 270 | table[mapa-month-grid] a:hover { background: var(--rst-surface-2); } |
| 271 | table[mapa-month-grid] a[mapa-outside] { color: var(--rst-text-muted); opacity: 0.7; } |
| 272 | [mapa-month-foot] { display: flex; align-items: center; justify-content: space-between; gap: var(--rst-sp-2); padding: var(--rst-sp-2) 0 0 var(--rst-sp-2); color: var(--rst-text-muted); font-size: 12px; } |
| 273 | [mapa-dot] { display: inline-block; inline-size: 4px; block-size: 4px; margin-inline-end: var(--rst-sp-1); border-radius: 50%; background: var(--rst-text-muted); vertical-align: middle; } |
| 274 | [mapa-month-foot] [rst-btn] { min-block-size: 26px; padding-block: 0; font-size: 12px; } |
| 275 | |
| 276 | /* ── The phone: the panel is a sheet at the foot with a peek line; |
| 277 | the page's own foot keeps the lists, so nothing needs the sheet. ── */ |
| 278 | @media (max-width: 799.98px) { |
| 279 | aside[mapa-links] { |
| 280 | display: block; |
| 281 | inset: auto 0 0 0; |
| 282 | inline-size: auto; |
| 283 | max-block-size: 62px; |
| 284 | overflow: hidden; |
| 285 | border-radius: 18px 18px 0 0; |
| 286 | padding-block-end: env(safe-area-inset-bottom); |
| 287 | transition: max-block-size 0.25s ease; |
| 288 | } |
| 289 | aside[mapa-links][data-open] { max-block-size: 74dvh; overflow: auto; } |
| 290 | aside[mapa-links]:not([data-open]) [mapa-links-body] { visibility: hidden; } |
| 291 | [mapa-peek] { |
| 292 | display: grid; |
| 293 | justify-items: center; |
| 294 | gap: var(--rst-sp-2); |
| 295 | inline-size: 100%; |
| 296 | padding: var(--rst-sp-2) var(--rst-sp-4) var(--rst-sp-3); |
| 297 | border: 0; |
| 298 | background: none; |
| 299 | color: var(--rst-text); |
| 300 | font: 600 14px var(--rst-font); |
| 301 | cursor: pointer; |
| 302 | } |
| 303 | [mapa-peek] > span:last-child { display: inline-flex; align-items: center; gap: var(--rst-sp-2); } |
| 304 | [mapa-peek] svg { inline-size: 16px; block-size: 16px; color: var(--rst-accent); } |
| 305 | [mapa-grabber] { inline-size: 36px; block-size: 4px; border-radius: 4px; background: var(--rst-line-strong); opacity: 0.6; } |
| 306 | [mapa-doc] { padding-block-end: 140px; /* spacing-allow: the page's foot room, and clear of the sheet's 62px peek */ } |
| 307 | [mapa-month] { position: fixed; inset-inline: 12px; inset-block-start: calc(var(--mapa-bar-h) + 8px); inline-size: auto; } |
| 308 | } |
| 309 | @media (prefers-reduced-motion: reduce) { |
| 310 | aside[mapa-links] { transition: none; } |
| 311 | } |
| 312 | |