/**
 * SKK Operation Manager - フロントエンドCSS
 * ショートコード表示用
 */

/* ===== 運航状況一覧 ===== */
.skk-operation-status {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    max-width: 800px;
}

.skk-operation-status__header {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    margin-bottom: 8px;
}

.skk-operation-status__updated {
    color: #666;
    font-size: 0.85em;
}

.skk-operation-status__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skk-operation-status__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #e0e0e0;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* リンク化された航路アイテム（<a>）。既定のリンク装飾を打ち消す */
a.skk-operation-status__item--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.skk-operation-status__item--link:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-color: #1d3557;
}

.skk-operation-status__item.skk-status--normal {
    border-left-color: #2d9a2d;
}
.skk-operation-status__item.skk-status--warning {
    border-left-color: #e6a817;
    background: #fffbf0;
}
.skk-operation-status__item.skk-status--delayed {
    border-left-color: #e68a00;
    background: #fff8f0;
}
.skk-operation-status__item.skk-status--partial {
    border-left-color: #d63638;
    background: #fef7f7;
}
.skk-operation-status__item.skk-status--partial-suspended {
    border-left-color: #c44a8b;
    background: #fbf3f8;
}
.skk-operation-status__item.skk-status--suspended {
    border-left-color: #d63638;
    background: #fef0f0;
}
.skk-operation-status__item.skk-status--cancelled {
    border-left-color: #888;
    background: #f8f8f8;
}

.skk-operation-status__route {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 220px;
}

.skk-operation-status__route-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #888;
    color: #fff;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.skk-operation-status__route-name {
    font-weight: bold;
    font-size: 0.95em;
}

.skk-operation-status__vessel-type {
    display: inline-flex;
    align-items: center;
    color: #555;
}
.skk-operation-status__vessel-type svg {
    display: block;
}

.skk-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}
.skk-status-badge.skk-status--normal {
    background: #2d9a2d;
}
.skk-status-badge.skk-status--warning {
    background: #e6a817;
    color: #333;
}
.skk-status-badge.skk-status--delayed {
    background: #e68a00;
}
.skk-status-badge.skk-status--partial {
    background: #d63638;
}
.skk-status-badge.skk-status--partial-suspended {
    background: #c44a8b;
}
.skk-status-badge.skk-status--suspended {
    background: #d63638;
}
.skk-status-badge.skk-status--cancelled {
    background: #888;
}

.skk-operation-status__reason {
    grid-column: 1 / -1;
    color: #555;
    font-size: 0.88em;
}

/* ステータス行: 通常は1行目右寄せ、ルートと同居できない長文時は次行へ折り返し
 * (.skk-operation-status__item は flex-wrap: wrap)
 * 折り返した後はモバイル風に左寄せで自然に並ぶ。 */
.skk-operation-status__statuses {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 0 0 auto;
}
.skk-operation-status__status-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px dashed #e0e0e0;
}
.skk-operation-status__statuses .skk-operation-status__status-line:first-child {
    border-top: none;
    padding-top: 0;
}
/* 理由テキスト (旧: バッジ横の inline 表示) → 行全体を独立した下段に */
.skk-operation-status__reasons {
    flex: 0 0 100%;
    margin-top: 2px;
}
.skk-operation-status__reason-text {
    color: #50575e;
    font-size: 0.92em;
    line-height: 1.5;
    margin: 0;
}
.skk-operation-status__reason-text + .skk-operation-status__reason-text {
    margin-top: 4px;
}
.skk-operation-status__window {
    color: #1d3557;
    font-size: 0.85em;
    background: #f0f6fc;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* コンパクトレイアウト */
.skk-layout--compact .skk-operation-status__item {
    padding: 8px 12px;
}
.skk-layout--compact .skk-operation-status__reason {
    display: none;
}

/* ===== 時刻表 ===== */
.skk-timetable__notice {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: bold;
}
.skk-timetable__notice--suspended {
    background: #fef0f0;
    color: #d63638;
    border: 1px solid #d63638;
}
.skk-timetable__notice--facility {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: bold;
    background: #fff8e6;
    color: #8a6d00;
    border: 1px solid #e6c200;
}
.skk-timetable__notice--range {
    background: #fff1e6;
    color: #b54400;
    border: 1px solid #e68a00;
}
.skk-timetable__notice--delayed {
    background: #fff7ee;
    color: #8a4a00;
    border: 1px solid #e68a00;
}

.skk-timetable__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
    /* スマホは内容に合わせて詰める(auto)。PCのみ等幅固定（min-width 指定で上書き） */
    table-layout: auto;
}
.skk-timetable__table th,
.skk-timetable__table td {
    padding: 8px 12px;
    /* 時刻セルは中央揃え */
    text-align: center;
    border-bottom: 1px solid #eee;
}
/* 時刻の値は折り返さない（短いので崩れない） */
.skk-timetable__table td {
    white-space: nowrap;
}
.skk-timetable__table th {
    background: #f7f7f7;
    font-weight: bold;
    font-size: 0.88em;
    color: #555;
    /* 見出しは <wbr> の位置でのみ折り返す（狭い列での被りを防ぐ） */
    white-space: normal;
}
/* 見出し各パーツ（例: 「直島」「(宮浦港)着」）は行内で崩さない */
.skk-timetable__th-part {
    white-space: nowrap;
}
.skk-timetable__table td:first-child {
    font-weight: bold;
    font-size: 1.05em;
}
/* 中継地点セルは着・発の2時刻。狭い時は「・」位置で折り返す */
.skk-timetable__stop-cell {
    white-space: normal;
}
.skk-timetable__stop-time,
.skk-timetable__cell-skipped {
    white-space: nowrap;
}
/* 備考列は左寄せ・折り返し可。幅はスマホでは内容に合わせ、PCのみ固定（下の min-width 指定） */
.skk-timetable__table th:last-child,
.skk-timetable__table td:last-child {
    text-align: left;
    white-space: normal;
}

/* PC/タブレット（スマホ幅より広い場合）のみ、時刻列を等幅固定し備考を広めに確保 */
@media (min-width: 601px) {
    .skk-timetable__table {
        table-layout: fixed;
    }
    .skk-timetable__table th:last-child,
    .skk-timetable__table td:last-child {
        width: 10em;
    }
}

.skk-timetable__row--suspended {
    opacity: 0.5;
    text-decoration: line-through;
}

.skk-timetable__row--delayed {
    background: #fff7ee;
}

.skk-timetable__suspended-label {
    display: inline-block;
    background: #d63638;
    color: #fff;
    font-size: 0.75em;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 4px;
}

.skk-timetable__delayed-label {
    display: inline-block;
    background: #e68a00;
    color: #fff;
    font-size: 0.75em;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 4px;
}

/* 寄港なしの始発/終着セル */
.skk-timetable__cell-skipped {
    text-decoration: line-through;
    text-decoration-color: #d63638;
    text-decoration-thickness: 2px;
    color: #999;
}

/* 中継地点セル */
.skk-timetable__stop-cell {
    white-space: nowrap;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.skk-timetable__stop-time {
    display: inline-block;
}
.skk-timetable__stop-none {
    color: #ccc;
}

.skk-timetable__label {
    display: inline-block;
    background: #0073aa; /* 既定色。インラインstyleでダイヤ種別ごとの色に上書き */
    color: #fff;
    font-size: 0.75em;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 4px;
}

.skk-error {
    color: #d63638;
    padding: 10px;
    background: #fef0f0;
    border-radius: 4px;
}

/* ===== 全航路時刻表一覧 ===== */
.skk-timetable-all {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    max-width: 900px;
}

/* 個別航路時刻表の運航状況ラベル + 取得時刻ヘッダー（中央揃え・上下配置） */
.skk-timetable__status-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    text-align: center;
}
.skk-timetable__status-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
/* 個別航路時刻表の運航状況ラベルは大きく目立たせる */
.skk-timetable__status-badges .skk-status-badge {
    font-size: 1.25em;
    font-weight: bold;
    padding: 8px 18px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.skk-timetable__updated {
    font-size: 0.85em;
    color: #666;
}

.skk-timetable-all__route {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 2px solid #e0e0e0;
}

.skk-timetable-all__route:last-child {
    border-bottom: none;
}

.skk-timetable-all__route-title {
    font-size: 1.3em;
    color: #1d3557;
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 3px solid #1d3557;
}
.skk-timetable-all__route-title-text {
    /* タイトル文字 */
}

/* 乗船可否案内: 見出しの下へ中央配置 */
.skk-vessel-capability {
    display: block;
    text-align: center;
    margin: 8px 0 12px;
    font-size: 0.85em;
    font-weight: normal;
    line-height: 1.6;
}
.skk-vessel-capability__item {
    display: inline-block;
    color: #1d3557;
}
.skk-vessel-capability__item i {
    margin-right: 4px;
    font-size: 1.1em;
}
.skk-vessel-capability__item--no {
    color: #d63638;
}
/* 乗船不可: アイコンに×印（罰印）を重ねる */
.skk-vessel-capability__item--no i {
    position: relative;
}
.skk-vessel-capability__item--no i::after {
    content: '\2715'; /* ✕ */
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d63638;
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}
.skk-vessel-capability__sep {
    margin: 0 4px;
    color: #999;
}

.skk-timetable-all__day-note {
    color: #d63638;
    font-weight: bold;
    font-size: 0.9em;
    margin: 4px 0 12px;
}

.skk-timetable-all__tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
/* 中継地点ありの航路は1カラム固定（PHP側でインラインstyleも付与しテーマに勝つ） */
.skk-timetable-all__tables--single {
    grid-template-columns: 1fr;
}

.skk-timetable-all__direction {
    min-width: 0;
}

.skk-timetable-all__dir-title {
    font-size: 1em;
    color: #1d3557;
    margin: 0 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ccc;
}

/* 所要時間は見出しの外に独立表示（見出し内に入れると段落ちで装飾が崩れるため） */
.skk-timetable-all__duration {
    display: inline-block;
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    margin: 0 0 8px;
}

.skk-timetable-all__season-label {
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
    background: #777; /* 既定色。インラインstyleでダイヤ種別ごとの色に上書き */
    padding: 4px 10px;
    border-radius: 3px;
    margin: 8px 0 4px;
    display: inline-block;
}

/* レスポンシブ */
/* 横幅が狭いと往路・復路の2カラムでは各表が窮屈になり、
   見出し(nowrap)が溢れる。各表が十分な幅を確保できるよう
   早めに1カラムへ折り返す。 */
@media (max-width: 860px) {
    .skk-timetable-all__tables {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 600px) {
    .skk-timetable__table th,
    .skk-timetable__table td {
        padding: 6px 5px;
        font-size: 0.9em;
    }
}
