/* "How to join the Merchant Navy" (merchant-navy.html): a standalone, static
   page in the site's colours. Readable without scripts: every section is a
   native <details>. js/career-finder.js adds "Find my route", and
   js/career-paths.js opens sections for links and switches the labels
   between English and Hindi.
   The site header, the section bar and the footer are in css/site-chrome.css
   (shared by every public page); this file is the guide itself. */
:root {
    --primary: #0066cc; --primary-dark: #004d99; --primary-light: #e6f0ff; --navy: #1a365d;
    --text: #1a202c; --text-2: #4a5568; --muted: #5f6c7e; --line: #e2e8f0; --soft: #f7fafc;
    --ok: #15803d; --warn-bg: #fffbeb; --warn-line: #fcd34d; --warn-text: #92400e; --warn-edge: #b45309; --no: #b91c1c;
    /* The longest comfortable line of running text: about 75 characters */
    --measure: 40rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 140px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); line-height: 1.6; background: #fff; }
a { color: var(--primary-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 10px 12px; border-radius: 8px; z-index: 1100; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
/* One reading column; tables, fact grids, step rows and card grids may run wider.
   Inside the column, running text keeps a comfortable line. */
main section:not(.cp-cta) .wrap > *, .cp-note .wrap > * { max-width: 800px; }
main section:not(.cp-cta) .wrap > .table-wrap, main section:not(.cp-cta) .wrap > table, main section:not(.cp-cta) .wrap > .facts, main section:not(.cp-cta) .wrap > .ladder, main section:not(.cp-cta) .wrap > .route-grid, main section:not(.cp-cta) .wrap > .guide-sec { max-width: 1040px; }
main section:not(.cp-cta) .wrap p, main section:not(.cp-cta) .wrap ul:not([class]) > li, main section:not(.cp-cta) .wrap ol:not([class]) > li, .cp-note .wrap p { max-width: var(--measure); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.4; text-decoration: none; border: 2px solid var(--primary); cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary-dark); }
main .btn-outline:hover { background: var(--primary-light); }
.link-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--primary-dark); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.cp-hero { background: linear-gradient(135deg, var(--navy), var(--primary-dark)); color: #fff; padding: 48px 0 40px; }
.cp-hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.2; margin: 0 0 12px; }
.cp-hero p { margin: 0 0 10px; max-width: var(--measure); color: #e2ecf9; }
.cp-news { margin-top: 4px; }
.cp-news a { display: inline-flex; align-items: center; min-height: 44px; color: #fff; font-weight: 600; }
.cp-checked { display: inline-block; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); font-size: 0.875rem; }
.cp-checked a { color: #fff; }

main section { padding: 36px 0; border-bottom: 1px solid var(--line); }
h2 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 6px; color: var(--navy); }
h3 { font-size: 1.125rem; margin: 22px 0 6px; color: var(--navy); }
h4 { font-size: 1.125rem; margin: 22px 0 6px; color: var(--navy); }
.lead { color: var(--text-2); margin: 0 0 14px; }
ul, ol { padding-left: 22px; margin: 6px 0 10px; }
li { margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; padding: 0; list-style: none; }
.facts li { margin: 0; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.facts strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.ladder { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 10px 0; list-style: none; counter-reset: step; }
.ladder li { margin: 0; background: var(--primary-light); color: var(--navy); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 0.875rem; }
.ladder li:not(:last-child)::after { content: '\2192'; margin-left: 10px; color: var(--muted); }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.note strong { color: #7c2d12; }
.sources { font-size: 0.875rem; color: var(--muted); margin-top: 14px; }
.sources a { color: var(--primary-dark); }
table { width: 100%; border-collapse: collapse; margin: 12px 0; }
caption { text-align: left; color: var(--muted); font-size: 0.875rem; padding-bottom: 6px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--soft); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table-wrap { overflow-x: auto; }

/* ---------- Find my route ---------- */
.finder-section { background: var(--soft); }
.finder-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.finder-head h2 { margin: 0; }
.lang-switch { display: inline-flex; border: 2px solid var(--primary); border-radius: 999px; overflow: hidden; background: #fff; }
.lang-switch[hidden] { display: none; }
.lang-switch button { min-height: 44px; min-width: 72px; padding: 8px 16px; border: 0; background: #fff; color: var(--primary-dark); font: inherit; font-weight: 600; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.lang-switch button:focus-visible { outline-offset: -4px; }
/* The finder uses the full width, so the route runs on one line on a computer */
main .finder-section .wrap > .finder { max-width: none; overflow-anchor: none; }
.finder-lead { margin: 14px 0 0; color: var(--text-2); }
.finder-lead[hidden] { display: none; }
.finder-panel { margin-top: 14px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.finder-panel-title { margin: 0 0 8px; font-size: 1.25rem; line-height: 1.35; }
.finder-hint { margin: 0; color: var(--text-2); }
.finder-reopened { margin-top: 6px; }

/* The folding route: stops on one line that folds into rows on a phone (js/career-route-map.js).
   Done: filled dot and solid line. Ahead: hollow dot and dashed line. Here: the ship. */
.route-map-card { margin-top: 14px; padding: 12px 8px 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.route-map { position: relative; }
.route-line { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.route-seg { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 7; }
.route-seg.is-solid { stroke: var(--primary-dark); stroke-dasharray: none; }
.route-stop { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 0 2px 4px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: center; cursor: pointer; }
.route-stop:disabled { cursor: default; }
.route-dot { flex: none; width: 16px; height: 16px; border: 3px solid var(--muted); border-radius: 999px; background: #fff; }
.route-stop.is-done .route-dot { border-color: var(--primary-dark); background: var(--primary-dark); }
.route-stop.is-now .route-dot { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.route-stop.is-selected .route-dot { box-shadow: 0 0 0 4px var(--warn-line); }
.stop-name, .stop-value { display: -webkit-box; max-width: 100%; overflow: hidden; font-size: 0.75rem; line-height: 1.35; overflow-wrap: break-word; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.stop-name { color: var(--muted); }
.stop-value { font-weight: 600; color: var(--navy); }
.route-stop.is-ahead:not(:disabled) .stop-value { color: var(--primary-dark); }
.route-stop.is-selected .stop-value, .route-stop:hover:not(:disabled) .stop-value { text-decoration: underline; }
.route-ship { position: absolute; width: 20px; margin-left: -10px; font-size: 1.125rem; line-height: 20px; text-align: center; color: var(--primary-dark); pointer-events: none; }
@keyframes route-sail { from { transform: translate(var(--ship-dx, 0), var(--ship-dy, 0)); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
    .route-ship.is-sailing { animation: route-sail 0.5s ease-out; }
}
.route-map-hint { margin: 2px 8px 4px; font-size: 0.875rem; color: var(--text-2); }

/* Panels under the map */
.route-option { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--primary-dark); font: inherit; font-weight: 600; line-height: 1.35; text-align: left; cursor: pointer; }
.route-option:hover, .route-option[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-light); }
.route-card .route-option { margin: 2px 0 6px; }
.route-switch { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.route-switch li { margin: 0; }
.route-card.is-drawn { border-color: var(--primary); }
.port-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.port-name { margin: 6px 0 0; font-size: 1.125rem; color: var(--navy); }
.port-takes-label { margin: 12px 0 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.port-top { font-weight: 600; color: var(--navy); }
.port-calc { margin: 10px 0 0; }
.finder-docs, .finder-notes, .finder-links { margin: 0; }
.finder-others, .finder-cadet { margin-top: 18px; }
.finder-cadet .route-card { margin-top: 10px; }
.route-switch .route-checks, .route-switch .finder-notes { margin: 6px 0 0; }
.route-verdict.tone-warn { margin: 6px 0 0; color: var(--warn-text); }
.way-closed .route-verdict { margin: 0; color: var(--no); }
.finder-reads { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.finder-reads .route-read { margin-top: 0; }
.finder-stcw { margin: 8px 0 12px; }
.finder-stcw p { margin: 4px 0 0; }
.finder-footer { margin-top: 18px; border-top: 1px solid var(--line); }
.finder-options { display: grid; gap: 10px; margin-top: 16px; }
.finder-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.4; text-align: left; cursor: pointer; }
.finder-option i { color: var(--primary-dark); flex-shrink: 0; }
.finder-option:hover, .finder-option[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-light); }
.finder-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.finder-summary { margin: 14px 0; font-size: 1.125rem; font-weight: 700; color: var(--navy); }
.route-cards { display: grid; gap: 14px; }
.route-card { padding: 16px 18px; border: 1px solid var(--line); border-left: 6px solid var(--muted); border-radius: 12px; background: #fff; }
.route-card.tone-ok { border-left-color: var(--ok); }
.route-card.tone-warn { border-left-color: var(--warn-edge); }
.route-card.tone-wait, .route-card.tone-info { border-left-color: var(--primary); }
.route-best { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 2px 10px; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.route-name { margin: 0 0 4px; font-size: 1.125rem; line-height: 1.35; }
.route-verdict { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.tone-ok .route-verdict { color: var(--ok); }
.tone-warn .route-verdict { color: var(--warn-text); }
.tone-wait .route-verdict, .tone-info .route-verdict { color: var(--primary-dark); }
.route-checks { display: grid; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.route-checks li { margin: 0; padding: 8px 12px; border: 1px solid var(--warn-line); border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); }
.route-need { margin: 0 0 10px; }
.route-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 0 0 4px; }
.route-facts div { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.route-facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.route-facts dd { margin: 0; }
.route-card h5 { margin: 14px 0 6px; font-size: 1rem; color: var(--navy); }
.route-week { margin: 0; padding-left: 20px; }
.route-read { margin-top: 12px; }
.finder-closed, .finder-outs, .finder-also { margin-top: 18px; }
.finder-closed h4, .finder-outs h4, .finder-also h4 { margin: 0 0 6px; }
.finder-closed ul { margin: 0; padding: 0; list-style: none; }
.finder-closed li { margin: 0; padding: 6px 0; border-top: 1px solid var(--line); }
.finder-closed li > i { color: var(--no); }
.finder-minimum { margin: 14px 0 0; font-size: 0.875rem; color: var(--muted); }
.finder-fraud { margin-top: 18px; }
.finder-fraud-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.finder-fraud ul { margin-bottom: 0; }
.finder-fraud .link-button, .finder-fraud a { color: #7c2d12; }
.finder-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.finder-share-status { flex-basis: 100%; margin: 0; font-size: 0.875rem; color: var(--text-2); }
.finder-share-status:empty { display: none; }
.finder-share-fallback { flex-basis: 100%; }
.finder-share-fallback[hidden] { display: none; }
.finder-share-fallback label { display: block; font-size: 0.875rem; font-weight: 600; }
.finder-share-fallback input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--muted); border-radius: 8px; font: inherit; font-size: 1rem; }

/* ---------- All routes ---------- */
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.route-grid li { margin: 0; }
.route-tile { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 2px; height: 100%; min-height: 44px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); text-decoration: none; }
.route-tile:hover { border-color: var(--primary); background: var(--primary-light); }
.route-tile i { grid-row: span 2; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: var(--primary-light); color: var(--primary-dark); font-size: 1.125rem; }
.tile-name { font-weight: 700; color: var(--navy); }
.tile-suits { font-size: 0.875rem; color: var(--text-2); }

/* ---------- The full guide: one <details> per section ---------- */
.guide-tools { border-bottom: 1px solid var(--line); }
.guide-tools .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 20px; }
.guide-tools p { margin: 0; color: var(--text-2); }
.guide-sec { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.guide-sec > summary { position: relative; display: block; min-height: 44px; padding: 14px 52px 14px 16px; cursor: pointer; list-style: none; }
.guide-sec > summary::-webkit-details-marker { display: none; }
.guide-sec > summary::after { content: ''; position: absolute; top: 22px; right: 20px; width: 10px; height: 10px; border-right: 3px solid var(--primary-dark); border-bottom: 3px solid var(--primary-dark); transform: rotate(45deg); }
.guide-sec[open] > summary::after { top: 27px; transform: rotate(-135deg); }
.guide-sec > summary:hover { background: var(--soft); border-radius: 12px; }
.guide-sec-title { margin: 0; font-size: 1.25rem; line-height: 1.35; }
.guide-sec-sum { display: block; margin-top: 4px; color: var(--text-2); }
.guide-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.guide-body > * { max-width: 800px; }
.guide-body > .table-wrap, .guide-body > .facts, .guide-body > .ladder { max-width: 1000px; }
.guide-en-note { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--primary-light); color: var(--navy); font-weight: 600; }
.guide-en-note[hidden] { display: none; }

.cp-cta { background: var(--soft); text-align: center; }
.cp-cta p { color: var(--text-2); max-width: var(--measure); margin: 0 auto 16px; }
.cp-note { padding: 24px 0 40px; font-size: 0.875rem; color: var(--muted); }
.cp-note p { margin: 0; }

@media (min-width: 720px) {
    .finder-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .wrap { padding: 0 16px; }
    .cp-hero { padding: 28px 0 24px; }
    main section { padding: 28px 0; }
    .finder-panel { padding: 16px; }
    .route-card { padding: 14px; }
    .guide-body { padding: 4px 12px 12px; }
    /* Tables become one card per row: three narrow columns are unreadable on a phone */
    table, caption, tbody, tr, th, td { display: block; }
    thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    tbody tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
    tbody th, tbody td { border: 0; padding: 2px 0; }
    tbody th { color: var(--navy); margin-bottom: 4px; }
    tbody td + td { color: var(--text-2); }
}
/* "Routes at a glance" has five columns: cards already on small tablets, each value with its label */
@media (max-width: 760px) {
    .glance, .glance tbody, .glance tr, .glance th, .glance td { display: block; }
    .glance thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .glance tbody tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
    .glance tbody th, .glance tbody td { border: 0; padding: 4px 0; }
    .glance tbody th { font-size: 1.125rem; }
    .glance td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
}
@media (prefers-reduced-motion: no-preference) {
    .guide-sec > summary::after { transition: transform 0.2s ease; }
}
@media print {
    .cp-cta, .finder-nojs, .lang-switch, .route-map-hint, .route-option, .finder-nav, .finder-share, .route-read, .guide-tools { display: none; }
    details.guide-sec::details-content { content-visibility: visible; display: block; }
    .guide-sec > summary::after { display: none; }
    .guide-sec { break-inside: auto; }
}
