/*
 * Theme layer over Bootstrap.
 *
 * Every colour is a custom property on :root. That is what makes per-franchise white-labelling a
 * matter of emitting four lines of CSS from the Franchise.Branding record (WP2) rather than
 * maintaining a stylesheet per franchisee. Nothing below hard-codes a brand colour.
 */

:root {
  /* Overridden per franchise at render time. */
  --brand-primary: #0b1f33;
  --brand-accent: #c9a227;

  --ink: #0d1b26;
  --ink-muted: #5a6b78;
  --surface: #ffffff;
  --surface-alt: #f5f7f9;
  --hairline: #e2e8ee;

  --shell-max: 1180px;
  --radius: 4px;
  --transition: 180ms ease;

  --font-display: "Georgia", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eef3;
    --ink-muted: #9bacba;
    --surface: #0d1620;
    --surface-alt: #131f2b;
    --hairline: #23323f;
  }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display-serif {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.shell {
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.site-header .brand span,
.brand-accent {
  color: var(--brand-accent);
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(160deg, var(--brand-primary) 0%, #06111d 100%);
  color: #f3f6f8;
  padding: clamp(4rem, 12vw, 8rem) 0;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.08;
  max-width: 18ch;
}

.hero .lede {
  color: #c3d0da;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 52ch;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--brand-accent);
}

/* ---------- Buttons ---------- */

.btn-brand {
  background: var(--brand-accent);
  border: 1px solid var(--brand-accent);
  color: #14202b;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  padding: 0.7rem 1.6rem;
  transition: background var(--transition), transform var(--transition);
}

.btn-brand:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-accent) 85%, #fff);
  transform: translateY(-1px);
}

.btn-brand:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #f3f6f8;
  border-radius: var(--radius);
  padding: 0.7rem 1.6rem;
  transition: border-color var(--transition), background var(--transition);
}

.btn-ghost:hover {
  border-color: var(--brand-accent);
  color: #fff;
}

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

.service-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  height: 100%;
  background: var(--surface);
  transition: border-color var(--transition), transform var(--transition);
}

.service-card:hover {
  border-color: var(--brand-accent);
  transform: translateY(-2px);
}

.service-card .icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 1rem;
  display: block;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.service-card p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Process ---------- */

.process-step {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--hairline);
}

.process-step:last-child {
  border-bottom: 0;
}

.process-step .num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--brand-accent);
}

.process-step h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.process-step p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Form ---------- */

.section-alt {
  background: var(--surface-alt);
}

.consult-form .form-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.consult-form .form-control,
.consult-form .form-select {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0.7rem 0.85rem;
}

.consult-form .form-control:focus,
.consult-form .form-select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 25%, transparent);
}

.consult-form .invalid-feedback {
  display: block;
  min-height: 1.1rem;
  font-size: 0.82rem;
}

/*
 * Honeypot. Off-screen rather than display:none, because some bots skip hidden inputs but almost
 * all of them fill anything they can find in the DOM. aria-hidden and tabindex keep it away from
 * assistive technology and keyboard users.
 */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Status region ---------- */

.form-status {
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.95rem;
}

.form-status[data-state="success"] {
  background: color-mix(in srgb, #1f7a4d 15%, transparent);
  border: 1px solid #1f7a4d;
}

.form-status[data-state="error"] {
  background: color-mix(in srgb, #b3261e 12%, transparent);
  border: 1px solid #b3261e;
}

/* The note beside a sign-in form: what to do if this is not the form you need. */
.auth-aside {
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--brand-accent);
  background: var(--surface-alt, rgb(0 0 0 / 3%));
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
}

.auth-aside a { color: var(--brand-primary); text-decoration-color: var(--brand-accent); }

/* ---------- Ops console ---------- */

.ops-shell {
  min-height: 100vh;
  background: var(--surface-alt);
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
}

.connection-pill .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink-muted);
}

.connection-pill[data-state="connected"] .dot { background: #1f7a4d; }
.connection-pill[data-state="reconnecting"] .dot { background: #c9a227; }
.connection-pill[data-state="disconnected"] .dot { background: #b3261e; }

.lead-row {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--brand-accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
}

/* Newly arrived rows flash once so a scheduler watching the board notices without a sound. */
@keyframes lead-arrive {
  from { background: color-mix(in srgb, var(--brand-accent) 22%, var(--surface)); }
  to   { background: var(--surface); }
}

.lead-row.is-new {
  animation: lead-arrive 1.6s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .lead-row.is-new { animation: none; }
  .service-card:hover, .btn-brand:hover { transform: none; }
}

.lead-row .meta {
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.empty-state {
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--brand-primary);
  color: #9bacba;
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: #c3d0da;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand-accent);
}

/* Visible focus for keyboard users everywhere, including over the dark hero. */
:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-accent);
  color: #14202b;
  padding: 0.75rem 1.25rem;
  z-index: 2000;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Cookie notice ---------- */

.consent-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1040;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  padding: 1rem 0;
  font-size: 0.9rem;
  box-shadow: 0 -4px 24px rgb(0 0 0 / 8%);
}

.consent-banner p {
  max-width: 62ch;
  color: var(--ink-muted);
}

/* ---------- Long-form legal copy ---------- */

.prose {
  max-width: 68ch;
}

.prose h2 {
  font-size: 1.2rem;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
}

.prose p,
.prose li {
  color: var(--ink-muted);
  font-size: 0.96rem;
}

.prose ul {
  padding-left: 1.15rem;
}

/* ---------- Public gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gallery-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
}

.gallery-item img {
  display: block;
  width: 100%;

  /* A fixed aspect keeps the grid even across a mix of hull panoramas and square paint shots,
     while object-fit stops either being distorted to reach it. */
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.gallery-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--brand-accent);
  color: #14202b;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item:hover img { transform: none; }
}

/* ---------- Testimonials ---------- */

.testimonial-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.testimonial {
  margin: 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  border-top: 3px solid var(--brand-accent);
}

.testimonial blockquote {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
}

/* Typographic quotation marks rather than characters in the text, so the comment is stored and
   read exactly as the client wrote it. */
.testimonial blockquote::before { content: "\201C"; }
.testimonial blockquote::after { content: "\201D"; }

.testimonial figcaption {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/*
 * Utilities that used to be inline style attributes. The Content-Security-Policy has no
 * unsafe-inline for styles, so every one of them was silently dropped by the browser: the sign-in
 * form had been rendering at the full reading width since the page was written.
 */
.shell-narrow { max-width: 26rem; }
.measure { max-width: 60ch; }
.small-print { font-size: 0.85rem; }

/* ---------- Availability: the working week as seven rows ---------- */

.hours-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
}

.hours-day {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.9rem;
}
