/* schedule.css -- /schedule, the booking page, and its confirmation and
   cancel pages. Loaded after jwebview.css, see the order-significant
   $stylesheets list in src/view/layout.php. Reads the site's own tokens;
   the form fields follow the look of .download-form in components.css. */

.sch-section {
    min-height: 0;
}

.sch {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 9fr);
    gap: var(--spacing-12);
    align-items: start;
}

.sch-info h1 {
    margin: 0 0 var(--spacing-4);
    font-size: var(--heading-size-h2);
    max-width: 14ch;
}

.sch-blurb {
    margin: 0 0 var(--spacing-6);
    color: var(--fg-neutral-body);
}

.sch-facts {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--fg-neutral-body);
    font-size: var(--text-size-label);
}

.sch-facts li {
    display: flex;
    gap: var(--spacing-3);
    align-items: flex-start;
    padding: var(--spacing-2) 0;
}

.sch-facts svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--fg-neutral-muted);
}

.sch-main {
    min-width: 0;
    padding: var(--spacing-8);
    border: 1px solid var(--border-neutral-default);
    border-radius: var(--rounded-xl);
    background: var(--bg-neutral-section);
}

.sch-step {
    margin: 0 0 var(--spacing-6);
    font-size: var(--heading-size-h4);
}

.sch-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--spacing-10);
    align-items: start;
}

.sch-empty,
.sch-hint {
    margin: 0;
    color: var(--fg-neutral-body);
}

/* ---------- month ---------- */

.sch-month {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-4);
}

.sch-month-name {
    font-weight: var(--weight-semibold);
}

.sch-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--rounded-full);
    color: var(--fg-neutral-accent);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
}

a.sch-nav:hover {
    background: var(--bg-neutral-state);
    color: var(--fg-neutral-accent);
}

.sch-nav-off {
    color: var(--fg-neutral-muted);
    opacity: 0.45;
}

.sch-days {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    table-layout: fixed;
}

.sch-days th {
    padding-bottom: var(--spacing-2);
    font-size: var(--text-size-small);
    font-weight: var(--weight-medium);
    color: var(--fg-neutral-muted);
    text-align: center;
}

.sch-days td {
    padding: 0;
    text-align: center;
}

.sch-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: var(--rounded-full);
    font-size: var(--text-size-label);
    color: var(--fg-neutral-muted);
}

.sch-day.is-today {
    box-shadow: inset 0 0 0 1px var(--border-neutral-strong);
}

a.sch-day-open {
    background: var(--bg-info-section);
    color: var(--fg-info-body);
    font-weight: var(--weight-semibold);
    text-decoration: none;
}

a.sch-day-open:hover {
    background: var(--bg-info-state);
    color: var(--fg-info-body);
}

a.sch-day-open.is-selected {
    background: var(--bg-info-accent);
    color: #fff;
}

/* ---------- times and form ---------- */

.sch-date {
    margin: 0 0 var(--spacing-4);
    font-size: var(--heading-size-h5);
}

.sch-times {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--spacing-2);
}

.sch-time {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border: 1px solid var(--fg-info-body);
    border-radius: var(--rounded);
    background: var(--bg-base);
    color: var(--fg-info-body);
    font-weight: var(--weight-semibold);
    text-decoration: none;
}

.sch-time:hover {
    background: var(--bg-info-section);
    color: var(--fg-info-body);
}

.sch-chosen {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-6);
}

.sch-chosen-when {
    margin: 0;
    font-weight: var(--weight-semibold);
}

.sch-form .field {
    margin-bottom: var(--spacing-5);
}

.sch-form label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-size: var(--label-font-size);
    font-weight: var(--label-font-weight);
}

.sch-optional {
    font-weight: var(--weight-regular);
    color: var(--fg-neutral-muted);
}

.sch-form input[type="text"],
.sch-form input[type="email"],
.sch-form select,
.sch-form textarea {
    width: 100%;
    font: inherit;
    font-size: var(--input-font-size);
    padding: 0 var(--input-padding-md);
    border: 1px solid var(--border-input);
    border-radius: var(--input-border-radius);
    background: var(--bg-input);
    color: var(--body-color);
}

.sch-form input[type="text"],
.sch-form input[type="email"],
.sch-form select {
    height: var(--input-height);
}

.sch-form textarea {
    padding: var(--input-padding-md);
    resize: vertical;
}

.sch-form .warning {
    display: block;
    margin-top: var(--spacing-2);
    font-size: var(--text-size-label);
}

.sch-side > .warning {
    margin: 0 0 var(--spacing-4);
}

.sch-form .caption {
    margin: var(--spacing-5) 0 0;
}

.sch a:focus-visible,
.sch button:focus-visible,
.sch input:focus-visible,
.sch select:focus-visible,
.sch textarea:focus-visible,
.sch-done a:focus-visible,
.sch-done button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* ---------- confirmation and cancel ---------- */

.sch-done {
    max-width: 36em;
}

.sch-done h1 {
    margin: 0 0 var(--spacing-4);
}

.sch-done-when {
    margin: 0 0 var(--spacing-5);
    font-size: var(--heading-size-h4);
    font-weight: var(--weight-semibold);
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
    .sch {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--spacing-8);
    }

    .sch-info h1 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .sch-main {
        padding: var(--spacing-5);
    }

    .sch-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--spacing-8);
    }
}

.sch-context {
    display: inline-block;
    margin: 0 0 var(--spacing-4);
    padding: 2px var(--spacing-3);
    border: 1px solid var(--border-neutral-default);
    border-radius: var(--rounded-full);
    font-size: var(--text-size-small);
    color: var(--fg-neutral-body);
}

/* The form sits below the calendar box, on the white page, once a time is chosen. */
.sch-col {
    min-width: 0;
}

.sch-col > .sch-form {
    margin-top: var(--spacing-10);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--spacing-8);
}

.sch-col > .sch-form > * {
    grid-column: 1 / -1;
}

.sch-col > .sch-form .field:not(.sch-field-wide) {
    grid-column: auto;
}

.sch-col > .sch-form .field-decoy {
    grid-column: auto;
}

.sch-col > .sch-form button[type="submit"] {
    justify-self: start;
}

@media (max-width: 720px) {
    .sch-col > .sch-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* the chosen time stays marked in the list, with a tick so colour is not the only cue */
.sch-time.is-selected {
    background: var(--fg-info-body);
    color: var(--bg-base);
    font-weight: var(--weight-bold);
}

.sch-time.is-selected::before {
    content: "\2713\00a0";
}

.sch-col > .sch-form .sch-chosen-when {
    margin: 0 0 var(--spacing-6);
    font-size: var(--heading-size-h4);
    font-weight: var(--weight-semibold);
}

/* The booking page: the site header leaves with the scroll, and the
   description on the left stays in view next to the long form. */
body:has(.sch) .site-header {
    position: static;
}

body:has(.sch)::before {
    display: none;
}

.sch-info {
    position: sticky;
    top: var(--spacing-8);
}

@media (max-width: 1000px) {
    .sch-info {
        position: static;
    }
}

/* The site's rule for a page's first section centres it and pulls it up
   by 5 %, which is right for a hero and wrong here: it pushed the
   description under the header. */
.page-content > .page-section.sch-section:first-child {
    justify-content: flex-start;
    padding-top: var(--spacing-10);
}

.page-content > .page-section.sch-section:first-child .page-section-content {
    margin-top: 0;
}
