/* Service-page hero + quote form.
   Loaded render-blocking in <head> so the hero is already in its final layout on first paint;
   quote-form.js only drops the form card and trust points into space reserved here.
   Selectors match the hero by structure (breadcrumb + h1) so they apply before any JS runs;
   the .ibq-* classes JS adds are a fallback for browsers without :has(). */

/* ---------- Hero ---------- */
.ibq-hero,
main section:has(nav[aria-label="Breadcrumb"] ~ h1) {
  min-height: 0 !important;
  align-items: flex-start !important;
}

/* Photo background (pseudo-element, so React never sees it) */
.ibq-hero::after,
main section:has(nav[aria-label="Breadcrumb"] ~ h1)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 85% 15%, rgba(0, 139, 206, 0.28) 0%, transparent 60%),
    linear-gradient(100deg, #020e16 0%, rgba(2, 14, 22, 0.93) 42%, rgba(2, 26, 43, 0.8) 75%, rgba(2, 14, 22, 0.9) 100%),
    linear-gradient(180deg, rgba(2, 14, 22, 0.55) 0%, transparent 35%, rgba(2, 14, 22, 0.85) 100%),
    url("/assets/img/service-hero.webp") 60% center / cover no-repeat;
}

/* No outline watermark word */
.ibq-hero span[class*="font-black"][class*="tracking-tighter"],
main section:has(nav[aria-label="Breadcrumb"] ~ h1) span[class*="font-black"][class*="tracking-tighter"] {
  display: none !important;
}

/* Hero copy is final from the first frame — no half-run entrance animations */
.ibq-wrap [style*="opacity"],
div:has(> nav[aria-label="Breadcrumb"]):has(> h1) [style*="opacity"] {
  opacity: 1 !important;
  transform: none !important;
}

.ibq-wrap h1 + div,
div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > h1 + div {
  margin-bottom: 1.5rem !important;
}

.ibq-wrap > div:not(.ibq-card) p,
div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > div:not(.ibq-card) p {
  color: rgba(223, 243, 255, 0.82) !important;
  font-size: 1.06rem !important;
}

/* ---------- Trust points + call ---------- */
.ibq-extras {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  font-family: var(--font-body), system-ui, sans-serif;
}

.ibq-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
}

.ibq-checks li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  font-size: 0.93rem;
  font-weight: 500;
}

.ibq-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(44, 199, 228, 0.16);
  color: #2cc7e4;
  flex-shrink: 0;
}

.ibq-tick svg {
  width: 0.8rem;
  height: 0.8rem;
}

.ibq-call {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
}

.ibq-call-icon {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 139, 206, 0.18);
  border: 1px solid rgba(44, 199, 228, 0.35);
  color: #2cc7e4;
}

.ibq-call small {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(223, 243, 255, 0.6);
  line-height: 1.3;
}

.ibq-call strong {
  display: block;
  font-family: var(--font-heading), system-ui, sans-serif;
  font-size: 1.1rem;
  line-height: 1.3;
}

.ibq-call:hover strong {
  color: #2cc7e4;
}

/* ---------- Quote card ---------- */
/* The card box itself never animates: on desktop it lands exactly on top of the placeholder below,
   so only its contents softly fade in. */
@keyframes ibq-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ibq-card > *,
.ibq-extras {
  animation: ibq-fade 0.3s ease both;
}

.ibq-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 2.75rem auto 0;
  background: #fff;
  color: #0b2433;
  border-radius: 14px;
  padding: 1.9rem 1.75rem 1.5rem;
  box-shadow: 0 30px 70px rgba(2, 14, 22, 0.45);
  text-align: left;
  font-family: var(--font-body), system-ui, sans-serif;
}

.ibq-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #008bce, #2cc7e4);
}

/* Beats ink-bridge.css "dark section headings are white" rule */
.ibq-card .ibq-title {
  font-family: var(--font-heading), system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #020e16 !important;
  margin: 0 0 0.3rem;
}

.ibq-sub {
  margin: 0 0 1.2rem;
  font-size: 0.88rem;
  color: #4a6272;
  line-height: 1.5;
}

.ibq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.ibq-full {
  grid-column: 1 / -1;
}

.ibq-field label,
.ibq-legend {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #06304b;
  margin: 0 0 0.3rem;
}

.ibq-field input,
.ibq-field select {
  width: 100%;
  border: 1.5px solid #d5e3ec;
  background: #fbfdff;
  border-radius: 7px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  color: #0b2433;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.ibq-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23084c72' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.ibq-field select:invalid,
.ibq-field input::placeholder {
  color: #8ea3b1;
}

.ibq-field input:focus,
.ibq-field select:focus {
  border-color: #008bce;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 139, 206, 0.12);
}

.ibq-invalid input,
.ibq-invalid select {
  border-color: #d64545 !important;
  box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.1) !important;
}

.ibq-services {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.ibq-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.ibq-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid #d5e3ec;
  border-radius: 7px;
  font-size: 0.84rem;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.ibq-chip:hover {
  border-color: #8fc6e3;
}

.ibq-chip input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: #008bce;
}

.ibq-chip:has(input:checked) {
  border-color: #008bce;
  background: #eef8fe;
  color: #025c8a;
  font-weight: 500;
}

.ibq-consent {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.7rem;
  line-height: 1.5;
  color: #4a6272;
  cursor: pointer;
}

.ibq-consent input {
  margin: 0.15rem 0 0;
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  accent-color: #008bce;
}

.ibq-consent a {
  color: #025c8a;
  text-decoration: underline;
}

.ibq-consent.ibq-invalid {
  color: #b83232;
}

.ibq-btn {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: #008bce;
  color: #fff;
  font-family: var(--font-heading), system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.95rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 139, 206, 0.3);
  transition:
    background 0.2s,
    transform 0.2s;
}

.ibq-btn:hover {
  background: #0a9be0;
  transform: translateY(-1px);
}

.ibq-btn[disabled] {
  opacity: 0.7;
  cursor: progress;
  transform: none;
}

.ibq-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ibq-error {
  grid-column: 1 / -1;
  display: none;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 7px;
  background: #fdeeee;
  color: #a12a2a;
  font-size: 0.8rem;
}

.ibq-error.is-visible {
  display: block;
}

.ibq-error a {
  font-weight: 600;
  text-decoration: underline;
}

.ibq-note {
  margin: 0.8rem 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: #4a6272;
}

.ibq-note a {
  color: #025c8a;
  font-weight: 600;
}

.ibq-done {
  text-align: center;
  padding: 1.5rem 0.5rem 1rem;
}

.ibq-done-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #008bce;
  color: #fff;
  box-shadow: 0 0 0 8px rgba(0, 139, 206, 0.12);
}

.ibq-done .ibq-title {
  margin-bottom: 0.5rem;
}

.ibq-done p {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  color: #4a6272;
}

.ibq-done a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.3rem;
  border-radius: 7px;
  background: #020e16;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .ibq-card {
    padding: 1.6rem 1.2rem 1.3rem;
  }

  .ibq-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ibq-card > *,
  .ibq-extras {
    animation: none;
  }
}

/* ---------- Desktop split: copy left, form right ---------- */
@media (min-width: 1024px) {
  .ibq-hero,
  main section:has(nav[aria-label="Breadcrumb"] ~ h1) {
    align-items: center !important;
    padding-top: 9.5rem !important;
    padding-bottom: 5.5rem !important;
    /* matches the finished hero so nothing moves when the card lands */
    min-height: 62rem !important;
  }

  /* Rows: spacer, 5 hero children, reserved trust-points row, spacer. Column 2 is held empty for the card. */
  .ibq-wrap,
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
    grid-template-rows: 1fr repeat(5, auto) minmax(11.75rem, auto) 1fr;
    column-gap: 4rem;
    align-items: center !important;
    justify-items: start;
    text-align: left !important;
  }

  .ibq-wrap > *,
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > * {
    grid-column: 1;
  }

  .ibq-wrap > :nth-child(1) { grid-row: 2; }
  .ibq-wrap > :nth-child(2) { grid-row: 3; }
  .ibq-wrap > :nth-child(3) { grid-row: 4; }
  .ibq-wrap > :nth-child(4) { grid-row: 5; }
  .ibq-wrap > :nth-child(5) { grid-row: 6; }
  .ibq-wrap > :nth-child(6) { grid-row: 7; }
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > :nth-child(1) { grid-row: 2; }
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > :nth-child(2) { grid-row: 3; }
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > :nth-child(3) { grid-row: 4; }
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > :nth-child(4) { grid-row: 5; }
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > :nth-child(5) { grid-row: 6; }
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > :nth-child(6) { grid-row: 7; }

  .ibq-wrap > .ibq-extras {
    align-self: start;
    align-items: flex-start;
  }

  .ibq-wrap ol,
  .ibq-wrap h1,
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) ol,
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > h1 {
    justify-content: flex-start !important;
  }

  .ibq-wrap h1,
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1) > h1 {
    font-size: clamp(2.4rem, 3.7vw, 3.6rem) !important;
  }

  .ibq-wrap > .ibq-card {
    grid-column: 2 !important;
    grid-row: 1 / -1 !important;
    margin: 0;
    max-width: none;
    align-self: center;
    min-height: 47rem;
  }

  /* Placeholder card painted from the first frame, same box as the real card, so the form fills in
     place instead of popping in. Hidden the moment the real card is in the DOM. */
  .ibq-wrap::after,
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1)::after {
    content: "Start Your Publishing Journey";
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    justify-self: stretch;
    box-sizing: border-box;
    height: 47rem;
    padding: 1.9rem 1.75rem;
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(2, 14, 22, 0.45);
    font-family: var(--font-heading), system-ui, sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #020e16;
    background:
      linear-gradient(90deg, #008bce, #2cc7e4) top / 100% 4px no-repeat,
      linear-gradient(#eef3f7, #eef3f7) 1.75rem 4.6rem / 70% 0.7rem no-repeat,
      linear-gradient(#eef3f7, #eef3f7) 1.75rem 8.1rem / calc(50% - 2.15rem) 2.9rem no-repeat,
      linear-gradient(#eef3f7, #eef3f7) right 1.75rem top 8.1rem / calc(50% - 2.15rem) 2.9rem no-repeat,
      linear-gradient(#eef3f7, #eef3f7) 1.75rem 13rem / calc(100% - 3.5rem) 11rem no-repeat,
      linear-gradient(#eef3f7, #eef3f7) 1.75rem 26.5rem / calc(50% - 2.15rem) 2.9rem no-repeat,
      linear-gradient(#eef3f7, #eef3f7) right 1.75rem top 26.5rem / calc(50% - 2.15rem) 2.9rem no-repeat,
      linear-gradient(#eef3f7, #eef3f7) 1.75rem 31.6rem / calc(100% - 3.5rem) 2.9rem no-repeat,
      linear-gradient(#cfe8f6, #cfe8f6) 1.75rem 38.3rem / calc(100% - 3.5rem) 3.3rem no-repeat,
      #fff;
  }

  .ibq-wrap:has(> .ibq-card)::after,
  div:has(> nav[aria-label="Breadcrumb"]):has(> h1):has(> .ibq-card)::after {
    content: none;
  }
}
