:root {
  --font-body: 'Inter', system-ui, sans-serif;
  --font-heading: 'Raleway', sans-serif;
  --color-navy: #243868;
  --color-sky: #4da0d5;
  --color-teal: #2aa9bf;
  --color-card-bg: #ffffff;
  --color-border: #d0e4f0;
  --color-text: #1a1a1a;
  --color-white: #ffffff;
}

body.theme-2 {
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

body.theme-3 {
  --font-body: 'Lato', system-ui, sans-serif;
  --font-heading: 'Montserrat', sans-serif;
}

/* Global base styles */
html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  min-height: 100%;
}

body {
  background-color: #f0f6fb;
  background-image: radial-gradient(#b8d0e4 1px, transparent 1px);
  background-size: 22px 22px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Background slideshow */
.bg-slides {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: bgCycle 45s ease-in-out infinite;
  will-change: opacity;
}

.bg-slide--1 { background-image: url('/img/background1.jpg'); animation-delay: 0s; }
.bg-slide--2 { background-image: url('/img/background2.jpg'); animation-delay: -30s; }
.bg-slide--3 { background-image: url('/img/background3.jpg'); animation-delay: -15s; }

@keyframes bgCycle {
  0%     { opacity: 1; }
  28%    { opacity: 1; }
  33.3%  { opacity: 0; }
  95%    { opacity: 0; }
  100%   { opacity: 1; }
}

/* Make the header image responsive */
.site-header-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Mobile-first nav styles */
.site-nav {
  background-color: var(--color-navy);
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
}

.site-nav__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  background-color: var(--color-white);
  border-radius: 16px;
  padding: 0.3rem 0.55rem;
}

.site-nav__brand img {
  display: block;
  height: 58px;
  width: auto;
}

.site-nav__toggle {
  display: inline-block;
  background: var(--color-white);
  color: var(--color-navy);
  border: 1px solid var(--color-white);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
}

.site-nav__list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.25rem 0;
  display: none; /* shown via JS toggle on mobile */
  text-align: left;
}

.site-nav__list.is-open {
  display: block;
}

.site-nav__list li {
  margin: 0.25rem 0;
}

.site-nav__list a {
  display: inline-block;
  text-decoration: none;
  color: var(--color-white);
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible {
  background-color: var(--color-white);
  color: var(--color-navy);
  outline: none;
}

/* Main content layout */
.site-main {
  padding: 1rem;
  flex: 1;
}

.site-main h1,
.site-main h2,
.site-main h3,
.site-main h4,
.site-main h5,
.site-main h6 {
  color: #000000;
  font-weight: 700;
  margin: 0 0 0.4rem;
  padding-left: 0.45rem;
}

.site-main h1 {
  color: var(--color-sky);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  line-height: 0.95;
  margin-bottom: 0.55rem;
}

.site-main h3 {
  color: var(--color-navy);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(1.2rem, 2vw, 1.85rem);
  margin-top: 1.5rem;
  margin-bottom: 0.35rem;
}

/* Reset h3 top margin inside cards — the card padding provides enough space */
.site-main section h3,
.site-main article h3 {
  margin-top: 0;
}

.site-main section {
  background-color: var(--color-card-bg);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.2rem;
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(36, 56, 104, 0.14);
}

.site-main p {
  color: var(--color-text);
  margin: 0 0 0.9rem;
  line-height: 1.6;
}

/* General content links */
.site-main a {
  color: var(--color-sky);
  text-decoration: underline;
}

.site-main a:hover {
  color: var(--color-navy);
}

.site-main .btn {
  color: var(--color-white);
  text-decoration: none;
}

.site-main .btn:hover {
  color: var(--color-navy);
}

/* Tables */
.site-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.95rem;
  background-color: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(36, 56, 104, 0.10);
}

.site-main th {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-weight: 600;
}

.site-main td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.site-main tr:last-child td {
  border-bottom: none;
}

.site-main tr:nth-child(even) td {
  background-color: #f5f8fc;
}

.hours-closed {
  opacity: 0.35;
}

/* Contact list */
.contact-list {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  background-color: var(--color-card-bg);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(36, 56, 104, 0.10);
  overflow: hidden;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.contact-list li svg {
  flex-shrink: 0;
  color: var(--color-sky);
}

.contact-list li:last-child {
  border-bottom: none;
}

/* Responsive map embed */
.map-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 0 0 0.9rem;
}

.map-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Booking CTA section on contact page */
.site-main .booking-cta {
  background-color: var(--color-navy);
  color: var(--color-white);
  text-align: center;
  padding: 2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(36, 56, 104, 0.25);
}

.site-main .booking-cta h2 {
  color: var(--color-white);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.site-main .booking-cta p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

.map-embed--compact {
  padding-bottom: 0;
  height: 220px;
}

.services-note {
  text-align: center;
}

/* Team cards */
.team-card {
  position: relative;
  overflow: hidden;
}

.team-card p {
  margin-right: 0;
}

.team-profile-image {
  float: right;
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 14px;
  border: 4px solid var(--color-white);
  margin: 0 0 0.5rem 0.75rem;
}

/* Footer */
.site-footer {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 2rem;
}

.footer-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.footer-section h2 {
  color: var(--color-sky);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem;
  padding: 0;
}

.footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-section ul li {
  margin: 0.4rem 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.footer-section a {
  color: var(--color-sky);
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-section p {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.footer-location .map-embed {
  margin-top: 0.75rem;
  padding-bottom: 60%;
}

/* Open hours: aligned columns + faded closed days */
.footer-hours li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-hours-closed {
  opacity: 0.35;
}

/* Contact: icon + link rows */
.footer-contact li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-contact li svg {
  flex-shrink: 0;
  color: var(--color-sky);
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.85);
}

.footer-contact a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.footer-copy {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 960px;
}

/* Home hero */
.site-main .home-hero {
  background-color: var(--color-navy);
  color: var(--color-white);
  text-align: center;
  padding: 2.5rem 1.5rem;
  box-shadow: 0 2px 12px rgba(36, 56, 104, 0.25);
}

.site-main .home-hero h1 {
  color: var(--color-white);
  margin-bottom: 0.75rem;
}

.home-hero__tagline {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 560px;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}

/* CTA button */
.btn {
  display: inline-block;
  background-color: var(--color-sky);
  color: var(--color-white);
  text-decoration: none;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0 1rem;
}

.service-card {
  background-color: var(--color-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(36, 56, 104, 0.12);
}

.service-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a2d56 0%, var(--color-sky) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.25);
}

.service-card__body {
  padding: 1rem 1.1rem 1.2rem;
}

.service-card__body h3 {
  margin-bottom: 0.5rem;
}

/* Building photo above map */
.home-location {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.building-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(36, 56, 104, 0.14);
  display: block;
}

/* Home two-column body */
.home-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Desktop breakpoint */
@media (min-width: 768px) {
  /* Switch nav back to a single row */
  .site-nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .site-nav__top {
    flex: 0 0 auto;
  }

  /* Hide the mobile toggle button */
  .site-nav__toggle {
    display: none;
  }

  /* Always show nav list horizontally */
  .site-nav__list {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
    text-align: left;
  }

  .site-nav__list li {
    margin: 0;
  }

  .site-nav__brand img {
    height: 70px;
  }

  .site-main {
    max-width: 960px;
    margin: 1.5rem auto;
    padding: 0 1rem;
  }

  .home-body {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Last card spans both columns when total count is odd */
  .services-grid article:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.75rem);
  }

  /* Restore absolute positioning for team images on desktop */
  .team-profile-image {
    float: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 12.5rem;
    height: 12.5rem;
    margin: 0;
  }

  .team-card--with-image p {
    padding-right: 14rem;
    min-height: 10rem;
  }

  .footer-sections {
    grid-template-columns: 1fr 1.5fr 1fr;
  }
}
