/* World time page: the city list is a terminal table in the phosphor palette. */

.worldclock-card {
    width: 100%;
    max-width: 680px;
    text-align: left;
    min-width: 0;
}

.worldclock-card .term-body {
    padding: 1rem;
}

/* ---------- Sort controls ---------- */

.wc-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.wc-sort-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.wc-sort-label {
    font-size: 0.85rem;
    color: var(--phosphor-dim);
    margin-right: 0.2rem;
}

.wc-btn {
    font: inherit;
    font-size: 0.9rem;
    color: var(--phosphor);
    background: #000;
    border: 1px solid var(--phosphor-dim);
    border-radius: 0;
    padding: 0.2rem 0.7rem;
    cursor: pointer;
}

.wc-btn:hover { background: rgba(var(--line-rgb), 0.12); }

/* Pressed = reverse video, like a selected menu item */
.wc-btn[aria-pressed="true"] {
    background: var(--phosphor);
    border-color: var(--phosphor);
    color: #000;
    text-shadow: none;
}

.wc-btn:focus-visible {
    outline: 2px solid var(--phosphor);
    outline-offset: 2px;
}

/* ---------- City table ---------- */

/* The list is one four-column grid. Each row spans the full width and uses
   subgrid, so every row shares the same column widths. Each column is
   max-content, so the city column is exactly as wide as the longest name. */
.wc-list {
    list-style: none;
    display: grid;
    grid-template-columns: max-content max-content max-content max-content;
    column-gap: 1rem;
    border: 1px solid var(--phosphor-dim);
    overflow-x: auto;
}

/* One line per city: CITY · UTC offset · date · local time. */
.wc-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: baseline;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    white-space: nowrap;
    text-transform: uppercase;
    border-bottom: 1px dashed rgba(var(--line-rgb), 0.35);
}

.wc-row:last-child { border-bottom: none; }

.wc-note {
    margin-top: 1rem;
}

/* Narrow screens: shrink every item by the same amount so the row keeps its
   one-line layout. The list scrolls sideways if it still doesn't fit. */
@media (max-width: 480px) {
    .wc-list { column-gap: 0.5rem; }
    .wc-row { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
}
