/* Plumbline — the contractor directory and each contractor's own page (contractors.html, assets/contractors.js).
   Phone first. The site's colours and type come from base.css and site.css; this file only adds what these two
   pages need. */

/* a contractor's own page: the directory's hero isn't shown (set before the page draws, in contractors.html) */
.is-one [data-dir-hero] { display: none; }

/* ── Stars ── */
/* an average, filled to the tenth: --v is 0 to 5 */
.cstars { position: relative; display: inline-block; font-size: 1em; line-height: 1; letter-spacing: 2px; white-space: nowrap; color: #d5d9de; }
.cstars::before { content: "★★★★★"; }
.cstars::after { content: "★★★★★"; position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) / 5 * 100%); overflow: hidden; color: #e0a100; }
.cstars--lg { font-size: 22px; }

/* ── The directory ── */
.dsearch { display: grid; gap: 12px; max-width: 820px; margin-bottom: 18px; }
.dsearch__f { display: grid; gap: 6px; }
.dsearch__f label { font-weight: 600; font-size: 14.5px; }
.dsearch__f input {
  width: 100%; min-width: 0; padding: 13px 15px; border: 1.5px solid var(--rule); border-radius: var(--r); background: var(--white);
  font: inherit; font-size: 16px; /* 16px: a phone doesn't zoom in on the box */
}
.dsearch__f input:focus { outline: none; border-color: var(--chalk); box-shadow: 0 0 0 3px var(--chalk-wash); }
.dsearch .btn { justify-content: center; }
@media (min-width: 720px) {
  .dsearch { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: end; }
  .dsearch .btn { height: 50px; }
}
.dcount { margin: 0 0 18px; color: var(--ink-3); font-size: 14.5px; min-height: 1.4em; }
.dgrid { display: grid; gap: 16px; }
@media (min-width: 720px) { .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .dgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dcard {
  display: grid; gap: 8px; align-content: start; padding: 20px; border: 1px solid var(--rule); border-radius: calc(var(--r) * 2);
  background: var(--white); color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: border-color 0.15s ease, transform 0.15s ease;
}
.dcard:hover { border-color: var(--chalk); transform: translateY(-1px); }
.dcard:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }
.dcard__name { font-size: 19px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.dcard__rate { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14.5px; color: var(--ink-2); }
.dcard__rate b { color: var(--ink); }
.dcard__none { color: var(--ink-3); font-size: 14.5px; }
.dcard__where, .dcard__work { color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.dcard__where b, .dcard__work b { font-weight: 600; color: var(--ink-3); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 6px; }
.dcard__about { color: var(--ink-3); font-size: 14.5px; }
.dcard__go { margin-top: 4px; font-weight: 600; font-size: 14.5px; color: var(--chalk-deep); }

/* a little mark for the verified kinds of review */
.vbadge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.vbadge svg { width: 12px; height: 12px; flex: none; }
.vbadge--paid { background: var(--ok-wash); color: var(--ok-ink); }
.vbadge--home { background: var(--chalk-wash); color: var(--chalk-ink); }

/* ── One contractor's page ── */
.cp { padding-top: clamp(20px, 3vw, 36px); }
.cp__crumbs { margin-bottom: 18px; }
.cp__head { display: grid; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.cp__name { margin: 8px 0 6px; font-family: var(--f-display); font-weight: 800; text-transform: uppercase; line-height: 0.95; letter-spacing: 0.004em; font-size: clamp(38px, 8vw, 76px); overflow-wrap: anywhere; text-wrap: balance; }
.cp__where { color: var(--ink-2); font-size: 17px; overflow-wrap: anywhere; }
.cp__rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; }
.cp__rate b { font-size: 22px; }
.cp__rate span:not(.cstars) { color: var(--ink-3); }
.cp__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cp__acts .btn { justify-content: center; white-space: normal; text-align: center; line-height: 1.2; }
/* the main button has the row to itself, and so does a last button with nobody beside it */
.cp__acts .btn--primary, .cp__acts .btn--primary ~ .btn:last-child:nth-child(even), .cp__acts .btn:only-child { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .cp__head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .cp__acts { display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 460px; }
}
.cp__grid { display: grid; gap: 28px; margin-top: 28px; }
@media (min-width: 960px) {
  .cp__grid { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 48px; align-items: start; }
  .cp__side { position: sticky; top: 84px; }
}
.cp__main { display: grid; gap: 22px; min-width: 0; }
.cp__about { font-size: 17px; color: var(--ink-2); white-space: pre-line; max-width: 66ch; overflow-wrap: anywhere; }
.cp__side { display: grid; gap: 14px; min-width: 0; }
.cp__box { padding: 18px 20px; border: 1px solid var(--rule); border-radius: calc(var(--r) * 2); background: var(--white); }
.cp__box h2 { margin-bottom: 8px; font-family: var(--f-mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.cp__box p + p { margin-top: 6px; }
.cp__box .fine { color: var(--ink-3); font-size: 14px; }
.cp__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cp__chips li { padding: 5px 11px; border-radius: 999px; background: var(--board); color: var(--ink-2); font-size: 14px; }
.cp__contact { display: grid; gap: 8px; }
.cp__contact a { overflow-wrap: anywhere; }
.cp__facts { display: grid; gap: 6px; color: var(--ink-2); font-size: 15px; }
.cp__facts b { font-family: var(--f-display); font-size: 22px; color: var(--ink); margin-right: 6px; }
.cp__lic { font-family: var(--f-mono); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }

/* the rating summary: the average beside the spread of stars */
.cp__sum { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--rule); border-radius: calc(var(--r) * 2); background: var(--white); }
@media (min-width: 560px) { .cp__sum { grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; } }
.cp__avg { display: grid; justify-items: start; gap: 4px; }
.cp__avg strong { font-family: var(--f-display); font-weight: 800; font-size: 64px; line-height: 0.9; }
.cp__avg span:not(.cstars) { color: var(--ink-3); font-size: 14.5px; }
.cp__bars { display: grid; gap: 6px; }
.cp__bar { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) 2.4em; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.cp__bar i { display: block; height: 10px; border-radius: 99px; background: var(--rule-2); overflow: hidden; }
.cp__bar i::before { content: ""; display: block; height: 100%; width: var(--w, 0%); background: #e0a100; border-radius: inherit; }
.cp__bar span:last-child { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.cp__revhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cp__revhead h2 { font-size: 22px; font-weight: 650; }
.cp__sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.cp__sort select { padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--white); font: inherit; font-size: 14.5px; color: var(--ink); }
.cp__how { color: var(--ink-3); font-size: 14.5px; max-width: 70ch; }

.crevs { display: grid; gap: 0; border-top: 1px solid var(--rule-2); }
.crev { padding: 18px 0; border-bottom: 1px solid var(--rule-2); }
.crev__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.crev__by { font-weight: 650; }
.crev__meta { margin-top: 4px; color: var(--ink-3); font-size: 14px; }
.crev__words { margin-top: 8px; white-space: pre-line; overflow-wrap: anywhere; }
.crev .rev__reply { margin-top: 12px; }
.crev .rev__reply p { margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.cp__more { justify-self: start; }
.cp__none { padding: 22px; border: 1px dashed var(--rule); border-radius: calc(var(--r) * 2); color: var(--ink-2); }
.cp__none b { display: block; color: var(--ink); margin-bottom: 4px; }

.cp__share-ok { color: var(--ok-ink); font-size: 14px; }
