/*
 * The legal pages (resources/views/legal.blade.php). Colours and sizes from css/tripdo-theme.css (--td-*); breadcrumb and the
 * rhythm between sections from css/destinations.css; the buttons from css/cookie-consent.css (.tpc-btn).
 */
.lg-page { --lg-sticky: 96px; }

/* ── Title ── */
.lg-page > .lg-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-top: 8px; }
.lg-head__title { margin: 0; font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--td-text); }
.lg-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--td-muted); }
.lg-print { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 500; color: var(--td-teal); cursor: pointer; }
.lg-print:hover { text-decoration: underline; }
.lg-print svg { width: 17px; height: 17px; }

/* ── The five pages ── */
.lg-page > .lg-tabs { display: flex; gap: 6px; margin-top: 20px; padding-bottom: 12px; overflow-x: auto; border-bottom: 1px solid var(--td-border); scrollbar-width: none; }
.lg-tabs::-webkit-scrollbar { display: none; }
.lg-tabs__item { flex: none; padding: 7px 14px; border-radius: var(--td-radius-pill); font-size: 14px; font-weight: 500; color: var(--td-body) !important; text-decoration: none !important; white-space: nowrap; transition: background-color var(--td-fast) ease, color var(--td-fast) ease; }
.lg-tabs__item:hover { background: var(--td-surface-2); color: var(--td-text) !important; }
.lg-tabs__item.is-on { background: var(--td-navy); color: #fff !important; }

.lg-note { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--td-radius); background: var(--td-sun-50); font-size: 13.5px; line-height: 1.5; color: var(--td-body); }
.lg-note a { font-weight: 600; color: var(--td-teal); text-decoration: underline; }

/* ── Contents beside the text ── */
.lg-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: start; margin-top: 32px; }
.lg-toc { position: sticky; top: var(--lg-sticky); max-height: calc(100vh - var(--lg-sticky) - 24px); overflow-y: auto; font-size: 14px; scrollbar-width: thin; }
.lg-toc summary { margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--td-muted); cursor: default; list-style: none; }
.lg-toc summary::-webkit-details-marker { display: none; }
.lg-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: lg-toc -1; }
.lg-toc li { counter-increment: lg-toc; }
.lg-toc a { display: block; padding: 6px 12px; border-inline-start: 2px solid var(--td-border); line-height: 1.35; color: var(--td-body) !important; text-decoration: none !important; transition: color var(--td-fast) ease, border-color var(--td-fast) ease; }
.lg-toc li:not(:first-child) a::before { content: counter(lg-toc) ". "; color: var(--td-muted); }
.lg-toc a:hover { color: var(--td-text) !important; border-color: var(--td-border-strong); }
.lg-toc a.is-on { border-color: var(--td-teal); font-weight: 600; color: var(--td-text) !important; }

/* ── The text ── */
.lg-body { min-width: 0; max-width: 820px; counter-reset: lg -1; }
.lg-section { counter-increment: lg; margin-top: 36px; scroll-margin-top: var(--lg-sticky); }
.lg-section:first-child { margin-top: 0; }
.lg-page .lg-section__title { margin: 0 0 10px; font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--td-text); }
.lg-section:not(.is-short) .lg-section__title::before { content: counter(lg) ". "; color: var(--td-teal); }
.lg-section.is-short { padding: 20px 24px; border-radius: var(--td-radius-lg); background: linear-gradient(135deg, var(--td-navy-50), var(--td-teal-50)); }
.lg-text { font-size: 15.5px; line-height: 1.7; color: var(--td-body); overflow-wrap: break-word; }
.lg-text > :first-child { margin-top: 0; }
.lg-text > :last-child { margin-bottom: 0; }
.lg-text p { margin: 0 0 12px; }
.lg-text ul, .lg-text ol { margin: 0 0 12px; padding-inline-start: 20px; list-style: disc; }
.lg-text ol { list-style: decimal; }
.lg-text li { margin-bottom: 6px; }
.lg-text strong { font-weight: 600; color: var(--td-text); }
.lg-text a { font-weight: 500; color: var(--td-teal); text-decoration: underline; text-underline-offset: 2px; }
.lg-text table { width: 100%; margin: 4px 0 14px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--td-border); border-radius: var(--td-radius); font-size: 14px; line-height: 1.5; overflow: hidden; }
.lg-text th { padding: 10px 14px; background: var(--td-surface-2); font-weight: 600; text-align: start; color: var(--td-text); }
.lg-text td { padding: 10px 14px; border-top: 1px solid var(--td-border); vertical-align: top; }
.lg-text td:first-child { color: var(--td-text); font-weight: 500; }

/* ── Company details, cookie choice, questions ── */
.lg-facts { margin-bottom: 32px; padding: 20px 24px; border: 1px solid var(--td-border); border-radius: var(--td-radius-lg); background: #fff; box-shadow: var(--td-shadow-sm); }
.lg-page .lg-facts__title { margin: 0 0 12px; font-size: 18px; font-weight: 700; color: var(--td-text); }
.lg-facts dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.lg-facts dt { font-size: 13px; font-weight: 500; color: var(--td-muted); }
.lg-facts dd { margin: 2px 0 0; font-size: 15px; line-height: 1.5; color: var(--td-text); overflow-wrap: anywhere; }
.lg-facts a { color: var(--td-teal); }

.lg-choice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 32px; padding: 18px 24px; border-radius: var(--td-radius-lg); background: var(--td-sun-50); }
.lg-page .lg-choice__title { margin: 0 0 2px; font-size: 18px; font-weight: 700; color: var(--td-text); }
.lg-choice p { margin: 0; font-size: 14.5px; color: var(--td-body); }

.lg-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 44px; padding: 22px 24px; border-radius: var(--td-radius-lg); background: linear-gradient(120deg, var(--td-navy-900), var(--td-navy) 60%, var(--td-teal)); color: #fff; }
.lg-page .lg-help__title { margin: 0 0 2px; font-size: 19px; font-weight: 700; color: #fff; }
.lg-help p { margin: 0; font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.lg-help .lg-help__who { margin-top: 8px; font-size: 13.5px; }
.lg-help__who a { color: #fff; text-decoration: underline; }
.lg-help__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-help .tpc-btn--main { border-color: var(--td-sun); background: var(--td-sun); color: var(--td-navy-900) !important; }
.lg-help .tpc-btn--main:hover { border-color: #fff; background: #fff; }
.lg-help .tpc-btn--line { border-color: rgba(255, 255, 255, .55); background: none; color: #fff !important; }
.lg-help .tpc-btn--line:hover { border-color: #fff; background: rgba(255, 255, 255, .12); }

/* ── Smaller screens ── */
@media (max-width: 991.98px) {
    .lg-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; }
    .lg-toc { position: static; max-height: none; overflow: visible; padding: 12px 16px; border: 1px solid var(--td-border); border-radius: var(--td-radius-lg); }
    .lg-toc summary { position: relative; margin: 0; font-size: 14.5px; color: var(--td-text); cursor: pointer; }
    .lg-toc summary::after { content: "+"; position: absolute; inset-inline-end: 0; top: -2px; font-size: 20px; font-weight: 400; color: var(--td-teal); }
    .lg-toc[open] summary { margin-bottom: 10px; }
    .lg-toc[open] summary::after { content: "×"; }
    .lg-body { max-width: none; }
}
@media (max-width: 767.98px) {
    .lg-page { --lg-sticky: 16px; }
    .lg-section { margin-top: 28px; }
    .lg-section.is-short, .lg-facts, .lg-choice, .lg-help { padding: 16px 18px; }
    .lg-page .lg-section__title { font-size: 19px; }
    .lg-facts dl { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    /* A table too wide for a phone scrolls by itself, not the page. */
    .lg-text table { display: block; overflow-x: auto; font-size: 13.5px; }
    .lg-text td:first-child { overflow-wrap: normal; }
    .lg-choice .tpc-btn, .lg-help__actions, .lg-help__actions .tpc-btn { flex: 1 1 100%; }
}

/* ── Printing: only the title and the text ── */
@media print {
    body * { visibility: hidden; }
    .lg-page, .lg-page * { visibility: visible; }
    .lg-page { position: absolute; inset: 0 0 auto; width: 100%; max-width: none; padding: 0; }
    .lg-tabs, .lg-toc, .lg-print, .lg-help, .lg-choice, .td-crumbs { display: none !important; }
    .lg-grid { display: block; margin-top: 16px; }
    .lg-body { max-width: none; }
    .lg-section.is-short { padding: 0; background: none; }
    .lg-section { break-inside: avoid-page; }
}
