/* GFT route-page components, layered over the site token base. */

:root {
    /* V1 has colour, font and width tokens only. These are the missing three. */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 1px 5px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.05);
    --hairline: var(--gray-200);
    --rail-width: 340px;
    --header-height: 64px;
}

/* One card treatment for every card on the page: outline plus a shadow small
   enough to read as a hairline. Never a heavy shadow. */
.card-chrome {
    background: var(--white);
    outline: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* Sticky 64px header eats any heading an in-page anchor lands on. */
[id] { scroll-margin-top: calc(var(--header-height) + var(--space-4)); }

/* ── Route page layout ────────────────────────────────────────────────
   Single column by default. Above 1000px it becomes prose + rail, and the
   rail is out of flow for a reader who scrolls, but still after the prose in
   the source order so an extractor reads the sentences first. */
.route-layout { max-width: var(--max-width); }
.route-main { min-width: 0; max-width: var(--content-width); }

@media (min-width: 1000px) {
    .route-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--rail-width);
        gap: var(--space-8);
        align-items: start;
    }
    .route-main { max-width: none; }
    .book-rail {
        position: sticky;
        top: calc(var(--header-height) + var(--space-4));
    }
}

/* V1 styles .route-content h2/h3/p/ul/a but has no h1 rule at all, so route
   H1s fall back to the UA default: 2em in Lato instead of Playfair. */
.route-content h1 {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--navy);
    margin: 0 0 var(--space-2);
}
.route-content .h1-sub {
    font-size: 1.05rem;
    color: var(--gray-500);
    margin: 0 0 var(--space-6);
}
@media (max-width: 600px) {
    .route-content h1 { font-size: 1.7rem; }
}

/* ── Answer block ─────────────────────────────────────────────────────
   First thing in the content column, above the prose. Every figure in the
   tiles below is also stated in the paragraph above them, so a readability
   extractor that drops the chrome still gets a quotable sentence. */
.answer-block {
    padding: var(--space-6);
    margin: 0 0 var(--space-8);
}
.answer-block h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--navy);
    margin: 0 0 var(--space-3);
    border: 0;
    padding: 0;
}
.route-content .answer-lede {
    font-size: 1.02rem;
    line-height: 1.65;
    margin: 0 0 var(--space-4);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--hairline);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
}
.stat { background: var(--white); padding: var(--space-3) var(--space-4); }
.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    display: block;
    line-height: 1.4;
}
.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    display: block;
    line-height: 1.35;
}
.stat-value small { font-size: 0.8rem; font-weight: 400; color: var(--gray-500); }
/* Two related figures in one tile, hairline between. */
.stat-split { display: flex; gap: var(--space-4); }
.stat-split > div { flex: 1 1 0; min-width: 0; }
.stat-split > div + div {
    border-left: 1px solid var(--hairline);
    padding-left: var(--space-4);
}

/* ── Sailing-day chips ────────────────────────────────────────────────
   Seven chips extract as the bare string MTWTFSS, which reads the same for a
   daily ferry and a Sunday-only one. The prose form always sits next to them
   (.days-prose), never behind display:none. */
.days-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    min-height: 44px;
    margin: var(--space-4) 0 0;
}
ul.ferry-days {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.ferry-days li {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    background: var(--gray-100);
    color: var(--gray-500);
    margin: 0;
}
ul.ferry-days li.on { background: var(--ocean); color: var(--white); }
.days-prose { font-size: 0.9rem; color: var(--gray-700); }
.days-prose strong { color: var(--navy); }

/* ── Booking rail card ────────────────────────────────────────────────
   Static HTML from data the build already holds. From/To are known on a route
   page, so there is no search form here and no JavaScript. */
.book-card { padding: var(--space-4) var(--space-6) var(--space-6); }
.book-card h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--navy);
    margin: 0 0 var(--space-3);
    border: 0;
    padding: 0;
}
.book-price {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--navy);
    line-height: 1.1;
}
.book-price-note { font-size: 0.85rem; color: var(--gray-500); }
.book-facts { list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.book-facts li {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}
.book-facts li:last-child { border-bottom: 0; }
.book-facts .k { color: var(--gray-500); }
.book-facts .v { color: var(--navy); font-weight: 700; text-align: right; }
.book-classes { margin: var(--space-4) 0 0; font-size: 0.85rem; color: var(--gray-700); }

/* One call to action, one colour, on the site's own blue. */
.rail-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--ocean);
    color: var(--white) !important;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}
/* One hover rule covers the button on any background. */
.rail-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    transition: opacity 0.2s;
}
.rail-cta:hover::before, .rail-cta:focus-visible::before { opacity: 0.1; }
.rail-cta span { position: relative; }
.rail-note {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin: var(--space-3) 0 0;
    line-height: 1.5;
}

/* On a phone the rail is not a rail: it follows the prose in one column. */
@media (max-width: 999px) {
    .book-rail { margin: var(--space-8) 0 0; }
}

/* ── Tables ───────────────────────────────────────────────────────────
   V1 sets `th { white-space: nowrap }` with no overflow-x anywhere in 746
   lines, so a six-column timetable pushes the body sideways at 390px. */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-4) 0 var(--space-6);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
}
.route-content .table-scroll table { margin: 0; }
.route-content .table-scroll table th:first-child,
.route-content .table-scroll table td:first-child { padding-left: var(--space-4); }
.route-content .table-scroll table tr:last-child td { border-bottom: 0; }
.table-scroll table td.days-cell { white-space: nowrap; }
.table-scroll table td.days-cell ul.ferry-days { display: inline-flex; vertical-align: middle; }
.table-scroll table td.days-cell .days-prose { margin-left: var(--space-2); }

/* ── Fares ────────────────────────────────────────────────────────────*/
.fare-group { margin: 0 0 var(--space-6); }
.fare-group > h3 { margin-top: var(--space-6); }
.route-content .fromfare {
    font-size: 1.05rem;
    background: var(--sky);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
}
.pso-block {
    background: var(--sand);
    border-left: 4px solid var(--navy);
    border-radius: var(--radius-sm);
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
}
.pso-block h3 { margin-top: 0 !important; }
.pso-block .table-scroll { background: var(--white); }
.badge {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.8rem;
    font-weight: 700;
}
.badge-hs { background: var(--sky); color: var(--navy); }

/* ── Horizon flag and provenance ──────────────────────────────────────*/
.route-content .horizon {
    border-left: 4px solid #8a5a0b;
    background: #fdf6e7;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: var(--space-3) var(--space-4);
    margin: 0 0 var(--space-6);
    font-size: 0.92rem;
}
.route-content .horizon p { margin: 0; }
footer.provenance {
    font-size: 0.82rem;
    color: var(--gray-500);
    border-top: 1px solid var(--hairline);
    margin-top: var(--space-8);
    padding-top: var(--space-4);
    line-height: 1.6;
}

/* ── 44px touch targets ───────────────────────────────────────────────
   V1's buttons are `padding: .4rem .9rem`, about 27px tall. */
.site-nav a,
.footer-nav a,
.breadcrumbs a,
.link-list a,
.route-content .ferry-book-btn,
.route-content .transfer-cta-btn,
.route-content .ferry-booking-cta a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.link-list a { width: 100%; }
.route-content .ferry-booking-cta li { margin: 0 !important; }

/* ── Homepage ─────────────────────────────────────────────────────────*/
.home-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--ocean-dark) 100%);
    color: var(--white);
    padding: 3.5rem 1.5rem;
    text-align: center;
}
.home-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: var(--space-4);
    line-height: 1.15;
}
.home-hero .hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.92;
    max-width: 620px;
    margin: 0 auto;
}
.home-hero .hero-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-8);
    margin-top: var(--space-8);
}
.home-hero .hero-stat strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.9rem;
    line-height: 1.1;
}
.home-hero .hero-stat span { font-size: 0.85rem; opacity: 0.85; }
@media (max-width: 600px) {
    .home-hero h1 { font-size: 2rem; }
    .home-hero .hero-stats { gap: var(--space-6); }
}

.home-section { padding: 2.5rem 0; }
.home-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--navy);
    margin-bottom: var(--space-2);
}
.home-section .section-intro {
    color: var(--gray-700);
    max-width: var(--content-width);
    margin-bottom: var(--space-6);
}
.home-alt { background: var(--gray-50); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }

.route-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-4);
}
.route-card {
    display: block;
    padding: var(--space-4);
    text-decoration: none;
    color: var(--gray-900);
    transition: box-shadow 0.2s, transform 0.2s;
}
.route-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.09); }
.route-card .rc-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    display: block;
    line-height: 1.3;
}
.route-card .rc-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: block;
    margin-top: var(--space-2);
}
.route-card .rc-price { color: var(--ocean-dark); font-weight: 700; }

.az-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}
.az-nav a {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-2);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ocean-dark);
    font-weight: 700;
    background: var(--white);
}
.az-nav a:hover { background: var(--sky); }

.port-block { margin: 0 0 var(--space-8); }
.port-block h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--navy);
    margin: 0 0 var(--space-1);
}
.port-block .port-region {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-3);
}
ul.link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 3;
    column-gap: var(--space-8);
}
ul.link-list li { break-inside: avoid; border-bottom: 1px solid var(--gray-200); }
ul.link-list a {
    color: var(--ocean);
    text-decoration: none;
    font-size: 0.9rem;
    justify-content: space-between;
    gap: var(--space-3);
}
ul.link-list a:hover { text-decoration: underline; }
ul.link-list .n { color: var(--gray-500); font-size: 0.8rem; flex: none; }
@media (max-width: 900px) { ul.link-list { columns: 2; } }
@media (max-width: 600px) { ul.link-list { columns: 1; } }
