/* SherlockHomes — azulejo blue on Lisbon limestone, tram yellow for the one action that matters */
:root {
  --paper: #ffffff;
  --stone: #eef1f4;
  --ink: #13233d;
  --ink-2: #3e4c63;
  --azulejo: #1c4e9e;
  --azulejo-deep: #123a7a;
  --tram: #f2c200;
  --tram-deep: #d9ad00;
  --bad: #a3301f;
  --bad-bg: #fbeeec;
  --good: #276e45;
  --good-bg: #eaf5ee;
  --line: #c8d0da;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tile: repeating-conic-gradient(from 45deg, var(--azulejo) 0 25%, var(--paper) 0 50%) 0 0 / 14px 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; color: var(--ink); background: var(--stone); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--azulejo); text-underline-offset: 2px; }
a:hover { color: var(--azulejo-deep); }
:focus-visible { outline: 3px solid var(--azulejo); outline-offset: 2px; }
h1, h2, h3, h4, h5 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 750; margin-top: 1.6em; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.3em; }
h4 { font-size: 1.05rem; font-weight: 700; }
h5 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.page { padding-top: 2rem; padding-bottom: 3rem; }
.narrow { max-width: 46rem; }
.prose { max-width: 46rem; }
.prose li { margin-bottom: .4em; }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 40rem; }
.meta { color: var(--ink-2); font-size: .92rem; }
.small { font-size: .9rem; color: var(--ink-2); }
.hint { font-size: .9rem; color: var(--ink-2); margin: .3rem 0 0; }
.req { font-weight: 400; color: var(--ink-2); font-size: .85rem; }
.good { color: var(--good); } .bad { color: var(--bad); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--tram); color: var(--ink); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
main:focus { outline: none; }

/* Header */
.site-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .8rem; padding-bottom: .8rem; }
.logo { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 600; }
.logo b { color: var(--azulejo); font-weight: 800; }
.logo svg { color: var(--azulejo); }
.logo img { height: 48px; width: auto; display: block; }
@media (max-width: 520px) { .logo img { height: 38px; } }
.site-head nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.2rem; margin: 0; padding: 0; }
.site-head nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: .3rem 0; }
.site-head nav a:hover { text-decoration: underline; }

/* Buttons */
.btn { display: inline-block; font: inherit; font-weight: 700; text-decoration: none; text-align: center; border: 2px solid transparent;
       border-radius: var(--radius); padding: .7rem 1.2rem; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--azulejo); color: #fff; }
.btn-primary:hover { background: var(--azulejo-deep); color: #fff; }
.btn-cta { background: var(--tram); color: var(--ink); border-color: var(--ink); }
.btn-cta:hover { background: var(--tram-deep); color: var(--ink); }
.btn-cta:focus-visible { outline-color: var(--ink); }
.btn-secondary { background: var(--paper); color: var(--azulejo); border-color: var(--azulejo); }
.btn-secondary:hover { background: var(--stone); }
.btn-danger { background: var(--paper); color: var(--bad); border-color: var(--bad); }
.btn-small { padding: .3rem .6rem; font-size: .85rem; }
.btn-big { font-size: 1.15rem; padding: .9rem 1.6rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* Hero */
.hero { background: var(--paper); padding: 3.5rem 0 3rem; position: relative; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--tile); }
.hero h1 { max-width: 18ch; }
.search label { display: block; font-weight: 700; margin-bottom: .4rem; }
.search-row { display: flex; gap: .5rem; max-width: 40rem; position: relative; }
.search-row input { flex: 1; min-width: 0; font-size: 1.15rem; padding: .8rem 1rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.search-inline { margin-bottom: 1.5rem; }
.combo-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; list-style: none; margin: 0; padding: .25rem 0;
              background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); max-height: 22rem; overflow-y: auto; }
.combo-list li { padding: .6rem 1rem; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--stone); }
.combo-list .meta { display: block; font-size: .85rem; }

/* Home sections */
.steps-section { padding-top: 2.5rem; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; padding: 0; margin: 0; }
.steps li { counter-increment: step; background: var(--paper); border-left: 4px solid var(--azulejo); padding: 1.2rem 1.2rem 1rem; }
.steps li::before { content: counter(step); display: block; font-size: 2rem; font-weight: 800; color: var(--azulejo); line-height: 1; margin-bottom: .5rem; }
.steps h3 { margin-top: 0; }
.recent { padding-bottom: 3rem; }
.recent-list, .result-list { list-style: none; padding: 0; margin: 0; background: var(--paper); border: 1px solid var(--line); }
.recent-list li, .result-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
.recent-list li:first-child, .result-list li:first-child { border-top: 0; }
.recent-list a { text-decoration: none; } .recent-list a strong { text-decoration: underline; }
.callout { background: var(--paper); border-left: 4px solid var(--tram); padding: 1rem 1.2rem; margin: 1.5rem 0; }
.callout p:last-child { margin-bottom: 0; }

/* Building page: the case file */
.case-head { background: var(--paper); padding: 2.2rem 0 2rem; position: relative; border-bottom: 1px solid var(--line); }
.case-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: var(--tile); }
.case-place { font-weight: 600; color: var(--ink-2); margin: .6rem 0 .2rem; }
.case-head h1 { margin-bottom: .3rem; }
.case-count { color: var(--ink-2); }
.building-grid { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 2rem; padding-top: 1.5rem; padding-bottom: 3rem; align-items: start; }
.unit-h { margin-top: 1.5rem; padding-bottom: .3rem; border-bottom: 2px solid var(--ink); }
.review { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 1rem 0; }
.review-head h4 { margin-bottom: .4rem; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .8rem; }
.badge { display: inline-block; font-size: .82rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; border: 1px solid currentColor; }
.badge-basic { color: var(--ink-2); }
.badge-good { color: var(--azulejo); }
.badge-detailed { color: #fff; background: var(--azulejo); border-color: var(--azulejo); }
.badge-verified { color: var(--good); background: var(--good-bg); }
.badge-muted { color: var(--ink-2); border-style: dashed; }
.facts { padding: .7rem 1rem; margin: .8rem 0; border-radius: var(--radius); }
.facts h5 { margin-bottom: .3rem; }
.facts p { margin: 0; }
.facts-bad { background: var(--bad-bg); border-left: 4px solid var(--bad); }
.facts-good { background: var(--good-bg); border-left: 4px solid var(--good); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .4rem; margin: .8rem 0; }
.gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 4px; }
.answers summary { cursor: pointer; font-weight: 700; color: var(--azulejo); padding: .3rem 0; }
.answers dl { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .35rem 1rem; margin: .6rem 0 0; }
.answers dt { color: var(--ink-2); } .answers dd { margin: 0; font-weight: 600; }
.reply { border-left: 4px solid var(--line); padding: .3rem 0 .3rem 1rem; margin: .8rem 0; }
.review-foot { margin: .8rem 0 0; font-size: .9rem; }
.area { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; position: sticky; top: 1rem; }
.area h2 { margin-top: 0; font-size: 1.3rem; }
.area h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; color: var(--azulejo); }
.area-list { margin: 0; }
.area-list dt { font-weight: 700; font-size: .92rem; margin-top: .5rem; }
.area-list dd { margin: 0; font-size: .95rem; }

/* Forms */
.form-sec { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 1.2rem 0; }
.form-sec h2 { margin-top: 0; font-size: 1.3rem; }
.field { margin: 0 0 1.1rem; }
.field label, .q legend { display: block; font-weight: 700; margin-bottom: .35rem; }
.field input[type=text], .field input[type=email], .field input[type=url], .field input[type=date], .field input[type=number],
.field input[type=password], .field select, .field textarea, .q input[type=text] {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid #7a8699; border-radius: var(--radius); padding: .6rem .75rem; }
.field input:focus, .field select:focus, .field textarea:focus, .q input[type=text]:focus { border-color: var(--azulejo); }
.field-row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.field-row .field { flex: 1 1 12rem; }
.field-row .grow { flex: 3 1 16rem; }
.small-field { max-width: 12rem; }
.q { border: 0; padding: 0; margin: 0 0 1.3rem; min-width: 0; }
.opts { display: flex; flex-wrap: wrap; gap: .45rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: inline-block; padding: .55rem .95rem; border: 2px solid #7a8699; border-radius: 999px; background: var(--paper); min-height: 44px; line-height: 1.45; }
.opt input:checked + span { background: var(--azulejo); border-color: var(--azulejo); color: #fff; font-weight: 700; }
.opt input:focus-visible + span { outline: 3px solid var(--azulejo); outline-offset: 2px; }
.note-label { display: block; font-weight: 400; font-size: .92rem; margin: .5rem 0 .25rem; }
.more { margin-top: .5rem; }
.more summary { cursor: pointer; font-weight: 700; color: var(--azulejo); padding: .5rem 0; }
.more[open] summary { margin-bottom: .8rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1rem; }
.check input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; flex: none; }
.rule { font-weight: 700; color: var(--bad); }
.geo-box { background: var(--stone); padding: 1rem 1.1rem; border-radius: var(--radius); }
.geo-box h3 { margin-top: 0; }
.notice { padding: .8rem 1rem; border-radius: var(--radius); margin: 1rem 0; border-left: 4px solid var(--azulejo); background: var(--paper); }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice-error { border-color: var(--bad); background: var(--bad-bg); }
.notice-success { border-color: var(--good); background: var(--good-bg); }
.h-small { font-size: 1.1rem; margin-top: 0; }
.report-form.mode-report [data-mode="reply"], .report-form.mode-reply [data-mode="report"] { display: none; }

/* Content pages */
.mission .motto { font-size: 1.4rem; font-weight: 800; color: var(--azulejo); }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.data-table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: .95rem; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--ink); color: #fff; }
.donate-list dt { font-weight: 700; margin-top: .8rem; } .donate-list dd { margin: 0; font-size: 1.15rem; }

/* Footer */
.site-foot { background: var(--ink); color: #dfe5ee; padding: 2.2rem 0 1.5rem; }
.site-foot a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; }
.foot-mission { font-weight: 700; font-size: 1.1rem; color: #fff; }
.site-foot .small { color: #c3ccd9; }
.foot-links { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.foot-links li { margin-bottom: .4rem; }
.foot-base { margin-top: 1.5rem; border-top: 1px solid #34466a; padding-top: 1rem; }
.foot-base p { margin: .3rem 0; }

/* Admin */
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.admin-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.admin-photos figure { margin: 0; background: var(--paper); border: 2px solid var(--line); padding: .5rem; font-size: .85rem; }
.admin-photos figure.is-flagged { border-color: var(--bad); }
.admin-photos figure.is-rejected { opacity: .55; }
.admin-photos img { aspect-ratio: 4/3; object-fit: cover; width: 100%; margin-bottom: .4rem; }
.log { font-size: .9rem; color: var(--ink-2); }
form.inline { display: inline; }

@media (max-width: 860px) {
  .building-grid { grid-template-columns: 1fr; }
  .area { position: static; }
  .admin-cols { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .search-row { flex-direction: column; }
  .answers dl { grid-template-columns: 1fr; gap: 0; }
  .answers dd { margin-bottom: .5rem; }
  .hero { padding-top: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Membership + official documents */
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--azulejo); text-decoration: underline; cursor: pointer; }
.or { color: var(--ink-2); margin: .2rem 0 .6rem; }
.btn-google { display: inline-flex; align-items: center; gap: .6rem; }
.save-hint { margin-top: .6rem; }
.case-head .actions { margin-top: .4rem; }
.acc-actions { margin-top: 2rem; }
.danger-zone { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.danger-zone summary { color: var(--bad); }
.stats { background: var(--paper); border-left: 4px solid var(--tram); padding: .6rem 1rem; margin-bottom: 1rem; }
.stats p { margin: 0; }
.docs { margin-top: 1.5rem; border-top: 2px solid var(--ink); padding-top: 1rem; }
.docs h2 { font-size: 1.2rem; margin-top: 0; }
.doc { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .7rem; }
.doc h3 { font-size: .98rem; margin: 0 0 .3rem; color: var(--ink); }
.doc p { font-size: .93rem; margin-bottom: .4rem; }
.doc-meta { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; font-size: .88rem; margin: 0 0 .4rem; }
.doc-meta dt { color: var(--ink-2); } .doc-meta dd { margin: 0; font-weight: 600; }
.nl-check { background: var(--stone); padding: .7rem .8rem; border-radius: var(--radius); font-size: .95rem; }
