/* Polity Research: trust colours (white/blue), light/dark aware, print friendly */

:root {
  color-scheme: light dark;

  --color-bg: #ffffff;
  --color-bg-alt: #f4f7fb;
  --color-text: #16232f;
  --color-text-muted: #4a5b6c;
  --color-border: #dbe4ee;

  --color-primary: #0b3d91;
  --color-primary-dark: #072a66;
  --color-primary-contrast: #ffffff;
  --color-accent: #2f6fed;

  --shadow-card: 0 0.5rem 1.5rem rgba(11, 61, 145, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0d1117;
    --color-bg-alt: #131b26;
    --color-text: #e6edf3;
    --color-text-muted: #a7b4c2;
    --color-border: #26333f;

    --color-primary: #4d8ff7;
    --color-primary-dark: #2f6fed;
    --color-primary-contrast: #ffffff;
    --color-accent: #6fa4ff;

    --shadow-card: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
  }
}

html, body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--color-accent);
}

/* Wordmark, carried over from the original Polity Research mark */
.navbar-brand {
  font-family: "Plaster", cursive;
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

footer .footer-brand {
  font-family: "Plaster", cursive;
  font-size: 1.5rem;
}

.navbar-polity {
  background-color: var(--color-primary-dark);
}

.navbar-polity .navbar-brand,
.navbar-polity .nav-link {
  color: var(--color-primary-contrast) !important;
}

.navbar-polity .nav-link.active {
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary-contrast);
}

/* Photographic hero, blended with the trust-colour gradient */
.hero {
  position: relative;
  background-color: var(--color-primary-dark);
  background-size: cover;
  background-position: center;
  color: var(--color-primary-contrast);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(7, 42, 102, 0.92), rgba(11, 61, 145, 0.82));
  z-index: -1;
}

.hero .lead {
  color: rgba(255, 255, 255, 0.9);
}

.section {
  padding: 4rem 0;
}

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

/* Photographic section background (e.g. tech pills), same treatment as hero */
.section-photo {
  position: relative;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.section-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(244, 247, 251, 0.94), rgba(244, 247, 251, 0.94));
  z-index: -1;
}

@media (prefers-color-scheme: dark) {
  .section-photo::before {
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.92), rgba(13, 17, 23, 0.92));
  }
}

.card-service {
  position: relative;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  height: 100%;
  overflow: hidden;
  transition: transform 0.15s ease-in-out;
}

.card-service:hover {
  transform: translateY(-4px);
}

.card-service .bi {
  color: var(--color-primary);
}

.card-service .card-img-top {
  height: 170px;
  object-fit: cover;
}

.card-service .card-body-inner {
  padding: 1.5rem;
}

/* Small photographic accent used on a handful of feature cards */
.card-service-thumb {
  float: right;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-left: 0.75rem;
  box-shadow: var(--shadow-card);
}

.photo-frame {
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  width: 100%;
  object-fit: cover;
}

@media (prefers-color-scheme: dark) {
  .photo-frame,
  .card-service .card-img-top {
    filter: brightness(0.85);
  }
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-outline-light-primary {
  color: var(--color-primary-contrast);
  border: 1px solid var(--color-primary-contrast);
}

.btn-outline-light-primary:hover {
  background-color: var(--color-primary-contrast);
  color: var(--color-primary-dark);
}

.text-primary-brand {
  color: var(--color-primary) !important;
}

.tech-pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  margin: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.client-strip {
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.cta-banner {
  background-color: var(--color-primary);
  color: var(--color-primary-contrast);
}

footer.site-footer {
  background-color: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
}

footer.site-footer a {
  color: #ffffff;
}

footer.site-footer a:hover {
  color: rgba(255, 255, 255, 0.75);
}

.contact-card {
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
}

@media print {
  :root {
    --color-bg: #ffffff !important;
    --color-bg-alt: #ffffff !important;
    --color-text: #000000 !important;
    --color-text-muted: #333333 !important;
    --color-border: #cccccc !important;
    --color-primary: #0b3d91 !important;
    --color-primary-dark: #0b3d91 !important;
    --color-primary-contrast: #000000 !important;
    --shadow-card: none !important;
  }

  .navbar-polity {
    background-color: #ffffff !important;
    border-bottom: 2px solid #0b3d91;
  }

  .navbar-polity .navbar-brand,
  .navbar-polity .nav-link {
    color: #0b3d91 !important;
  }

  .hero,
  .cta-banner {
    background: #ffffff !important;
    color: #000000 !important;
    border-bottom: 2px solid #0b3d91;
  }

  .hero::before,
  .section-photo::before {
    content: none !important;
  }

  .hero .lead {
    color: #333333 !important;
  }

  footer.site-footer {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-top: 2px solid #0b3d91;
  }

  footer.site-footer a {
    color: #0b3d91 !important;
  }

  .no-print,
  .navbar-toggler {
    display: none !important;
  }

  .card-service {
    box-shadow: none !important;
    border: 1px solid #cccccc !important;
  }

  a[href]::after {
    content: none !important;
  }
}
