/* Travel preferences for one trip (js/trip_preferences.js): the create page's
   "Travel preferences for this trip" card and Converge's group preferences.
   Voyager tokens only, so light and dark follow voyager.css. */

.tp-head {
    margin: 0;
}

/* The card's heading is the button that opens it. */
.card h2.tp-head {
    margin-bottom: 0;
    font-size: inherit;
}

.tp-toggle {
    display: flex;
    align-items: center;
    gap: var(--v-space-3);
    width: 100%;
    min-height: 44px;
    padding: var(--v-space-2) 0;
    background: none;
    border: none;
    color: var(--v-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: var(--v-radius-sm);
}

.tp-toggle:focus-visible {
    outline: 2px solid var(--v-accent);
    outline-offset: 4px;
}

.tp-toggle > .material-icons {
    color: var(--v-accent);
    font-size: 28px;
    flex: none;
}

.tp-toggle-text {
    display: flex;
    flex-direction: column;
    gap: var(--v-space-1);
    min-width: 0;
    flex: 1;
}

.tp-title {
    font-family: var(--v-font-display);
    font-size: clamp(1.25rem, 3vw, var(--v-text-headline));
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.tp-summary {
    font-family: var(--v-font-body);
    font-size: var(--v-text-body);
    font-weight: 400;
    color: var(--v-ink-muted);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.tp-edit {
    flex: none;
    font-family: var(--v-font-body);
    font-size: var(--v-text-small);
    font-weight: 600;
    color: var(--v-accent);
    padding: var(--v-space-1) var(--v-space-3);
    border-radius: var(--v-radius-pill);
    background: var(--v-accent-soft);
}

.tp-body {
    margin-top: var(--v-space-4);
}

.tp-body[hidden] {
    display: none;
}

.tp-source,
.tp-hint {
    font-size: var(--v-text-label);
    color: var(--v-ink-muted);
    line-height: 1.5;
    margin: 0 0 var(--v-space-2);
}

.tp-source {
    font-size: var(--v-text-small);
    margin-bottom: var(--v-space-4);
}

.tp-field {
    margin: 0 0 var(--v-space-5);
    padding: 0;
    border: none;
    min-width: 0;
}

.tp-label {
    display: block;
    font-family: var(--v-font-body);
    font-size: var(--v-text-body);
    font-weight: 600;
    color: var(--v-ink);
    margin: 0 0 var(--v-space-2);
    padding: 0;
}

.tp-slider {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0;
    accent-color: var(--v-accent);
    cursor: pointer;
}

.tp-slider:focus-visible {
    outline: 2px solid var(--v-accent);
    outline-offset: 2px;
    border-radius: var(--v-radius-sm);
}

.tp-ends {
    display: flex;
    justify-content: space-between;
    gap: var(--v-space-2);
    font-size: var(--v-text-label);
    color: var(--v-ink-muted);
}

.tp-ends span:nth-child(2) {
    text-align: center;
}

.tp-ends span:last-child {
    text-align: right;
}

/* Food importance: profile.html's three-state selector, as a radio group. */
.tp-choices {
    display: flex;
    gap: var(--v-space-2);
    flex-wrap: wrap;
}

.tp-choice {
    flex: 1;
    min-width: 96px;
    min-height: 44px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--v-space-1);
    padding: var(--v-space-3) var(--v-space-4);
    background: var(--v-surface-low);
    border-radius: var(--v-radius-sm);
    cursor: pointer;
    font-family: var(--v-font-display);
    font-size: var(--v-text-small);
    color: var(--v-ink-muted);
    text-align: center;
    transition: background 0.2s var(--v-ease), color 0.2s var(--v-ease);
}

.tp-choice input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.tp-choice:hover {
    background: var(--v-surface-highest);
    color: var(--v-ink);
}

.tp-choice:has(input:focus-visible) {
    outline: 2px solid var(--v-accent);
    outline-offset: 2px;
}

.tp-choice:has(input:checked) {
    background: color-mix(in srgb, var(--v-accent) 18%, transparent);
    color: var(--v-accent);
    font-weight: 600;
}

.tp-choice .material-icons {
    font-size: 18px;
    color: inherit;
}

.tp-check {
    display: flex;
    align-items: center;
    gap: var(--v-space-2);
    min-height: 44px;
    cursor: pointer;
    color: var(--v-ink);
}

.tp-check .tp-label {
    margin: 0;
}

.tp-check input {
    width: 20px;
    height: 20px;
    margin: 0;
    flex: none;
    accent-color: var(--v-accent);
}

/* "Support local businesses": three checkboxes, each with its own hint under
   its label (lined up with the label, past the box). */
.tp-local-item + .tp-local-item {
    margin-top: var(--v-space-1);
}

.tp-check-label {
    font-family: var(--v-font-body);
    font-size: var(--v-text-body);
    color: var(--v-ink);
    line-height: 1.35;
}

.tp-local-item .tp-hint {
    margin: calc(-1 * var(--v-space-2)) 0 var(--v-space-2) calc(20px + var(--v-space-2));
}

.tp-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: var(--v-surface-low);
    color: var(--v-ink);
    border: none;
    border-radius: var(--v-radius-sm);
    font: inherit;
    font-size: var(--v-text-body);
    margin-bottom: var(--v-space-2);
}

.tp-input::placeholder {
    color: var(--v-ink-subtle);
}

.tp-input:focus-visible {
    outline: 2px solid var(--v-accent);
    outline-offset: 1px;
}

.tp-save {
    margin-top: var(--v-space-2);
    padding: var(--v-space-3) var(--v-space-4);
    background: var(--v-surface-low);
    border-radius: var(--v-radius-sm);
}

.tp-save span {
    font-size: var(--v-text-body);
}

/* Converge: the group's preferences inside the trip form. */
.tp-group {
    margin: var(--v-space-4) 0;
    padding: var(--v-space-3) var(--v-space-4);
    background: var(--v-surface-low);
    border-radius: var(--v-radius);
}

.tp-group .tp-title {
    font-size: var(--v-text-title);
}

.tp-group .tp-choice {
    background: var(--v-surface);
}

@media (max-width: 480px) {
    .tp-choices {
        flex-direction: column;
    }

    .tp-choice {
        flex-direction: row;
        justify-content: flex-start;
    }

    .tp-ends {
        font-size: 0.6875rem;
    }
}

/* Unset sliders and food importance (docs/planning/TRIP-CHIP-WIRING.md, decisions 8 and 11): a
   "No preference" label that goes away on the first move, and a Clear button to put it back. */
.tp-label-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--v-space-2);
}

.tp-state-row {
    display: flex;
    align-items: center;
    gap: var(--v-space-2);
    margin: 0 0 var(--v-space-2);
}

.tp-state {
    font-size: var(--v-text-label);
    font-style: italic;
    color: var(--v-ink-muted);
}

.tp-state[hidden],
.tp-clear[hidden] {
    display: none;
}

.tp-clear {
    min-height: 32px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--v-accent);
    font: inherit;
    font-size: var(--v-text-label);
    font-weight: 600;
    cursor: pointer;
}

.tp-clear:focus-visible {
    outline: 2px solid var(--v-accent);
    outline-offset: 2px;
    border-radius: var(--v-radius-sm);
}

.tp-slider.tp-unset {
    opacity: 0.55;
}
