/* The leap second article's parts (includes/leap.php). Loaded after the theme's site.css, so it uses its
   colour tokens (light and dark) and reuses its flip clock, mind map, table and calculator looks. */

.prose .mtc-leap-count, .prose .mtc-leap-years, .prose .mtc-leap-since, .prose .mtc-leap-gauge { margin: 20px 0 26px; }
.prose .mtc-leap-years ol, .prose .mtc-leap-gauge ul { padding-left: 0; margin: 0; }
.prose .mtc-leap-years li, .prose .mtc-leap-gauge li { margin: 0; }
.mtc-leap-count figcaption, .mtc-leap-years figcaption, .mtc-leap-gauge figcaption { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-3); }

/* ---- Countdown ---- */
.mtc-leap-count { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
.mtc-leap-count__when { margin: 0 0 12px; line-height: 1.3; }
.mtc-leap-count__when span { display: block; font: 700 15px/1.1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.mtc-leap-count__when b { display: block; margin-top: 4px; font: 700 clamp(24px, 6.4vw, 32px)/1.1 var(--cond); letter-spacing: .02em; }
.mtc-leap-count__when small { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.mtc-leap-count__display { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 4px; padding: 14px 8px 12px; border-radius: var(--radius); background: var(--lcd); box-shadow: inset 0 0 0 2px var(--lcd-edge); text-align: center; }
.mtc-leap-count__display b { display: block; white-space: nowrap; font: 400 clamp(22px, 7vw, 50px)/1 var(--seg); color: var(--amber); }
.mtc-leap-count__display small { display: block; margin-top: 8px; font: 700 12.5px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--lcd-ink); opacity: .75; }
.mtc-leap-count.is-past .mtc-leap-count__display b { opacity: .45; }
.mtc-leap-count__mine { margin: 12px 0 0; font-size: 15.5px; color: var(--ink-2); }
.mtc-leap-count .mtc-zulu__table { margin-top: 14px; }
.mtc-table--leap td small { white-space: nowrap; }
@media (max-width: 479px) {
	.mtc-table--leap th, .mtc-table--leap td { padding-top: 7px; padding-bottom: 7px; }
	.mtc-table--leap tbody th { font-size: 15px; }
	.mtc-table--leap tbody th small { font-size: 12.5px; }
	.mtc-table--leap td b { font-size: 19px; }
}
.mtc-table--leap tr.is-zulu { background: var(--amber-soft); }

/* ---- Flip clock (the theme's .mtc-flip and .mtc-flip--now cards) ---- */
.mtc-leap-flip__day { margin: 0 0 14px; font: 700 15px/1.2 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--dark-ink-2); }
.mtc-leap-flip__count { margin: 12px 0 0; font: 700 18px/1.2 var(--cond); letter-spacing: .04em; color: var(--dark-ink); }
.mtc-leap-flip.is-leap .mtc-leap-flip__count { color: var(--amber); }
.mtc-leap-flip .mtc-flip__card--sec { transition: box-shadow .2s; }
.mtc-leap-flip.is-leap .mtc-flip__card--sec { box-shadow: 0 6px 10px -4px rgba(0, 0, 0, .8), inset 0 0 0 2px var(--amber); }
.mtc-leap-flip__controls { flex-direction: column; }
.mtc-leap-flip__modes { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.mtc-leap-flip__label { width: 100%; font: 700 14px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--dark-ink-2); }
.mtc-leap-flip__mode { min-height: 40px; padding: 0 12px; border-radius: 8px; border: 2px solid #3D4736; background: transparent; color: var(--dark-ink); font: 700 15px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.mtc-leap-flip__mode:hover { background: rgba(255, 255, 255, .06); }
.mtc-leap-flip__mode[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }
.mtc-leap-flip .mtc-btn[aria-disabled="true"] { opacity: .6; cursor: default; }
@media (prefers-reduced-motion: reduce) { .mtc-leap-flip .mtc-flip__card--sec { transition: none; } }

/* ---- Every leap second: a row of ten years per decade, each year's box split June 30 (top) / December 31 (bottom) ---- */
.mtc-leap-years { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); }
.mtc-leap-years__head, .mtc-leap-years__row { display: grid; grid-template-columns: 3.3em minmax(0, 1fr) 2.6em; gap: 8px; align-items: center; }
.mtc-leap-years__head { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.mtc-leap-years__head .mtc-leap-years__key { grid-column: 1 / 3; }
.mtc-leap-years__head > span:last-child { white-space: nowrap; font: 700 12px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; text-align: right; }
.mtc-leap-years__key small { color: var(--ink-3); }
.mtc-leap-years__row { padding: 6px 0; border-top: 1px solid var(--line); }
.mtc-leap-years__decade { font: 700 17px/1 var(--cond); letter-spacing: .03em; }
.mtc-leap-years__count { font: 700 22px/1 var(--cond); text-align: right; }
.mtc-leap-years__cells { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.mtc-leap-years__year { text-align: center; }
.mtc-leap-years__year small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1; color: var(--ink-3); }
.mtc-leap-years__box { display: grid; grid-template-rows: 1fr 1fr; height: 34px; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; background: var(--bg); }
.mtc-leap-years__half + .mtc-leap-years__half { border-top: 1px solid var(--line); }
.mtc-leap-years__half.is-on { background: var(--amber); }
.mtc-leap-years__half.is-ruled { background: repeating-linear-gradient(135deg, var(--line-2) 0 2px, transparent 2px 5px); }
.mtc-leap-years__half.is-gone { background: var(--brand); opacity: .55; }
.mtc-leap-years__year.is-before .mtc-leap-years__box, .mtc-leap-years__year.is-after .mtc-leap-years__box { border-style: dashed; background: transparent; }
.mtc-leap-years__foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.mtc-leap-years i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line-2); border-radius: 2px; }
.mtc-leap-years i.is-on { background: var(--amber); border-color: var(--amber); }
.mtc-leap-years i.is-before { border-style: dashed; }
.mtc-leap-years i.is-ruled { background: repeating-linear-gradient(135deg, var(--line-2) 0 2px, transparent 2px 5px); }
.mtc-leap-years i.is-gone { background: var(--brand); opacity: .55; }
@media (min-width: 600px) {
	.mtc-leap-years { padding: 20px; }
	.mtc-leap-years__head, .mtc-leap-years__row { grid-template-columns: 4em minmax(0, 1fr) 3em; gap: 12px; }
	.mtc-leap-years__cells { gap: 6px; }
	.mtc-leap-years__box { height: 40px; }
	.mtc-leap-years__year small { font-size: 12px; }
}

/* The list of every leap second, in columns: the day it ended, and TAI−UTC after it. */
.mtc-leap-list__head { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font: 700 13px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.mtc-leap-list { list-style: none; margin: 8px 0 0 !important; padding: 0 !important; columns: 2; column-gap: 20px; counter-reset: leap; }
.mtc-leap-list li { display: flex; justify-content: space-between; gap: 6px; break-inside: avoid; padding: 3px 0 3px 1.9em; position: relative; font-size: 14.5px; line-height: 1.3; border-bottom: 1px dashed var(--line); counter-increment: leap; }
.mtc-leap-list li::before { content: counter(leap); position: absolute; left: 0; top: 4px; width: 1.5em; text-align: right; font: 700 13px/1.3 var(--cond); color: var(--ink-3); }
.mtc-leap-list li b { font-weight: 600; white-space: nowrap; }
.mtc-leap-list li span { white-space: nowrap; color: var(--ink-2); }
@media (min-width: 760px) { .mtc-leap-list { columns: 3; column-gap: 28px; } }

/* ---- Leap seconds since a date (the theme's .mtc-calc) ---- */
.mtc-leap-since .mtc-conv__input { max-width: 14em; }
.mtc-leap-since__say { margin: 12px 0 0; font-size: 16px; }

/* ---- Gauge: UT1−UTC on a bar from −span to +span ---- */
.mtc-leap-gauge { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
.mtc-leap-gauge__bar + .mtc-leap-gauge__bar, .mtc-leap-gauge__zoom + .mtc-leap-gauge__bar { margin-top: 18px; }
.mtc-leap-gauge__title { margin: 0 0 8px; font: 700 16px/1.2 var(--cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.mtc-leap-gauge__track { position: relative; height: 34px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line-2); overflow: hidden; }
.mtc-leap-gauge__new { position: absolute; top: 0; bottom: 0; background: rgba(61, 74, 44, .34); }
.mtc-leap-gauge__bar[data-gauge="bar"]:not(.is-out) .mtc-leap-gauge__new { display: none; }
.mtc-leap-gauge__old { position: absolute; top: 5px; bottom: 5px; min-width: 2px; border-radius: 3px; background: var(--amber); }
.mtc-leap-gauge__zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--ink-3); opacity: .5; }
.mtc-leap-gauge__mark { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid var(--surface); z-index: 2; }
.mtc-leap-gauge__mark.is-value { background: var(--ink); }
.mtc-leap-gauge__mark.is-forecast { background: var(--surface); border-color: var(--ink); }
.mtc-leap-gauge__bar.is-wide .mtc-leap-gauge__mark { display: none; }
.mtc-leap-gauge__ends { display: flex; justify-content: space-between; margin: 5px 0 0; font: 700 14px/1 var(--cond); letter-spacing: .04em; color: var(--ink-3); }
.mtc-leap-gauge__zoom { margin-top: 14px; }
.mtc-leap-gauge__zoom label { display: block; font: 700 15px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.mtc-leap-gauge__range { display: block; width: 100%; margin: 10px 0 6px; accent-color: #C98400; }
.mtc-leap-gauge__read { margin: 0; font-size: 15px; color: var(--ink-2); }
.mtc-leap-gauge__key { list-style: none; display: grid; gap: 6px; margin: 16px 0 0 !important; padding: 12px 0 0 !important; border-top: 1px solid var(--line); font-size: 14.5px; }
.mtc-leap-gauge__key i { display: inline-block; width: 18px; height: 12px; margin-right: 8px; vertical-align: -1px; border-radius: 3px; }
.mtc-leap-gauge__key i.is-old { background: var(--amber); }
.mtc-leap-gauge__key i.is-new { background: rgba(61, 74, 44, .34); }
.mtc-leap-gauge__key i.is-value, .mtc-leap-gauge__key i.is-forecast { width: 12px; height: 12px; margin: 0 14px 0 3px; border-radius: 50%; }
.mtc-leap-gauge__key i.is-value { background: var(--ink); }
.mtc-leap-gauge__key i.is-forecast { border: 2px solid var(--ink); }
@media (min-width: 600px) { .mtc-leap-gauge { padding: 22px; } .mtc-leap-gauge__key { grid-template-columns: 1fr 1fr; } }
@media (prefers-color-scheme: dark) {
	.mtc-leap-gauge__new, .mtc-leap-gauge__key i.is-new { background: rgba(185, 214, 142, .24); }
}
