/* scheduler.css — the scheduler: the poll's grid of answers, the answer form,
   the slot rows on the create form and the creator's panel.
   ---------
   Loaded only by the scheduler's own templates, the way analytics.css is, so it
   costs nothing on the rest of the site. The cards, tables, buttons, fields,
   details lists, tag rows and status words are the site's own (style.css,
   listings.css); this file adds only what a poll has of its own. Every colour
   and every space comes from the tokens in style.css. */

/* ---- One poll: the status follows the date, as on a game's page, and the
   owner's Share sits at the right end of that same line; the facts go in the
   site's details list ---- */
.sch-head-line {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
	margin: var(--space-1) 0 var(--space-4);
}
.sch-head-line .dateline { margin: 0; }
.sch-head-line .lst-share-tag { margin-left: auto; }   /* Share at the right end of the line, as in a tag row */
.sch-head-line + .lst-view-meta { margin-top: 0; }
.sch-locked { margin: 0 0 var(--space-5); }

/* ---- The grid: a row for each time, a column for each person ----
   The times go down and the people across, so the grid is only as wide as the
   party: each name stands on its side over a column one mark wide. Before the
   names, how many can make it, large, with a thin bar out of everybody. Scrolls
   sideways only if a poll has more people than the page has room for. */
.sch-grid-wrap { overflow-x: auto; }
.sch-grid-wrap .tbl { margin-bottom: 0; }
.tbl.sch-grid td, .tbl.sch-grid tbody th { vertical-align: middle; }
.tbl.sch-grid thead th { vertical-align: bottom; }

/* The time is the row's own heading, so it is a th and takes the row's tint itself */
.tbl.sch-grid tbody th.sch-col-when { text-align: left; font-weight: normal; padding: var(--space-2) var(--space-3); }
.tbl.sch-grid tbody tr:nth-child(odd) th  { background: var(--row-stripe); }
.tbl.sch-grid tbody tr:nth-child(even) th { background: var(--row-stripe-even); }
.tbl.sch-grid tbody tr:hover th { background: var(--row-hover); }
.sch-when-date, .sch-when-time { display: block; white-space: nowrap; }
.sch-when-date { font-family: var(--font-heading); font-size: var(--fs-body); line-height: var(--lh-tight); color: var(--text-heading); }
.sch-when-time { font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text-muted); }
.sch-col-when .status { display: flex; height: auto; margin-top: var(--space-1); }
/* The time settled on, or else the best so far: the line the site marks a chosen item with */
.tbl.sch-grid tbody tr.sch-row-best > th { box-shadow: inset 2px 0 0 var(--selected-border); }   /* design-ok: the chosen item's line, drawn inside the cell */

/* How many can make it: the number large, "of 5" small, the bar under them */
.tbl.sch-grid .sch-col-count { width: 1%; text-align: center; border-right: 1px solid var(--rule-accent); }   /* design-ok: as narrow as its own content, so the room goes to the names */
.tbl.sch-grid thead th.sch-col-count { white-space: nowrap; }
.sch-count {
	display: flex; align-items: baseline; justify-content: center; gap: var(--space-1);
	font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text-muted); white-space: nowrap;
}
.sch-count-big { font-family: var(--font-heading); font-size: var(--fs-h2); line-height: 1; color: var(--success); }
.sch-bar {
	display: flex; margin-top: var(--space-1); background: var(--row-head);
	height: 4px; min-width: 3rem;   /* design-ok: the bar's thickness, and room for it beside a short header */
}
.sch-bar > i { display: block; }
.sch-bar-yes   { background: var(--success); }
.sch-bar-maybe { background: var(--gold-dark); }

/* The people: a name on its side, read from the bottom up */
.tbl.sch-grid :is(.sch-col-person, .sch-cell) { text-align: center; padding-left: var(--space-1); padding-right: var(--space-1); }
.tbl.sch-grid thead th.sch-col-person { font-family: var(--font-ui); font-size: var(--fs-ui); letter-spacing: 0; color: var(--text); }
/* A block with a tight line, so the name ends level with the labels beside it
   and no line box adds space under it */
.sch-person-stand { display: block; margin: 0 auto; line-height: var(--lh-tight); writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }   /* design-ok: a standing name keeps the column one mark wide */
.sch-person-stand a { text-decoration: none; }   /* on its side the underline turns into a line beside the name */
.sch-person-cell { display: flex; align-items: center; gap: var(--space-2); }
.sch-person-name { font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text); }

/* The marks: a green tick for yes, a gold tilde for if need be, a red minus for
   no. Each has its own shape as well as its own colour, so the grid still reads
   without colour; the word itself is in the cell for screen readers. The answer
   bar uses the same three, so the form and the grid say it alike. Each mark
   takes 12px across, so the words beside them line up. */
.sch-cell::before, .sch-seg-btn::before { content: ""; display: inline-block; flex: none; vertical-align: middle; }
.sch-cell-yes::before, .sch-seg-yes::before {
	width: 5px; height: 10px; margin: 0 4px 0 3px;   /* design-ok: a drawn tick, 12px across with its sides */
	border: solid var(--success); border-width: 0 2px 2px 0;   /* design-ok: the tick's strokes */
	transform: translateY(-2px) rotate(45deg);
}
.sch-cell-maybe::before, .sch-seg-maybe::before {
	content: "~"; width: 12px; text-align: center;   /* design-ok: a drawn mark, not spacing */
	font-family: var(--font-ui); font-weight: bold; font-size: var(--fs-h3); line-height: 1; color: var(--gold-dark);
}
.sch-cell-no::before, .sch-seg-no::before { width: 11px; height: 2px; margin-right: 1px; background: var(--danger); }   /* design-ok: a drawn minus, 12px across */

/* ---- Your own answer: one bar per slot, three ways to answer it ----
   Plain rows in the card, spaced apart with no line between them: the date is
   a fieldset legend, so a border on the row would run beside the date. */
.sch-answer-list { margin: 0 0 var(--space-5); }
.sch-answer-row { margin: 0; padding: var(--space-3) 0; border: 0; }
.sch-answer-row:first-child { padding-top: 0; }
.sch-answer-row legend {
	display: block; padding: 0; margin: 0 0 var(--space-2);
	font-family: var(--font-caps); font-size: var(--fs-ui);
	letter-spacing: .04em; color: var(--text-heading);
}
/* The bar. The three answers share it equally, so the one wanted is in the same
   place on every row and a tap lands on it without aiming, and the one picked
   stays lit with the same line the site marks a chosen item with elsewhere.
   The radios themselves are off in the corner (.sr-only), so these labels carry
   the look while the control underneath stays a real radio group. */
.sch-seg {
	display: grid; grid-template-columns: repeat(3, 1fr);
	max-width: 30rem;   /* design-ok: three words' own width, rather than a card wide */
	border: 1px solid var(--input-border); border-radius: var(--radius);
	background: var(--input-bg);
	overflow: hidden;   /* design-ok: the rounded corners cut the segments inside */
}
.sch-seg-btn {
	display: flex; align-items: center; justify-content: center; gap: var(--space-2);
	padding: var(--space-2);
	border-bottom: 2px solid transparent;   /* design-ok: the line under the one picked, kept clear so nothing shifts */
	font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text-muted);
	text-align: center; cursor: pointer;
	transition: background .15s, color .15s;
}
.sch-seg-btn:not(:first-of-type) { border-left: 1px solid var(--input-border); }
.sch-seg-btn:hover { background: var(--hover-tint); color: var(--text-hover); }
.sch-seg-input:checked + .sch-seg-btn {
	background: var(--selected-bg); color: var(--text-heading);
	border-bottom-color: var(--selected-border);
}
/* The radio is out of sight, so its focus shows on the segment instead; the ring
   is drawn inside the edge, since the bar cuts anything outside it */
.sch-seg-input:focus-visible + .sch-seg-btn { outline: 2px solid var(--focus-outline); outline-offset: -2px; }

/* ---- Comments: who wrote it on top, the words under them, and what can be
   done about them under that again, so a button belongs to the comment above
   it rather than to the name beside it ---- */
.sch-comment-list { margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.sch-comment { margin-bottom: var(--space-5); }
.sch-comment:last-child { margin-bottom: 0; }
.sch-comment-by {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
	margin: 0 0 var(--space-2); font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text-heading);
}
.sch-comment-edited { font-size: var(--fs-xs); color: var(--text-faint); }
.sch-comment-text { margin: 0; }
.sch-comment-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.sch-comment-actions > form { margin: 0; }
/* A form wrapping one button: a flex container, so the row is as tall as the
   button and not as tall as a line of body text, which is what made the Edit
   link beside it stretch taller than the Remove button */
.sch-inline-form { display: inline-flex; margin-top: 0; }

/* ---- The creator's panel: the link, the buttons, then the two lists. Space
   between the parts, not a line, since the card's own edges are the only ones
   a panel needs. ---- */
/* Every button in the row sits on the row itself, whether or not it came
   wrapped in a form of its own: the site gives a form a top margin, which would
   drop those buttons half a line below the plain ones beside them. */
.sch-owner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sch-owner-actions > form { margin: 0; }
.sch-owner-part { margin-top: var(--space-5); }
.sch-owner-part .form-group:last-of-type { margin-bottom: var(--space-3); }

/* Who answered: the circle and the name at one end, when they last said
   anything and the one thing to do about them at the other, so three columns
   line up down the list instead of each row finding its own width. */
.sch-person-list { margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.sch-person {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
	padding: var(--space-2) 0; font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text);
}
.sch-person + .sch-person { border-top: 1px solid var(--card-border); }
.sch-person .dateline-sm { margin-left: auto; }
.sch-person > form { margin: 0; }

/* ---- The create and edit form: the blocks somebody types the times into ----
   One block per slot, numbered, holding the moment it starts and the moment it
   ends side by side. A tint rather than a border keeps the pairs apart, which
   is what a phone needs when a poll offers half a dozen times: on one long run
   of fields it stops being clear which end belongs to which start. The list
   stops at the width the two fields need, rather than stretching across. */
.sch-slot-list {
	display: flex; flex-direction: column; gap: var(--space-3);
	margin: 0 0 var(--space-4);
	max-width: 34rem;   /* design-ok: the two datetime fields' own width */
}
.sch-slot-row {
	margin: 0; padding: var(--space-3);
	border: 0; border-radius: var(--radius);
	background: var(--band-bg);
}
.sch-slot-row legend {
	display: block; padding: 0; margin: 0 0 var(--space-2);
	font-family: var(--font-caps); font-size: var(--fs-sm);
	letter-spacing: .06em; color: var(--text-muted);
}
.sch-slot-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.sch-slot-fields .form-group { margin-bottom: 0; }

/* ---- The creator's own polls ---- */
.sch-mine .tbl { margin-bottom: var(--space-3); }
/* The buttons sit in a box of their own inside the cell: a flex cell stops
   being a table cell, so it lost the row's height and left a gap under it */
.sch-mine-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.sch-mine .tbl td { vertical-align: middle; }

/* Where the site's own rule puts every field up to 16px, two datetime fields
   stop fitting on one line, so a slot's start and end take a line each. The
   block around them is what still says they are one pair. */
@media (max-width: 700px) {
	.sch-slot-fields { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
	/* Phones: the three answers take a line each, so each is easy to hit, and
	   the line marking the one picked moves to the side it now has */
	.sch-seg { grid-template-columns: 1fr; }
	.sch-seg-btn { justify-content: flex-start; border-bottom: 0; border-left: 2px solid transparent; }   /* design-ok: as above, on its side */
	.sch-seg-btn:not(:first-of-type) { border-left: 2px solid transparent; border-top: 1px solid var(--input-border); }
	.sch-seg-input:checked + .sch-seg-btn { border-left-color: var(--selected-border); }

	/* and the grid's first two columns may take two lines, so the names keep their room */
	.sch-when-date, .tbl.sch-grid thead th.sch-col-count { white-space: normal; }
	.tbl.sch-grid .sch-col-when, .tbl.sch-grid .sch-col-count { padding-left: var(--space-2); padding-right: var(--space-2); }
	.tbl.sch-grid tbody th.sch-col-when { padding-left: var(--space-2); padding-right: var(--space-1); }
}
