/* Peter Barry letters — personalised page. Mobile first, 375px up. */

:root {
  --ink: #15202b;
  --body: #39485a;
  --muted: #6b7a8d;
  --brand: #075282;        /* headings and links */
  --brand-dark: #053e63;
  --accent: #187F9C;       /* solid blocks */
  --accent-dark: #126479;
  --button: #FF7033;       /* button fill */
  --button-ink: #15202b;   /* white on the orange is 2.76:1, so labels are dark */
  --line: #dde3ea;
  --wash: #f4f6f9;
  --card: #ffffff;
  --good: #1f7a52;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(21, 32, 43, 0.06), 0 8px 24px rgba(21, 32, 43, 0.06);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--wash);
  color: var(--body);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--brand); line-height: 1.25; margin: 0 0 12px; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 27px; }
h2 { font-size: 21px; }
h3 { font-size: 18px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
a { color: var(--brand); }
small { font-size: 14px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 18px; }

/* ----------------------------------------------------------------- header */

.masthead {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.masthead .wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.masthead img { width: 158px; height: auto; display: block; }
.masthead .rics {
  font-size: 12px; color: var(--muted); letter-spacing: 0.09em;
  text-transform: uppercase; font-weight: 600;
}

/* ------------------------------------------------------------------- hero */

.hero { background: var(--card); padding: 22px 0 26px; border-bottom: 1px solid var(--line); }
.hero .eyebrow {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 650; margin-bottom: 10px;
}
.hero p.lede { font-size: 17px; color: var(--body); margin-top: 12px; }

/* ------------------------------------------------------------------ cards */

main { padding: 18px 0 40px; }
section { margin: 0 0 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }

.summary dl { margin: 0; }
.summary .row { padding: 12px 0; border-top: 1px solid var(--line); }
.summary .row:first-child { border-top: 0; padding-top: 0; }
.summary dt {
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 3px;
}
.summary dd { margin: 0; color: var(--ink); font-size: 17px; font-weight: 550; }
.summary dd .position { display: block; font-weight: 400; color: var(--muted); font-size: 15px; margin-top: 2px; }

.portal-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 4px; font-weight: 600; text-decoration: none;
  min-height: 44px;
}
.portal-link span { text-decoration: underline; }

/* -------------------------------------------------------------- collapsed */

details.council {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--wash);
}
details.council summary {
  cursor: pointer; padding: 13px 14px; font-weight: 600; color: var(--brand);
  font-size: 16px; list-style: none; min-height: 44px; display: flex; align-items: center;
}
details.council summary::-webkit-details-marker { display: none; }
details.council summary::after { content: " ▾"; margin-left: auto; color: var(--muted); }
details.council[open] summary::after { content: " ▴"; }
details.council .inner { padding: 0 14px 14px; font-size: 16px; color: var(--body); }

/* ------------------------------------------------------------- drawings */

.drawings { display: flex; gap: 12px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
.drawing {
  flex: 0 0 auto; width: 150px; text-decoration: none; color: var(--body);
}
.drawing img {
  width: 150px; height: 112px; object-fit: cover; object-position: center;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; display: block;
}
.drawing .t { display: block; font-size: 14px; margin-top: 7px; line-height: 1.35; }
.caption { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* --------------------------------------------------------------- triggers */

.trigger { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin: 0 0 18px; }
.trigger:last-of-type { margin-bottom: 0; }
.trigger h3 { margin-bottom: 6px; }
.trigger .covers { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 8px; }
.note {
  margin-top: 16px; padding: 13px 14px; background: var(--wash);
  border-radius: 8px; font-size: 16px; color: var(--body);
}

/* -------------------------------------------------------------- timeline */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 30px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--brand);
}
.timeline li::after {
  content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline strong { display: block; color: var(--ink); font-weight: 600; }
.timeline span { font-size: 16px; }

/* -------------------------------------------------------------------- cta */

.cta { background: var(--accent); color: #fff; border: 0; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,0.88); }
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 14px 20px; border-radius: 8px;
  font-size: 17px; font-weight: 650; text-decoration: none; text-align: center;
  border: 0; width: 100%; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--button); color: var(--button-ink); }
.btn-secondary {
  background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.5);
  margin-top: 10px;
}
.btn-submit { background: var(--button); color: var(--button-ink); margin-top: 6px; }

/* ------------------------------------------------------------------- form */

.field { margin-bottom: 16px; }
.field label, .field .field-label, fieldset legend {
  display: block; font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.field .hint { font-size: 14px; color: var(--muted); font-weight: 400; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink);
  padding: 12px 13px; border: 1px solid #c6cfda; border-radius: 8px; background: #fff;
  min-height: 50px; -webkit-appearance: none; appearance: none;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.readonly-value {
  padding: 12px 13px; background: var(--wash); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 16px;
}
fieldset { border: 0; margin: 0 0 16px; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  flex: 1 1 auto; display: flex; align-items: center; gap: 8px;
  border: 1px solid #c6cfda; border-radius: 8px; padding: 12px 13px;
  background: #fff; min-height: 50px; cursor: pointer; font-size: 16px;
}
.choice input { margin: 0; width: 20px; height: 20px; accent-color: var(--accent); }
.consent { display: flex; gap: 11px; align-items: flex-start; font-size: 16px; line-height: 1.45; }
.consent input { width: 24px; height: 24px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.errors {
  background: #fdf1f1; border: 1px solid #e9c3c3; color: #8a2222;
  padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 16px;
}
.errors ul { margin: 6px 0 0; padding-left: 20px; }

/* ----------------------------------------------------------------- footer */

.privacy { font-size: 15px; color: var(--muted); }
.privacy h2 { font-size: 18px; }
.privacy a { color: var(--brand); }

footer.site {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 22px 0 34px; font-size: 14px; color: var(--muted);
}
footer.site p { margin-bottom: 8px; }

/* ----------------------------------------------------------------- lightbox */

dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh;
}
dialog.lightbox::backdrop { background: rgba(10, 16, 24, 0.85); }
dialog.lightbox .inner { background: #fff; border-radius: 10px; overflow: hidden; }
dialog.lightbox img { display: block; width: 100%; height: auto; max-height: 76vh; object-fit: contain; background: #fff; }
dialog.lightbox .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink);
}
dialog.lightbox button {
  font: inherit; font-size: 16px; font-weight: 600; border: 0; background: var(--wash);
  color: var(--brand); border-radius: 7px; padding: 10px 16px; min-height: 44px; cursor: pointer;
}

/* ---------------------------------------------------------------- simple */

.simple { max-width: 520px; margin: 0 auto; padding: 48px 20px; }
.simple .card { text-align: left; }
.simple h1 { font-size: 24px; }
.tick {
  width: 46px; height: 46px; border-radius: 50%; background: #e7f3ec; color: var(--good);
  display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 14px;
}
.code-input { letter-spacing: 0.22em; text-transform: uppercase; font-size: 20px; text-align: center; }

@media (min-width: 560px) {
  h1 { font-size: 31px; }
  .card { padding: 22px; }
  .btn { width: auto; min-width: 280px; }
  .choices .choice { flex: 0 1 auto; min-width: 120px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
