/*
 * ABM Diagnostics — WordPress additions.
 *
 * Loads after styles.css, so a same-specificity rule here beats the design's,
 * including rules inside the design's media queries (media queries add no
 * specificity). Every rule below that overrides a responsive design rule
 * restates the responsive versions here too, in cascade order.
 */

/* -------------------------------------------------------------------------
 * Layout fixes
 * ---------------------------------------------------------------------- */

/*
 * The design sets `main { overflow: hidden }`, which makes <main> a scroll
 * container — so the sticky "Why choose ABM?" heading could never stick.
 * `clip` hides horizontal overflow without creating a scroll container.
 * (Browsers without `clip` ignore the declaration and show overflow.)
 */
main {
  overflow: visible;
  overflow-x: clip;
}

/*
 * The prototype put the header inside <main> with `min-height: 100vh`.
 * In WordPress the header sits outside it, so 100vh on <main> would push the
 * footer below the fold on short pages. A flex column keeps the footer at the
 * bottom of the viewport instead.
 */
body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  min-height: 0;
}

/* Header logo width comes from Site Settings via --logo-width. */
.brand {
  width: var(--logo-width, 292px);
}

/* Footer address: the design's flex column, moved onto <address> because a
   heading may not sit inside <address>. */
.contact-details address {
  display: flex;
  flex-direction: column;
  font-style: normal;
}

/*
 * Icons are Font Awesome <i> elements; the design's sizes were set on SVGs and
 * PNGs via width/height, so restate them as font sizes here.
 */
.whatsapp-icon,
.tiktok-icon,
.facebook-icon,
.button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  line-height: 1;
}

.whatsapp-icon {
  font-size: 30px;
}

.tiktok-icon {
  font-size: 23px;
}

.facebook-icon {
  width: 22px;
  height: 22px;
  font-size: 17px;
}

.button__icon {
  width: 34px;
  height: 34px;
  font-size: 30px;
}

.button--outline .button__icon {
  color: var(--acid);
}

/* Service card icon: acid green, top-left — replaces the design's PNG icons. */
.service-icon {
  position: absolute;
  top: 24px;
  left: 25px;
  color: var(--acid);
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 2px 10px #00000099);
}

/* Overlays now share the card with a positioned placeholder. */
.service-overlay {
  z-index: 0;
}

.service-content {
  z-index: 1;
}

/* CTA banners can carry more than one button. */
.cta-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 1050px) {
  .brand {
    width: min(var(--logo-width, 292px), 220px);
  }
}

@media (max-width: 720px) {
  .brand {
    width: min(var(--logo-width, 292px), 205px);
  }

  .button--header .whatsapp-icon {
    font-size: 25px;
  }

  .button__icon {
    width: 28px;
    height: 28px;
    font-size: 26px;
  }

  /*
   * Mobile column menu.
   * Full width: the design's 1050px rule sets `justify-self: center`, which
   * still applies here. On an absolutely-positioned grid child that shrinks
   * the box to fit its content despite left/right: 0 — `stretch` restores
   * the full header width.
   * nowrap: never let the column wrap into extra columns.
   */
  .main-nav {
    justify-self: stretch;
    width: auto;
    flex-wrap: nowrap;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
  }

  /* The design caps the open sub-menu at 120px (two links). Allow more. */
  .nav-dropdown--open .services-dropdown {
    max-height: 480px;
  }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .brand {
    width: min(var(--logo-width, 292px), 165px);
  }
}

/* -------------------------------------------------------------------------
 * Accessibility
 * ---------------------------------------------------------------------- */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 18px;
  clip: auto;
  clip-path: none;
  color: #06090a;
  background: var(--acid);
  border-radius: 8px;
}

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

/* -------------------------------------------------------------------------
 * Section settings (ACF "Section settings" group)
 * ---------------------------------------------------------------------- */

.abm-section {
  scroll-margin-top: 16px;
}

.abm-bg--base {
  background: #080d10;
}

.abm-bg--deep {
  background: #070c0f;
}

.abm-bg--mid {
  background: #0a1013;
}

.abm-bg--raised {
  background: #10171a;
}

.abm-pt--none {
  padding-top: 0;
}

.abm-pt--small {
  padding-top: clamp(20px, 3vw, 32px);
}

.abm-pt--medium {
  padding-top: clamp(40px, 6vw, 72px);
}

.abm-pt--large {
  padding-top: clamp(56px, 9vw, 112px);
}

.abm-pb--none {
  padding-bottom: 0;
}

.abm-pb--small {
  padding-bottom: clamp(20px, 3vw, 32px);
}

.abm-pb--medium {
  padding-bottom: clamp(40px, 6vw, 72px);
}

.abm-pb--large {
  padding-bottom: clamp(56px, 9vw, 112px);
}

/* Narrow: keep the design's gutters, cap the content at 1200px. */
.abm-width--narrow {
  padding-left: max(clamp(20px, 5.2vw, 84px), calc((100% - 1200px) / 2));
  padding-right: max(clamp(20px, 5.2vw, 84px), calc((100% - 1200px) / 2));
}

/* -------------------------------------------------------------------------
 * Editor helpers (only rendered for logged-in editors)
 * ---------------------------------------------------------------------- */

.abm-editor-notice {
  margin: 16px clamp(20px, 5.2vw, 84px);
  padding: 14px 18px;
  color: #06090a;
  font-size: 16px;
  line-height: 1.4;
  background: #ffd75e;
  border-radius: 8px;
}

.enquiry-panel .abm-editor-notice {
  margin: 0;
}

/* Missing-image placeholder: a tinted box, labelled for editors only. */
.abm-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f8b90;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: repeating-linear-gradient(135deg, #0d1417 0 12px, #10181b 12px 24px);
}

/* -------------------------------------------------------------------------
 * Rich text (Text block section, posts, fallback page content)
 * ---------------------------------------------------------------------- */

.rich-text-section {
  background: #0a1013;
}

.rich-text-section .detail-copy {
  margin-bottom: 8px;
}

.entry-content {
  max-width: 780px;
  color: #b8c0c3;
  font-size: 19px;
  line-height: 1.55;
}

.entry-content > * + * {
  margin-top: 18px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 40px;
  color: #f4f5f5;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.entry-content h2 {
  font-size: clamp(34px, 3vw, 44px);
}

.entry-content h3 {
  font-size: 30px;
}

.entry-content h4 {
  font-size: 24px;
}

.entry-content a {
  color: var(--acid);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content a:hover {
  color: #06090a;
  background: #abcb00;
  text-decoration: none;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.3em;
}

.entry-content ul {
  list-style: square;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li + li {
  margin-top: 6px;
}

.entry-content li::marker {
  color: var(--acid);
}

.entry-content strong {
  color: #f4f5f5;
}

.entry-content blockquote {
  padding-left: 20px;
  color: #f4f5f5;
  border-left: 3px solid var(--acid);
}

.entry-content img {
  border-radius: 10px;
}

.entry-content figcaption,
.wp-caption-text {
  margin-top: 8px;
  color: #899397;
  font-size: 15px;
}

.entry-content table {
  width: 100%;
}

.entry-content th,
.entry-content td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #3b464a;
}

.alignleft {
  float: left;
  margin: 0 24px 16px 0;
}

.alignright {
  float: right;
  margin: 0 0 16px 24px;
}

.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.entry-thumbnail {
  max-width: 980px;
  margin-bottom: 40px;
}

.entry-thumbnail img {
  border-radius: 13px;
}

.post-navigation {
  max-width: 780px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid #3b464a;
}

.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.post-navigation a {
  color: #f4f5f5;
  font-size: 19px;
}

.post-navigation a:hover {
  color: var(--acid);
}

/* -------------------------------------------------------------------------
 * Archives
 * ---------------------------------------------------------------------- */

.post-list-section {
  background: #0a1013;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #3b464a;
  border-left: 1px solid #3b464a;
}

.post-card {
  background: #080e11;
  border-right: 1px solid #3b464a;
  border-bottom: 1px solid #3b464a;
  transition: background 0.18s;
}

.post-card:hover {
  background: #abcb0014;
}

.post-card__link {
  display: block;
  height: 100%;
  padding: 30px;
}

/* Thumbnails vary — crop to a consistent 16:10 card image. */
.post-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 22px;
  object-fit: cover;
  border-radius: 8px;
}

.post-card h2 {
  margin: 0 0 12px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.post-card p {
  color: #aeb7ba;
  font-size: 17px;
  line-height: 1.5;
}

.abm-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.abm-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  padding: 0 14px;
  color: #c7ced0;
  text-transform: uppercase;
  border: 1px solid #3b464a;
  border-radius: 8px;
}

.abm-pagination .page-numbers.current,
.abm-pagination a.page-numbers:hover {
  color: #06090a;
  background: #abcb00;
  border-color: #abcb00;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 520px;
}

.search-form .search-field {
  flex: 1;
  height: 54px;
  padding: 0 15px;
  color: #f4f5f5;
  background: #0c1316;
  border: 1px solid #465156;
  border-radius: 7px;
}

.search-form .search-submit {
  padding: 0 22px;
  color: #06090a;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--acid);
  border-radius: 7px;
  cursor: pointer;
}

@media (max-width: 1050px) {
  .post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .post-list {
    grid-template-columns: 1fr;
  }

  .post-card__link {
    padding: 25px 20px;
  }

  .alignleft,
  .alignright {
    float: none;
    margin: 0 0 16px;
  }
}

/* -------------------------------------------------------------------------
 * Gravity Forms — matched to the design's enquiry form
 * ---------------------------------------------------------------------- */

.enquiry-intro {
  margin: -6px 0 22px;
  color: #b8c0c3;
  font-size: 18px;
  line-height: 1.5;
}

/*
 * Gravity Forms (2.7+ "Orbital" theme) prints its CSS-API variables in an
 * inline <style> scoped to #gform_wrapper_{id}. An ID selector cannot be
 * out-specified from here, so these overrides need !important.
 */
.enquiry-panel .gform_wrapper.gform-theme {
  --gf-color-primary: #d7ff00 !important;
  --gf-color-primary-rgb: 215, 255, 0 !important;
  --gf-color-primary-contrast: #06090a !important;
  --gf-color-primary-darker: #abcb00 !important;
  --gf-color-in-ctrl: #0c1316 !important;
  --gf-color-in-ctrl-contrast: #f4f5f5 !important;
  --gf-color-in-ctrl-dark: #465156 !important;
  --gf-color-in-ctrl-darker: #465156 !important;
  --gf-color-out-ctrl-dark: #cbd1d3 !important;
  --gf-color-out-ctrl-light: #3b464a !important;
  --gf-ctrl-bg-color: #0c1316 !important;
  --gf-ctrl-bg-color-hover: #0c1316 !important;
  --gf-ctrl-bg-color-focus: #0c1316 !important;
  --gf-ctrl-border-color: #465156 !important;
  --gf-ctrl-border-color-hover: #5a666b !important;
  --gf-ctrl-border-color-focus: #d7ff00 !important;
  --gf-ctrl-color: #f4f5f5 !important;
  --gf-ctrl-radius: 7px !important;
  --gf-ctrl-size: 54px !important;
  --gf-ctrl-font-family: Rajdhani, sans-serif !important;
  --gf-ctrl-font-size: 18px !important;
  --gf-ctrl-label-color-primary: #cbd1d3 !important;
  --gf-ctrl-label-color-secondary: #919ca0 !important;
  --gf-ctrl-label-font-family-primary: Rajdhani, sans-serif !important;
  --gf-ctrl-label-font-size-primary: 16px !important;
  --gf-ctrl-label-font-weight-primary: 500 !important;
  --gf-ctrl-desc-color: #919ca0 !important;
  --gf-ctrl-shadow: none !important;
  --gf-ctrl-outline-color-focus: #d7ff001a !important;
  --gf-form-gap-y: 22px !important;
  --gf-form-gap-x: 22px !important;

  /* Submit button — the design's .button.button--primary. */
  --gf-ctrl-btn-bg-color-primary: #d7ff00 !important;
  --gf-ctrl-btn-bg-color-hover-primary: #abcb00 !important;
  --gf-ctrl-btn-bg-color-focus-primary: #abcb00 !important;
  --gf-ctrl-btn-color-primary: #06090a !important;
  --gf-ctrl-btn-color-hover-primary: #06090a !important;
  --gf-ctrl-btn-color-focus-primary: #06090a !important;
  --gf-ctrl-btn-border-color-primary: transparent !important;
  --gf-ctrl-btn-border-width-primary: 2px !important;
  --gf-ctrl-btn-radius: 13px !important;
  --gf-ctrl-btn-font-family: "Barlow Condensed", sans-serif !important;
  --gf-ctrl-btn-font-size: 23px !important;
  --gf-ctrl-btn-font-weight: 600 !important;
  --gf-ctrl-btn-letter-spacing: 1.4px !important;
  --gf-ctrl-btn-line-height: 1 !important;
  --gf-ctrl-btn-text-transform: uppercase !important;
  --gf-ctrl-btn-padding-x: 38px !important;
  --gf-ctrl-btn-size: 64px !important;
  --gf-ctrl-btn-shadow: none !important;
}

/* Everything below is ordinary specificity — works for Orbital and legacy themes. */
.enquiry-panel .gform_wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.enquiry-panel .gform_wrapper select,
.enquiry-panel .gform_wrapper textarea {
  width: 100%;
  color: #f4f5f5;
  font: inherit;
  font-size: 18px;
  background: #0c1316;
  border: 1px solid #465156;
  border-radius: 7px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.enquiry-panel .gform_wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.enquiry-panel .gform_wrapper select {
  height: 54px;
  padding: 0 15px;
}

.enquiry-panel .gform_wrapper textarea {
  min-height: 150px;
  padding: 15px;
}

.enquiry-panel .gform_wrapper input:focus,
.enquiry-panel .gform_wrapper select:focus,
.enquiry-panel .gform_wrapper textarea:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px #d7ff001a;
}

.enquiry-panel .gform_wrapper .gfield_label,
.enquiry-panel .gform_wrapper .gform-field-label {
  color: #cbd1d3;
  font-size: 16px;
  font-weight: 500;
}

.enquiry-panel .gform_wrapper .gfield_required {
  color: var(--acid);
}

.enquiry-panel .gform_wrapper .ginput_container_consent,
.enquiry-panel .gform_wrapper .gfield_consent_label {
  color: #919ca0;
  line-height: 1.4;
}

.enquiry-panel .gform_wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--acid);
}

.enquiry-panel .gform_wrapper .gform_footer,
.enquiry-panel .gform_wrapper .gform_page_footer {
  margin-top: 6px;
  padding: 0;
}

/*
 * Submit button: the design's .button.button--primary.
 *
 * Gravity Forms' Orbital theme styles its button with long chains of classes,
 * which outrank a plain class selector here — that is why the button came out
 * small. Anchoring on the theme's own <main id="main"> adds one ID, which
 * beats any number of classes without resorting to !important.
 * Covers <input type="submit"> (Gravity Forms' default) and <button>.
 */
#main .enquiry-panel .gform_wrapper .gform_footer input[type="submit"],
#main .enquiry-panel .gform_wrapper .gform_footer button[type="submit"],
#main .enquiry-panel .gform_wrapper .gform_page_footer input[type="submit"],
#main .enquiry-panel .gform_wrapper .gform_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 258px;
  height: auto;
  min-height: 64px;
  margin: 15px 0 0 0;
  padding: 0 38px;
  color: #06090a;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 23px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  background: var(--acid);
  border: 2px solid transparent;
  border-radius: 13px;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.18s, filter 0.18s, background-color 0.18s;
}

#main .enquiry-panel .gform_wrapper .gform_footer input[type="submit"]:hover,
#main .enquiry-panel .gform_wrapper .gform_footer button[type="submit"]:hover,
#main .enquiry-panel .gform_wrapper .gform_page_footer input[type="submit"]:hover,
#main .enquiry-panel .gform_wrapper .gform_button:hover {
  color: #06090a;
  filter: brightness(1.08);
  background: #abcb00;
  border-color: #abcb00;
  transform: translateY(-2px);
}

.enquiry-panel .gform_wrapper .validation_message,
.enquiry-panel .gform_wrapper .gfield_validation_message {
  color: #ff8a7a;
  background: transparent;
  border: 0;
  padding: 4px 0 0;
}

.enquiry-panel .gform_wrapper .gform_validation_errors {
  background: #2a1414;
  border-color: #ff8a7a;
  border-radius: 8px;
}

.enquiry-panel .gform_wrapper .gform_validation_errors h2 {
  color: #ffd5cf;
  font-size: 17px;
}

.enquiry-panel .gform_confirmation_message {
  padding: 13px 16px;
  color: #dbe0e1;
  background: #d7ff0014;
  border-left: 3px solid var(--acid);
}

@media (max-width: 720px) {
  #main .enquiry-panel .gform_wrapper .gform_footer input[type="submit"],
  #main .enquiry-panel .gform_wrapper .gform_footer button[type="submit"],
  #main .enquiry-panel .gform_wrapper .gform_page_footer input[type="submit"],
  #main .enquiry-panel .gform_wrapper .gform_button {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    font-size: 21px;
  }
}
