/* ==========================================================================
   AGD Stitch — responsive safety net
   Applied site-wide on top of the Stitch (Tailwind CDN) markup.
   Targets real mobile bugs without altering the desktop design.
   ========================================================================== */

/* Never allow horizontal scrolling on small screens. */
/* overflow-x: clip prevents horizontal scroll WITHOUT creating a scroll
   container — so the sticky header keeps sticking (overflow-x: hidden breaks it). */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

/* Media should never exceed its container. */
img,
svg,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* CSS grid children default to min-width:auto, which lets long labels
   (e.g. the "PAYROLLS PROCESSED" stats) push columns past the viewport.
   Allow them to shrink so 2-up / multi-column grids stay inside the screen. */
[class*="grid-cols"] > * {
  min-width: 0;
}

/* Phone-width niceties (≤ 480px). The Stitch layout is already mobile-first
   responsive (verified at 375px), so we only soften letter-spacing and let
   genuinely over-long words break — without touching the grid/column layout. */
@media (max-width: 480px) {
  h1,
  h2,
  h3,
  h4 {
    overflow-wrap: break-word;
  }
  .tracking-widest {
    letter-spacing: 0.05em;
  }
}

/* --------------------------------------------------------------------------
   Mobile navigation (hamburger + slide-in drawer)
   The Stitch header hides its nav links below the `md` breakpoint and ships
   no mobile menu. We inject a burger button + drawer (see agd-mobile-nav.js).
   -------------------------------------------------------------------------- */
/* White logo on the dark-green header (no separate asset needed). */
.agd-logo-white {
  filter: brightness(0) invert(1);
}

#agd-burger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  line-height: 0;
  color: #ffffff; /* white on the green header */
}
#agd-burger svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 767px) {
  #agd-burger {
    display: inline-flex;
    align-items: center;
  }
}

#agd-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 80%;
  max-width: 320px;
  background: #00231b;
  color: #fff;
  z-index: 100000;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  font-family: "Inter", system-ui, sans-serif;
}
#agd-mobile-menu.open {
  transform: translateX(0);
}

#agd-mobile-menu .agd-mm-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
#agd-mobile-menu .agd-mm-close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
#agd-mobile-menu a {
  color: #fff;
  padding: 15px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
}
#agd-mobile-menu a:hover {
  color: #9dd1c0;
}

#agd-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99999;
}
#agd-overlay.open {
  display: block;
}

/* Lock background scroll when the drawer is open. */
body.agd-menu-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   FAQ accordion — smooth open/close (height animated via JS-set max-height).
   -------------------------------------------------------------------------- */
.agd-faq-toggle {
  cursor: pointer;
  background: none;
}
.agd-faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.agd-faq-icon {
  transition: transform 0.3s ease;
}
.agd-faq.open .agd-faq-icon {
  transform: rotate(180deg);
}
.agd-faq.open {
  border-color: #366759;
}

/* Clear the sticky header when jumping to an in-page anchor (e.g. #openings). */
:target {
  scroll-margin-top: 110px;
}

/* Green scrollbar (theme primary). */
body::-webkit-scrollbar {
  width: 6px;
}

body::-webkit-scrollbar-track {
  background: #dbdbdb;
}

body::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb:hover {
  background: #00231b;
}

/* WordPress pagination (the_posts_pagination) styled to match the design. */
.pagination {
  margin-top: 3rem;
}
.pagination .nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.6rem;
  border: 1px solid #c0c8c4;
  border-radius: 0.25rem;
  color: #404945;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.pagination .page-numbers:hover {
  background: #00231b;
  color: #fff;
  border-color: #00231b;
}
.pagination .page-numbers.current {
  background: #00231b;
  color: #fff;
  border-color: #00231b;
}
.pagination .page-numbers.dots {
  border-color: transparent;
}
.pagination .page-numbers .material-symbols-outlined {
  font-size: 20px;
}

/* --------------------------------------------------------------------------
   Mobile spacing — tighter vertical rhythm + one consistent horizontal gutter
   so every section aligns with the header & footer (24px left/right).
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Vertical: shrink the big desktop section padding on phones. */
  .py-section-gap {
    padding-top: 3.25rem !important;
    padding-bottom: 3.25rem !important;
  }
  .pt-section-gap {
    padding-top: 3.25rem !important;
  }
  .pb-section-gap {
    padding-bottom: 3.25rem !important;
  }
  .py-24 {
    padding-top: 3.25rem !important;
    padding-bottom: 3.25rem !important;
  }
  .mt-section-gap {
    margin-top: 2.25rem !important;
  }
  .mb-section-gap {
    margin-bottom: 2.25rem !important;
  }
  .mb-16 {
    margin-bottom: 2.25rem !important;
  }
  .mb-20 {
    margin-bottom: 2.5rem !important;
  }

  /* Horizontal: one common 24px gutter, aligned with header/footer (px-gutter). */
  .px-margin-desktop {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  .px-margin-mobile {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* --------------------------------------------------------------------------
   Rich-text content (single Service / Job / Blog post bodies via the editor)
   Tailwind's CDN reset strips default spacing, so restore readable typography.
   -------------------------------------------------------------------------- */
.agd-content > * + * {
  margin-top: 1rem;
}
.agd-content p {
  line-height: 1.75;
}
.agd-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #00231b;
  margin-top: 2rem;
  line-height: 1.25;
}
.agd-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #00231b;
  margin-top: 1.5rem;
}
.agd-content ul {
  list-style: disc;
  padding-left: 1.4rem;
}
.agd-content ol {
  list-style: decimal;
  padding-left: 1.4rem;
}
.agd-content li {
  margin: 0.35rem 0;
}
.agd-content a {
  color: #366759;
  text-decoration: underline;
}
.agd-content blockquote {
  border-left: 4px solid #9dd1c0;
  padding-left: 1rem;
  font-style: italic;
  color: #42655a;
}
.agd-content img {
  border-radius: 0.5rem;
  height: auto;
  max-width: 100%;
}
.agd-content strong {
  color: #1c1b1b;
}

/* ---------------------------------------------------------------------------
   Contact Form 7 styling — match the original hand-coded forms.
   Tokens: surface #fcf9f8, outline #707975, primary #00231b,
   on-primary #fff, primary-container #003b2f, surface-container-low #f6f3f2.
   --------------------------------------------------------------------------- */
.agd-cf7 .wpcf7-form-control-wrap,
.agd-cf7-news .wpcf7-form-control-wrap {
  display: block;
}

/* Light contact form (white card) */
.agd-cf7 input[type="text"],
.agd-cf7 input[type="email"],
.agd-cf7 textarea {
  width: 100%;
  background-color: #fcf9f8;
  border: 1px solid #707975;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition: all 0.2s ease;
}
.agd-cf7 textarea {
  min-height: 8rem;
  resize: none;
}
.agd-cf7 input[type="text"]:focus,
.agd-cf7 input[type="email"]:focus,
.agd-cf7 textarea:focus {
  border-color: #00231b;
  box-shadow: none;
}
.agd-cf7 .wpcf7-submit {
  width: 100%;
  background-color: #00231b;
  color: #ffffff;
  padding: 1rem 3rem;
  border: 0;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease;
}
.agd-cf7 .wpcf7-submit:hover {
  background-color: #003b2f;
}
@media (min-width: 768px) {
  .agd-cf7 .wpcf7-submit {
    width: auto;
  }
}

/* Dark newsletter form (on the gradient/primary panel) */
.agd-cf7-news input[type="email"] {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  outline: none;
  margin-bottom: 1rem;
}
.agd-cf7-news input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.agd-cf7-news input[type="email"]:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}
.agd-cf7-news .wpcf7-submit {
  width: 100%;
  background-color: #ffffff;
  color: #00231b;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.agd-cf7-news .wpcf7-submit:hover {
  background-color: #f6f3f2;
}
.agd-cf7-news .wpcf7-submit:active {
  transform: scale(0.95);
}

/* CF7 response messages + spinner */
.agd-cf7 .wpcf7-response-output,
.agd-cf7-news .wpcf7-response-output {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}
.agd-cf7-news .wpcf7-response-output {
  color: #ffffff;
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
  border-color: #ba1a1a;
}
.agd-cf7 .wpcf7-not-valid-tip {
  color: #ba1a1a;
  font-size: 0.8125rem;
}
.agd-cf7-news .wpcf7-not-valid-tip {
  color: #ffe0e0;
  font-size: 0.8125rem;
}
