/*
 * Standalone route refinements for saved WordPress blocks.
 * The shared shell and editorial hero live in style.css. These rules only
 * change emphasis and arrangement where the corresponding React route differs.
 */

/* Home: a larger, softer opening followed by a deliberate editorial cadence. */
body.rm-route-home .rm-page-content > article:has(> .rm-hero-art) {
  padding-top: clamp(6rem, 10vw, 11rem);
}
body.rm-route-home .rm-page-content > article:has(> .rm-hero-art)::before {
  margin-top: calc(-1 * clamp(6rem, 10vw, 11rem));
  background:
    radial-gradient(circle at 87% 16%, rgba(112, 222, 212, .14), transparent 34%),
    radial-gradient(circle at 10% 92%, rgba(122, 192, 67, .11), transparent 37%),
    radial-gradient(rgba(239, 246, 242, .075) 1px, transparent 1px),
    #102b3b;
  background-size: auto, auto, 24px 24px, auto;
}
body.rm-route-home .rm-page-content > article > .rm-page-title {
  max-width: 12ch;
  font-size: clamp(4.2rem, 7.2vw, 8rem);
  line-height: .98;
}
body.rm-route-home .rm-page-content > article > .rm-hero-art {
  transform: none;
  border-radius: 1.7rem;
}
body.rm-route-home .rm-page-content > article > .rm-hero-art img {
  border-radius: 1.15rem;
}
body.rm-route-home .rm-page-content > article > .rm-hero-art + .rm-lede {
  max-width: 31ch;
  font: 600 clamp(2rem, 3.7vw, 4.1rem)/1.15 var(--rm-font-display);
  letter-spacing: -.05em;
}
body.rm-route-home .rm-content-section:nth-of-type(2) {
  padding-block: clamp(2rem, 5vw, 5rem);
  border-bottom: 1px solid var(--rm-border);
}
body.rm-route-home .rm-content-section:last-of-type {
  padding: clamp(2rem, 5vw, 5rem);
  border: 0;
  background: #dfeee8;
}

/* The three offering hubs read as browsable libraries rather than identical
   triptych cards. All links, descriptions and editor-defined order remain. */
body:is(.rm-route-services, .rm-route-products, .rm-route-industries)
  .rm-content-section > .rm-card-grid {
  gap: clamp(.85rem, 1.8vw, 1.5rem);
}
body.rm-route-services .rm-card-grid > .rm-card,
body.rm-route-products .rm-card-grid > .rm-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  min-height: 245px;
  border-radius: 1.45rem;
}
body:is(.rm-route-services, .rm-route-products) .rm-card-grid > .rm-card p:last-child,
body.rm-route-industries .rm-card-grid > .rm-card p:last-child {
  margin-top: auto;
  padding-top: 1.5rem;
}
body.rm-route-services .rm-card-grid > .rm-card:first-child,
body.rm-route-products .rm-card-grid > .rm-card:first-child {
  border-color: #a7cbc6;
  background: #dfeee8;
}
body.rm-route-products .rm-card-grid > .rm-card:nth-child(4n + 2) {
  background: #e7f1e9;
}
body.rm-route-industries .rm-card-grid > .rm-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  border-radius: .5rem 1.5rem 1.5rem .5rem;
}
body.rm-route-industries .rm-card-grid > .rm-card:nth-child(3n + 2) {
  background: #e1efea;
}

/* Result directories are editorial rows in React. Keep every Gutenberg card
   visible, but give the directory the same broad, scannable horizontal rhythm. */
body:is(.rm-route-cases, .rm-route-work) .rm-content-section > .rm-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--rm-border);
}
body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card,
body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card:first-child:nth-last-child(2),
body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card:first-child:nth-last-child(2) ~ .rm-card {
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(12rem, .75fr) minmax(0, 1.5fr) auto;
  gap: clamp(1rem, 3vw, 4rem);
  align-items: center;
  height: auto;
  min-height: 150px;
  padding: clamp(1.4rem, 2.6vw, 2.5rem) 0;
  border: 0;
  border-bottom: 1px solid var(--rm-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card:hover {
  transform: none;
  border-bottom-color: #237e78;
  box-shadow: none;
}
body:is(.rm-route-cases, .rm-route-work) .rm-card h3 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 3.25rem);
}
body:is(.rm-route-cases, .rm-route-work) .rm-card p {
  margin: 0;
}
body:is(.rm-route-cases, .rm-route-work) .rm-card p:last-child a {
  white-space: nowrap;
}

/* Company pages use an open, text-led layout. The React career and pricing
   routes have no card catalogue in the saved page, so preserve their chapters. */
body.rm-route-about .rm-content-section:first-of-type,
body.rm-route-pricing .rm-content-section:first-of-type,
body.rm-route-careers .rm-content-section:first-of-type {
  border-top: 0;
}
body.rm-route-about .rm-content-section:first-of-type,
body.rm-route-pricing .rm-content-section:first-of-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  column-gap: clamp(2rem, 7vw, 8rem);
  align-items: start;
}
body.rm-route-about .rm-content-section:first-of-type > h2,
body.rm-route-pricing .rm-content-section:first-of-type > h2 {
  grid-row: 1 / span 3;
}
body.rm-route-about .rm-content-section:first-of-type > p,
body.rm-route-pricing .rm-content-section:first-of-type > p {
  margin-top: 0;
}
body.rm-route-about .rm-card {
  border-radius: .4rem;
  box-shadow: 0 15px 35px rgba(18, 45, 61, .06);
}
body.rm-route-careers .rm-page-content > article > .rm-page-title {
  max-width: 12ch;
}
body.rm-route-careers .rm-content-section:first-of-type {
  max-width: 950px;
}
body.rm-route-pricing .rm-content-section:nth-of-type(2) {
  padding: clamp(2rem, 5vw, 5rem);
  border: 1px solid var(--rm-border);
  background: #e0eeea;
}

/* Contact: make the real, native form the destination, not an afterthought. */
body.rm-route-contact .rm-content-section:first-of-type {
  max-width: 62rem;
  margin-bottom: 0;
  border-top: 0;
}
body.rm-route-contact .rm-contact-form {
  width: min(100%, 880px);
  max-width: none;
  margin: clamp(1rem, 3vw, 3rem) 0 0;
  border-radius: .45rem;
  box-shadow: 0 26px 70px rgba(18, 45, 61, .11);
}
body.rm-route-contact .rm-contact-form__field :is(input, textarea, select) {
  transition: border-color .2s ease, background-color .2s ease;
}
body.rm-route-contact .rm-contact-form__field :is(input, textarea, select):focus {
  background: #f8fbf6;
}

/* Legal and support pages stay narrow, readable, and conspicuously editable.
   No disclaimer or policy copy is introduced through CSS. */
body.rm-family-legal .rm-page-content > article > .rm-hero-art,
body.rm-route-help-support .rm-page-content > article > .rm-hero-art {
  transform: none;
}
body.rm-family-legal .rm-content-section,
body.rm-route-help-support .rm-content-section {
  max-width: 850px;
}
body.rm-family-legal .rm-content-section > h2,
body.rm-route-help-support .rm-content-section > h2 {
  font-size: clamp(2rem, 4vw, 3.7rem);
}
body.rm-family-legal .rm-content-section :is(p, li),
body.rm-route-help-support .rm-content-section :is(p, li) {
  max-width: 72ch;
  line-height: 1.85;
}
body:is(.rm-family-legal, .rm-route-help-support) .rm-page-content > article > p > a,
body:is(.rm-route-pricing, .rm-route-careers, .rm-route-services) .rm-page-content > article > p > a,
body.rm-route-home .rm-page-content > article > p:last-child > a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: .75rem 1.35rem;
  border-radius: .45rem;
  background: var(--rm-lime);
  color: var(--rm-ink);
  font-weight: 750;
  text-decoration: none;
  transition: transform .25s ease, background-color .25s ease;
}
body:is(.rm-family-legal, .rm-route-help-support, .rm-route-pricing, .rm-route-careers, .rm-route-services, .rm-route-home)
  .rm-page-content > article > p > a:hover {
  background: var(--rm-coral);
  transform: translateY(-2px);
}

@media (max-width: 850px) {
  body.rm-route-home .rm-page-content > article:has(> .rm-hero-art) { padding-top: 4rem; }
  body.rm-route-home .rm-page-content > article:has(> .rm-hero-art)::before { margin-top: -4rem; }
  body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card,
  body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card:first-child:nth-last-child(2),
  body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card:first-child:nth-last-child(2) ~ .rm-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem 2rem;
  }
  body:is(.rm-route-cases, .rm-route-work) .rm-card h3 { grid-column: 1 / -1; }
  body.rm-route-about .rm-content-section:first-of-type,
  body.rm-route-pricing .rm-content-section:first-of-type {
    display: block;
  }
}
@media (max-width: 600px) {
  body.rm-route-home .rm-page-content > article:has(> .rm-hero-art) { padding-top: 3.2rem; }
  body.rm-route-home .rm-page-content > article:has(> .rm-hero-art)::before { margin-top: -3.2rem; }
  body.rm-route-home .rm-page-content > article > .rm-page-title { font-size: clamp(3.55rem, 12vw, 5.4rem); }
  body.rm-route-home .rm-page-content > article > .rm-hero-art + .rm-lede { font-size: clamp(1.8rem, 8vw, 2.8rem); }
  body.rm-route-home .rm-content-section:last-of-type,
  body.rm-route-pricing .rm-content-section:nth-of-type(2) { padding: 1.5rem; }
  body.rm-route-services .rm-card-grid > .rm-card,
  body.rm-route-products .rm-card-grid > .rm-card,
  body.rm-route-industries .rm-card-grid > .rm-card {
    grid-column: 1 / -1;
    min-height: 0;
  }
  body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card,
  body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card:first-child:nth-last-child(2),
  body:is(.rm-route-cases, .rm-route-work) .rm-card-grid > .rm-card:first-child:nth-last-child(2) ~ .rm-card {
    display: block;
    min-height: 0;
  }
  body:is(.rm-route-cases, .rm-route-work) .rm-card p { margin-top: .8rem; }
  body.rm-route-contact .rm-contact-form { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  body:is(.rm-family-legal, .rm-route-help-support, .rm-route-pricing, .rm-route-careers, .rm-route-services, .rm-route-home)
    .rm-page-content > article > p > a:hover { transform: none; }
}