/* The AM and PM articles' parts (includes/ampm.php). Loads after site.css and uses its tokens, so dark
   mode follows them; the dial and the flip clock are objects with their own fixed colours, as the site's
   other flip clock is. */

.prose .mtc-ampm-dial, .prose .mtc-ampm-halves, .prose .mtc-ampm-table, .prose .mtc-ampm-write, .prose .mtc-ampm-flip,
.prose .mtc-ampm-edge, .prose .mtc-ampm-quiz { margin: 20px 0 26px; }
.mtc-ampm__label { display: block; margin: 0 0 8px; font: 700 15px/1.1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }

/* ---- The day dial: a 24-hour dial tilted like a table, the sun on its ring, the meridian standing on it ---- */

.mtc-ampm-dial { --w: min(70vw, 330px); overflow: clip; display: grid; gap: 4px 24px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
@media (min-width: 760px) {
	.mtc-ampm-dial { --w: 320px; grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: 20px 22px; }
	.mtc-ampm-dial figcaption { grid-column: 1 / -1; }
}
.mtc-ampm-dial__stage { display: grid; place-items: center; perspective: 1000px; perspective-origin: 50% 0; }
.mtc-ampm-dial__disc {
	position: relative; width: var(--w); height: var(--w); border-radius: 50%;
	margin: calc(var(--w) * -.2 + 70px) 0 calc(var(--w) * -.2 + 44px);
	transform: rotateX(56deg) rotateZ(-24deg); transform-style: preserve-3d;
}
/* The dial's edge: a darker disc a little below the face. */
.mtc-ampm-dial__disc::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #1B2117; transform: translateZ(-14px); box-shadow: 0 0 0 1px #0E120B, 0 12px 22px rgba(0, 0, 0, .3); }
.mtc-ampm-dial__face { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mtc-ampm-dial__base { fill: #3D4A2C; }
.mtc-ampm-dial__half.is-am { fill: #F3F1EA; }
.mtc-ampm-dial__half.is-pm { fill: #E7E2D2; }
.mtc-ampm-dial__hour { stroke: #3D4A2C; stroke-width: 1; }
.mtc-ampm-dial__hour.is-night { fill: #1F2A3A; }
.mtc-ampm-dial__hour.is-morning { fill: #F2D58A; }
.mtc-ampm-dial__hour.is-afternoon { fill: #F0B44C; }
.mtc-ampm-dial__hour.is-evening { fill: #A0522D; }
.mtc-ampm-dial__mil { font: 700 15px var(--cond); text-anchor: middle; fill: #3A2C05; }
.mtc-ampm-dial__mil.is-night { fill: #DCE4F2; }
.mtc-ampm-dial__mil.is-evening { fill: #FFF4EA; }
.mtc-ampm-dial__std { font: 700 17px var(--cond); text-anchor: middle; fill: #15171A; }
.mtc-ampm-dial__tick { stroke: #62676E; stroke-width: 2; }
.mtc-ampm-dial__line { stroke: #C98400; stroke-width: 3; stroke-dasharray: 9 7; }
.mtc-ampm-dial__big { font: 700 40px var(--cond); text-anchor: middle; fill: #15171A; letter-spacing: .02em; }
.mtc-ampm-dial__small { font: 400 italic 15px var(--font); text-anchor: middle; fill: #464B52; }
/* The meridian: a half disc standing on the line from midnight to noon. */
.mtc-ampm-dial__meridian {
	position: absolute; left: 50%; top: 0; width: 40%; height: 100%; transform-origin: 0 50%; transform: rotateY(-90deg);
	border: 2px solid rgba(201, 132, 0, .8); border-left: 0; border-radius: 0 100% 100% 0 / 0 50% 50% 0;
	background: linear-gradient(90deg, rgba(255, 176, 31, .34), rgba(255, 176, 31, .06)); pointer-events: none;
}
/* The sun rides the ring on an arm (a point at the dial's centre) turned to the time; it is turned back and stood up to face the reader. */
.mtc-ampm-dial__arm { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; transition: transform .45s ease; }
.mtc-ampm-dial__sun {
	position: absolute; left: calc(var(--w) * -.065); top: calc(var(--w) * -.56); width: calc(var(--w) * .13); height: calc(var(--w) * .13); border-radius: 50%; transform-origin: 50% 100%;
	background: radial-gradient(circle at 36% 30%, #FFF8DC 0, #FFD25A 26%, #FFB01F 56%, #B26A00 100%);
	box-shadow: inset -3px -4px 8px rgba(120, 60, 0, .45); transition: transform .45s ease;
}
.mtc-ampm-dial__shadow { position: absolute; left: calc(var(--w) * -.06); top: calc(var(--w) * -.46); width: calc(var(--w) * .12); height: calc(var(--w) * .06); border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); }
.mtc-ampm-dial__controls { margin-bottom: 14px; }
.mtc-ampm-dial__row { display: flex; gap: 8px; }
.mtc-ampm-dial__range { display: block; width: 100%; margin: 14px 0 0; accent-color: #C98400; }
.mtc-ampm-dial__out p { margin: 0; }
.mtc-ampm-dial__time { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.mtc-ampm-dial__time > b:first-child { font: 700 clamp(34px, 9vw, 44px)/1 var(--cond); letter-spacing: .01em; }
.mtc-ampm-dial__time > span { font-size: 15px; color: var(--ink-3); }
.mtc-ampm-dial__mil-out { padding: 8px 10px 6px; border-radius: 8px; background: var(--lcd); box-shadow: inset 0 0 0 2px var(--lcd-edge); color: var(--amber); font: 400 26px/1 var(--seg); }
.mtc-ampm-dial__word { margin-top: 12px !important; padding-top: 10px; border-top: 1px solid var(--line); font: 700 18px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.mtc-ampm-dial__more { margin-top: 6px !important; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.mtc-ampm-dial figcaption { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-3); }
.mtc-ampm-dial.is-error .mtc-ampm-dial__time, .mtc-ampm-dial.is-error .mtc-ampm-dial__word { opacity: .35; }
.mtc-ampm-dial.is-error .mtc-ampm-dial__more { color: var(--error); }
@media (prefers-color-scheme: dark) { .mtc-ampm-dial__word { color: #CFE3AE; } }
@media (prefers-reduced-motion: reduce) { .mtc-ampm-dial__arm, .mtc-ampm-dial__sun { transition: none; } }

/* ---- The two halves of the day ---- */

.mtc-ampm-halves { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mtc-ampm-halves__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 0 14px; }
/* The two heads share one row (subgrid), so 12 AM and 12 PM start level however the heads wrap. */
.mtc-ampm-halves__col { display: grid; grid-row: span 2; grid-template-rows: subgrid; align-content: start; }
.mtc-ampm-halves__head { align-self: end; }
@media (min-width: 600px) { .mtc-ampm-halves__cols { gap: 0 28px; } }
.mtc-ampm-halves__head { margin: 0 0 6px; padding-bottom: 8px; border-bottom: 3px solid var(--c); font-size: 13px; line-height: 1.3; color: var(--ink-3); }
.mtc-ampm-halves__head b { display: block; font: 700 32px/1 var(--cond); letter-spacing: .02em; color: var(--ink); }
.mtc-ampm-halves__head span { display: block; margin-top: 2px; font: 700 14px/1.2 var(--cond); letter-spacing: .06em; color: var(--ink-2); }
.mtc-ampm-halves__col.is-am { --c: var(--line-2); }
.mtc-ampm-halves__col.is-pm { --c: var(--amber); }
.prose .mtc-ampm-halves ol, .prose .mtc-ampm-halves ul { list-style: none; padding: 0; margin: 0; }
.prose .mtc-ampm-halves li { margin: 0; }
.mtc-ampm-halves__col li { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 9px; padding: 5px 0; border-top: 1px dashed var(--line); }
.mtc-ampm-halves__col li:first-child { border-top: 0; }
.mtc-ampm-halves__col li::before { content: ""; grid-row: 1 / 3; align-self: stretch; border-radius: 3px; background: var(--part); }
.mtc-ampm-halves__std { font: 700 19px/1.1 var(--cond); letter-spacing: .02em; }
.mtc-ampm-halves__mil { font: 700 19px/1.1 var(--cond); letter-spacing: .05em; text-decoration: none; text-align: right; }
.mtc-ampm-halves__mil:hover { text-decoration: underline; }
.mtc-ampm-halves__rule { grid-column: 2 / 4; font-size: 12px; line-height: 1.2; color: var(--ink-3); }
.mtc-ampm-halves__col li.is-twelve .mtc-ampm-halves__rule { font-weight: 600; color: var(--ink); }
@media (min-width: 480px) {
	.mtc-ampm-halves__col li { grid-template-columns: 6px minmax(0, 1fr) auto 4.6em; grid-template-rows: auto; }
	.mtc-ampm-halves__col li::before { grid-row: auto; }
	.mtc-ampm-halves__rule { grid-column: auto; text-align: right; font-size: 13px; }
}
.is-night { --part: #1F2A3A; }
.is-morning { --part: #F2D58A; }
.is-afternoon { --part: #F0B44C; }
.is-evening { --part: #A0522D; }
@media (prefers-color-scheme: dark) { .mtc-ampm-halves .is-night, .mtc-ampm-halves__key .is-night { --part: #4A5F82; } }
.mtc-ampm-halves__key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px !important; font-size: 14px; color: var(--ink-2); }
.mtc-ampm-halves__key i { display: inline-block; width: 14px; height: 14px; margin-right: 6px; border-radius: 3px; vertical-align: -2px; background: var(--part); }
.mtc-ampm-halves figcaption { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-3); }

/* ---- Tables: what each source says (rows stack on a phone) ---- */

.mtc-ampm-table { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.mtc-table--ampm caption { padding: 12px 14px 10px; text-align: left; font: 700 15px/1.25 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.mtc-table--ampm thead th span { font: 500 12.5px/1.2 var(--font); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.mtc-table--ampm tbody th { font: 600 16px/1.25 var(--font); letter-spacing: 0; }
.mtc-table--ampm tbody th small { display: block; margin-top: 2px; font-weight: 400; font-size: 13.5px; color: var(--ink-3); }
.mtc-table--ampm td { font-size: 15px; line-height: 1.45; }
.mtc-table--ampm td b, .mtc-table--ampm td a { font: 700 19px/1.15 var(--cond); letter-spacing: .02em; }
.mtc-table--who td b { font-size: 17px; }
@media (max-width: 599px) {
	.mtc-table--ampm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
	.mtc-table--ampm, .mtc-table--ampm tbody, .mtc-table--ampm tr, .mtc-table--ampm th, .mtc-table--ampm td { display: block; width: auto; }
	.mtc-table--ampm caption { display: block; }
	.mtc-table--ampm tr { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
	.mtc-table--ampm tbody tr:last-child { border-bottom: 0; }
	.mtc-table--ampm th, .mtc-table--ampm td { padding: 2px 0 !important; border: 0 !important; }
	.mtc-table--ampm tbody th { margin-bottom: 4px; }
	.mtc-table--ampm td { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 8px; align-items: baseline; }
	.mtc-table--ampm td::before { content: attr(data-label); font: 700 12.5px/1.3 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
}

/* ---- Write a time each way ---- */

.mtc-ampm-write { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
.mtc-ampm-write__out { display: grid; gap: 10px; margin: 14px 0 0; }
@media (min-width: 600px) { .mtc-ampm-write__out { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mtc-ampm-write__out > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }
.mtc-ampm-write__out dt { font: 700 13px/1.2 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.mtc-ampm-write__out dd { margin: 4px 0 0; font: 700 22px/1.2 var(--cond); letter-spacing: .02em; }
.mtc-ampm-write__note { margin: 10px 0 0; font-size: 14px; color: var(--ink-3); }
.mtc-ampm-write.is-error .mtc-ampm-write__note { color: var(--error); }
.mtc-ampm-write.is-error .mtc-ampm-write__out { opacity: .35; }

/* ---- The flip clock through 12 o'clock (the site's flip clock, with day and AM/PM cards) ---- */

.mtc-ampm-flip .mtc-flip__stage { display: grid; justify-items: center; }
.mtc-ampm-flip__label { margin: 14px 0 8px; font: 700 13px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--dark-ink-2); }
.mtc-ampm-flip__label:first-child { margin-top: 4px; }
.mtc-ampm-flip .mtc-flip__clock { align-items: center; }
.mtc-ampm-flip .mtc-flip__card { width: clamp(28px, 9vw, 60px); height: clamp(44px, 13.5vw, 88px); font-size: clamp(32px, 10vw, 66px); }
.mtc-ampm-flip .mtc-ampm-flip__card--day, .mtc-ampm-flip .mtc-ampm-flip__card--ap { width: clamp(42px, 13vw, 86px); font-size: clamp(18px, 5.6vw, 36px); letter-spacing: .04em; }
.mtc-ampm-flip .mtc-ampm-flip__card--day { margin-right: clamp(4px, 1.6vw, 12px); }
.mtc-ampm-flip__colon { font: 700 clamp(26px, 8vw, 54px)/1 var(--cond); color: #F3F1EA; margin: 0 -1px; }
.mtc-ampm-flip__pick { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.mtc-ampm-flip__pick .mtc-btn { background: transparent; border-color: #4A5640; color: var(--dark-ink); }
.mtc-ampm-flip__pick .mtc-btn[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #15171A; }
.prose .mtc-ampm-flip__steps { list-style: none; display: grid; gap: 6px; max-width: 30em; margin: 16px auto 0; padding: 0; text-align: left; counter-reset: step; }
.prose .mtc-ampm-flip__steps li { margin: 0; }
.mtc-ampm-flip__steps li { position: relative; padding: 8px 10px 8px 36px; border: 1px solid #3A4532; border-radius: var(--radius-sm); font-size: 15px; color: var(--dark-ink-2); counter-increment: step; }
.mtc-ampm-flip__steps li::before { content: counter(step); position: absolute; left: 12px; top: 8px; font: 700 15px/1.45 var(--cond); color: var(--dark-ink-2); }
.mtc-ampm-flip__steps li.is-now { border-color: var(--amber); color: var(--dark-ink); }
.mtc-ampm-flip__steps li.is-now::before { color: var(--amber); }
.mtc-ampm-flip__steps li:has(button) { padding: 0; }
.mtc-ampm-flip__go { display: block; width: 100%; padding: 8px 10px 8px 36px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mtc-ampm-flip__go:hover { color: #FFFFFF; }

/* ---- Which day? Three days in a row, midnight where they meet ---- */

.mtc-ampm-edge { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
.mtc-ampm-edge__form { display: grid; gap: 12px; margin-bottom: 20px; }
@media (min-width: 560px) { .mtc-ampm-edge__form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; } }
.mtc-ampm-edge__form .mtc-select { max-width: none; min-height: 48px; }
.mtc-ampm-edge__strip { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 30px 0 30px; }
.mtc-ampm-edge__day { border: 1px solid var(--line-2); border-left: 0; background: var(--bg); }
.mtc-ampm-edge__day:first-child { border-left: 1px solid var(--line-2); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.mtc-ampm-edge__day:last-of-type { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.mtc-ampm-edge__day b { display: block; padding: 6px 4px; background: var(--brand); color: var(--brand-ink); text-align: center; font: 700 clamp(13px, 3.6vw, 17px)/1.1 var(--cond); letter-spacing: .06em; text-transform: uppercase; }
.mtc-ampm-edge__day.is-day { background: var(--amber-soft); }
.mtc-ampm-edge__day.is-day b { background: var(--amber); color: #15171A; }
.mtc-ampm-edge__day span { display: flex; justify-content: space-between; height: 46px; align-items: flex-end; padding: 0 4px 4px; }
.mtc-ampm-edge__day i { font: 600 clamp(9.5px, 2.6vw, 12px)/1 var(--font); font-style: normal; color: var(--ink-3); }
.mtc-ampm-edge__seam { position: absolute; z-index: 1; top: -6px; bottom: -8px; width: 0; border-left: 2px solid var(--ink-2); margin-left: -1px; }
.mtc-ampm-edge__seam small { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font: 700 12px/1 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.mtc-ampm-edge__mark { position: absolute; z-index: 2; top: -14px; bottom: -2px; width: 5px; margin-left: -2.5px; border-radius: 2px; background: #C98400; box-shadow: 0 0 0 2px var(--surface); }
.mtc-ampm-edge__mark::before { content: ""; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 13px solid #C98400; }
.mtc-ampm-edge__say { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.5; }
.prose .mtc-ampm-edge__ways { margin: 10px 0 0; padding-left: 1.2em; font-size: 15.5px; color: var(--ink-2); }
.mtc-ampm-edge figcaption { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-3); }

/* ---- The check of tricky times ---- */

.mtc-ampm-quiz { display: grid; gap: 12px; }
.mtc-ampm-quiz__q { margin: 0; padding: 12px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius-sm); }
.mtc-ampm-quiz__q.is-right { border-left-color: #5B7A3A; }
.mtc-ampm-quiz__q.is-wrong { border-left-color: var(--error); }
.mtc-ampm-quiz__q legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; font: 700 20px/1.2 var(--cond); letter-spacing: .01em; }
.mtc-ampm-quiz__q legend span { color: var(--ink-3); }
.mtc-ampm-quiz__options { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.mtc-ampm-quiz__options label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); font-size: 16px; cursor: pointer; }
.mtc-ampm-quiz__options input { width: 18px; height: 18px; margin: 0; accent-color: #3D4A2C; }
.mtc-ampm-quiz__mark { margin: 8px 0 0; font: 700 16px/1.2 var(--cond); letter-spacing: .06em; text-transform: uppercase; }
.mtc-ampm-quiz__mark:empty { margin: 0; }
.mtc-ampm-quiz__q.is-right .mtc-ampm-quiz__mark { color: #3F5A24; }
.mtc-ampm-quiz__q.is-wrong .mtc-ampm-quiz__mark { color: var(--error); }
.mtc-ampm-quiz__why { margin-top: 8px; }
.mtc-ampm-quiz__why summary { cursor: pointer; font: 700 14px/1.6 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--link); }
.mtc-ampm-quiz__why p { margin: 6px 0 0; font-size: 15.5px; color: var(--ink-2); }
.mtc-ampm-quiz__score { margin: 4px 0 0; padding: 12px 14px; border: 2px solid var(--amber); border-radius: var(--radius-sm); background: var(--amber-soft); font-weight: 600; }
@media (prefers-color-scheme: dark) {
	.mtc-ampm-quiz__q.is-right .mtc-ampm-quiz__mark { color: #B9D68E; }
	.mtc-ampm-quiz__options input { accent-color: #B9D68E; }
}
