/*
 * The website's legal / policy pages (task 758): Privacy, Terms,
 * Cancellation and Refund, and /b2b which shares the view.
 *
 * Loaded by privacy.blade.php, terms.blade.php and page-content.blade.php
 * only, before the design system (gotaxi-site.css), and written against its
 * tokens: the brand colour, its soft tint and deep text shade come from
 * layout/theme-vars, so a dark-header cyan brand and a light yellow brand
 * both draw these pages in their own colours. Rules that refine a design-
 * outrank it there and nowhere else. The hero follows About / FAQ
 * (about-faq.css) without touching that file.
 *
 * Layout: a sticky table of contents (280px) beside a 72ch prose column at
 * desktop; one column under 992px with the contents as a collapsible block
 * on top. Printing drops the site chrome, the contents and the buttons.
 */

/* ------------------------------------------------------------------ */
/* Hero: as About / FAQ, with the brand's glow                          */
/* ------------------------------------------------------------------ */

/* Hero overlay removed (task 765). */
.gt-legal .gt-hero-actions { width: 100%; margin-top: var(--gt-s2); }
/* Task 773: a plain head now that the banner is gone (766) - the date pill on
   its own line, right-aligned, then the tab row whose bottom rule the current
   tab's indicator sits on. The old negative margins pulled the tabs through
   the rule. */
.gt-legal-hero-extras { display: flex; flex-direction: column; align-items: stretch; gap: var(--gt-s2); padding-bottom: 0; border-bottom: 0; }


/* The CMS text's own intro line ("Privacy Policy for Passengers of ..."): a muted subtitle, never a second title. */
.gt-legal-subtitle { margin: 0; max-width: 70ch; font-size: var(--gt-fs-md); font-weight: 500; letter-spacing: .01em; color: var(--gt-ink-soft, var(--gt-ink)); overflow-wrap: anywhere; }
.gt-legal-updated {
    display: inline-flex; align-items: center; gap: var(--gt-s2); margin: 0; width: fit-content; max-width: 100%;
    padding: 6px 12px 6px 10px; border-radius: 999px; order: -1; align-self: flex-end;
    border: 1px solid var(--gt-line); background: var(--gt-bg-2);
    font-size: var(--gt-fs-sm); color: var(--gt-ink-soft, var(--gt-ink));
}
.gt-legal-updated svg { flex: 0 0 auto; color: var(--gt-accent-deep, var(--gt-accent)); }
.gt-legal-updated time { color: var(--gt-ink); font-weight: 500; }

/* The switcher: tabs along the hero's bottom edge, the current one carrying the brand rule. */
.gt-legal-switcher {
    display: flex; flex-wrap: wrap; gap: var(--gt-s1) var(--gt-s2); margin: 0;
    padding-top: 0; border-top: 0; border-bottom: 1px solid var(--gt-line); max-width: 100%;
}
.gt-legal-tab {
    position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px;
    color: var(--gt-ink-soft, var(--gt-ink)) !important; font-size: var(--gt-fs-md); font-weight: 500; text-decoration: none !important; white-space: nowrap;
    border-radius: var(--gt-r-sm) var(--gt-r-sm) 0 0; transition: color var(--gt-t-fast) var(--gt-ease), background var(--gt-t-fast) var(--gt-ease);
}
.gt-legal-tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background var(--gt-t-fast) var(--gt-ease); }
.gt-legal-tab:hover { color: var(--gt-ink) !important; background: var(--gt-bg-2); }
.gt-legal-tab.is-current { color: var(--gt-accent-deep) !important; font-weight: 600; }
.gt-legal-tab.is-current::after { background: var(--gt-accent); }
.gt-legal-tab:focus-visible { outline: 2px solid var(--gt-accent); outline-offset: -2px; }

/* ------------------------------------------------------------------ */
/* Layout                                                               */
/* ------------------------------------------------------------------ */

.gt-section.gt-legal-main { padding-top: clamp(40px, 5vw, 64px); padding-bottom: var(--gt-s12); }
.gt-legal-layout {
    display: grid; grid-template-columns: 280px minmax(0, 72ch); justify-content: space-between; align-items: start;
    gap: var(--gt-s10) clamp(32px, 6vw, 96px);
}
.gt-legal--no-toc .gt-legal-layout { grid-template-columns: minmax(0, 72ch); justify-content: center; }
.gt-legal--no-toc .gt-legal-toc { display: none; }
.gt-legal-body { min-width: 0; }

/* The contents, stuck beside the text as it scrolls. */
.gt-legal-aside { position: sticky; top: calc(var(--gt-header-h) + var(--gt-s6)); display: grid; gap: var(--gt-s4); min-width: 0; }
.gt-legal-toc { border: 1px solid var(--gt-line); border-radius: var(--gt-r-lg); background: var(--gt-bg-2); overflow: hidden; }
.gt-legal-toc-summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--gt-s3); list-style: none; cursor: pointer;
    padding: 14px 18px; font-size: var(--gt-fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gt-muted);
    -webkit-tap-highlight-color: transparent;
}
.gt-legal-toc-summary::-webkit-details-marker, .gt-legal-toc-summary::marker { display: none; content: ""; }
.gt-legal-toc-summary:focus-visible { outline: none; box-shadow: var(--gt-focus); border-radius: var(--gt-r-lg); }
.gt-legal-toc-chevron { flex: 0 0 auto; color: var(--gt-muted); transition: transform var(--gt-t) var(--gt-ease); }
.gt-legal-toc[open] .gt-legal-toc-chevron { transform: rotate(180deg); }
.gt-legal-toc-nav { max-height: calc(100vh - var(--gt-header-h) - 180px); overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; }
.gt-legal-toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gt-legal-toc-item a {
    position: relative; display: block; padding: 8px 10px 8px 14px; border-radius: var(--gt-r-sm);
    color: var(--gt-text-2) !important; font-size: var(--gt-fs-sm); line-height: 1.4; text-decoration: none !important;
    border-inline-start: 2px solid transparent; overflow-wrap: anywhere;
    transition: color var(--gt-t-fast) var(--gt-ease), background var(--gt-t-fast) var(--gt-ease), border-color var(--gt-t-fast) var(--gt-ease);
}
.gt-legal-toc-item a:hover { color: var(--gt-ink) !important; background: var(--gt-bg-3); }
.gt-legal-toc-item a.is-active { color: var(--gt-accent-deep) !important; font-weight: 600; background: var(--gt-accent-soft); border-inline-start-color: var(--gt-accent); }
.gt-legal-toc-item a:focus-visible { outline: none; box-shadow: var(--gt-focus); }
.gt-legal-toc-item--l3 a { padding-inline-start: 26px; font-size: var(--gt-fs-xs); }
.gt-legal-tools { display: flex; flex-wrap: wrap; gap: var(--gt-s2); }
.gt-legal-print { gap: 8px; }
.gt-legal-print svg { flex: 0 0 auto; }

/* ------------------------------------------------------------------ */
/* The text: a clear hierarchy over the CMS markup                     */
/* ------------------------------------------------------------------ */

.gt-legal-prose { max-width: 72ch; font-size: 1.0625rem; line-height: 1.75; color: var(--gt-text-2); overflow-wrap: anywhere; }
.gt-legal-prose :where(h2, h3, h4) { color: var(--gt-ink); line-height: 1.3; letter-spacing: -.01em; scroll-margin-top: calc(var(--gt-header-h) + var(--gt-s6)); }
.gt-legal-prose :where(h2) { font-size: var(--gt-fs-2xl); font-weight: 700; margin: 2em 0 .7em; padding-top: 1.1em; border-top: 1px solid var(--gt-line); }
.gt-legal-prose > :where(h2:first-child) { margin-top: 0; padding-top: 0; border-top: 0; }
.gt-legal-prose :where(h3) { font-size: var(--gt-fs-xl); font-weight: 600; margin: 1.6em 0 .5em; }
.gt-legal-prose :where(h4) { font-size: var(--gt-fs-lg); font-weight: 600; margin: 1.4em 0 .4em; }
.gt-legal-prose :where(h2, h3, h4) :where(strong, b) { font-weight: inherit; }
.gt-legal-prose :where(p) { margin: 0 0 1.1em; }
.gt-legal-prose > :where(p:first-child) { font-size: 1.125rem; color: var(--gt-text); }
.gt-legal-prose :where(strong, b) { color: var(--gt-ink); font-weight: 600; }
.gt-legal-prose :where(ul, ol) { margin: 0 0 1.3em; padding-inline-start: 0; }
.gt-legal-prose :where(ul) { list-style: none; }
.gt-legal-prose :where(ul > li) { position: relative; padding-inline-start: 1.6em; margin: .55em 0; }
.gt-legal-prose :where(ul > li)::before {
    content: ""; position: absolute; inset-inline-start: .25em; top: .72em;
    width: .45em; height: .45em; border-radius: 50%; background: var(--gt-accent);
}
.gt-legal-prose :where(ol) { padding-inline-start: 1.6em; }
.gt-legal-prose :where(ol > li) { margin: .55em 0; padding-inline-start: .2em; }
.gt-legal-prose :where(ol > li)::marker { color: var(--gt-accent-deep); font-weight: 600; }
.gt-legal-prose :where(li > ul, li > ol) { margin: .5em 0 .3em; }
.gt-legal-prose :where(a) { color: var(--gt-accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gt-legal-prose :where(a:hover) { color: var(--gt-ink); }
.gt-legal-prose :where(blockquote) { margin: 1.2em 0; padding: .2em 0 .2em 1.2em; border-inline-start: 3px solid var(--gt-accent); color: var(--gt-text); }
.gt-legal-prose :where(hr) { border: 0; border-top: 1px solid var(--gt-line); margin: 2em 0; }
.gt-legal-prose :where(table) { display: block; overflow-x: auto; border-collapse: collapse; margin: 1.2em 0; font-size: var(--gt-fs-md); }
.gt-legal-prose :where(th, td) { padding: 10px 12px; border: 1px solid var(--gt-line); text-align: start; vertical-align: top; }
.gt-legal-prose :where(th) { background: var(--gt-bg-2); color: var(--gt-ink); font-weight: 600; }
.gt-legal-prose :where(img, video, iframe) { max-width: 100%; height: auto; margin-block: var(--gt-s6); }
.gt-legal-empty { max-width: 70ch; display: grid; gap: var(--gt-s3); justify-items: start; }
.gt-legal-empty p { margin: 0; color: var(--gt-text-2); }

/* The foot: the date again, and how to reach us. */
.gt-legal-foot { margin-top: var(--gt-s10); padding-top: var(--gt-s6); border-top: 1px solid var(--gt-line); display: grid; gap: var(--gt-s5); max-width: 72ch; }
.gt-legal-foot-updated { margin: 0; font-size: var(--gt-fs-sm); color: var(--gt-muted); }
.gt-legal-foot-updated time { color: var(--gt-text); font-weight: 500; }
.gt-legal-contact {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--gt-s4) var(--gt-s8);
    padding: clamp(20px, 3vw, 28px); border: 1px solid var(--gt-line); border-radius: var(--gt-r-lg); background: var(--gt-bg-2);
}
.gt-legal-contact-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 240px; }
.gt-legal-contact-text strong { color: var(--gt-ink); font-size: var(--gt-fs-base); font-weight: 600; }
.gt-legal-contact-text p { margin: 0; color: var(--gt-text-2); font-size: var(--gt-fs-md); }
.gt-legal-contact-actions { display: flex; flex-wrap: wrap; gap: var(--gt-s2); min-width: 0; max-width: 100%; }
.gt-legal-contact-actions .gt-btn { max-width: 100%; }
.gt-legal-contact-actions .gt-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ */
/* Tablet and phone: one column, the contents fold at the top          */
/* ------------------------------------------------------------------ */

@media (max-width: 991px) {
    .gt-legal-layout, .gt-legal--no-toc .gt-legal-layout { grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: var(--gt-s6); }
    .gt-legal-aside { position: static; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
    .gt-legal-toc { grid-column: 1 / -1; }
    .gt-legal--no-toc .gt-legal-aside { grid-template-columns: minmax(0, 1fr); justify-items: end; }
    .gt-legal-toc-nav { max-height: none; }
    .gt-legal-tools { grid-column: 1 / -1; justify-content: flex-end; }
    .gt-legal-body { max-width: 72ch; }
    .gt-legal-prose :where(h2, h3, h4) { scroll-margin-top: calc(var(--gt-header-h) + var(--gt-s4)); }
}
@media (max-width: 599px) {
    .gt-legal-switcher { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 0; margin-inline: calc(-1 * var(--gt-gutter)); padding-inline: var(--gt-gutter); }
    .gt-legal-switcher::-webkit-scrollbar { display: none; }
    .gt-legal-tab { padding: 10px 12px; font-size: var(--gt-fs-sm); }
    .gt-legal-prose { font-size: 1rem; }
    .gt-legal-prose :where(h2) { font-size: var(--gt-fs-xl); }
    .gt-legal-prose :where(h3) { font-size: var(--gt-fs-lg); }
    .gt-legal-tools { justify-content: stretch; }
    .gt-legal-tools .gt-btn { width: 100%; }
    .gt-legal-contact-actions { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.gt-legal) { scroll-behavior: smooth; }
}

/* ------------------------------------------------------------------ */
/* Print: the text alone                                                */
/* ------------------------------------------------------------------ */

@media print {
    @page { margin: 18mm 16mm; }
    .gt-header, .gt-footer, .gt-legal-aside, .gt-legal-switcher,
    .gt-cookie, [data-gt-cookie], #dtCookieConsent, .dt-cc-overlay, #tawkchat-container, iframe[title*="chat" i] { display: none !important; }
    .gt-legal-contact-actions { display: block; }
    .gt-legal-contact-actions .gt-btn { display: inline; border: 0; background: none; padding: 0; min-height: 0; color: #000; font-size: 11pt; }
    .gt-legal-contact-actions .gt-btn + .gt-btn { display: none; }
    body.gt-site { background: #fff !important; color: #000 !important; }
    .gt-legal-updated { border: 0; background: none; padding: 0; }
    .gt-legal-updated svg { display: none; }
    .gt-section.gt-legal-main { padding: 0; }
    .gt-container { padding: 0; max-width: none; }
    .gt-legal-layout, .gt-legal--no-toc .gt-legal-layout { display: block; }
    .gt-legal-prose, .gt-legal-body, .gt-legal-foot { max-width: none; font-size: 11pt; line-height: 1.5; color: #000; }
    .gt-legal-prose :where(h2, h3, h4, strong, b) { color: #000; }
    .gt-legal-prose :where(h2) { font-size: 15pt; border-top-color: #bbb; break-after: avoid; }
    .gt-legal-prose :where(h3) { font-size: 13pt; break-after: avoid; }
    .gt-legal-prose :where(ul > li)::before { background: #000; }
    .gt-legal-prose :where(a) { color: #000; text-decoration: underline; }
    .gt-legal-prose :where(a[href^="http"])::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
    .gt-legal-prose :where(li, blockquote, table) { break-inside: avoid; }
    .gt-legal-foot { border-top-color: #bbb; }
    .gt-legal-contact { border: 0; background: none; padding: 0; }
    .gt-legal-contact-text strong, .gt-legal-contact-text p, .gt-legal-foot-updated, .gt-legal-foot-updated time { color: #000; }
}
