/*
Theme Name: Spire Corporate
Theme URI: https://spirecorporate.com
Author: Spire Corporate
Description: Custom theme for Spire Corporate — an accounting, tax and immigration advisory firm in Nairobi. Navy & gold design system with a ledger-line motif.
Version: 1.0.0
License: Proprietary
Text Domain: spire-corporate
*/

/* ==========================================================================
   Spire Corporate — Design System
   (Full design CSS below is enqueued automatically by functions.php
   as the theme's main stylesheet.)
   ========================================================================== */

/* ==========================================================================
   Spire Corporate — Design System
   Navy & gold, ledger-line motif (a nod to the firm's own working material:
   the ruled lines of a financial ledger).
   ========================================================================== */

:root {
  /* Color */
  --navy-900: #0B1F3A;
  --navy-800: #122a4d;
  --navy-700: #1a3a66;
  --gold-500: #C9A24B;
  --gold-400: #d8b869;
  --gold-100: #f3e9d2;
  --white: #FFFFFF;
  --gray-100: #F5F6F8;
  --gray-200: #E7E9ED;
  --charcoal: #2B2B2B;
  --charcoal-soft: #55595f;

  /* Type */
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Scale */
  --step-1: clamp(2.5rem, 2rem + 2vw, 4rem);   /* H1 */
  --step-2: clamp(1.75rem, 1.5rem + 1vw, 2.5rem); /* H2 */
  --step-3: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); /* H3 */
  --step-0: 1rem;    /* body */
  --step--1: 0.875rem; /* caption */

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 2px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 220ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-1); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-3); font-weight: 600; }
p { margin: 0 0 1em; color: var(--charcoal-soft); }
button { font-family: inherit; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(3.5rem, 6vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 4vw, 4rem); }
.section--alt { background: var(--gray-100); }
.section--navy { background: var(--navy-900); color: var(--white); }
.section--navy h1, .section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy p { color: rgba(255,255,255,0.75); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 0.9em;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold-500);
}
.section--navy .eyebrow { color: var(--gold-400); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 3vw, 2rem);
}
@media (min-width: 780px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Ledger-line motif ----------
   A quiet signature drawn from the firm's own material: the ruled
   horizontal lines of a ledger sheet, used as texture and dividers
   rather than decoration for its own sake. */
.ledger-rule {
  position: relative;
  height: 1px;
  background: var(--gray-200);
  margin-block: 3rem;
}
.ledger-rule::after {
  content: "";
  position: absolute;
  left: 0; top: -1px;
  width: 48px;
  height: 3px;
  background: var(--gold-500);
}
.ledger-bg {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.05) 0px,
    rgba(255,255,255,0.05) 1px,
    transparent 1px,
    transparent 40px
  );
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.9em;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  min-height: 48px;
  touch-action: manipulation;
}
.btn-gold {
  background: var(--gold-500);
  color: var(--navy-900);
}
.btn-gold:hover { background: var(--gold-400); }
.btn-gold:active { transform: translateY(1px); }

.btn-outline {
  background: transparent;
  border-color: var(--gold-500);
  color: var(--white);
}
.btn-outline:hover { background: var(--gold-500); color: var(--navy-900); }

.btn-navy {
  background: var(--navy-900);
  color: var(--white);
  border-color: var(--navy-900);
}
.btn-navy:hover { background: var(--navy-800); }

/* ---------- Header ---------- */
.topbar {
  background: var(--navy-900);
  color: rgba(255,255,255,0.85);
  font-size: 0.8125rem;
}
.topbar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  justify-content: space-between;
  padding-block: 0.55rem;
}
.topbar__item { display: inline-flex; align-items: center; gap: 0.5em; }
.topbar__item svg { width: 14px; height: 14px; flex: none; color: var(--gold-400); }
.topbar a:hover { color: var(--gold-400); }

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--navy-900);
  display: flex;
  align-items: baseline;
  gap: 0.4em;
}
.brand__mark { color: var(--gold-500); }

.nav-links {
  display: none;
  align-items: center;
  gap: 2.25rem;
}
.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--navy-900);
  padding-block: 0.3rem;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--navy-900); font-weight: 600; }

.nav-cta { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.nav-toggle svg { width: 20px; height: 20px; color: var(--navy-900); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem var(--gutter) 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a {
  padding: 0.85rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy-900);
  border-bottom: 1px solid var(--gray-200);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.mobile-menu .btn { margin-top: 1rem; justify-content: center; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--navy-900);
  color: var(--white);
  overflow: hidden;
  padding-block: clamp(4.5rem, 10vw, 8.5rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(201,162,75,0.16), transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, #0e2749 55%, var(--navy-900) 100%);
}
.hero__inner {
  position: relative;
  max-width: 720px;
}
.hero h1 { color: var(--white); margin-bottom: 0.5em; }
.hero p.lede {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.78);
  max-width: 52ch;
  margin-bottom: 2em;
}
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.page-header {
  position: relative;
  background: var(--navy-900);
  color: var(--white);
  padding-block: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--navy-900) 0%, #0e2749 60%, var(--navy-900) 100%);
}
.page-header__inner { position: relative; }
.page-header h1 { color: var(--white); margin-bottom: 0.35em; }
.page-header p { color: rgba(255,255,255,0.75); max-width: 60ch; margin: 0; }
.page-header__meta {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.page-header__meta a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 600;
  color: var(--gold-400);
}
.page-header__meta svg { width: 18px; height: 18px; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -18px rgba(11,31,58,0.28);
  border-color: var(--gold-500);
}
.card__icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
  margin-bottom: 1.25rem;
}
.card__icon svg { width: 100%; height: 100%; }
.card h3 { margin-bottom: 0.5em; }
.card p { margin: 0; font-size: 0.9375rem; }
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-900);
  border-bottom: 1px solid transparent;
}
.card:hover .card__link { border-color: var(--gold-500); color: var(--gold-500); }

.card--alt { background: var(--gray-100); border-color: var(--gray-100); }
.card--alt:hover { border-color: var(--gold-500); background: var(--white); }

/* ---------- Checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 1rem; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  font-weight: 500;
  color: var(--navy-900);
}
.checklist svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--gold-500);
  margin-top: 0.1em;
}

/* ---------- Media placeholder (stand-in for licensed photography) ---------- */
.media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(160deg, var(--navy-800), var(--navy-900));
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.media::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(201,162,75,0.08) 0 2px, transparent 2px 34px);
  z-index: -1;
}
.media__label {
  padding: 1.25rem 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  border-top: 1px solid rgba(255,255,255,0.14);
  width: 100%;
  background: linear-gradient(0deg, rgba(0,0,0,0.35), transparent);
}
.media--wide { aspect-ratio: 16 / 9; }
.media--tall { aspect-ratio: 3 / 4; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--navy-900);
  color: var(--white);
  text-align: center;
  padding-block: clamp(3rem, 6vw, 4.5rem);
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(201,162,75,0.14), transparent 60%);
}
.cta-banner__inner { position: relative; max-width: 640px; margin-inline: auto; }
.cta-banner h2 { color: var(--white); }
.cta-banner p { color: rgba(255,255,255,0.75); }

/* ---------- Callout ---------- */
.callout {
  border-left: 3px solid var(--gold-500);
  background: var(--gray-100);
  padding: 1.75rem 2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout h3 { margin-bottom: 0.4em; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field--full { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy-900);
}
.field input,
.field textarea {
  border: 1px solid var(--navy-900);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--charcoal);
  background: var(--white);
  min-height: 48px;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.25);
}
.field-error {
  font-size: 0.8125rem;
  color: #b3261e;
  min-height: 1.2em;
}
.field-error:empty { display: none; }
.field.has-error input,
.field.has-error textarea { border-color: #b3261e; }

.form-status {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  display: none;
}
.form-status.is-visible { display: block; }
.form-status.success { background: #e7f3ea; color: #1e6b34; }
.form-status.error { background: #fbe9e7; color: #b3261e; }

/* ---------- Contact list ---------- */
.contact-list { display: flex; flex-direction: column; gap: 1rem; }
.contact-list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--navy-900);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.contact-list a:hover { border-color: var(--gold-500); background: var(--gray-100); }
.contact-list svg { width: 22px; height: 22px; color: var(--gold-500); flex: none; }

/* ---------- Map ---------- */
.map-frame {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.map-frame iframe { display: block; width: 100%; height: 380px; border: 0; filter: grayscale(0.15) contrast(1.05); }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-900);
  color: rgba(255,255,255,0.72);
  padding-block: clamp(3rem, 5vw, 4.5rem) 2rem;
}
.footer h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.footer p { color: rgba(255,255,255,0.6); font-size: 0.9375rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.footer-grid ul { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-grid a { font-size: 0.9375rem; color: rgba(255,255,255,0.72); }
.footer-grid a:hover { color: var(--gold-400); }
.footer-brand {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 0.4em;
}
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.55);
}
.footer-bottom a:hover { color: var(--gold-400); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.max-w-copy { max-width: 62ch; }
.mt-lg { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 1rem; top: -60px;
  background: var(--gold-500);
  color: var(--navy-900);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 700;
  z-index: 100;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ==========================================================================
   Editor content areas (About Us story, Service page bodies)
   Generic styling so ordinary paragraphs / bullet lists typed into the
   WordPress block editor automatically match the design system —
   no special classes required from whoever is editing content.
   ========================================================================== */
.entry-content { color: var(--charcoal-soft); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.1em; font-size: 1rem; line-height: 1.7; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content a { color: var(--navy-900); text-decoration: underline; text-decoration-color: var(--gold-500); text-underline-offset: 3px; }
.entry-content a:hover { color: var(--gold-500); }
.entry-content ul,
.entry-content ol { margin: 0 0 1.5em; padding: 0; }
.entry-content ul { list-style: none; }
.entry-content ul li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.85rem;
  font-weight: 500;
  color: var(--navy-900);
}
.entry-content ul li::before {
  content: "\2713";
  position: absolute;
  left: 0; top: -0.05em;
  color: var(--gold-500);
  font-weight: 700;
  font-size: 1.05em;
}
.entry-content ol {
  counter-reset: spire-ol;
  list-style: none;
}
.entry-content ol li {
  position: relative;
  padding-left: 2.1rem;
  margin-bottom: 0.85rem;
  counter-increment: spire-ol;
}
.entry-content ol li::before {
  content: counter(spire-ol) ".";
  position: absolute;
  left: 0;
  color: var(--gold-500);
  font-weight: 700;
}
.entry-content img { border-radius: var(--radius); margin: 1.5em 0; }
.entry-content blockquote {
  border-left: 3px solid var(--gold-500);
  margin: 1.75em 0;
  padding: 0.25em 0 0.25em 1.5em;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy-900);
}

/* Contact form status banner, server-rendered (works without JS) */
.form-status[data-state] { display: block; }

/* Skip link already defined above; ensure it sits above WP admin bar */
.admin-bar .skip-link:focus { top: 46px; }
