/* The property, construction material and mortgage pages.
 *
 * These pages reuse the Budget Machine shell (bm-), the Product Policies
 * timeline (pp-) and the levers panel (pl-) rather than restyling any of it.
 * Only the parts those three do not already have live here: the definition
 * list at the top of a page, the published price block, the property tax block
 * with its fold-out tutorial, and the two small labels that mark a result as
 * exact arithmetic or as a ceiling. */

.ep-definition {
  margin: 0 0 1.25rem;
  padding: 0;
}
.ep-definition dt {
  margin: 0.75rem 0 0.2rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bm-text);
}
.ep-definition dd {
  margin: 0;
  color: var(--bm-muted);
  line-height: 1.6;
}

.ep-measured {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--bm-subtle);
  border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius);
}
.ep-measured p { margin: 0 0 0.5rem; line-height: 1.6; }
.ep-measured p:last-child { margin-bottom: 0; }
.ep-measured-price {
  font-family: var(--bm-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bm-text);
}
.ep-measured-price .pp-per {
  display: block;
  font-family: var(--bm-font);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--bm-muted);
}
.ep-measured-none { font-size: 1rem; }
.ep-caveat {
  font-size: 0.85rem;
  color: var(--bm-muted);
  font-style: italic;
}

.ep-tax {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--bm-border-dark);
  border-radius: var(--bm-radius);
  background: var(--bm-white);
}
.ep-tax h3 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.ep-tax p { margin: 0 0 0.5rem; line-height: 1.6; }
.ep-tax-rate {
  font-family: var(--bm-mono);
  font-size: 1.3rem;
  font-weight: 700;
}
.ep-tax-rate .pp-per {
  display: block;
  font-family: var(--bm-font);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--bm-muted);
}

.ep-tutorial,
.ep-notes {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  background: var(--bm-subtle);
}
.ep-tutorial summary,
.ep-notes summary { cursor: pointer; }
.ep-tutorial-lede { margin: 0.6rem 0; color: var(--bm-muted); }
.ep-tutorial dt,
.ep-notes dt { margin: 0.7rem 0 0.2rem; font-weight: 700; }
.ep-tutorial dd,
.ep-notes dd { margin: 0; line-height: 1.6; color: var(--bm-muted); }

.ep-exact,
.ep-ceiling {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.ep-exact { background: #1b5e20; color: #fff; }
.ep-ceiling { background: var(--bm-border-dark); color: var(--bm-text); }

/* The picker on a page that holds a set of things, laid out the same way the
 * Product Policies picker is, so the two pages read identically. Every field
 * and every button in the row is the same height on purpose. */
.ep-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.ep-picker-row .bm-field { flex: 1 1 14rem; min-width: 0; }
.ep-picker-row select,
.ep-picker-row input { height: 2.6rem; box-sizing: border-box; width: 100%; }

/* The side menu of pages about a price and the policies behind it.
 *
 * It sits in the normal flow of the page in a two column grid, and that is all
 * it does. There is no fixed position, no sticky behaviour and no scroll area
 * of its own on purpose: if the list grows longer than the page, the page
 * scrolls and the menu goes with it. align-items: start keeps the menu the
 * height of its own contents rather than stretching it down the whole page. */
.ep-layout {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  /* Room to scroll past the reading bar, which is fixed to the bottom of the
     screen on every one of these pages. A fixed bar always covers whatever is
     at the bottom edge of the window, so this does not stop it covering the
     last row of the menu at rest -- what it does is guarantee there is always
     somewhere further to scroll, so anything the bar is sitting on can be
     moved out from under it. Measured at 1440 by 1000: the menu's last row
     ends at 951 and the bar begins at 928, and 150 pixels of scroll clears
     it. */
  padding-bottom: 6rem;
}
@media (min-width: 62rem) {
  .ep-layout { grid-template-columns: 16rem minmax(0, 1fr); }
}
.ep-main { min-width: 0; }

.ep-side {
  /* budget-machine.css styles the bare `nav` element as a flex row for the
     header, and this menu is a nav too, so it has to say plainly that it is a
     block. Without this line the heading, the group labels and the lists lay
     out side by side and spill out of the box. */
  display: block;
  gap: 0;
  position: static;
  padding: 0.9rem 1rem;
  border: 1px solid var(--bm-border-dark);
  border-radius: var(--bm-radius);
  background: var(--bm-white);
  font-size: 0.9rem;
}
.ep-side:empty { display: none; }
/* The list inside the box -- the heading, the group labels, the rows and the
   sentence under each row -- is the shared .side-list family in
   css/site-menu.css, which every page already loads. The account menu is built
   from the same family, so there is one implementation of this list and not
   two that drift apart. */

/* The three picker fields are a third of the row each, with real space between
   them. Product Policies already does this in its own stylesheet; this is the
   same shape for the pages built here. */
.ep-picker-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 62rem) {
  .ep-picker-row { grid-template-columns: minmax(0, 1fr); }
}

/* The Levers page: who carries the weight of each policy figure now. */
.lv-top { margin: 0 0 1.5rem; font-size: 1rem; }
.lv-section { margin: 0 0 2rem; }
.lv-section h2 { margin: 0 0 0.3rem; font-size: 1.2rem; }
.lv-count {
  font-family: var(--bm-mono); font-size: 0.78rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 999px;
  background: var(--bm-subtle); color: var(--bm-muted); vertical-align: middle;
}
.lv-lede { margin: 0 0 1rem; color: var(--bm-muted); }
.lv-row {
  margin: 0 0 0.9rem; padding: 0.8rem 1rem;
  border: 1px solid var(--bm-border); border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius); background: var(--bm-white);
}
.lv-row p { margin: 0 0 0.35rem; }
.lv-row p:last-child { margin-bottom: 0; }
.lv-name { font-weight: 700; }
.lv-name a { color: var(--bm-accent); text-decoration: none; }
.lv-name a:hover { text-decoration: underline; }
.lv-figure { font-family: var(--bm-mono); font-size: 1.05rem; }
.lv-on { font-family: var(--bm-font); font-size: 0.85rem; color: var(--bm-muted); }
.lv-exact {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 0.08rem 0.4rem; border-radius: 999px;
  background: #1b5e20; color: #fff;
}
.lv-move { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.lv-from, .lv-to { padding: 0.15rem 0.5rem; border-radius: var(--bm-radius); background: var(--bm-subtle); }
.lv-arrow { color: var(--bm-accent); font-weight: 700; }
.lv-why { font-size: 0.9rem; line-height: 1.6; }
.lv-budget { font-size: 0.88rem; font-weight: 600; }
.lv-nobudget { font-size: 0.85rem; color: var(--bm-muted); }

/* The definition at the top of the Levers page. A reader meets the word
   "lever" there before any list of them, because the whole page is sorted by
   something that only makes sense once you know what one is. */
.lv-define {
  margin: 0 0 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--bm-border-dark);
  border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius);
  background: var(--bm-white);
}
.lv-define h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.lv-define-lede { margin: 0 0 0.8rem; font-size: 1.02rem; font-weight: 600; }
.lv-define .ep-definition { margin: 0; }

/* ---- Levers page: where the country's credit stands, and what a surplus would take ---- */
.lv-rating {
  margin: 0 0 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--bm-border-dark);
  border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius);
  background: var(--bm-white);
}
.lv-rating h2 { margin: 0.3rem 0 0.4rem; font-size: 1.15rem; }
.lv-rating-note {
  margin: 0 0 1rem;
  padding: 0.8rem 0.95rem;
  background: var(--bm-subtle);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  font-size: 0.93rem;
  color: var(--bm-muted);
}
.lv-rating-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.4rem;
}
.lv-rating-card {
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  background: var(--bm-subtle);
}
.lv-rating-agency {
  margin: 0 0 0.3rem;
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bm-light);
}
.lv-rating-grade {
  margin: 0 0 0.25rem;
  font-family: var(--bm-mono);
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--bm-accent);
}
.lv-rating-step { margin: 0 0 0.5rem; font-size: 0.86rem; font-weight: 600; color: var(--bm-text); }
.lv-rating-when { margin: 0; font-size: 0.88rem; color: var(--bm-muted); }
.lv-rating-when a { color: var(--bm-accent); }
.lv-rating-subhead { margin: 0 0 0.5rem; font-size: 1.02rem; }
.lv-rating-text { margin: 0 0 0.8rem; color: var(--bm-muted); }
.lv-rating .ep-definition { margin: 0.4rem 0 0; }
@media (max-width: 860px) {
  .lv-rating-grid { grid-template-columns: 1fr; }
}

/* Long source names and web addresses must wrap on a phone. */
.ep-definition dd, .pp-source { overflow-wrap: anywhere; }

/* The central figures of a page whose subject is a rate or a share rather
   than a price. A page with a real price already puts it in big type through
   .ep-measured-price; a page measured in per cent had nowhere to put its own
   figures and they ended up inside a paragraph, which is the fault this fixes.
   One implementation, used by any page in this family that carries
   measured.headline_figures -- never restyled per page. */
.ep-headline-figures {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.ep-hf {
  flex: 1 1 8rem;
  min-width: 7.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--bm-border);
  border-left: 4px solid var(--bm-accent);
  background: var(--bm-white);
  border-radius: var(--bm-radius);
}
/* The figure the other two produce. Marked so the reader can see which one is
   the answer and which are the inputs. */
.ep-hf.is-answer {
  border-left-color: var(--bm-text);
  background: var(--bm-subtle);
}
.ep-hf-value {
  font-family: var(--bm-mono);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--bm-text);
  overflow-wrap: break-word;
}
.ep-hf-label {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bm-muted);
}
.ep-hf-note {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--bm-muted);
}
/* The operator between two figures, so a subtraction reads as one. It is
   decoration for a sighted reader: the sentence under the block says the same
   thing in words, so this is hidden from a screen reader. */
.ep-hf-op {
  align-self: center;
  font-family: var(--bm-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bm-muted);
  padding: 0 0.1rem;
}
@media (max-width: 560px) {
  .ep-headline-figures { gap: 0.5rem; }
  .ep-hf { flex: 1 1 100%; }
  .ep-hf-op { display: none; }
  .ep-hf-value { font-size: 1.4rem; }
}

/* When a figure was last confirmed against the source it came from. Shown on
   every dial, because a figure nobody has checked looks exactly as trustworthy
   as a checked one unless it says otherwise. */
.pl-verified {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--bm-muted);
}
/* The honest admission. Marked so it reads as a caveat rather than a date. */
.pl-verified.is-unconfirmed {
  font-style: italic;
  color: var(--bm-accent);
}
