/*
 * The shared page patterns (Task T4): container, sections and bands, the section label, H2/H3, cards, the large and
 * secondary buttons (moved from home.css unchanged, so Home renders exactly as before), then the inner pages: the page
 * H1, the reading column of the policies (42em) with its contents box, the About founder block and the Contact email.
 * Linked from every page; App tokens only.
 */

/* ---------------------------------------------------------------------------------------------- shared */

main.page {
  max-width: none;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 24px;
}

.container-narrow {
  max-width: 880px;
}

.section {
  padding-block: 88px;
  border-bottom: 1px solid var(--border);
}

/* Sections 2, 5 and 7: the card band. */
.band {
  background: var(--card);
}

.section-label {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.page h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin-bottom: 48px;
}

.section-intro .section-label {
  margin: 0;
}

.section-intro p:not(.section-label) {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.page h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.card p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--card);
}

.page ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------------------------------------------------------------------------------------------- buttons */

.button-large {
  min-height: 48px;
  padding-inline: 20px;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.button-secondary:hover {
  background: var(--accent);
}

/* ---------------------------------------------------------------------------------------------- inner pages */

/* Home's hero sets its own H1 (home.css, later in the cascade). */
.page h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.page-lead {
  max-width: 34em;
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

/* The policies' reading column. */
.prose {
  max-width: 42em;
}

.prose h2 {
  margin: 48px 0 0;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

/* Running text only: a classed paragraph (label, lead, updated line) keeps its own size. */
.prose p:not([class]),
.prose li {
  font-size: 16px;
  line-height: 1.65;
}

.prose p:not([class]) {
  margin: 12px 0 0;
}

.prose ul {
  margin: 12px 0 0;
  padding-left: 1.25em;
  list-style: disc;
}

.prose li + li {
  margin-top: 6px;
}

.updated {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  color: var(--muted-foreground);
}

.toc {
  margin-top: 32px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.toc ol {
  margin: 0;
  padding-left: 1.5em;
  list-style: decimal;
}

.toc li {
  font-size: 15px;
  line-height: 1.5;
}

.toc li + li {
  margin-top: 6px;
}

/* About: the photo beside the name and lead, stacked on phones. */
.about-founder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 56px;
}

.about-photo {
  flex: 0 0 280px;
  max-width: 280px;
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--muted);
}

.about-intro {
  flex: 1 1 360px;
  min-width: 0;
}

.about-role {
  margin: 12px 0 0;
  font-size: 17px;
  font-weight: 500;
}

.about-closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin: 40px 0 0;
}

.about-closing span {
  font-size: 16px;
  color: var(--muted-foreground);
}

/* Contact: the address is the call to action. */
.contact-email {
  display: inline-block;
  margin-top: 32px;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.contact-plan {
  margin: 16px 0 0;
  font-weight: 500;
  color: var(--primary);
}

.contact-include {
  margin-top: 40px;
}

.contact-include-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

/* The enquiry form (Task T8): shown by scripts/contact-form.js; errors, the summary and the alert in the status tones. */
.contact-form-section {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.contact-form {
  position: relative;
}

.field {
  margin-top: 20px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 500;
}

.field-optional {
  font-weight: 400;
  color: var(--muted-foreground);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  /* 16px: phones don't zoom into the field. */
  font-size: 16px;
  line-height: 1.5;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field [aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--danger);
}

.field-count {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  color: var(--muted-foreground);
}

/* The honeypot: off-screen, not display:none (some bots skip hidden fields); aria-hidden and out of the tab order. */
.form-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form button[type="submit"] {
  margin-top: 28px;
  border: 0;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.contact-form button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: progress;
}

.form-alert,
.form-summary {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.5;
}

.form-summary-title {
  margin: 0;
  font-weight: 600;
}

.form-summary ul {
  margin: 8px 0 0;
  padding-left: 1.25em;
  list-style: disc;
}

.form-summary a {
  color: var(--foreground);
}

.form-success {
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius);
  background: var(--card);
}

.form-success h3 {
  margin: 0;
  font-size: 18px;
}

.form-success p {
  margin: 8px 0 0;
  font-size: 16px;
}

/* ---------------------------------------------------------------------------------------------- phones */

@media (max-width: 759px) {
  .section {
    padding-block: 56px;
  }

  .about-photo {
    flex-basis: 60vw;
  }
}
