/*
 * Listing marketing pages: the index at /marketing and one set per listing.
 *
 * A reading surface. The job is to make four pieces of copy easy to read side
 * by side against the photograph they would be published with, so nothing here
 * competes with the copy for attention.
 *
 * Everything is a brand token, so a second agent's site inherits this without
 * an edit.
 */

.mkt {
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  background: var(--c-white);
  margin: 0 0 2.5rem;
  overflow: hidden;
}

.mkt__meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--c-muted);
}

/*
 * The Rule 712 line.
 *
 * Called out rather than buried, because on a closed sale it is the difference
 * between one photograph and twenty three.
 */
.mkt__rule {
  margin: 0;
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  color: var(--c-ink-soft);
  background: color-mix(in srgb, var(--c-accent) 8%, transparent);
  border-bottom: 1px solid var(--c-line);
}

/* --- Body ----------------------------------------------------------------- */

.mkt__body {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
  align-items: start;
}

@media (max-width: 48rem) {
  .mkt__body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mkt__photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--s-radius);
  border: 1px solid var(--c-line);
}

.mkt__photocap,
.mkt__nophoto {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--c-muted);
}

.mkt__nophoto {
  padding: 1rem;
  border: 1px dashed var(--c-line);
  border-radius: var(--s-radius);
  background: var(--c-paper);
}

.mkt__copy {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.mkt__piecehead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: var(--t-tracking);
  text-transform: uppercase;
  color: var(--c-muted);
}

.mkt__piecehead em {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-muted);
  white-space: nowrap;
}

/*
 * The copy itself, in a pre.
 *
 * Line breaks in a Google Business Profile post and in an email are content,
 * not presentation, so they are shown exactly as the file holds them. white-space
 * pre-wrap keeps the breaks and still wraps long lines on a narrow screen.
 */
.mkt__text {
  margin: 0;
  padding: 1rem 1.1rem;
  font-family: var(--f-body);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--c-body);
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-left: 3px solid color-mix(in srgb, var(--c-accent) 55%, transparent);
  border-radius: var(--s-radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* --- Footer --------------------------------------------------------------- */

.mkt__foot {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--c-line);
  background: var(--c-paper-alt);
}

.mkt__note {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--s-radius);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-left: 3px solid var(--c-alarm);
}

.mkt__note--warn {
  border-left-color: var(--c-error);
}

.mkt__note h3,
.mkt__note h4 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--t-tracking);
  text-transform: uppercase;
  color: var(--c-ink);
}

.mkt__note p,
.mkt__note li {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--c-body);
}

.mkt__note ul {
  margin: 0;
  padding-left: 1.1rem;
}

.mkt__gbp { margin: 0 0 1.5rem; padding: 0.9rem 1.1rem; background: var(--c-paper-alt); font-size: 0.9rem; }
.mkt__gbp code { font-family: var(--f-mono); font-size: 0.82em; }

.mkt__passed {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--c-muted);
  max-width: var(--s-measure);
}

.mkt__empty {
  padding: 2rem;
  border: 1px dashed var(--c-line);
  border-radius: var(--s-radius);
  color: var(--c-muted);
  line-height: 1.7;
}

.mkt__empty code {
  font-family: var(--f-mono);
  font-size: 0.85em;
  color: var(--c-ink);
}

/* --- Index grid ----------------------------------------------------------- */

.mktgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 0 0 2rem;
}

.mktcard {
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  background: var(--c-white);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.mktcard:hover {
  border-color: color-mix(in srgb, var(--c-accent) 55%, var(--c-line));
  transform: translateY(-2px);
}

.mktcard__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.mktcard__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--c-paper-alt);
}

.mktcard__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mktcard__nophoto {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--c-muted);
}

.mktcard__badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: calc(var(--s-radius) / 2);
  background: var(--c-white);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: var(--t-tracking);
  text-transform: uppercase;
  color: var(--c-ink);
}

.mktcard__body {
  display: block;
  padding: 0.85rem 1rem 1rem;
}

.mktcard__addr {
  display: block;
  font-family: var(--f-display);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--c-ink);
}

.mktcard__price {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-accent-deep);
}

.mktcard__count {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--c-muted);
}

/* The index carries the same footnote without a card around it. */
.mkt__passed--page {
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-line);
}

.mkt__meta--page {
  margin: 0.5rem 0 0;
}

.mkt__meta--page a,
.eyebrow a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Notes ---------------------------------------------------------------- */

.postlist {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border-top: 1px solid var(--c-line);
}

.postlist__item { border-bottom: 1px solid var(--c-line); }

.postlist__link {
  display: block;
  padding: 1.15rem 0;
  text-decoration: none;
  color: inherit;
}

.postlist__link:hover .postlist__title { color: var(--c-accent-deep); }

.postlist__title {
  display: block;
  font-family: var(--f-display);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--c-ink);
}

.postlist__summary {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--c-body);
  max-width: var(--s-measure);
}

.postlist__date {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: var(--t-tracking);
  text-transform: uppercase;
  color: var(--c-muted);
}

/* The post body. One column, measure limited, nothing else competing. */
.post {
  max-width: var(--s-measure);
  margin: 0 0 3rem;
}

.post p {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--c-body);
}

/* The source note and the caveat close every post. Set back so they read as
   what they are: the limits of what was just claimed.

   Excluded on a guide. A guide's body ends in ordinary prose or a numbered
   step, not in a source note, and this rule would mute the last of it into
   fine print for no reason. A guide puts its sources in .post-sources below
   instead, where they are links rather than a sentence. */
.post:not(.post--guide) p:nth-last-child(-n+2) {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--c-muted);
}

/* --- A town guide -------------------------------------------------------- */
/* Longer and more structured than anything else the blog renders: headings,
   an ordered sequence of steps, and quoted statute text. The quotation styling
   is the load-bearing part. Reproduced law has to look like reproduced law and
   not like the agent's own sentence, because it is published under his licence
   number. See lib/town-update.php town_split_quoted(). */

/* Space separates the sections, not a rule across every one of them. Four
   full-width borders down a long page read as four cuts through it. */
.post--guide h2 {
  font-size: var(--t-display-m);
  line-height: 1.25;
  margin: 3.25rem 0 1rem;
}
.post--guide h2:first-child { margin-top: 0; }

.post--guide h3 {
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 2rem 0 0.6rem;
}

.post--guide ol,
.post--guide ul {
  margin: 0 0 1.4rem;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.post--guide li {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--c-body);
  padding-left: 0.35rem;
}
.post--guide li::marker { color: var(--c-accent-deep); font-weight: 600; }

.post--guide strong { font-weight: 600; color: var(--c-ink, inherit); }

/* A quotation is set back from the writing, not boxed against it.

   The first version filled each one with a tinted panel and a heavy rule. With
   two quotations that reads as emphasis; with nine it read as a wall of grey
   slabs with the agent's own writing squeezed between them, which is what a
   reader noticed first about the page. The quotation is supporting evidence.
   It should look like evidence: indented, a shade quieter than the prose
   around it, with the source attached. The rule alone carries it. */
.post--guide blockquote {
  margin: 1.5rem 0 1.5rem 0.15rem;
  padding: 0.1rem 0 0.1rem 1.35rem;
  border-left: 2px solid color-mix(in srgb, var(--c-accent) 45%, var(--c-line));
}
.post--guide blockquote p {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  line-height: 1.68;
  color: var(--c-muted);
}
.post--guide blockquote p:last-of-type { margin-bottom: 0; }

.post--guide blockquote cite {
  display: block;
  margin-top: 0.55rem;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  opacity: 0.85;
}

/* --- The short answer ---------------------------------------------------- */
/* Sits above the writing and answers the question outright. A reader who
   stops here has still been helped, which is the point. */

.answer {
  max-width: var(--s-measure);
  margin: 0 0 2.5rem;
  padding: 1.35rem 1.5rem;
  background: color-mix(in srgb, var(--c-accent) 7%, transparent);
  border-radius: 2px;
}
.answer__head {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent-deep);
}
.answer__body {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--c-body);
}

/* --- Where a guide got its facts ----------------------------------------- */
/* Published rather than kept, because a page that names its sources can be
   checked. The citation gate refuses any URL the search did not return, so
   this list is the retrieved set. */

.post-sources {
  max-width: var(--s-measure);
  margin: 0 0 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-line);
}
.post-sources__head { font-size: var(--t-display-m); margin: 0 0 0.9rem; }
.post-sources__list {
  margin: 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.post-sources__list li {
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--c-muted);
  overflow-wrap: anywhere;
}
.post-sources__list a { color: var(--c-accent-deep); }

/* --- Questions on a post ------------------------------------------------- */

.post-faq {
  max-width: var(--s-measure);
  margin: 0 0 3rem;
  border-top: 1px solid var(--c-line);
}
.post-faq__head { font-size: var(--t-display-m); margin: 2rem 0 0.5rem; }
.post-faq__item { padding: 1.25rem 0; border-bottom: 1px solid var(--c-line); }
.post-faq__item h3 { font-size: 1.2rem; margin: 0 0 0.6rem; }
.post-faq__item p { margin: 0; font-size: 1rem; line-height: 1.72; color: var(--c-body); }

.post-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 4rem;
}

/* --- Town market brief ---------------------------------------------------- */

.page-head--brief .page-head__title { max-width: 22ch; }
.brief__lede {
  max-width: 62ch;
  margin: 0.4rem 0 1.4rem;
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.45;
  color: var(--c-ink);
}

.brief { margin-top: clamp(2rem, 4vw, 3rem); }
.brief__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-bottom: 1rem;
}
.brief__story .post { margin-bottom: 2rem; max-width: none; }
.brief__story .post p:nth-last-child(-n+2) { font-size: 1.02rem; color: var(--c-body); }

.brief__take {
  border-left: 3px solid var(--c-accent);
  padding: 0.35rem 0 0.35rem 1.25rem;
  margin: 0 0 2rem;
}
.brief__takehead {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-accent-deep);
}
.brief__take p:last-child {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--c-ink);
}

.brief__panel {
  position: sticky;
  top: 7.5rem;
  border: 1px solid var(--c-line);
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--c-white);
}
.brief__panelhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-ink);
}
.brief__panelhead span { font-weight: 500; letter-spacing: 0.06em; text-transform: none; color: var(--c-muted); }

.brief__tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  background: var(--c-line);
  border: 1px solid var(--c-line);
}
.brief__tiles li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1rem 0.9rem;
  background: var(--c-paper-alt);
}
.brief__tiles strong {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--c-ink);
}
.brief__tiles span {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.brief__tiles small { font-size: 0.78rem; color: var(--c-muted); }

.brief__table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4rem;
  font-size: 0.86rem;
}
.brief__table caption {
  text-align: left;
  padding: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-ink);
}
.brief__table th, .brief__table td { padding: 0.45rem 0; border-top: 1px solid var(--c-line); vertical-align: top; }
.brief__table thead th { border-top: 0; padding-top: 0; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted); font-weight: 600; text-align: right; }
.brief__table tbody th { text-align: left; font-weight: 500; color: var(--c-ink-soft); padding-right: 0.75rem; }
.brief__table td { text-align: right; font-family: var(--f-data); font-size: 0.82rem; color: var(--c-ink); white-space: nowrap; }
.brief__table td:first-of-type { font-weight: 600; }
.brief__table td + td { color: var(--c-muted); }
.brief__windows { margin: 0; font-size: 0.72rem; line-height: 1.5; color: var(--c-muted); }

.brief__foot { max-width: var(--s-measure); margin: 0 0 4rem; }
.brief__foot p { font-size: 0.88rem; color: var(--c-muted); margin: 0 0 0.6rem; }

@media (max-width: 900px) {
  .brief__grid { grid-template-columns: 1fr; }
  .brief__panel { position: static; }
}

/* --- Town chips on the index -------------------------------------------- */

.townchips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0; }
.townchip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--c-ink);
}
.townchip span { font-family: var(--f-data); font-size: 0.7rem; color: var(--c-muted); letter-spacing: 0; }
.townchip:hover { border-color: var(--c-ink); }
.townchip.is-on { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-white); }
.townchip.is-on span { color: rgba(255,255,255,0.7); }

/* ---------------------------------------------------------------------------
   The trend and the bands.

   Both are a table with a picture beside it, never a picture alone. The table
   is what an assistant reads and quotes; the sparkline is aria-hidden and
   costs nothing if it never paints. Wide tables scroll inside themselves so
   the page body never scrolls sideways on a phone.
   --------------------------------------------------------------------------- */

.section--trend .section__head,
.section--bands .section__head { margin-bottom: 1.75rem; }

.trend__spark {
  display: block;
  width: 100%;
  height: clamp(90px, 16vw, 140px);
  margin-bottom: 1.5rem;
  overflow: visible;
}
.trend__line {
  fill: none;
  stroke: var(--c-accent-deep);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.trend__fill { fill: var(--c-accent-soft); opacity: 0.45; stroke: none; }

.trend__table,
.bands__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--f-data);
  font-size: 0.86rem;
}
.trend__table caption,
.bands__table caption {
  caption-side: top;
  text-align: left;
  color: var(--c-muted);
  font-family: var(--f-body);
  font-size: 0.85rem;
  padding-bottom: 0.9rem;
}
.trend__table th,
.trend__table td,
.bands__table th,
.bands__table td {
  text-align: left;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--c-line);
  font-weight: 400;
}
.trend__table thead th,
.bands__table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-family: var(--f-body);
}
.trend__table td,
.bands__table td { text-align: right; white-space: nowrap; }

/* The band holding the median. Marked because the point of the table is that
   it is usually not the biggest one. */
.bands__median th,
.bands__median td { font-weight: 600; }
.bands__flag {
  display: block;
  font-family: var(--f-body);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent-deep);
  font-weight: 400;
}
.bands__bar {
  display: inline-block;
  vertical-align: middle;
  /* Unitless --w, multiplied into a length here. As a percentage it
     resolved against the table cell while max-width capped the longest bar,
     so a three-sale band could draw longer than a four-sale one. */
  width: calc(var(--w, 0) * 0.09rem);
  height: 0.55rem;
  margin-right: 0.6rem;
  background: var(--c-accent-soft);
  border-radius: 2px;
}
.bands__median .bands__bar { background: var(--c-accent); }

@media (max-width: 40rem) {
  .bands__bar { display: none; }
  .trend__table, .bands__table { font-size: 0.8rem; }
}

/* The month against its own series, and the band comparison. */
.context__table { width: 100%; border-collapse: collapse; font-family: var(--f-data); font-size: 0.86rem; }
.context__table th, .context__table td {
  text-align: right; padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--c-line); font-weight: 400; white-space: nowrap;
}
.context__table th[scope="row"] { text-align: left; }
.context__table thead th {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c-muted); font-family: var(--f-body);
}
/* A month at either end of its own range. Marked because that is the sentence
   worth quoting, and the plain figure never says it. */
.context__extreme th, .context__extreme td { font-weight: 600; }
.context__extreme td:last-child { color: var(--c-accent-deep); }
.context__scope { font-size: 0.8rem; color: var(--c-muted); margin-top: 1rem; }
.bands__then { color: var(--c-muted); }

@media (max-width: 40rem) {
  .context__table { font-size: 0.78rem; }
  .context__table th, .context__table td { padding-right: 0.4rem; }
}
