/* Terms and Conditions / legal page template.
   Mirrors F:\CyprusParadise-NewDesigns\prototypes\legal-pages\styles.css as closely as this
   page's architecture allows, re-mapped onto this site's own tokens (Layout.css) instead of that
   prototype's standalone --cp-* tokens, and scoped under .legal-page so it can't leak into the
   rest of the site. Verified 1:1 against Layout.css: --primary-color-2 (#218887) is exactly the
   prototype's --cp-primary-dark, --sky-tooltip-background (#def6f5) is exactly its
   --cp-primary-mist - used those instead of --dark-green/#e6f7f7, which don't actually match (the
   card/heading colour was visibly too dark, the mist tint visibly off). --cp-border (#d8e0e0) has
   no site equivalent, used as a literal to match. Headings now set Montserrat explicitly (site
   loads it - see _HeadAssets.cshtml - but nothing here was applying it) at the prototype's real
   sizes/weight/letter-spacing, not the unrelated 300/400 weights this had before.

   Checked against an actual rendered screenshot of the prototype (not just its source) and found
   this had over-applied --primary-color-2/teal to h1s and .legal-help's h2 that the prototype
   actually leaves as plain body text colour (only specific accents - print button, contents
   toggle/active link, table headers, links - are really teal), and had the print button/active
   contents link in the wrong teal (--primary-color, the brighter cyan) instead of
   --primary-color-2 (--cp-primary-dark, the one the prototype actually uses for those two).

   Clauses: LegalContentTocBuilder wraps each top-level H2 and the content after it in a
   <section class="legal-section" id>, exactly like the prototype's hand-authored markup, and wraps
   tables in .data-table. If an editor's H2s are nested (so they can't be wrapped), the old
   fallback still applies - the divider is a border-top on each bare h2 (.legal-card > h2). */

.legal-page { color: var(--dark-text-color); background: #f3f6f6; }

.legal-page .legal-hero { padding: 48px 0 54px; background: linear-gradient(130deg, var(--sky-tooltip-background), #fff 68%); }
.legal-page .breadcrumbs { display: flex; margin: 0 0 22px; gap: 8px; flex-wrap: wrap; color: var(--primary-text-color); font-size: 13px; }
.legal-page .breadcrumbs a { color: var(--primary-color-2); font-weight: 900; text-decoration: none; }
.legal-page .breadcrumbs a:hover { text-decoration: underline; }
.legal-page .legal-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.legal-page .legal-hero h1 { max-width: 820px; margin: 0; color: var(--dark-text-color); font-family: "Montserrat", "Lato", sans-serif; font-size: clamp(35px, 5vw, 56px); font-weight: 700; line-height: 1.06; letter-spacing: -.045em; }
.legal-page .legal-hero__intro { max-width: 780px; margin: 14px 0 0; color: var(--primary-text-color); font-size: 18px; }

.legal-page .legal-main { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 34px; align-items: start; padding-top: 40px; padding-bottom: 80px; }
.legal-page .contents { position: sticky; top: 20px; border: 1px solid #d8e0e0; border-radius: var(--main-border-radius); background: #fff; box-shadow: var(--general-box-shadow) var(--general-box-shadow-color); overflow: hidden; }
.legal-page .contents__toggle { display: flex; width: 100%; padding: 16px 18px; border: 0; align-items: center; justify-content: space-between; background: var(--primary-color-2); color: #fff; font-weight: 900; text-align: left; cursor: pointer; }
.legal-page .contents__toggle::after { content: "\2212"; font-size: 20px; }
.legal-page .contents__toggle[aria-expanded="false"]::after { content: "+"; }
.legal-page .contents__nav { max-height: calc(100vh - 115px); overflow: auto; padding: 9px; }
.legal-page .contents__nav[hidden] { display: none; }
.legal-page .contents__nav a { display: block; padding: 9px 10px; border-radius: 4px; color: var(--dark-text-color); font-size: 13px; font-weight: 700; line-height: 1.35; text-decoration: none; }
.legal-page .contents__nav a:hover,
.legal-page .contents__nav a.is-current { background: var(--sky-tooltip-background); color: var(--primary-color-2); }

.legal-page .legal-article { min-width: 0; }
.legal-page .legal-card { padding: clamp(22px, 4vw, 42px); border: 1px solid #d8e0e0; border-radius: 14px; background: #fff; box-shadow: var(--general-box-shadow) var(--general-box-shadow-color); }
.legal-page .legal-card > p:first-child { margin: 0 0 30px; padding: 0 0 24px; border-bottom: 1px solid #d8e0e0; font-size: 18px; }
.legal-page .legal-card h1 { margin: 0 0 16px; color: var(--dark-text-color); font-family: "Montserrat", "Lato", sans-serif; font-size: 28px; font-weight: 700; }
.legal-page .legal-card h2 { margin: 0 0 15px; color: var(--dark-text-color); font-family: "Montserrat", "Lato", sans-serif; font-size: clamp(23px, 3vw, 30px); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; scroll-margin-top: 24px; }

/* One clause per section (prototype's .legal-section). */
.legal-page .legal-section { padding: 10px 0 30px; border-bottom: 1px solid #d8e0e0; scroll-margin-top: 24px; }
.legal-page .legal-section + .legal-section { padding-top: 30px; }
.legal-page .legal-section:last-child { padding-bottom: 0; border-bottom: 0; }

/* Fallback when the H2s couldn't be wrapped into sections. */
.legal-page .legal-card > h2 { margin-top: 30px; padding-top: 30px; border-top: 1px solid #d8e0e0; }
.legal-page .legal-card > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-page .legal-card h3 { margin: 24px 0 8px; font-family: "Montserrat", "Lato", sans-serif; font-size: 19px; font-weight: 700; line-height: 1.3; }
.legal-page .legal-card p { margin: 0 0 14px; font-size: 16px; line-height: 1.65; }
.legal-page .legal-card ul,
.legal-page .legal-card ol { margin: 12px 0 18px; padding-left: 24px; }
.legal-page .legal-card li { margin: 7px 0; }
.legal-page .legal-card a { color: var(--primary-color-2); font-weight: 800; overflow-wrap: anywhere; }
.legal-page .legal-card table { width: 100%; margin: 18px 0; border-collapse: collapse; font-size: 14px; }
.legal-page .legal-card th,
.legal-page .legal-card td { padding: 12px; border: 1px solid #d8e0e0; vertical-align: top; text-align: left; }
.legal-page .legal-card th { background: var(--sky-tooltip-background); color: var(--primary-color-2); }
.legal-page .legal-card .data-table { overflow-x: auto; }
.legal-page .legal-card .callout { margin: 20px 0; padding: 16px; border-left: 4px solid var(--primary-color); background: var(--sky-tooltip-background); }
.legal-page .legal-card .callout strong { display: block; }

/* "Questions?" band - Settings > [legal page] > Sidebar Heading/Description/Phone/Email.
   Full-width under the page, like the prototype's .legal-help. */
.legal-page .legal-help { padding: 34px 0; background: var(--sky-tooltip-background); }
.legal-page .legal-help__inner { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.legal-page .legal-help h2 { margin: 0; color: var(--dark-text-color); font-family: "Montserrat", "Lato", sans-serif; font-size: 25px; font-weight: 700; }
.legal-page .legal-help p { margin: 4px 0 0; color: var(--dark-text-color); }
.legal-page .legal-help__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.legal-page .legal-help .btn { display: inline-flex; min-height: 48px; padding: 11px 20px; border-radius: var(--main-border-radius); align-items: center; justify-content: center; background: var(--primary-color); color: #fff; font-weight: 900; text-decoration: none; white-space: nowrap; }
.legal-page .legal-help .btn:hover { background: var(--primary-color-2); }
.legal-page .legal-help .btn--outline { border: 1px solid var(--primary-color-2); background: #fff; color: var(--primary-color-2); }
.legal-page .legal-help .btn--outline:hover { background: var(--primary-color-2); color: #fff; }

@media (max-width: 860px) {
    .legal-page .legal-main { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; }
    .legal-page .contents { position: static; }
    .legal-page .contents__nav { max-height: 320px; }
}

@media only screen and (max-width: 450px) {
    .legal-page .legal-hero { padding: 34px 0 40px; text-align: center; }
    .legal-page .legal-hero__grid { text-align: left; }
    .legal-page .legal-card { padding: 22px 18px; }
    .legal-page .legal-card table { min-width: 520px; }
    .legal-page .legal-card .data-table,
    .legal-page .legal-card table { display: block; overflow-x: auto; }
    .legal-page .legal-help__inner { align-items: flex-start; flex-direction: column; }
    .legal-page .legal-help__actions,
    .legal-page .legal-help .btn { width: 100%; }
}

@media print {
    .legal-page .contents,
    .legal-page .legal-help { display: none !important; }
    .legal-page { background: #fff; }
    .legal-page .legal-hero { padding: 0 0 24px; background: #fff; }
    .legal-page .breadcrumbs { display: none; }
    .legal-page .legal-section { break-inside: avoid; }
    .legal-page .legal-main { display: block; width: 100%; padding: 0; }
    .legal-page .legal-card { padding: 0; border: 0; box-shadow: none; }
}
