/*
 * Nebula Cruise Agenda - frontend schedule styles
 *
 * BEM naming under .nbca-schedule. Uses CSS custom properties so themes can
 * override colors without touching the plugin CSS.
 *
 * Responsive: at <= 600px viewport the table collapses to a stacked card
 * layout where each row becomes a card and cell labels are surfaced from
 * the data-label attribute.
 */

.nbca-schedule {
    /* Theme-overridable tokens */
    --nbca-border: #e5e7eb;
    --nbca-header-bg: #f3f4f6;
    --nbca-header-text: #111827;
    --nbca-row-bg: #ffffff;
    --nbca-row-alt-bg: #f9fafb;
    --nbca-row-hover: #fef3c7;
    --nbca-text: #1f2937;
    --nbca-muted: #6b7280;
    --nbca-title-text: #111827;
    --nbca-radius: 6px;
    --nbca-font-size: 0.95rem;
    --nbca-cell-padding: 0.65rem 0.9rem;

    font-size: var(--nbca-font-size);
    color: var(--nbca-text);
    margin: 1.5rem 0;
}

.nbca-schedule__title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--nbca-title-text);
}

.nbca-schedule__empty {
    padding: 1rem;
    background: var(--nbca-row-alt-bg);
    border: 1px solid var(--nbca-border);
    border-radius: var(--nbca-radius);
    color: var(--nbca-muted);
    text-align: center;
}

.nbca-schedule__wrap {
    overflow-x: auto;
    border: 1px solid var(--nbca-border);
    border-radius: var(--nbca-radius);
    background: var(--nbca-row-bg);
}

.nbca-schedule__table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.nbca-schedule__caption.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nbca-schedule__head {
    background: var(--nbca-header-bg);
}

.nbca-schedule__th {
    padding: var(--nbca-cell-padding);
    text-align: left;
    font-weight: 600;
    color: var(--nbca-header-text);
    border-bottom: 1px solid var(--nbca-border);
    white-space: nowrap;
}

.nbca-schedule__th--arrival,
.nbca-schedule__th--departure {
    text-align: center;
}

.nbca-schedule__body .nbca-schedule__row:nth-child(even) {
    background: var(--nbca-row-alt-bg);
}

.nbca-schedule__body .nbca-schedule__row:hover {
    background: var(--nbca-row-hover);
}

.nbca-schedule__cell {
    padding: var(--nbca-cell-padding);
    border-bottom: 1px solid var(--nbca-border);
    vertical-align: middle;
}

.nbca-schedule__row:last-child .nbca-schedule__cell {
    border-bottom: none;
}

.nbca-schedule__cell--arrival,
.nbca-schedule__cell--departure {
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nbca-schedule__cell--date time {
    font-weight: 500;
    white-space: nowrap;
}

.nbca-schedule__cell--ship {
    font-weight: 500;
}

.nbca-schedule__cell--line,
.nbca-schedule__cell--port {
    color: var(--nbca-muted);
}

/* ---------------------------------------------------------------- */
/* Footer (timezone note on left, last updated on right)            */
/* ---------------------------------------------------------------- */
.nbca-schedule__footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.nbca-schedule__timezone-note,
.nbca-schedule__updated {
    margin: 0;
    font-size: 0.8rem;
    color: var(--nbca-muted);
}

.nbca-schedule__updated {
    text-align: right;
}

/* ---------------------------------------------------------------- */
/* Responsive: collapse to stacked cards on narrow viewports        */
/* ---------------------------------------------------------------- */
@media (max-width: 600px) {
    .nbca-schedule__wrap {
        border: none;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }

    .nbca-schedule__table,
    .nbca-schedule__head,
    .nbca-schedule__body,
    .nbca-schedule__row,
    .nbca-schedule__cell {
        display: block;
        width: 100%;
    }

    .nbca-schedule__head {
        position: absolute;
        left: -9999px;
        top: -9999px;
    }

    .nbca-schedule__row {
        background: var(--nbca-row-bg) !important;
        border: 1px solid var(--nbca-border);
        border-radius: var(--nbca-radius);
        margin-bottom: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .nbca-schedule__cell {
        border-bottom: 1px dashed var(--nbca-border);
        padding: 0.5rem 0;
        text-align: left !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
    }

    .nbca-schedule__cell:last-child {
        border-bottom: none;
    }

    .nbca-schedule__cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--nbca-muted);
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.03em;
        flex-shrink: 0;
    }
}
