/* ==========================================================================
   halco-guide.css — the gated guide opt-in form
   Loaded only on pages that actually use [halco_guide].

   Holds the same standards as the rest of the site: 44px minimum touch targets,
   14px minimum for anything a person reads or types into, brand sage #5F6D59 for
   text-weight use (5.50:1) rather than the lighter #707F6A (4.19:1).
   ========================================================================== */

.halco-guide {
  --hg-ink:    var(--halco-ink, #15161A);
  --hg-sage:   var(--halco-sage-text, #5F6D59);
  --hg-line:   var(--halco-line, #E3E6E0);
  --hg-canvas: var(--halco-canvas, #FFFFFE);
  margin: 0;
}

.halco-guide__row {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
@media (min-width: 720px) {
  .halco-guide__row { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.halco-guide__field { display: block; }

.halco-guide__field > span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--halco-font-head, Manrope, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--hg-ink);
}

.halco-guide__field input {
  width: 100%;
  min-height: 52px;                 /* comfortably past the 44px floor */
  padding: 12px 16px;
  font-size: 16px;                  /* 16px stops iOS zooming the page on focus */
  font-family: inherit;
  color: var(--hg-ink);
  background: var(--hg-canvas);
  border: 1px solid var(--hg-line);
  border-radius: 12px;
  box-sizing: border-box;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.halco-guide__field input:focus {
  outline: none;
  border-color: var(--hg-sage);
  box-shadow: 0 0 0 3px rgba(95, 109, 89, .16);
}
.halco-guide__field input:focus-visible { outline: 2px solid var(--hg-sage); outline-offset: 2px; }

/* The honeypot. Off-screen rather than display:none — some bots skip hidden
   fields, and screen readers are kept out with aria-hidden on the wrapper. */
.halco-guide__hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* NOTE ON SPECIFICITY
   Elementor's reset.css loads AFTER this stylesheet and carries
     [type="button"], [type="submit"], button { border: 1px solid rgb(204,51,102) }
   — a hot pink debug border at (0,1,0). A bare .halco-guide__submit ties on
   specificity and loses on order, which put a pink ring around both buttons.
   Two classes take these rules to (0,2,0) and settle it without !important. */
.halco-guide .halco-guide__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 30px;
  border: 0;
  border-radius: 320px;             /* the site's pill */
  background: var(--hg-sage);
  color: var(--hg-canvas);
  font-family: var(--halco-font-head, Manrope, system-ui, sans-serif);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.halco-guide .halco-guide__submit:hover  { background: var(--halco-sage-dark, #4A5744); transform: translateY(-1px); }
.halco-guide .halco-guide__submit:disabled { opacity: .6; cursor: default; transform: none; }
@media (max-width: 719px) {
  .halco-guide .halco-guide__submit { width: 100%; }
}

.halco-guide__fineprint {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6A7064;                   /* 4.78:1 on the warm canvas */
  max-width: 46em;
}

.halco-guide__msg {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.5;
}
.halco-guide__msg:empty { margin: 0; }
.halco-guide__msg.is-error { color: #8A1F11; font-weight: 600; }
.halco-guide__msg.is-ok    { color: var(--hg-ink); font-weight: 600; }

.halco-guide__dl {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 22px;
  border-radius: 320px;
  background: var(--hg-ink);
  color: var(--hg-canvas);
  font-weight: 700;
  text-decoration: none;
}
.halco-guide__dl:hover { background: var(--hg-sage); color: var(--hg-canvas); }

/* On a dark band, invert the field chrome so the form stays legible. */
.halco-on-dark .halco-guide__field > span,
.halco-section--dark .halco-guide__field > span { color: var(--hg-canvas); }
.halco-on-dark .halco-guide__fineprint,
.halco-section--dark .halco-guide__fineprint { color: #C7CCC2; }
.halco-on-dark .halco-guide__msg.is-ok,
.halco-section--dark .halco-guide__msg.is-ok { color: var(--hg-canvas); }

@media (prefers-reduced-motion: reduce) {
  .halco-guide .halco-guide__submit, .halco-guide__field input { transition: none; }
  .halco-guide .halco-guide__submit:hover { transform: none; }
}


/* --------------------------------------------------------------------------
   The guide cover is a portrait document page, not a landscape photo.
   The theme caps every Elementor image on mobile with
     @media (max-width:767px) [data-elementor-type] .e-con .elementor-widget-image img
       { max-height: 230px; object-fit: cover }   -- specificity (0,3,1)
   which crops the cover to a strip. Adding the widget's own class takes this to
   (0,4,1) so it wins without !important. Scoped to this one image only; every
   other image keeps the theme's behaviour.
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  [data-elementor-type] .e-con .elementor-widget-image.halco-guide-cover img {
    max-height: none;
    object-fit: contain;
    width: 100%;
    height: auto;
  }
}

/* A document cover reads better with a soft edge and a little lift. */
.halco-guide-cover img {
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(21, 22, 26, .16);
}
@media (min-width: 768px) {
  /* min() so this never overrides the browser default max-width:100%. A bare
     420px made the cover outgrow its 44% column at tablet width and put 106px
     of horizontal scroll on the page. */
  .halco-guide-cover img { max-width: min(420px, 100%); }
}


/* ==========================================================================
   THE OFFER, ON THE INK PLANE
   The first pass put three bare input boxes on a near-white ground that barely
   differed from the page (#FFFDFA on #FAF7F2). It read as a form, not an offer.
   Dark is the premium surface in this palette, the theme already has an ink
   plane (.halco-on-dark), and #96A684 is the sage meant for dark grounds.
   ========================================================================== */

.halco-guide-section {
  color: #E6E9E3;
  overflow-x: clip;   /* clip, not hidden: it does not create a scroll container */
}

/* Body copy and list items, light enough to read without shouting.
   #C7CCC2 on #15161A is 9.6:1. */
.halco-guide-section .elementor-widget-text-editor,
.halco-guide-section .elementor-widget-text-editor p { color: #C7CCC2; }

.halco-guide-section .elementor-widget-heading .elementor-heading-title { letter-spacing: -0.02em; }
.halco-guide-section .halco-t-eyebrow { letter-spacing: .16em; }

/* Belt and braces behind the widget setting: the icon-list rendered ink-on-ink
   here (contrast 1.00). The widget prefix matches how Elementor's own per-page
   rules are written, so this holds even if the widget colour is cleared. */
.halco-guide-section .elementor-widget-icon-list .elementor-icon-list-text,
.halco-guide-section .elementor-icon-list-text { color: #E6E9E3; font-size: 16px; }
.halco-guide-section .elementor-icon-list-item { margin-bottom: 2px; }

/* --- the form becomes a contained panel, not loose fields ----------------- */
.halco-on-dark .halco-guide {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
  backdrop-filter: blur(2px);
}
@media (max-width: 719px) {
  .halco-on-dark .halco-guide { padding: 22px 20px; border-radius: 16px; }
}

.halco-on-dark .halco-guide__field > span {
  color: #C7CCC2;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.halco-on-dark .halco-guide__field input {
  color: #FFFFFE;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .18);
}
.halco-on-dark .halco-guide__field input::placeholder { color: rgba(255, 255, 255, .38); }
.halco-on-dark .halco-guide__field input:focus {
  border-color: #96A684;
  background: rgba(255, 255, 255, .10);
  box-shadow: 0 0 0 3px rgba(150, 166, 132, .22);
}

/* White button on ink — the strongest available contrast, and the same
   treatment .halco-btn--primary already uses on dark bands. */
.halco-on-dark .halco-guide .halco-guide__submit {
  background: #FFFFFE;
  color: var(--halco-ink, #15161A);
}
.halco-on-dark .halco-guide .halco-guide__submit:hover { background: #96A684; color: var(--halco-ink, #15161A); }

.halco-on-dark .halco-guide__fineprint { color: #9AA096; }
.halco-on-dark .halco-guide__msg.is-error { color: #FFB4A6; }
.halco-on-dark .halco-guide__dl { background: #FFFFFE; color: var(--halco-ink, #15161A); }
.halco-on-dark .halco-guide__dl:hover { background: #96A684; }

/* --- the cover, presented rather than just placed ------------------------- */
.halco-guide-section .halco-guide-cover { position: relative; }

/* A soft sage bloom behind the cover so it sits on the plane instead of
   floating on it. Purely decorative, and it never intercepts a tap. */
.halco-guide-section .halco-guide-cover::before {
  content: "";
  position: absolute;
  /* Never extends sideways past the cover: at -10% it pushed 27px of horizontal
     scroll onto the page at 390px. Pseudo-elements do not show up in a
     querySelectorAll sweep, so this is easy to miss — hence the belt and braces
     `overflow-x: clip` on the section below. */
  inset: -12% 0 -6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(150, 166, 132, .20), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.halco-guide-section .halco-guide-cover img {
  position: relative;
  z-index: 1;
  border-radius: 6px;                      /* a printed page has a tight corner */
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 34px 70px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
}
@media (min-width: 768px) {
  .halco-guide-section .halco-guide-cover img { max-width: min(440px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  .halco-on-dark .halco-guide { backdrop-filter: none; }
}


/* ==========================================================================
   THE POPUP
   Same offer, same form, same handler — shown once the reader has committed.
   On a phone it is a bottom sheet: the page stays visible above it, so this is
   not the full-screen interstitial Google treats as a ranking problem.
   ========================================================================== */

html.halco-gp-open { overflow: hidden; }

.halco-gp { position: fixed; inset: 0; z-index: 9998; }
.halco-gp[hidden] { display: none !important; }

.halco-gp__scrim {
  position: absolute; inset: 0;
  background: rgba(10, 11, 13, .62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .22s ease;
}
.halco-gp.is-open .halco-gp__scrim { opacity: 1; }

.halco-gp__panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(940px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 0;
  background: #15161A;
  border-top: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
  transform: translate(-50%, 100%);
  transition: transform .26s cubic-bezier(.22, 1, .36, 1);
}
.halco-gp.is-open .halco-gp__panel { transform: translate(-50%, 0); }

@media (min-width: 860px) {
  /* On a wide screen it becomes a centred dialog with the cover alongside. */
  .halco-gp__panel {
    top: 50%; bottom: auto;
    grid-template-columns: 40% 1fr;
    align-items: center;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    transform: translate(-50%, -46%);
    opacity: 0;
    transition: transform .26s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
  }
  .halco-gp.is-open .halco-gp__panel { transform: translate(-50%, -50%); opacity: 1; }
}

.halco-gp .halco-gp__x {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;            /* a real target, not a 16px glyph */
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  color: #FFFFFE;
  cursor: pointer;
  z-index: 2;
  transition: background .18s ease;
}
.halco-gp .halco-gp__x:hover { background: rgba(255, 255, 255, .2); }
.halco-gp .halco-gp__x:focus-visible { outline: 2px solid #96A684; outline-offset: 2px; }

.halco-gp__media { display: none; }
@media (min-width: 860px) {
  .halco-gp__media {
    display: block;
    align-self: stretch;
    overflow: hidden;
    border-radius: 18px 0 0 18px;
  }
  .halco-gp__media img {
    display: block;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: top center;
  }
}

.halco-gp__body { padding: 30px 26px 26px; }
@media (min-width: 860px) { .halco-gp__body { padding: 44px 44px 40px; } }

.halco-gp__eyebrow {
  margin: 0 0 10px;
  color: #96A684;
  font-family: var(--halco-font-head, Manrope, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.halco-gp__title {
  margin: 0 0 10px;
  color: #FFFFFE;
  font-family: var(--halco-font-head, Manrope, system-ui, sans-serif);
  font-size: clamp(26px, 4.4vw, 36px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.halco-gp__desc {
  margin: 0 0 22px;
  color: #C7CCC2;
  font-size: 15px;
  line-height: 1.6;
}

/* Inside the popup the form already has a surface, so drop the inner panel. */
.halco-gp .halco-guide {
  padding: 0;
  border: 0;
  background: none;
  backdrop-filter: none;
}
.halco-gp .halco-guide__row { gap: 12px; }
@media (min-width: 860px) { .halco-gp .halco-guide__row { grid-template-columns: 1fr 1fr; } }
.halco-gp .halco-guide .halco-guide__submit { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .halco-gp__scrim, .halco-gp__panel { transition: none; }
  .halco-gp__panel { transform: translate(-50%, 0); }
  @media (min-width: 860px) { .halco-gp__panel { transform: translate(-50%, -50%); opacity: 1; } }
}
