/* =====================================================================
   Zero Alpha: child template user.css
   Order matters: light basics > dark mode > components
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --cassiopeia-color-primary: #aeb0b5;
  --cassiopeia-color-link: #000000;
  --cassiopeia-color-hover: #5b616b;
  --content-width: 84rem; /* width of Joomla's text area: adjust if needed */
  --za-green: #457d54;
  --za-green-hi: #4da861;
}

/* ---------- Header and menu (light) ---------- */
/* The purple is technically an image, so colour the background white */
.container-header {
  background-color: white;
  background-image: none;
}

.container-header .mod-menu {
  color: #323a45;
}

.container-header .brand-logo picture {
  display: contents;
}

/* Hamburger menu: white on white is not good */
.container-header .navbar-toggler {
  color: #000000;
  border: 1px solid #000000;
}

/* ---------- Header: mobile (logo left, hamburger right) ---------- */
@media (max-width: 991.98px) {
  .container-header {
    position: relative;
    --hb-top: 1rem;   /* raise or lower the hamburger to line up with the logo */
  }

  .container-header .navbar-brand {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    padding-inline: 1rem 4rem;   /* left edge, then space for the hamburger */
  }

  .container-header .brand-logo img {
    display: block;
    max-width: 100%;
    height: auto;
  }

  /* Let the button position itself against the header, not the nav row */
  .container-header .container-nav,
  .container-header .navbar {
    position: static;
  }

  .container-header .navbar-toggler {
    position: absolute;
    top: var(--hb-top);
    right: 1rem;
    z-index: 2;
    margin: 0;
  }
}

/* ---------- Buttons ---------- */
:root {
  --za-btn-bg: #aeb0b5;
  --za-btn-border: #aeb0b5;
  --za-btn-text: #ffffff;
  --za-btn-bg-hover: #94bfa2;
  --za-btn-border-hover: #4aa564;
}

.btn-primary,
.za-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--za-btn-text);
  text-decoration: none;
  background-color: var(--za-btn-bg);
  border: 1px solid var(--za-btn-border);
  border-radius: 999px;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary.btn-lg {
  padding: 0.85rem 2.1rem;
  font-size: 1.125rem;
  border-radius: 999px;
}

.btn-primary:hover,
.btn-primary:active,
.za-btn:hover,
.za-btn:active {
  color: var(--za-btn-text);
  background-color: var(--za-btn-bg-hover);
  border-color: var(--za-btn-border-hover);
  box-shadow: none;
}

.btn-primary:focus-visible,
.za-btn:focus-visible {
  color: var(--za-btn-text);
  outline: 3px solid var(--za-btn-border-hover);
  outline-offset: 3px;
}

.btn-primary:disabled,
.btn-primary.disabled {
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .za-btn {
    transition: none;
  }
}

/* ---------- Footer layout ---------- */
.footer .grid-child {
  column-gap: 2.5em;
}

/* ---------- Font Awesome ---------- */
.fa,
.far,
.fas {
  font-family: inherit;
}

.fa::before,
.far::before,
.fas::before {
  font-family: "Font Awesome 5 Free";
  margin-right: 5px;
}

/* ---------- Misc ---------- */
.image-title {
  margin-left: 10px;
}

hr {
  margin-top: 20px;
  margin-bottom: 20px;
  border: 10px solid Gainsboro;
  border-radius: 5px;
}

/* ---------- Dark mode (13Oct26) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --cassiopeia-color-primary: var(--za-green);
    --cassiopeia-color-link: #8ab4ff;
    --cassiopeia-color-hover: #b5d0ff;
    --bs-body-bg: #12141a;
    --bs-body-color: #e3e6ea;
    --bs-border-color: #343a40;
  }

  body.site {
    background-color: #12141a;
    color: #e3e6ea;
  }

  .container-header {
    background-color: #1a1d23;
  }

  .container-header .mod-menu {
    color: #e3e6ea;
  }

  .container-header .navbar-toggler {
    color: #e3e6ea;
    border-color: #e3e6ea;
  }

  hr {
    border-color: #3a3f4a;
  }

  /* Footer: green gradient that fades to a darker green */
  .footer,
  .container-footer {
    background-color: #2d5239;
    background-image: linear-gradient(to bottom, var(--za-green) 0%, #2d5239 100%);
    color: #e3e6ea;
  }

  .footer a,
  .container-footer a {
    color: #ffffff;
  }

  .footer a:hover,
  .container-footer a:hover {
    color: #b9e0c4;
  }

  .card,
  .form-control,
  .form-select,
  .list-group-item {
    background-color: #1a1d23;
    color: #e3e6ea;
    border-color: #343a40;
  }
}

/* ---------- Banner: clickable (invisible link stretched over it) ---------- */
.clickable-banner {
  position: relative;
}

.clickable-banner__link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.clickable-banner__link:focus-visible {
  outline: 3px solid var(--za-green-hi);
  outline-offset: -3px;
}

/* Real buttons or links inside the banner stay clickable above the overlay */
.clickable-banner a:not(.clickable-banner__link),
.clickable-banner .btn {
  position: relative;
  z-index: 2;
}

/* ---------- Banner: shrinks from full width to an inset rounded rectangle on scroll ---------- */
@keyframes banner-shrink {
  from {
    clip-path: inset(0 0 0 0 round 0);
  }
  to {
    clip-path: inset(
      0
      max(1rem, calc((100% - var(--content-width)) / 2))
      0
      max(1rem, calc((100% - var(--content-width)) / 2))
      round 28px
    );
  }
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .container-banner .banner-overlay {
      animation: banner-shrink linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 300px;
    }
  }
}

/* ---------- Banner: mobile (up to 767px) ---------- */
@media (max-width: 767px) {
  .container-banner .banner-overlay {
    background-attachment: scroll;
    min-height: 0;
    max-height: 450px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
  }

  /* If the banner is a real <img> instead of a background image */
  .container-banner img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
  }
}

/* ---------- Photo service cards ---------- */
.za-section {
  --za-card: #fff;
  --za-line: rgba(0, 0, 0, .12);
  --za-text: #16201a;
  --za-muted: #4b5563;
}

@media (prefers-color-scheme: dark) {
  .za-section {
    --za-card: #1b211d;
    --za-line: rgba(255, 255, 255, .14);
    --za-text: #eef2ef;
    --za-muted: #b4bdb7;
  }
}

.za-services {
  display: grid;
  gap: 1.5rem;
  margin: 1rem -1rem 2rem;   /* negative sides cancel the padding below, so the cards stay aligned with your text */
  padding: 1rem;             /* breathing room so the glow isn't cut off at the edges */
  list-style: none;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .za-services { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .za-services { grid-template-columns: repeat(3, 1fr); }
}

.za-card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  background: var(--za-card);
  border: 2px solid var(--za-accent, var(--za-line));
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.za-card:hover {
  z-index: 2;
  border-color: var(--za-accent, var(--za-green-hi));
  box-shadow: 0 0 14px 2px color-mix(in srgb, var(--za-accent, var(--za-green-hi)) 45%, transparent);
}

.za-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform .4s;
}

.za-card:hover img {
  transform: scale(1.04);
}

.za-body {
  flex: 1;
  padding: 1.1rem 1.25rem 1.3rem;
}

.za-card h3 {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.za-card h3 a {
  color: var(--za-text);
  text-decoration: none;
}

.za-card:hover h3 a {
  color: var(--za-green);
}

@media (prefers-color-scheme: dark) {
  .za-card:hover h3 a { color: var(--za-green-hi); }
}

/* Whole card is the link */
.za-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.za-card h3 a:focus-visible {
  outline: none;
}

.za-card h3 a:focus-visible::after {
  outline: 3px solid var(--za-green-hi);
  outline-offset: -3px;
  border-radius: 14px;
}

.za-card p {
  margin: 0;
  color: var(--za-muted);
  line-height: 1.55;
}

.za-quote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--za-line);
  border-radius: 14px;
}

.za-quote p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--za-text);
}

@media (prefers-reduced-motion: reduce) {
  .za-card,
  .za-card img { transition: none; }
  .za-card:hover img { transform: none; }
}

/* Why use us: green panel fades in and out as it scrolls through the screen */
.why-strip {
  --why-from: #ffffff;
  --why-to: #c9e2d1;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin: 1.5rem 0 2rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.why-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--why-to);
  border-radius: 28px;
}

.why-item strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.75rem;
  line-height: 1.2;
  color: #2d5239;
}

@media (min-width: 768px) {
  .why-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2.5rem 2rem;
  }
}

@keyframes why-tint {
  0%   { opacity: 0; }
  35%  { opacity: 1; }
  65%  { opacity: 1; }
  100% { opacity: 0; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .why-strip::before {
      animation: why-tint linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
  }
}

@media (prefers-color-scheme: dark) {
  .why-strip {
    --why-from: #12141a;
    --why-to: #264a35;
  }

  .why-item strong {
    color: #6fcf8a;
  }
}

/* FAQ accordion */
.faq {
  --faq-bg: #f4f7f5;
  --faq-bg-open: #e8f1eb;
  --faq-text: #16201a;
  --faq-muted: #3f4a43;
  --faq-accent: #457d54;
  --faq-link: #2d5239;
  max-width: 52rem;
  margin: 1.5rem auto 2rem;
}

.faq-item {
  margin: 0 0 0.75rem;
  background-color: var(--faq-bg);
  border-radius: 14px;
  transition: background-color 0.2s ease;
}

.faq-item[open] {
  background-color: var(--faq-bg-open);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--faq-text);
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

/* Chevron drawn with borders, so no icon font is needed */
.faq-item summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: -0.25rem;
  border-right: 2px solid var(--faq-accent);
  border-bottom: 2px solid var(--faq-accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  margin-top: 0.25rem;
  transform: rotate(-135deg);
}

.faq-item summary:focus-visible {
  outline: 3px solid var(--faq-accent);
  outline-offset: -3px;
  border-radius: 14px;
}

.faq-answer {
  padding: 0 1.25rem 1.1rem;
  color: var(--faq-muted);
  line-height: 1.6;
}

.faq-answer p {
  margin: 0;
}

.faq-answer a {
  color: var(--faq-link);
  text-decoration: underline;
}

/* Smooth open and close (Chrome and Edge; other browsers just snap open) */
@media (prefers-reduced-motion: no-preference) {
  .faq {
    interpolate-size: allow-keywords;
  }

  .faq-item::details-content {
    height: 0;
    overflow: clip;
    transition: height 0.25s ease, content-visibility 0.25s allow-discrete;
  }

  .faq-item[open]::details-content {
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-item summary::after {
    transition: none;
  }
}

@media (prefers-color-scheme: dark) {
  .faq {
    --faq-bg: #1a1d23;
    --faq-bg-open: #22262e;
    --faq-text: #e3e6ea;
    --faq-muted: #b0b7c0;
    --faq-accent: #aab2bd;
    --faq-link: #8ab4ff;
  }
}

/* Client logo marquee */
.logo-marquee {
  --lm-size: 88px;        /* displayed logo size */
  --lm-gap: 2.5rem;       /* space between columns */
  --lm-row-gap: 1rem;     /* space between rows */
  --lm-rows: 1;           /* rows of logos */
  --lm-per-logo: 2.2s;    /* seconds per column: lower = faster */
  --lm-chip: transparent;
  margin: 2rem 0;
}

.logo-marquee__viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.logo-marquee__track {
  display: flex;
  width: max-content;
  animation: logo-scroll calc(var(--lm-count, 12) / var(--lm-rows) * var(--lm-per-logo)) linear infinite;
}

.logo-marquee__group {
  display: grid;
  grid-template-rows: repeat(var(--lm-rows), auto);
  grid-auto-flow: column;
  align-items: center;
  gap: var(--lm-row-gap) var(--lm-gap);
  margin: 0;
  padding: 0 var(--lm-gap) 0 0;
  list-style: none;
}

.logo-marquee__group li {
  padding: 0.5rem 0.9rem;
  background-color: var(--lm-chip);
  border-radius: 10px;
}

.logo-marquee__group img {
  display: block;
  width: var(--lm-size);
  height: var(--lm-size);
  object-fit: contain;
}

.logo-marquee__group img:hover {
  filter: none;
  opacity: 1;
}

/* Pause on hover, tap or keyboard focus */
.logo-marquee:hover .logo-marquee__track,
.logo-marquee:focus-within .logo-marquee__track {
  animation-play-state: paused;
}

@keyframes logo-scroll {
  to { transform: translateX(-50%); }
}

/* Phones: smaller logos, tighter spacing, two rows */
@media (max-width: 767px) {
  .logo-marquee {
    --lm-size: 64px;
    --lm-gap: 1rem;
    --lm-rows: 2;
    --lm-per-logo: 1.6s;
  }

  .logo-marquee__group li {
    padding: 0.3rem 0.5rem;
  }
}

/* No motion: static, wrapping row */
@media (prefers-reduced-motion: reduce) {
  .logo-marquee__viewport {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .logo-marquee__track {
    width: auto;
    animation: none;
    justify-content: center;
  }

  .logo-marquee__group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-right: 0;
  }

  .logo-marquee__group[aria-hidden="true"] {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  .logo-marquee {
    /* Light tiles keep logos with dark text or white backgrounds readable */
    --lm-chip: #eef0f3;
  }
}

/* Footer locations */
.footer-locations {
  font-size: 14px;
}

.footer-loc {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.footer-loc strong {
  display: block;
  margin-bottom: 0.15rem;
}

.footer-loc__addr {
  display: block;
  line-height: 1.45;
}

/* Hover: drawn outside the text, so it never changes the spacing */
@media (hover: hover) {
  .footer-loc:hover {
    background-color: color-mix(in srgb, currentColor 14%, transparent);
    box-shadow: 0 0 0 0.4rem color-mix(in srgb, currentColor 14%, transparent);
  }

  .footer-loc:hover strong {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.footer-loc:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .footer-loc {
    transition: none;
  }
}

/* Phones: more space between the stacked locations */
@media (max-width: 575px) {
  .footer-locations .col-sm {
    margin-bottom: 1.25rem !important;
  }
}

/* Banner typography */
:root {
  --banner-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.banner-title,
.banner-tagline,
.banner-sub {
  font-family: var(--banner-font);
  -webkit-font-smoothing: antialiased;
}

.banner-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2.4rem, 5.5vw + 0.8rem, 4.25rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.005em;
}

.banner-tagline {
  margin: 0 0 0.25rem;
  font-size: clamp(1.2rem, 1.4vw + 0.9rem, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.banner-sub {
  margin: 0 0 1.5rem;
  font-size: clamp(1.1rem, 1.2vw + 0.85rem, 1.4rem);
  font-weight: 400;
  opacity: 0.92;
}