/* cartitleloancanada.ca - base styles. System fonts (no external requests). */
:root {
  --ink: #10222e;
  --ink-soft: #3b4f5c;
  --muted: #5d707c;
  --bg: #ffffff;
  --bg-alt: #f3f6f7;
  --line: #d8e0e4;
  --brand: #0f5c63;
  --brand-dark: #0a4449;
  --cta: #f0a020;
  --cta-dark: #d48a0f;
  --cta-ink: #1b1405;
  --radius: 12px;
  --header-h: 68px;
  --container: 1120px;
  --accent-soft: #e6f0f1;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
html.menu-open { overflow: hidden; }
body { margin: 0; font-family: var(--font); font-size: 18px; line-height: 1.65; color: var(--ink); background: var(--bg); }
@media (max-width: 760px) { body { font-size: 17px; } }
/* Short service pages: footer sits at the bottom of the window, no blank strip. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.env-ribbon { background: #fff4d6; color: #5a4100; font-size: 13px; text-align: center; padding: 4px 8px; }

/* Header: always visible (sticky), no auto-hide. */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; min-width: 0; }
.logo-mark { flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; letter-spacing: .5px; }
.logo-image { width: 44px; flex: none; border-radius: 7px; }
.site-header .logo-image { mix-blend-mode: multiply; }
.logo-word { font-size: 17px; line-height: 1.2; }
.site-nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; color: var(--ink-soft); text-decoration: none; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.4; background: none; border: 0; cursor: pointer; border-radius: 8px; }
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--ink); background: var(--bg-alt); }
.sub-menu { position: absolute; top: 100%; left: 0; min-width: 300px; list-style: none; margin: 6px 0 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(16, 34, 46, .12); display: none; }
.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.has-sub:hover .sub-menu, .has-sub.open .sub-menu, .has-sub:focus-within .sub-menu { display: block; }
.sub-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.sub-menu a:hover { background: var(--bg-alt); }

.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-cta { background: var(--cta); color: var(--cta-ink); }
.btn-cta:hover { background: var(--cta-dark); color: var(--cta-ink); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-lg { padding: 15px 28px; font-size: 18px; }
.header-cta { flex: none; }

.nav-toggle { display: none; flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 11px 10px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.mobile-menu { position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; background: #fff; overflow-y: auto; padding: 16px 20px 32px; border-top: 1px solid var(--line); }
.mobile-menu[hidden] { display: none; }
.mnav-list { list-style: none; margin: 0 0 20px; padding: 0; }
.mnav-list > li > a, .mnav-group { display: block; padding: 12px 4px; font-size: 18px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.mnav-sub { list-style: none; margin: 0; padding: 4px 0 8px 16px; border-bottom: 1px solid var(--line); }
.mnav-sub a { display: block; padding: 9px 4px; font-size: 16px; color: var(--ink-soft); text-decoration: none; }
.mnav-cta { width: 100%; }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-row { gap: 10px; }
  .header-cta { margin-left: auto; padding: 9px 14px; font-size: 15px; }
}
@media (max-width: 380px) {
  .logo-word { font-size: 15px; }
  .logo-image { width: 36px; }
  .logo-mark { width: 32px; height: 32px; }
  .header-cta { padding: 8px 10px; font-size: 14px; }
}

/* Breadcrumbs */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 14px 20px 0; font-size: 14px; color: var(--muted); }
.breadcrumbs { padding: 0; }
.hero .hero-grid { padding-top: 14px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line); }
.breadcrumbs a { color: var(--brand); }

/* Hero: H1 spans the container above the columns (UI rule 09.09).
   Without an approved photo the hero is a single text column; no empty media box. */
.hero { padding: 0 0 32px; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); gap: 16px 40px; align-items: start; }
.hero-grid.no-media { grid-template-columns: minmax(0, 1fr); }
.hero-title { grid-column: 1 / -1; margin: 10px 0 6px; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.18; letter-spacing: -.01em; }
.hero-copy p { color: var(--ink-soft); }
.hero-copy > * { margin-top: 0; }
.hero-cta { margin: 22px 0 0; }
@media (min-width: 761px) { .hero-media .content-figure { margin: 0; } }
@media (min-width: 1120px) { .hero-grid:not(.no-media) .hero-copy { align-self: center; } }
@media (max-width: 760px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* Content */
.section { padding: 36px 0 20px; }
.section + .section { border-top: 1px solid var(--bg-alt); }
.section-faq { background: var(--bg-alt); padding-bottom: 36px; }
.prose { min-width: 0; }
.information-prose { max-width: 860px; }
.information-prose h2:not(:first-child) { margin-top: 32px; }
.prose h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; margin: 0 0 16px; }
.prose h2::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 10px; border-radius: 2px; background: var(--brand); }
.prose h3 { font-size: 21px; line-height: 1.3; margin: 26px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 0 0 6px; padding-left: 4px; }
.prose ul li::marker { color: var(--brand); }
.prose ol li::marker { color: var(--brand); font-weight: 700; }
.prose .list-label { font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.prose a { text-underline-offset: 2px; }
.content-figure { margin: 20px 0; }
.prose .content-figure { max-width: 600px; margin: 24px auto; }
.content-figure img { border-radius: var(--radius); }
.article-media { display: grid; gap: 16px; align-items: start; margin: 16px 0 0; }
.article-media-copy { min-width: 0; }
.article-media-followup { margin-top: 24px; }
.section[id] { scroll-margin-top: 90px; }
.prose .article-media .content-figure { max-width: none; margin: 0; min-width: 0; }
.prose .article-media-copy > :last-child { margin-bottom: 0; }
.prose .article-cta { margin: 14px 0 0; }
@media (min-width: 761px) {
  .article-media { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: clamp(24px, 4vw, 48px); }
  .article-media--left { grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); }
  .article-media--left.article-media--wide-image { grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); }
  .article-media--left .content-figure { grid-column: 1; grid-row: 1; }
  .article-media--left .article-media-copy { grid-column: 2; grid-row: 1; }
}

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
table.table-wide { min-width: 560px; }
@media (max-width: 760px) { table { font-size: 15px; } th, td { padding: 10px 12px; } }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-alt); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

.cta-band { padding: 4px 0 28px; }
.cta-band-inner { display: flex; justify-content: center; }

/* FAQ accordion */
.faq-list { display: grid; gap: 10px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.faq-item summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 18px; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--brand); }
.faq-item[open] summary::after { content: "\2212"; }
.prose .faq-q { margin: 0; font-size: 18px; line-height: 1.35; }
.faq-a { padding: 0 18px 4px; }
.faq-item summary:hover .faq-q { color: var(--brand); }

/* Closing: the brief's soft final CTA */
.section-closing { padding: 32px 0 40px; }
.closing-card { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: #fff; padding: 22px 24px; }
.closing-card p { margin: 0 0 14px; font-size: 19px; }
.closing-card .closing-cta { margin: 0; }
@media (max-width: 760px) { .closing-card { padding: 18px; } .closing-card p { font-size: 17px; } }

/* Apply / modal */
.narrow-form { max-width: 720px; }
.apply-closed { border: 1px solid var(--line); background: var(--bg-alt); border-radius: var(--radius); padding: 18px 20px; }
.apply-closed-title { font-weight: 700; margin: 0 0 6px; }
.apply-closed p:last-child { margin-bottom: 0; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 34, 46, .55); }
.modal-panel { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; color: var(--ink); border-radius: 16px; padding: 28px 24px 24px; font-size: 16px; }
.modal-panel:focus { outline: none; }
.modal-title { font-size: 22px; font-weight: 700; margin: 0 0 14px; }
.modal-close { position: absolute; right: 10px; top: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink); }

.dev-pending { border: 2px dashed #c98a00; background: #fff8e6; border-radius: var(--radius); padding: 16px 18px; }
.dev-pending p:last-child { margin: 0; }

/* Footer: brand/contacts | Loans | Resources */
.site-footer { background: var(--ink); color: #dbe5ea; margin-top: 24px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; padding-top: 40px; padding-bottom: 24px; }
.footer-grid.no-loans { grid-template-columns: 1.3fr 1fr; }
.footer-col { min-width: 0; }
.site-footer a { color: #fff; }
.logo-footer { color: #fff; margin-bottom: 12px; }
/* Approved light mark on a white badge: no foreign square on the dark footer. */
.logo-footer .logo-image { width: 48px; padding: 3px; background: #fff; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.footer-title { font-weight: 700; color: #fff; margin: 4px 0 10px; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-venue a { overflow-wrap: anywhere; }
.footer-label { display: block; font-size: 13px; color: #a9bac3; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 14px; padding-bottom: 20px; font-size: 14px; color: #a9bac3; }
.footer-bottom p { margin: 0; }
@media (max-width: 760px) { .footer-grid, .footer-grid.no-loans { grid-template-columns: minmax(0, 1fr); } }

.section-404 { padding: 64px 0; }
