/* Place Match: the tool and its method page. SpainExpat's own type and colours: Gotham, headings at 900,
   SpainExpat red for actions, the site's warm greys, teal and gold only for fit on the map and cards. */
@font-face { font-family: 'Gotham'; src: url('/fonts/GothamBook.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Black.otf') format('opentype'); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --pm-bg: #f3f2f0;
  --pm-paper: #ffffff;
  --pm-ink: #302b29;
  --pm-muted: #5e5854;
  --pm-line: #e0dbd4;
  --pm-red: #e12b38;
  --pm-red-ink: #b81e2a;
  --pm-red-wash: #fbeaeb;
  --pm-footer: #e8e6e2;
  --pm-strong: #05665e;
  --pm-good: #0aada0;
  --pm-partial: #c8a24c;
  --pm-unranked: #9a918a;
  --pm-land: #e6e1da;
  --pm-sans: 'Gotham', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pm-page { margin: 0; background: var(--pm-bg); color: var(--pm-ink); font-family: var(--pm-sans); font-size: 16px; line-height: 1.55; overflow-x: hidden; }
.pm-page a { color: var(--pm-ink); text-decoration-color: var(--pm-red); text-underline-offset: 2px; }
.pm-page a:hover { color: var(--pm-red-ink); }
.pm-page :focus-visible { outline: 3px solid var(--pm-good); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Site header and footer, as the EE templates draw them */
.pm-site-header { background: var(--pm-paper); border-bottom: 1px solid var(--pm-line); }
.pm-nav { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; }
.pm-brand { display: block; width: 150px; line-height: 0; }
.pm-brand spainexpat-logo, .pm-brand img { display: block; width: 150px; height: auto; }
.pm-nav-links { display: flex; gap: 24px; flex: 1; justify-content: center; }
.pm-nav-link { font-weight: 700; text-decoration: none; color: var(--pm-ink); font-size: 16px; }
.pm-page .pm-nav-link { text-decoration: none; }
@media (max-width: 640px) {
  .pm-nav { justify-content: space-between; }
  .pm-brand, .pm-brand spainexpat-logo, .pm-brand img { width: 120px; }
  .pm-nav-links { order: 3; flex-basis: 100%; justify-content: flex-start; gap: 18px; }
  .pm-nav-link { font-size: 15px; }
}
.pm-site-footer { background: var(--pm-footer); margin-top: 56px; padding: 40px 16px 32px; font-size: 14px; }
.pm-footer-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.pm-footer-links { display: flex; flex-direction: column; gap: 10px; }
.pm-footer-links a { font-weight: 700; text-decoration: none; }
.pm-footer-logo { width: 123px; height: auto; }
.pm-footer-small { max-width: 1120px; margin: 28px auto 0; color: var(--pm-muted); }
.pm-footer-small p { margin: 0 0 10px; }

/* Page body */
.pm-main { max-width: 1120px; margin: 0 auto; padding: 32px 16px 0; }
.pm-intro { max-width: 760px; }
.pm-kicker { margin: 0 0 6px; color: var(--pm-red); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.pm-title { margin: 0; font-weight: 900; font-size: clamp(34px, 7vw, 56px); line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; }
.pm-lede { margin: 16px 0 0; font-size: 18px; color: var(--pm-ink); max-width: 62ch; }
.pm-privacy { margin: 12px 0 0; color: var(--pm-muted); font-size: 14px; }
.pm-noscript { padding: 12px 14px; background: var(--pm-red-wash); border-left: 4px solid var(--pm-red); }

/* Questions */
.pm-step { margin-top: 36px; }
.pm-step-title { margin: 0; font-weight: 900; font-size: clamp(24px, 4.5vw, 32px); line-height: 1.15; }
.pm-step-help { margin: 6px 0 16px; color: var(--pm-muted); max-width: 62ch; }
#pm-dealbreakers, #pm-priorities { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
#pm-dealbreakers > .pm-step-title, #pm-dealbreakers > .pm-step-help, #pm-priorities > .pm-step-title, #pm-priorities > .pm-step-help { grid-column: 1 / -1; }
@media (min-width: 820px) { #pm-dealbreakers, #pm-priorities { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pm-question { margin: 0 0 16px; padding: 16px; min-width: 0; background: var(--pm-paper); border: 1px solid var(--pm-line); border-radius: 6px; }
.pm-legend { padding: 0; font-weight: 700; font-size: 17px; line-height: 1.3; float: left; width: 100%; }
.pm-legend + * { clear: both; }
.pm-help { margin: 4px 0 12px; color: var(--pm-muted); font-size: 14px; line-height: 1.45; }
.pm-answers { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-answer { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--pm-line); border-radius: 999px; cursor: pointer; font-size: 15px; line-height: 1.3; background: var(--pm-bg); max-width: 100%; }
.pm-answer input { accent-color: var(--pm-red); margin: 0; flex: none; }
.pm-answer:hover { border-color: var(--pm-ink); }
.pm-answer:has(input:checked) { border-color: var(--pm-red); background: var(--pm-red-wash); }
.pm-answer--skip { color: var(--pm-muted); }
.pm-answer--skip:has(input:checked) { border-color: var(--pm-line); background: var(--pm-bg); color: var(--pm-muted); }
.pm-top { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.pm-top input { accent-color: var(--pm-red); margin: 0; }
.pm-top:has(input:disabled) { color: var(--pm-unranked); cursor: default; }
.pm-actions { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.pm-status { margin: 0; color: var(--pm-muted); }

.pm-button { font: inherit; font-weight: 700; font-size: 16px; border-radius: 4px; padding: 12px 20px; cursor: pointer; border: 2px solid transparent; text-decoration: none; display: inline-block; text-align: center; }
.pm-button--primary { background: var(--pm-red); color: #fff; }
.pm-page a.pm-button--primary { color: #fff; text-decoration: none; }
.pm-button--primary:hover, .pm-page a.pm-button--primary:hover { background: var(--pm-red-ink); color: #fff; }
.pm-button--primary:disabled { opacity: .6; cursor: progress; }
.pm-button--quiet { background: transparent; color: var(--pm-ink); border-color: var(--pm-line); padding: 8px 14px; font-size: 15px; }
.pm-button--quiet:hover { border-color: var(--pm-ink); }

/* Results */
.pm-results { margin-top: 48px; padding-top: 32px; border-top: 3px solid var(--pm-ink); }
.pm-results-title { margin: 0; font-weight: 900; font-size: clamp(28px, 5.5vw, 40px); line-height: 1.1; }
.pm-results-title:focus { outline: none; }
.pm-results-count { margin: 8px 0 0; font-size: 18px; }
.pm-caveat { margin: 12px 0 0; padding: 10px 14px; background: var(--pm-paper); border-left: 4px solid var(--pm-partial); font-size: 14px; max-width: 72ch; }
.pm-results-tools { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.pm-layout { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) {
  .pm-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .pm-map { position: sticky; top: 16px; }
}
.pm-map { margin: 0; padding: 12px; background: var(--pm-paper); border: 1px solid var(--pm-line); border-radius: 6px; }
.pm-map-svg { display: block; width: 100%; height: auto; }
.pm-prov { fill: var(--pm-land); stroke: var(--pm-paper); stroke-width: .8; }
.pm-inset { fill: none; stroke: var(--pm-line); stroke-width: 1.2; }
.pm-dot { stroke: #fff; stroke-width: 1.5; cursor: pointer; }
.pm-dot--strong { fill: var(--pm-strong); }
.pm-dot--good { fill: var(--pm-good); }
.pm-dot--partial { fill: var(--pm-partial); }
.pm-dot--unranked { fill: var(--pm-unranked); }
.pm-dot--active, .pm-dot:hover, .pm-dot:focus-visible { stroke: var(--pm-red); stroke-width: 3; }
.pm-map-caption { margin-top: 8px; color: var(--pm-muted); font-size: 13px; }

.pm-group + .pm-group { margin-top: 28px; }
.pm-group-title { margin: 0 0 12px; font-weight: 900; font-size: 22px; }
.pm-group-count { font-weight: 400; color: var(--pm-muted); font-size: 16px; }
.pm-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pm-card { background: var(--pm-paper); border: 1px solid var(--pm-line); border-left: 5px solid var(--pm-unranked); border-radius: 6px; padding: 14px 16px; transition: box-shadow .3s; }
.pm-card--strong { border-left-color: var(--pm-strong); }
.pm-card--good { border-left-color: var(--pm-good); }
.pm-card--partial { border-left-color: var(--pm-partial); }
.pm-card--flash { box-shadow: 0 0 0 3px var(--pm-red); }
.pm-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.pm-card-title { margin: 0; font-weight: 900; font-size: 20px; line-height: 1.2; }
.pm-card-province { font-weight: 400; font-size: 14px; color: var(--pm-muted); }
.pm-band { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.pm-band--strong { color: var(--pm-strong); }
.pm-band--good { color: #087f75; }
.pm-band--partial { color: #8a6a1f; }
.pm-band--unranked { color: var(--pm-muted); }
.pm-fit { display: inline-block; width: 64px; height: 6px; background: var(--pm-land); border-radius: 3px; overflow: hidden; }
.pm-fit-bar { display: block; height: 100%; background: currentColor; }
.pm-unranked { margin: 8px 0 0; color: var(--pm-muted); font-size: 14px; }
.pm-card-sub { margin: 12px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--pm-muted); }
.pm-reasons { margin: 0; padding-left: 20px; }
.pm-reason { margin: 2px 0; }
.pm-catch { margin: 10px 0 0; padding: 8px 12px; background: var(--pm-bg); border-radius: 4px; font-size: 15px; }
.pm-catch-title { font-weight: 700; }
.pm-not-checked { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--pm-muted); }
.pm-not-available::before { content: '?'; display: inline-block; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--pm-land); color: var(--pm-ink); text-align: center; font-weight: 700; font-size: 12px; line-height: 18px; }
.pm-sources-toggle { margin-top: 10px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--pm-ink); text-decoration: underline; text-decoration-color: var(--pm-red); text-underline-offset: 2px; cursor: pointer; }
.pm-sources { margin-top: 8px; font-size: 14px; }
.pm-source-list { margin: 0; padding-left: 18px; }
.pm-source { margin: 6px 0; }
.pm-source-label { font-weight: 700; }
.pm-source-caveat { display: block; color: var(--pm-muted); }
.pm-tag { display: inline-block; padding: 1px 6px; border: 1px solid var(--pm-partial); border-radius: 3px; font-size: 12px; font-weight: 700; color: #8a6a1f; white-space: nowrap; }
.pm-more { margin-top: 12px; }

.pm-nudge { margin: 32px 0 0; padding: 16px 18px; background: var(--pm-paper); border-left: 4px solid var(--pm-red); font-size: 17px; max-width: 72ch; }

.pm-optin, .pm-cta { margin-top: 32px; padding: 24px 20px; border-radius: 6px; }
.pm-optin { background: var(--pm-paper); border: 1px solid var(--pm-line); }
.pm-optin-title, .pm-cta-title { margin: 0; font-weight: 900; font-size: clamp(22px, 4vw, 28px); line-height: 1.2; }
.pm-optin-text { margin: 8px 0 16px; }
.pm-optin-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 520px; }
@media (min-width: 640px) { .pm-optin-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pm-consent, .pm-optin-status { grid-column: 1 / -1; } }
.pm-input { font: inherit; font-size: 16px; padding: 12px; border: 1.5px solid var(--pm-line); border-radius: 4px; background: var(--pm-bg); min-width: 0; width: 100%; }
.pm-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.pm-consent input { margin-top: 2px; accent-color: var(--pm-red); }
.pm-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pm-optin-status { margin: 0; font-size: 14px; }
.pm-optin-form--done .pm-input, .pm-optin-form--done .pm-consent, .pm-optin-form--done button { display: none; }
.pm-optin-form--done .pm-optin-status { font-size: 16px; font-weight: 700; }
.pm-cta { background: var(--pm-ink); color: #f3f2f0; }
.pm-cta-text { margin: 12px 0 0; max-width: 64ch; }
.pm-cta-button { margin-top: 20px; }

.pm-method-link { margin: 40px 0 0; font-weight: 700; }
.pm-ai-notice { margin: 32px 0 0; color: var(--pm-muted); font-size: 13px; line-height: 1.5; max-width: 90ch; }
.pm-ai-notice p { margin: 0; }

/* Method page */
.pm-back { margin: 16px 0 0; font-weight: 700; }
.pm-method-section { margin-top: 40px; max-width: 900px; }
.pm-method-section h2 { margin: 0 0 12px; font-weight: 900; font-size: clamp(24px, 4.5vw, 32px); line-height: 1.15; }
.pm-method-section p, .pm-list { max-width: 72ch; }
.pm-list li { margin: 6px 0; }
#pm-sources { max-width: none; }
.pm-sources-table { width: 100%; border-collapse: collapse; background: var(--pm-paper); font-size: 14px; line-height: 1.45; }
.pm-sources-table th, .pm-sources-table td { padding: 10px 12px; border-bottom: 1px solid var(--pm-line); text-align: left; vertical-align: top; overflow-wrap: break-word; }
.pm-sources-table th:nth-child(3), .pm-sources-table th:nth-child(4) { min-width: 8.5em; }
.pm-sources-table th { background: var(--pm-ink); color: #f3f2f0; font-weight: 700; }
.pm-source-links a { margin-right: 6px; white-space: nowrap; }
@media (max-width: 760px) {
  .pm-sources-table thead { display: none; }
  .pm-sources-table, .pm-sources-table tbody, .pm-sources-table tr, .pm-sources-table td { display: block; width: 100%; }
  .pm-sources-table tr { border: 1px solid var(--pm-line); border-radius: 6px; margin-bottom: 12px; }
  .pm-sources-table td { border: 0; padding: 6px 12px; }
  .pm-sources-table td::before { content: attr(data-label); display: block; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--pm-muted); }
}
.pm-map-credit { margin-top: 32px; color: var(--pm-muted); font-size: 13px; }
