/* ==========================================================================
   Components shared by more than one page: buttons, page opener, jump links,
   heading-and-content rows, lists, timeline, steps, questions, sources, form,
   contact card. Anything used by one page only lives in css/pages/.
   ========================================================================== */

/* A bold link keeps the link color (base.css makes other bold text ink) */
a strong { color: inherit; }

/* Buttons: green primary with ink text, blue outline, white outline on blue --------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .8rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn--primary { background: var(--green); border-color: var(--green); color: var(--ink); }
.btn--primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn--ghost { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn--ghost:hover { background: var(--blue); color: var(--paper); }
.btn--light { background: transparent; border-color: rgba(255,255,255,.6); color: var(--paper); }
.btn--light:hover { border-color: var(--paper); background: rgba(255,255,255,.1); }
.btn--lg { min-height: 54px; padding: .95rem 1.7rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; cursor: default; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
}

/* Page opener: the blue band at the top of every inner page ------------------------ */
.page-hero {
  background: var(--blue);
  color: var(--slate-light);
  padding-block: clamp(2.5rem, 5vw, 4.25rem) clamp(2.25rem, 4.5vw, 3.75rem);
}
.page-hero h1 { color: var(--paper); max-width: 22ch; }
.page-hero .lead { margin-top: 1.1rem; max-width: 58ch; }
.page-hero .actions { margin-top: 1.75rem; }
.page-hero a:not(.btn) { color: var(--paper); }
.page-hero :focus-visible { outline-color: var(--green); }

/* Jump links: "on this page" row inside a page opener */
.jump {
  list-style: none;
  margin: 2rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(255,255,255,.22);
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.5rem;
  font-weight: 700;
}
.jump li { margin: 0; }
.jump a { display: inline-block; padding: .3rem 0; text-decoration-color: rgba(255,255,255,.4); }
.jump a:hover { text-decoration-color: var(--green); }

/* Row: a heading on the left, its content on the right. Used for the topics on the
   membership-year page, the postage page and the link lists. ------------------------ */
.rows > .row:first-child { border-top: 0; padding-top: 0; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 1.25rem clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(2.25rem, 4vw, 3.5rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--header-h) + .5rem);
}
.row__head h2 { font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.1rem); }
.row__head .pitch { margin-top: .7rem; }
.row__body > * + * { margin-top: 1.1rem; }
@media (max-width: 879px) {
  .row { grid-template-columns: 1fr; }
}

/* Split: a section's heading on the left, its content on the right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 1.75rem clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.split__head .lead { margin-top: 1rem; }
@media (max-width: 879px) {
  .split { grid-template-columns: 1fr; }
}

/* The one-line message under a topic heading */
.pitch {
  color: var(--ink);
  font-size: var(--fs-lead);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

/* Lists ------------------------------------------------------------------------------ */
/* Square markers; two columns when there is room */
.list {
  list-style: none;
  padding: 0;
}
.list li {
  position: relative;
  margin: 0;
  padding: .32rem 0 .32rem 1.35rem;
  break-inside: avoid;
}
.list li::before {
  content: "";
  position: absolute;
  left: 0; top: .82em;
  width: .5rem; height: .5rem;
  background: var(--blue);
}
.list--cols { columns: 2; column-gap: 2.5rem; }
@media (max-width: 599px) { .list--cols { columns: 1; } }
.section--blue .list li::before { background: var(--green); }

/* A small heading over a list, for groups inside one topic */
.subhead {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: .2rem;
}

/* A side note: how something works, or a caution */
.note {
  padding: 1rem 1.15rem;
  background: var(--stock);
  border-left: 4px solid var(--blue);
  color: var(--slate);
}
.section--stock .note { background: var(--paper); }
.note strong { color: var(--ink); }

/* Source line under a fact */
.source { font-size: var(--fs-sm); color: var(--mark); }
.source a { color: inherit; }

/* Timeline: points along a line. Across the page when there is room, down the page
   on a phone. The line and the dots say "in this order". ------------------------------ */
.timeline {
  --cols: 5;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 0 clamp(1.25rem, 2.2vw, 2rem);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 7px;
  height: 2px;
  background: var(--rule);
}
.timeline > li {
  position: relative;
  margin: 0;
  padding-top: 2.2rem;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--blue);
}
.section--stock .timeline > li::before { background: var(--stock); }
.timeline h3 { font-size: 1.2rem; line-height: 1.22; }
.timeline__when {
  display: block;
  margin-bottom: .3rem;
  color: var(--mark);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0;
}
.timeline p { margin-top: .6rem; font-size: 1rem; }
.timeline a { font-weight: 700; }
@media (max-width: 1019px) {
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline::before { left: 7px; right: auto; top: .4rem; bottom: .4rem; width: 2px; height: auto; }
  .timeline > li { padding: 0 0 2rem 2.4rem; }
  .timeline > li:last-child { padding-bottom: 0; }
  .timeline > li::before { top: .15rem; }
  .timeline p { max-width: 60ch; }
}

/* Steps: a numbered sequence, for things that really happen in order ---------------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 1.25rem 0 1.25rem 4rem;
  border-top: 1px solid var(--rule);
}
.steps > li:last-child { border-bottom: 1px solid var(--rule); }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1.05rem;
  width: 2.6rem;
  color: var(--blue);
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.steps h3 { font-size: 1.2rem; }
.steps p { margin-top: .3rem; max-width: 62ch; }

/* Questions and answers --------------------------------------------------------------- */
.faq { border-bottom: 1px solid var(--rule); }
.faq details { border-top: 1px solid var(--rule); }
.faq summary {
  position: relative;
  padding: 1.05rem 2.75rem 1.05rem 0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: .25rem; top: 50%;
  transform: translateY(-50%);
  width: 1.6rem; height: 1.6rem;
  display: grid; place-items: center;
  border-radius: 2px;
  background: var(--green);
  color: var(--ink);
  font-weight: 900;
  font-size: 1.2rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--blue); }
.faq details > p { padding: 0 2.75rem 1.2rem 0; max-width: 68ch; }

/* Promises: short points two by two, each under a hairline -------------------------- */
.promises {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 3vw, 2.5rem) clamp(2rem, 5vw, 4.5rem);
}
.promise {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.promise h3 { text-wrap: balance; }
.promise p { margin-top: .6rem; max-width: 56ch; }
@media (max-width: 767px) {
  .promises { grid-template-columns: 1fr; }
}

/* A closing line under a section, usually a link onward */
.more { margin-top: clamp(2rem, 4vw, 3rem); max-width: 70ch; }

/* Closing call to action -------------------------------------------------------------- */
.cta .lead { margin-top: 1rem; }
.cta .actions { margin-top: 1.75rem; }

/* Form --------------------------------------------------------------------- */
.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 879px) { .quote-layout { grid-template-columns: 1fr; } }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 599px) { .form-grid { grid-template-columns: 1fr; } }

.field label, .field > .label {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .35rem;
  font-size: .97rem;
}
.field .hint { display: block; font-weight: 400; color: var(--mark); font-size: var(--fs-sm); margin-top: .15rem; }
.field label .hint, .field > .label .hint { display: inline; margin: 0 0 0 .35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: .7rem .85rem;
  border: 1px solid #8C9AAD;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--blue) 50%), linear-gradient(135deg, var(--blue) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - .8rem) 50%;
  background-size: .36rem .36rem;
  background-repeat: no-repeat;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .9rem;
  margin-top: .3rem;
}
.checks label {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  min-height: 44px;
  margin: 0;
  padding: .6rem .65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-weight: 400;
  color: var(--slate);
  line-height: 1.3;
  cursor: pointer;
}
.checks label:has(input:checked) { border-color: var(--blue); background: var(--stock); color: var(--ink); }
.checks input { width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; flex: none; accent-color: var(--blue); }
@media (max-width: 479px) { .checks { grid-template-columns: 1fr; } }

.quote-form .actions { margin-top: 1.5rem; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 1rem; display: none; padding: .9rem 1rem; border-radius: var(--radius); }
.form-status.is-error { display: block; background: #FBEAEA; color: #7A1E1E; border: 1px solid #E7B9B9; }
.form-status.is-info  { display: block; background: var(--stock); color: var(--ink); border: 1px solid var(--rule); }
.form-status a { color: inherit; font-weight: 700; }

.form-footnote { margin-top: 1rem; font-size: var(--fs-sm); color: var(--mark); }

/* Contact card beside the form --------------------------------------------- */
.contact-card {
  background: var(--stock);
  border-top: 4px solid var(--blue);
  padding: 1.4rem 1.5rem 1.5rem;
  display: grid;
  gap: .35rem;
}
.contact-card h2, .contact-card h3 { font-size: 1.15rem; letter-spacing: -0.015em; margin-bottom: .35rem; }
.contact-card a { font-weight: 700; text-decoration: none; }
.contact-card a:hover { text-decoration: underline; text-decoration-color: var(--green-deep); }
.contact-card .phone { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; }
.contact-card address { margin-top: .6rem; color: var(--slate); }

/* Thank-you and not-found pages ---------------------------------------------- */
.notice { padding-block: clamp(4rem, 10vw, 8rem); }
.notice h1 { margin-bottom: 1rem; }
.notice .actions { margin-top: 1.75rem; }
.notice .list { margin-top: 1.5rem; }
