/* SD Property Inspections — shared styles
   Used by /index.html (maintenance page) and /2230-logan-ave-san-diego/ (inspection report). */

:root {
  --ink: #0e1a2b;
  --ink-2: #2d3b50;
  --muted: #5d6b7e;
  --line: #e1e6ed;
  --line-strong: #c9d2dd;
  --paper: #fff;
  --canvas: #f4f6f9;
  --navy: #0b1b2e;
  --navy-2: #12304f;
  --accent: #f2a31b;

  --safety: #b42318;  --safety-bg: #fef3f2;  --safety-line: #fecdca;
  --code: #6941c6;    --code-bg: #f4f3ff;    --code-line: #d9d6fe;
  --defect: #b54708;  --defect-bg: #fffaeb;  --defect-line: #fedf89;
  --monitor: #175cd3; --monitor-bg: #eff8ff; --monitor-line: #b2ddff;
  --pending: #667085; --pending-bg: #f2f4f7; --pending-line: #d0d5dd;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(14 26 43 / 6%), 0 10px 30px rgb(14 26 43 / 10%);
  --wrap: 1120px;
  --topbar-h: 64px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--navy-2); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand__mark { flex: none; width: 32px; height: 32px; }
.brand__name { font-size: 17px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--canvas); }
.btn svg { width: 16px; height: 16px; }

/* ---------- Maintenance / coming soon page ---------- */

.page-soon {
  color: #e6edf6;
  background-color: var(--navy);
  background-image:
    radial-gradient(900px 520px at 50% 0%, rgb(242 163 27 / 13%), transparent 65%),
    linear-gradient(rgb(255 255 255 / 4.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4.5%) 1px, transparent 1px),
    linear-gradient(rgb(255 255 255 / 1.8%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 1.8%) 1px, transparent 1px);
  background-size: 100% 100%, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: center top;
}

.soon {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 16px;
}
.soon .brand { color: #fff; }

.soon__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 0;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 7px 14px 7px 12px;
  border: 1px solid rgb(242 163 27 / 35%);
  border-radius: 999px;
  background: rgb(242 163 27 / 8%);
  color: #fbd58a;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.status-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(242 163 27 / 55%); }
  70% { box-shadow: 0 0 0 10px rgb(242 163 27 / 0%); }
  100% { box-shadow: 0 0 0 0 rgb(242 163 27 / 0%); }
}

.soon__title {
  max-width: 13em;
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}
.soon__title span { color: var(--accent); }

.soon__lede {
  max-width: 560px;
  margin: 24px 0 0;
  color: #b6c3d4;
  font-size: clamp(17px, 2.2vw, 19px);
}

.soon__progress {
  position: relative;
  width: min(320px, 100%);
  height: 4px;
  margin-top: 40px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
}
.soon__progress::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent));
  animation: sweep 2.4s ease-in-out infinite;
}
@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(290%); }
}

.soon__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 10%);
  color: #8494a9;
  font-size: 14px;
}
.soon__footer p { margin: 0; }

/* ---------- Report page ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-h);
}

/* Notice shown while the report contains illustrative findings */
.notice {
  border-bottom: 1px solid var(--defect-line);
  background: var(--defect-bg);
  color: #7a2e0e;
  font-size: 14px;
}
.notice__inner { display: flex; align-items: flex-start; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.notice p { margin: 0; }

.summary { max-width: 72ch; margin: 0; color: var(--ink-2); font-size: 17px; }

/* Cover */
.cover {
  padding: 20px 0 56px;
  color: #fff;
  background-color: var(--navy);
  background-image:
    linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 32px 32px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #9fb0c5;
  font-size: 13px;
}
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: #5f7390; }
.breadcrumb a { color: #c9d6e6; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.cover__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
  margin-top: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover__title {
  margin: 0;
  font-size: clamp(36px, 5.6vw, 62px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.04;
}
.cover__street, .cover__city { display: block; }
.cover__city {
  margin-top: 10px;
  color: #c3d0e0;
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cover__lede { max-width: 52ch; margin: 20px 0 0; color: #b9c7d8; font-size: 17px; }

/* data-verdict: pending | pass | fail */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 10px 16px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 12px;
  background: rgb(255 255 255 / 7%);
}
.verdict__label { color: #b9c7d8; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.verdict__value { font-size: 15px; letter-spacing: 0.02em; }
.verdict[data-verdict="pending"] .verdict__value { color: #d5dde8; font-style: italic; font-weight: 500; }
.verdict[data-verdict="fail"] { border-color: #f04438; background: var(--safety); }
.verdict[data-verdict="fail"] .verdict__label { color: #fee4e2; }
.verdict[data-verdict="pass"] { border-color: #17b26a; background: #067647; }
.verdict[data-verdict="pass"] .verdict__label { color: #dcfae6; }

.cover__photo { margin: 0; }
.cover__photo .photo-btn {
  border-radius: 16px;
  background-color: #16304d;
  box-shadow: 0 24px 60px rgb(0 0 0 / 35%);
}

/* Layout */
.report__layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 88px;
}

.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  align-self: start;
  font-size: 14px;
}
.toc__title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.toc a {
  display: block;
  margin-left: -2px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover { border-left-color: var(--line-strong); color: var(--ink); }
.toc a.is-active { border-left-color: var(--accent); color: var(--navy-2); font-weight: 650; }

.section { scroll-margin-top: calc(var(--topbar-h) + 24px); }
.section + .section { margin-top: 56px; padding-top: 48px; border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 8px; font-size: 26px; font-weight: 750; }
.section__intro { max-width: 68ch; margin: 0 0 24px; color: var(--muted); }

/* Pending (not yet completed) content */
.pending { color: var(--pending); font-style: italic; }
.pending-block {
  margin: 0;
  padding: 16px 18px;
  border: 1px dashed var(--pending-line);
  border-radius: 12px;
  background: #fafbfc;
  color: var(--pending);
  font-style: italic;
}

/* Ratings: data-rating = safety | code | defect | monitor | pending */
[data-rating="safety"]  { --c: var(--safety);  --c-bg: var(--safety-bg);  --c-line: var(--safety-line); }
[data-rating="code"]    { --c: var(--code);    --c-bg: var(--code-bg);    --c-line: var(--code-line); }
[data-rating="defect"]  { --c: var(--defect);  --c-bg: var(--defect-bg);  --c-line: var(--defect-line); }
[data-rating="monitor"] { --c: var(--monitor); --c-bg: var(--monitor-bg); --c-line: var(--monitor-line); }
[data-rating="pending"] { --c: var(--pending); --c-bg: var(--pending-bg); --c-line: var(--pending-line); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 10px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Summary tally */
.tally {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}
.tally__item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: 12px;
}
.tally__count {
  display: block;
  color: var(--c);
  font-size: 30px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.tally__label { color: var(--muted); font-size: 13px; font-weight: 600; }

/* Property details */
.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}
.details > div { padding: 12px 16px; background: #fff; }
.details dt { color: var(--muted); font-size: 13px; }
.details dd { margin: 2px 0 0; font-weight: 600; }

/* Rating legend */
.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.legend li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.legend p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }

/* Findings */
.finding {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: var(--radius);
  background: #fff;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.finding + .finding { margin-top: 20px; }
.findings-group + .findings-group { margin-top: 44px; }
.findings-group__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 700;
}
.findings-group__title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.finding__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.finding__num {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.finding__title { margin: 6px 0 0; font-size: 18px; font-weight: 700; }
.finding__body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}
.finding__body--text { grid-template-columns: minmax(0, 1fr); }
.finding__tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgb(11 27 46 / 82%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.fields { margin: 0; }
.fields > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.fields > div:first-child { padding-top: 0; }
.fields > div:last-child { padding-bottom: 0; border-bottom: 0; }
.fields dt {
  padding-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.fields dd { margin: 0; }

/* Photos */
.photo-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E") center / 36px no-repeat;
  cursor: zoom-in;
}
.photo-btn img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.photo-btn:hover img { transform: scale(1.03); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 8px; font-size: 14px; }
.gallery__num { font-weight: 700; }

/* Next steps */
.steps { display: grid; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  padding: 16px 18px 16px 62px;
  border: 1px solid var(--line);
  border-radius: 12px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 15px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.steps strong { display: block; }

.prose p { max-width: 72ch; margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.prose p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer { background: var(--navy); color: #9fb0c5; font-size: 14px; }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.site-footer .brand { color: #fff; }
.site-footer p { margin: 0; }

/* Photo viewer */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 64px 72px 24px;
  border: 0;
  background: rgb(6 13 23 / 94%);
  color: #fff;
}
.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.lightbox::backdrop { background: transparent; }
.lightbox__img {
  max-width: min(1200px, 100%);
  max-height: calc(100dvh - 150px);
  border-radius: 8px;
  object-fit: contain;
}
.lightbox__caption { margin: 0; color: #c9d6e6; font-size: 15px; text-align: center; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
  background: rgb(255 255 255 / 8%);
  color: #fff;
  cursor: pointer;
}
.icon-btn:hover { background: rgb(255 255 255 / 16%); }
.icon-btn svg { width: 20px; height: 20px; }
.lightbox__close { position: absolute; top: 12px; right: 12px; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

body:has(.lightbox[open]) { overflow: hidden; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .report__layout { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 40px; }
  .toc { position: static; }
  .toc ol { columns: 2; column-gap: 24px; }
  .toc li { break-inside: avoid; }
}

@media (max-width: 860px) {
  .cover__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 700px) {
  .finding__body { grid-template-columns: minmax(0, 1fr); }
  .fields > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox { padding: 64px 12px 24px; }
  .lightbox__nav { top: auto; bottom: 16px; transform: none; }
}

@media (max-width: 640px) {
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend, .details { grid-template-columns: minmax(0, 1fr); }
  .section h2 { font-size: 23px; }
}

@media (max-width: 560px) {
  .toc ol { columns: 1; }
  .hide-sm { display: none; }
}

@media (max-width: 420px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Print ---------- */

@media print {
  @page { margin: 14mm; }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 10.5pt; }

  .topbar, .toc, .skip-link, .lightbox, .site-footer { display: none !important; }

  .cover { padding: 0 0 16px; background: none; color: var(--ink); }
  .cover__city, .cover__lede, .breadcrumb ol, .breadcrumb a { color: var(--ink-2); }
  .cover__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 24px; margin-top: 12px; }
  .cover__photo .photo-btn { box-shadow: none; }
  .verdict { border-color: var(--line-strong); background: none; }
  .verdict__label, .verdict[data-verdict="pending"] .verdict__value { color: var(--ink-2); }

  .report__layout { display: block; padding: 24px 0 0; }
  .section + .section { margin-top: 28px; padding-top: 20px; }
  .finding__body:not(.finding__body--text) { grid-template-columns: 200px minmax(0, 1fr); }
  .findings-group__title { break-after: avoid; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finding, .tally__item, .legend li, .steps li, .gallery li, .details > div { break-inside: avoid; }
  .photo-btn img { transform: none !important; }
  a { color: inherit; text-decoration: none; }
}
