/* base.css – Westbridge House public website system */
/* Shared tokens, typography, layout, components, states */

/* ============================= */
/* 1. CSS custom properties      */
/* ============================= */

:root {
  /* Font sizes */
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-h3: 18px;
  --font-size-h2: 24px;
  --font-size-h1: 32px;

  /* Line heights */
  --line-height-body: 1.6;
  --line-height-small: 1.45;
  --line-height-h1: 1.2;
  --line-height-h2: 1.25;
  --line-height-h3: 1.3;

  /* Font weights */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Font families */
  --font-family-sans: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-family-serif: "Georgia", "Times New Roman", serif;

  /* Colors (monochroom) */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-text-main: #111111;
  --color-text-secondary: #222222;
  --color-text-muted: #555555;

  --color-border-subtle: #e0e0e0;
  --color-border-default: #c7c7c7;
  --color-border-strong: #111111;
  --color-border-error: #b00000;

  --color-surface-default: #ffffff;
  --color-surface-muted: #f5f5f5;

  /* Brand-aligned accents (restrained) */
  --color-accent: #1f2a35; /* deep, ink-like */
  --color-accent-strong: #151e27;
  --color-surface-warm: #f4f1ec;

  /* Brand neutrals (restrained) */
  --color-graphite: #2b333c; /* muted graphite for borders/text */

  --color-error-text: #b00000;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 40px;

  /* Layout */
  --content-max-width: 1040px;
  --page-padding-x: 24px;
  --page-padding-top: 32px;
  --page-padding-bottom: 40px;

  /* Radii */
  --radius-none: 0;
  --radius-sm: 3px;
  --radius-md: 4px;

  /* Button */
  --button-padding-y: 10px;
  --button-padding-x: 16px;
  --button-font-size: 15px;
}

/* ============================= */
/* 2. Base layout and typography */
/* ============================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  padding: var(--page-padding-top) var(--page-padding-x) var(--page-padding-bottom);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-main);
  background-color: var(--color-surface-default);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Headings */

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--color-text-main);
}

h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family-serif);
  color: var(--color-accent);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-h2);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family-serif);
  color: var(--color-accent);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-h3);
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

/* Text elements */

p {
  margin-top: 0;
  margin-bottom: 0;
}

p + p {
  margin-top: var(--space-md);
}

p + ul,
p + ol,
ul + p,
ol + p {
  margin-top: var(--space-md);
}

small,
.text-small {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-small);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
}

/* Lists */

ul,
ol {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 1.5rem;
}

li + li {
  margin-top: var(--space-sm);
}

/* Sections (generic spacing between major blocks) */

.section {
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

/* ============================= */
/* 3. Header and navigation      */
/* ============================= */

.site-header {
  position: relative;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
  border-bottom: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface-default);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-bottom: var(--space-md);
}

.site-header__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-left: 4px;
  margin-right: 0;
  flex-shrink: 0;
}

.site-header__wordmark {
  height: 26px;
  width: auto;
  display: block;
  vertical-align: middle;
}

.header-cta-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Header: narrow viewports – same inset as body, CTA on second line */
@media (max-width: 1023px) {
  .site-header {
    padding-left: 0;
    padding-right: 0;
  }

  .site-header__inner {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: var(--page-padding-x);
    flex-wrap: wrap;
    min-height: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 12px 0;
  }

  .site-header__brand {
    margin-left: 0;
    margin-right: 0;
  }

  .header-cta-wrapper {
    flex-basis: 100%;
    margin-top: 0;
    margin-left: 0;
    padding-top: 0;
    padding-left: 0;
    justify-content: flex-start;
    align-items: center;
  }

  .header-cta-wrapper .btn {
    margin-left: 0;
  }
}

/* ============================= */
/* 4. Buttons / CTAs             */
/* ============================= */

.button,
.btn {
  display: inline-block;
  padding: var(--button-padding-y) var(--button-padding-x);
  font-size: var(--button-font-size);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-main);
}

.button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* Primary CTA */

.btn--primary {
  padding: 12px 20px;
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
}

.btn--primary:hover {
  background-color: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
}

.btn--primary:active {
  background-color: var(--color-accent-strong);
}

/* Secondary CTA */

.btn--secondary {
  background-color: transparent;
  color: var(--color-text-main);
  border-color: var(--color-graphite);
  font-weight: var(--font-weight-medium);
}

.btn--secondary:hover {
  background-color: var(--color-surface-muted);
  border-color: #bbbbbb;
}

.btn--secondary:active {
  background-color: var(--color-surface-muted);
}

/* Disabled state for buttons */

.button[disabled],
.btn[disabled],
.button.is-disabled,
.btn.is-disabled {
  background-color: #f2f2f2;
  color: #999999;
  border-color: #dddddd;
  cursor: not-allowed;
}

/* CTA block: separation between explanation and action row */
.cta-actions {
  margin-top: 30px;
}

/* ============================= */
/* 5. Links                      */
/* ============================= */

a {
  color: var(--color-text-main);
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* Inline text links – optional helper */

.link-inline {
  color: var(--color-text-main);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.link-inline:hover {
  text-decoration-thickness: 2px;
}

/* ============================= */
/* 6. Forms                      */
/* ============================= */

form {
  margin: 0;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group--compact {
  margin-bottom: var(--space-md);
}

/* Labels */

label {
  display: block;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-main);
  margin-bottom: var(--space-xs);
}

/* Text inputs, selects, textareas */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="url"],
select,
textarea {
  display: block;
  width: 100%;
  max-width: 520px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: 1.4;
  color: var(--color-text-main);
  background-color: var(--color-surface-default);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-graphite);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #888888;
}

/* Form control states */

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
  border-color: var(--color-accent);
}

/* Disabled fields */

input[disabled],
select[disabled],
textarea[disabled] {
  background-color: #f7f7f7;
  color: #777777;
  border-color: #dddddd;
  cursor: not-allowed;
}

/* ============================= */
/* 7. Radios and checkboxes      */
/* ============================= */

input[type="radio"],
input[type="checkbox"] {
  margin: 0;
  accent-color: var(--color-text-main);
}

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

.option-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.option-item label {
  margin-bottom: 0;
  font-size: 15px;
  font-weight: var(--font-weight-regular);
}

/* ============================= */
/* 8. Fieldsets and groups       */
/* ============================= */

fieldset {
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: 0;
  margin-bottom: var(--space-xl);
}

legend {
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  padding: 0 var(--space-xs);
}

/* ============================= */
/* 9. Errors and confirmation    */
/* ============================= */

.form-error {
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-small);
  font-weight: var(--font-weight-regular);
  color: var(--color-error-text);
}

/* Error border on fields */

.is-error,
input.is-error,
select.is-error,
textarea.is-error {
  border-color: var(--color-border-error);
}

/* Confirmation / success-like receipt block */

.notice-confirmation {
  background-color: var(--color-surface-warm);
  border: 1px solid #dddddd;
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-top: var(--space-2xl);
  color: var(--color-text-secondary);
}

.notice-confirmation__title {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-main);
}

.notice-confirmation p {
  margin-top: 0;
}

/* ============================= */
/* 10. Utilities (minimal)       */
/* ============================= */

.u-mb-xs {
  margin-bottom: var(--space-xs);
}

.u-mb-sm {
  margin-bottom: var(--space-sm);
}

.u-mb-md {
  margin-bottom: var(--space-md);
}

.u-mb-lg {
  margin-bottom: var(--space-lg);
}

.u-mb-xl {
  margin-bottom: var(--space-xl);
}

.u-text-muted {
  color: var(--color-text-muted);
}
