/* making-tax-digital-deadlines: the almanac. A slim rail of dates runs down the left of the page,
   to scale, with the prose to its right; on a phone the rail becomes a row of five dates at the top.
   Also the strip (one tax year drawn to scale) and the page's tables. Tokens from site.css only. */

.entry-body:has(> .almanac) { max-width: none; }
.almanac { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 0 40px; align-items: start; }
.almanac-text { min-width: 0; grid-column: 2; grid-row: 1; }
/* the rail comes after the text in the page's source (it is a list of links, read last) and is drawn on the left */
.almanac > .dl-rail { grid-column: 1; grid-row: 1; }
.almanac-text > p, .almanac-text > ul, .almanac-text > ol, .almanac-text > h2, .almanac-text > h3, .almanac-text > .src { max-width: 40em; }
.almanac-text > p:first-child { font-size: 21px; line-height: 1.5; color: var(--ink); }
.almanac-text > p:first-child .f:not([data-fig]) { color: var(--red); }
/* the theme's article lists indent and space their items: this page's drawn lists are not prose */
.entry-body .dl-rail ol, .entry-body .dl-strip ol, .entry-body .dl-strip ul { margin: 0; padding: 0; list-style: none; }
.entry-body .dl-rail li, .entry-body .dl-strip li { margin: 0; }
.almanac-text > h2 { font-size: 32px; margin: 76px 0 14px; scroll-margin-top: 20px; }
.almanac-text > h3 { font-size: 22px; margin: 40px 0 4px; }
.almanac-text > h3 + figure.facts { margin-top: 10px; }
.almanac-text > p[id] { scroll-margin-top: 20px; }
.almanac-text > .src { margin-top: -4px; max-width: 720px; }

/* ---------------------------------------------------------------- the date rail */
.dl-rail { position: sticky; top: 24px; height: min(700px, calc(100vh - 48px)); min-height: 420px; display: flex; flex-direction: column; padding: 6px 0 4px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rail-head { margin: 0 0 24px; font-size: 12px; line-height: 1.35; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rail-head b { display: block; font-family: var(--cond); font-size: 24px; letter-spacing: -.01em; text-transform: none; color: var(--ink); line-height: 1.05; }
.entry-body .dl-rail .rail-track { position: relative; flex: 1 1 auto; margin: 0 0 0 30px; border-left: 2px solid var(--ink); }
.rail-track li { margin: 0; }
.rail-months { position: absolute; inset: 0 auto 0 -30px; width: 30px; }
.rail-months ol { height: 100%; position: relative; }
.rm { position: absolute; left: 0; width: 30px; top: calc(var(--a) * 100%); font-size: 11px; line-height: 1; color: var(--ink-4); padding-top: 2px; border-top: 1px solid var(--rule); }
.rm i { position: absolute; left: 0; top: -14px; font-style: normal; font-size: 11px; letter-spacing: .02em; color: var(--ink-3); }
.rm.jan { border-top-color: var(--ink-3); color: var(--ink-2); }
.rp { position: absolute; left: -2px; right: 0; top: calc(var(--a) * 100%); transform: translateY(-50%); }
.rp a { display: block; position: relative; padding: 3px 0 3px 16px; text-decoration: none; color: var(--ink); line-height: 1.15; border-radius: 0; }
.rp a::before { content: ""; position: absolute; left: 0; top: 50%; width: 11px; height: 2px; background: var(--red); }
.rp b { display: block; font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.rp span { display: block; font-family: var(--sans); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.rp em { font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--red); text-transform: uppercase; }
.rp.ret b { font-size: 15px; }
.rp.ret a::before { width: 14px; height: 3px; margin-top: -1px; background: var(--ink); }
.rp a:hover b { color: var(--link); }
.rp.past a { color: var(--ink-4); }
.rp.past a::before { background: var(--mute); }
.rp.past em { color: var(--ink-4); }
.rp.next b { color: var(--red); }
.rp.next a::before { height: 4px; margin-top: -1px; width: 13px; }
.rail-dial { position: absolute; left: -7px; top: calc(var(--a) * 100%); width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--paper); transition: top 160ms var(--ease); pointer-events: none; }
.rail-dial::after { content: ""; position: absolute; left: 12px; top: 5px; width: 74px; height: 1px; background: linear-gradient(90deg, var(--red), transparent); opacity: .45; }
.rail-dial.off { display: none; }
.rail-foot { margin: 30px 0 0; font-size: 11px; line-height: 1.4; letter-spacing: .04em; color: var(--ink-4); }

/* ---------------------------------------------------------------- one tax year on one strip */
.dl-strip { margin: 30px 0 30px; padding: 22px 24px 18px; background: var(--card); border: 1px solid var(--rule); }
.dl-strip figcaption { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: baseline; margin: 0 0 18px; }
.dl-strip figcaption b { font-family: var(--cond); font-size: 24px; letter-spacing: -.01em; }
.dl-strip figcaption span { font-size: 14px; color: var(--ink-3); }
.strip { position: relative; margin-left: 92px; padding-top: 52px; }
.strip-year, .strip-after { position: absolute; top: 0; height: 24px; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.strip-year { border-top: 3px solid var(--ink); color: var(--ink); }
.strip-after { border-top: 3px solid var(--red); color: var(--red); }
.strip-year span, .strip-after span { display: block; padding: 5px 6px 0; white-space: nowrap; }
.entry-body .dl-strip .strip-axis { position: absolute; top: 28px; left: 0; right: 0; bottom: 0; }
.strip-axis li { position: absolute; top: 0; bottom: 0; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); margin: 0; border-left: 1px solid var(--rule-2); font-family: var(--mono); font-size: 10px; line-height: 1; color: var(--ink-4); }
.strip-axis li:nth-child(odd) { background: var(--wash-2); }
.strip-axis li span { display: block; padding: 3px 0 0 3px; }
.strip-axis li.yr { border-left: 1px solid var(--ink-3); }
.strip-axis li i { position: absolute; left: 3px; bottom: -16px; font-style: normal; color: var(--ink-3); }
.entry-body .dl-strip .strip-rows { position: relative; padding-top: 18px; }
.srow { position: relative; height: 46px; margin: 0; }
.srow .lbl { position: absolute; right: 100%; top: 14px; margin-right: 14px; font-family: var(--mono); font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--ink); }
.srow .lbl .short { display: none; }
.bar { position: absolute; top: 15px; height: 14px; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); }
.bar.new { background: var(--ink); }
.bar.old { background: repeating-linear-gradient(135deg, var(--mute) 0 1.5px, var(--wash) 1.5px 5px); box-shadow: inset 0 0 0 1px var(--rule); }
.send { position: absolute; top: 21px; height: 0; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); border-top: 2px dotted var(--red); }
.pin { position: absolute; top: 6px; left: calc(var(--a) * 100%); height: 32px; padding: 0 0 0 7px; border-left: 2px solid var(--red); font-family: var(--mono); font-weight: 600; font-size: 12px; line-height: 32px; color: var(--red); white-space: nowrap; }
.pin small { font-weight: 400; font-size: 11px; color: var(--ink-3); }
.pin.wk small { color: var(--red); }
.pin.end { transform: translateX(-100%); border-left: 0; border-right: 3px solid var(--red); padding: 0 8px 0 6px; background: var(--card); }
.srow.ret .send { border-top-color: var(--ink-4); }
.entry-body .dl-strip .strip-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 34px 0 0; padding: 12px 0 0; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }
.strip-key li { margin: 0; display: flex; align-items: center; gap: 8px; }
.strip-key i { display: inline-block; width: 22px; height: 10px; }
.strip-key .k-new { background: var(--ink); }
.strip-key .k-old { background: repeating-linear-gradient(135deg, var(--mute) 0 1.5px, var(--wash) 1.5px 5px); box-shadow: inset 0 0 0 1px var(--rule); }
.strip-key .k-send { height: 0; border-top: 2px dotted var(--red); }
.strip-key .k-pin { width: 2px; height: 14px; background: var(--red); }
.strip-poa { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); max-width: 46em; }
.dl-strip .src { margin-top: 10px; }

/* the deadline tables: each due date in red, as in an almanac's margin; the return in ink */
.almanac-text .facts-table tbody td.fig:first-child { color: var(--red); }
.almanac-text .facts-table tbody tr:last-child td.fig:first-child { color: var(--ink); }
.almanac-text .facts-table td.fig small { font-weight: 400; color: var(--ink-3); }
.almanac-text .dl-weekends .facts-table tbody tr:last-child td.fig:first-child { color: var(--red); }

/* ---------------------------------------------------------------- a tax year's deadlines as calendar leaves */
.dl-alm { margin: 14px 0 30px; }
.dl-alm figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 12px; }
.dl-alm figcaption b { font-family: var(--cond); font-size: 19px; }
.dl-alm figcaption span { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.entry-body .dl-alm .alm-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 14px; margin: 0; padding: 0; list-style: none; }
.entry-body .dl-alm .alm-e { margin: 0; min-width: 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.cal-leaf { display: grid; grid-template-rows: auto auto auto; justify-items: center; margin: 0 0 10px; padding: 0 0 8px; border: 1px solid var(--rule); border-top: 0; background: var(--card); box-shadow: 0 1px 0 var(--rule), 0 10px 18px -16px rgba(23, 32, 51, .45); text-align: center; }
.lf-m { justify-self: stretch; padding: 4px 0 3px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border-top: 2px dotted var(--paper); }
.lf-d { font-family: var(--cond); font-weight: 700; font-size: 46px; line-height: 1; padding-top: 6px; color: var(--red); font-variant-numeric: tabular-nums; }
.lf-w { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-3); }
.cal-leaf.wk .lf-w { color: var(--red); font-weight: 600; }
.cal-leaf.wk .lf-w::after { content: " · weekend"; font-weight: 400; }
.cal-leaf.ret .lf-d { color: var(--ink); }
.cal-leaf.ret .lf-m { background: var(--slate); }
.alm-e p { margin: 0 0 3px; }
.alm-what b { display: block; font-family: var(--cond); font-size: 17px; color: var(--ink); }
.alm-cover { font-size: 13px; color: var(--ink-3); }
.alm-late { padding-top: 5px; margin-top: 6px !important; border-top: 1px solid var(--rule-2); font-size: 13px; color: var(--ink-2); }
.alm-ann, .entry-body .dl-alm .alm-notes { margin: 16px 0 0; font-size: 14px; color: var(--ink-3); max-width: 50em; }
.entry-body .dl-alm .alm-notes { padding-left: 18px; }
.entry-body .dl-alm .alm-notes li { margin: 0 0 6px; }
.alm-ann { padding-left: 10px; border-left: 2px solid var(--red); color: var(--ink-2); }
.dl-alm .src { margin-top: 10px; }

/* the weekend table: the day in red, as a warning the date itself carries */
.dl-weekends td:nth-child(2) { color: var(--red); font-family: var(--mono); font-size: 14px; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1099px) {
	.almanac { grid-template-columns: 104px minmax(0, 1fr); gap: 0 28px; }
}
@media (max-width: 700px) {
	.almanac { display: flex; flex-direction: column; }
	.almanac > .dl-rail { order: -1; }
	.almanac-text > p:first-child { font-size: 19px; }
	.almanac-text > h2 { font-size: 26px; margin-top: 56px; }
	.almanac-text > h3 { font-size: 20px; }
	/* the rail becomes the year's five dates in a row */
	.dl-rail { position: static; height: auto; min-height: 0; margin: 0 0 26px; padding: 10px 0 0; border-top: 3px solid var(--ink); }
	.rail-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 8px; }
	.rail-head b { display: inline; font-size: 20px; }
	.entry-body .dl-rail .rail-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border-left: 0; border-bottom: 1px solid var(--rule); }
	.rail-months, .rail-dial, .rail-foot { display: none; }
	.rp { position: static; transform: none; }
	.rp a { padding: 8px 2px 10px 6px; min-height: 52px; border-left: 1px solid var(--rule); }
	.rp:first-of-type a { border-left: 0; padding-left: 0; }
	.rp a::before { left: 0; top: 0; width: 100%; height: 3px; background: transparent; }
	.rp.next a::before { background: var(--red); }
	.rp.next a::after { content: none; }
	.rp b { font-size: 14px; }
	.rail-head { font-size: 12px; }
	.rp span { font-size: 12px; white-space: normal; }
	.rp em { display: block; font-size: 12px; }

	/* the leaves stack: one a line, the leaf beside its words */
	.entry-body .dl-alm .alm-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.entry-body .dl-alm .alm-e { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 0 14px; align-items: start; font-size: 15px; }
	.dl-alm .cal-leaf { grid-row: 1 / span 4; margin: 0; }
	.lf-d { font-size: 38px; }
	.cal-leaf.wk .lf-w::after { content: none; }
	.alm-cover, .alm-late { font-size: 15px; }
	.alm-ann, .entry-body .dl-alm .alm-notes { font-size: 15px; }

	/* the weekend table becomes one entry a date, as in a diary: the date, then the day and what is due */
	.almanac-text > figure.facts .facts-table thead { display: none; }
	.almanac-text > figure.facts .facts-table tr { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 3px 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
	.almanac-text > figure.facts .facts-table tbody tr:first-child { border-top: 2px solid var(--ink); }
	.almanac-text > figure.facts .facts-table td { padding: 0; border: 0; }
	.almanac-text > figure.facts .facts-table td:nth-child(3) { grid-column: 2; font-size: 13px; color: var(--ink-3); }
	.almanac-text > figure.facts .facts-table td.fig { font-size: 14px; white-space: normal; }

	/* the strip turns on its side: time runs down the page */
	.dl-strip { padding: 16px 14px 14px; margin-left: 0; margin-right: 0; }
	.dl-strip figcaption b { font-size: 21px; }
	.strip { margin-left: 0; padding: 0; height: 820px; margin-top: 26px; }
	.strip-year, .strip-after { top: calc(var(--a) * 100%); height: calc((var(--b) - var(--a)) * 100%); left: 0; width: 0; border-top: 0; border-left: 3px solid var(--ink); }
	.strip-after { border-left-color: var(--red); }
	.strip-year span, .strip-after span { position: absolute; left: 6px; top: 4px; padding: 0; writing-mode: vertical-rl; font-size: 12px; }
	.entry-body .dl-strip .strip-axis { top: 0; left: 26px; }
	.strip-axis li { top: calc(var(--a) * 100%); height: calc((var(--b) - var(--a)) * 100%); bottom: auto; left: 0; right: 0; width: auto; border-left: 0; border-top: 1px solid var(--rule-2); }
	.strip-axis li.yr { border-left: 0; border-top-color: var(--ink-3); }
	.strip-axis li { font-size: 12px; }
	.strip-axis li span { padding: 3px 0 0 2px; }
	.strip-axis li i { left: 2px; top: 17px; bottom: auto; font-size: 12px; }
	.entry-body .dl-strip .strip-rows { position: absolute; top: 0; bottom: 0; left: 62px; right: 0; padding: 0; }
	.srow { position: static; height: auto; }
	.srow .lbl { right: auto; top: -22px; left: calc(var(--c) * 21px); width: 14px; margin: 0; text-align: center; font-size: 12px; }
	.srow .lbl .long { display: none; }
	.srow.ret .lbl .short { display: inline; }
	.bar { top: calc(var(--a) * 100%); height: calc((var(--b) - var(--a)) * 100%); left: calc(var(--c) * 21px); width: 14px; }
	.send { top: calc(var(--a) * 100%); height: calc((var(--b) - var(--a)) * 100%); left: calc(var(--c) * 21px + 6px); width: 0; border-top: 0; border-left: 2px dotted var(--red); }
	.srow.ret .send { border-left-color: var(--ink-4); }
	.pin, .pin.end { top: calc(var(--a) * 100%); left: calc(var(--c) * 21px); right: 0; height: 0; transform: none; border: 0; border-top: 2px solid var(--red); padding: 0; line-height: 1.2; text-align: right; }
	.pin b, .pin small { position: absolute; right: 0; background: var(--card); padding-left: 4px; white-space: nowrap; }
	.pin b { bottom: 3px; }
	.pin small { top: 3px; }
	.entry-body .dl-strip .strip-key { margin-top: 18px; font-size: 13px; gap: 6px 14px; }
	.strip-poa { font-size: 15px; }
	.pin small { font-size: 12px; }
	.dl-strip figcaption span { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
	.rail-dial { transition: none; }
}
@media print {
	.dl-rail { position: static; height: auto; }
}
